]> arthur.barton.de Git - netatalk.git/blobdiff - etc/atalkd/rtmp.c
replaced all #include <sys/syslog.h> with #include <syslog.h>
[netatalk.git] / etc / atalkd / rtmp.c
index 3819f5691f84c253b529bb7b5a32de0823ff8117..991c20bf9f2d07cfccddcfb8b973567438e1ba2b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rtmp.c,v 1.5 2001-06-19 18:04:39 rufustfirefly Exp $
+ * $Id: rtmp.c,v 1.10 2002-01-03 17:49:39 sibaz Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
 
 #include <stdlib.h>
 #include <string.h>
-#include <sys/syslog.h>
+#include <errno.h>
+#include <syslog.h>
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
+#ifdef TRU64
+#include <sys/mbuf.h>
+#include <net/route.h>
+#endif /* TRU64 */
 #include <net/if.h>
 #include <net/route.h>
 #include <netatalk/endian.h>
@@ -137,9 +142,10 @@ static int rtmp_config( rh, iface )
       return -1;
 
     if (cc) {
-       syslog( LOG_ERR, "rtmp_config: can't route %u.%u to loopback: %m",
+       syslog( LOG_ERR, "rtmp_config: can't route %u.%u to loopback: %s",
                ntohs( iface->i_addr.sat_addr.s_net ),
-               iface->i_addr.sat_addr.s_node );
+               iface->i_addr.sat_addr.s_node,
+               strerror(errno) );
     }
 
     syslog( LOG_INFO, "rtmp_config configured %s", iface->i_name );
@@ -459,7 +465,8 @@ int rtmp_packet( ap, from, data, len )
                } 
 
                if (cc)
-                 syslog( LOG_ERR, "rtmp_packet: can't remove loopback: %m" );
+                 syslog( LOG_ERR, "rtmp_packet: can't remove loopback: %s",
+                         strerror(errno) );
 
                iface->i_flags &= ~IFACE_NOROUTER;
                iface->i_time = 0;
@@ -558,7 +565,7 @@ int rtmp_packet( ap, from, data, len )
        }
        if ( !gate ) {  /* new gateway */
            if (( gate = (struct gate *)malloc( sizeof( struct gate ))) == 0 ) {
-               syslog( LOG_ERR, "rtmp_packet: malloc: %m" );
+               syslog( LOG_ERR, "rtmp_packet: malloc: %s", strerror(errno) );
                return -1;
            }
            gate->g_next = iface->i_gate;
@@ -697,7 +704,7 @@ int rtmp_packet( ap, from, data, len )
                        ntohs( rt.rt_net ));
            } else {            /* new for router */
                if (( rtmp = newrt(iface)) == NULL ) {
-                   syslog( LOG_ERR, "rtmp_packet: newrt: %m" );
+                   syslog( LOG_ERR, "rtmp_packet: newrt: %s", strerror(errno) );
                    return -1;
                }
                rtmp->rt_firstnet = rt.rt_net;
@@ -784,7 +791,7 @@ int rtmp_packet( ap, from, data, len )
            if ( sendto( ap->ap_fd, packet, data - packet, 0,
                    (struct sockaddr *)from,
                    sizeof( struct sockaddr_at )) < 0 ) {
-               syslog( LOG_ERR, "as_timer sendto: %m" );
+               syslog( LOG_ERR, "as_timer sendto: %s", strerror(errno) );
            }
        } else if ( *data == 2 || *data == 3 ) {
 #ifdef DEBUG
@@ -843,7 +850,7 @@ int rtmp_request( iface )
     sat.sat_port = ap->ap_port;
     if ( sendto( ap->ap_fd, packet, data - packet, 0, (struct sockaddr *)&sat,
            sizeof( struct sockaddr_at )) < 0 ) {
-       syslog( LOG_ERR, "rtmp_request sendto: %m" );
+       syslog( LOG_ERR, "rtmp_request sendto: %s", strerror(errno) );
        return -1;
     }
     return 0;
@@ -852,7 +859,7 @@ int rtmp_request( iface )
 
 int looproute( iface, cmd )
     struct interface   *iface;
-    int                        cmd;
+    unsigned int       cmd;
 {
     struct sockaddr_at dst, loop;
 
@@ -888,7 +895,7 @@ int looproute( iface, cmd )
                RTF_UP | RTF_HOST ) ) {
        return( 1 );
     }
-#else /* BSD4_4 */
+#else /* BSD4_4 */
     if ( route( cmd,
                (struct sockaddr_at *) &dst,
                (struct sockaddr_at *) &loop,
@@ -906,7 +913,7 @@ int looproute( iface, cmd )
 }
 
 int gateroute( command, rtmp )
-    int                        command;
+    unsigned int       command;
     struct rtmptab     *rtmp;
 {
     struct sockaddr_at dst, gate;
@@ -951,11 +958,12 @@ int gateroute( command, rtmp )
                    (struct sockaddr *) &dst,
                    (struct sockaddr *) &gate,
                    RTF_UP | RTF_GATEWAY )) {
-           syslog( LOG_ERR, "route: %u -> %u.%u: %m", net,
-                   ntohs( gate.sat_addr.s_net ), gate.sat_addr.s_node );
+           syslog( LOG_ERR, "route: %u -> %u.%u: %s", net,
+                   ntohs( gate.sat_addr.s_net ), gate.sat_addr.s_node,
+                   strerror(errno) );
            continue;
        }
-#else /* BSD4_4 */
+#else /* BSD4_4 */
        if ( route( command,
                    (struct sockaddr_at *) &dst,
                    (struct sockaddr_at *) &gate,
@@ -964,7 +972,7 @@ int gateroute( command, rtmp )
                    ntohs( gate.sat_addr.s_net ), gate.sat_addr.s_node );
            continue;
        }
-#endif /* BSD4_4 */
+#endif /* BSD4_4 */
     } while ( net++ < ntohs( rtmp->rt_lastnet ));
 
     if ( command == RTMP_ADD ) {