/*
- * $Id: main.c,v 1.20 2009-10-13 22:55:37 didg Exp $
+ * $Id: main.c,v 1.22 2009-10-14 02:24:05 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
extern int aep_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len);
int rtfd;
+int transition = 0;
+int stabletimer, newrtmpdata = 0;
static struct atserv atserv[] = {
{ "rtmp", 1, rtmp_packet }, /* 0 */
struct interface *interfaces = NULL, *ciface = NULL;
-int debug = 0, quiet = 0, chatty = 0;
-char *configfile = NULL;
-int ziptimeout = 0, transition = 0;
-int stabletimer, stable = 0, newrtmpdata = 0, noparent = 0;
-static int ninterfaces;
-int defphase = IFACE_PHASE2;
-int nfds = 0;
-fd_set fds;
-char Packet[ PKTSZ ];
-char *version = VERSION;
-static char *pidfile = _PATH_ATALKDLOCK;
+static int debug = 0, quiet = 0, chatty = 0;
+static char *configfile = NULL;
+static int ziptimeout = 0;
+static int stable = 0, noparent = 0;
+static int ninterfaces;
+static int defphase = IFACE_PHASE2;
+static int nfds = 0;
+static fd_set fds;
+static char Packet[ PKTSZ ];
+static char *version = VERSION;
+static char *pidfile = _PATH_ATALKDLOCK;
/* from config.c */
while ( rtmp ) {
frtmp = rtmp->rt_next;
if ( rtmp->rt_hops == RTMPHOPS_POISON ||
- rtmp->rt_iprev == 0 ) {
+ rtmp->rt_iprev == NULL ) {
rtmp_free( rtmp );
} else {
rtmp->rt_hops = RTMPHOPS_POISON;
}
rtmp = frtmp;
}
- if ( gate->g_rt == 0 ) {
- if ( gate->g_prev == 0 ) {
+ if ( gate->g_rt == NULL ) {
+ if ( gate->g_prev == NULL ) {
gate->g_iface->i_gate = gate->g_next;
} else {
gate->g_prev->g_next = gate->g_next;
}
- if ( gate->g_next != 0 ) {
+ if ( gate->g_next != NULL ) {
gate->g_next->g_prev = gate->g_prev;
}
fgate = gate; /* can't free here, just mark it */
* if we're not a seed router.
*/
- if ( gate->g_iface->i_gate == 0 &&
+ if ( gate->g_iface->i_gate == NULL &&
((iface->i_flags & IFACE_SEED) == 0)) {
gate->g_iface->i_flags |= IFACE_NOROUTER;
gate->g_iface->i_flags &= ~IFACE_CONFIG;
*/
if ( rtmp->rt_state >= RTMPTAB_BAD ) {
frtmp = rtmp->rt_next;
- if ( rtmp->rt_iprev == 0 ) { /* not in use */
+ if ( rtmp->rt_iprev == NULL ) { /* not in use */
rtmp_free( rtmp );
} else { /* in use */
if ( rtmp->rt_hops == RTMPHOPS_POISON ) {
*/
for ( rtmp = iface2->i_rt; rtmp; rtmp = rtmp->rt_inext ) {
/* don't broadcast routes we have no zone for */
- if ( rtmp->rt_zt == 0 ||
+ if ( rtmp->rt_zt == NULL ||
( rtmp->rt_flags & RTMPTAB_ZIPQUERY ) ||
( rtmp->rt_flags & RTMPTAB_HASZONES ) == 0 ) {
continue;
}
#endif /* DEBUG */
-void
+static void
as_debug(int sig _U_)
{
struct interface *iface;
/*
* Called when SIGTERM is recieved. Remove all routes and then exit.
*/
-void
+static void
as_down(int sig _U_)
{
struct interface *iface;
*/
void bootaddr(struct interface *iface)
{
- if ( iface == 0 ) {
+ if ( iface == NULL ) {
return;
}