/*
- * $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>
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 );
}
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;
}
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;
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;
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
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;
int looproute( iface, cmd )
struct interface *iface;
- int cmd;
+ unsigned int cmd;
{
struct sockaddr_at dst, loop;
RTF_UP | RTF_HOST ) ) {
return( 1 );
}
-#else /* BSD4_4 */
+#else /* ! BSD4_4 */
if ( route( cmd,
(struct sockaddr_at *) &dst,
(struct sockaddr_at *) &loop,
}
int gateroute( command, rtmp )
- int command;
+ unsigned int command;
struct rtmptab *rtmp;
{
struct sockaddr_at dst, gate;
(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,
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 ) {