]> arthur.barton.de Git - netatalk.git/blobdiff - etc/atalkd/route.c
Remove bdb env on exit
[netatalk.git] / etc / atalkd / route.c
index cc97b2acedd9c69525ab35b3af389ff696253087..4e7dfac353663dff7605a1a562e9c92807fe0d73 100644 (file)
@@ -1,44 +1,53 @@
 /*
+ * $Id: route.c,v 1.8 2009-10-13 22:55:37 didg Exp $
+ *
  * Copyright (c) 1990,1996 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <string.h>
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <net/route.h>
-
+#include <sys/ioctl.h>
 #include <netatalk/at.h>
 
 #include "rtmp.h"
+#include "route.h"
 
 #ifndef BSD4_4
-route( message, dst, gate, flags )
-    int                        message;
-    struct sockaddr    *dst, *gate;
-    int                        flags;
+int route( int message, struct sockaddr *dst, struct sockaddr *gate, int flags)
 {
+#ifdef TRU64
+    struct ortentry    rtent;
+#else /* TRU64 */
     struct rtentry     rtent;
+#endif /* TRU64 */
 
-    bzero( &rtent, sizeof( struct rtentry ));
+    memset( &rtent, 0, sizeof( struct rtentry ));
     rtent.rt_dst = *dst;
     rtent.rt_gateway = *gate;
     rtent.rt_flags = flags;
     return( ioctl( rtfd, message, &rtent ));
 }
 
-#else BSD4_4
+#else /* BSD4_4 */
 
 struct sockaddr_m {
     u_char     sam_len;
     u_char     sam_family;
     u_short    sam_pad;
     u_short    sam_mask;
-} mask = { sizeof( struct sockaddr_m ), 0, 0, 0xffff };
+    u_short    sam_pad2;
+} mask = { sizeof( struct sockaddr_m ), 0, 0, 0xffff, 0 };
 
 struct rt_msg_at {
     struct rt_msghdr   rtma_rtm;
@@ -47,14 +56,11 @@ struct rt_msg_at {
     struct sockaddr_m  rtma_mask;
 } rtma;
 
-route( message, dst, gate, flags )
-    int                        message;
-    struct sockaddr_at *dst, *gate;
-    int                        flags;
+route( int message, struct sockaddr_at *dst, struct sockaddr_at *gate, int flags)
 {
     int                        rc;
 
-    bzero( &rtma, sizeof( struct rt_msg_at ));
+    memset( &rtma, 0, sizeof( struct rt_msg_at ));
     rtma.rtma_rtm.rtm_msglen = sizeof( struct rt_msg_at );
     rtma.rtma_rtm.rtm_version = RTM_VERSION;
     rtma.rtma_rtm.rtm_type = message;
@@ -78,4 +84,4 @@ route( message, dst, gate, flags )
     }
     return( 0 );
 }
-#endif BSD4_4
+#endif /* BSD4_4 */