7 +#include <sys/types.h>
16 -#define LOG_NAME "RFC1483/2684 bridge"
17 -#define LOG_OPTION LOG_PERROR
18 -#define LOG_FACILITY LOG_LOCAL0
19 +#define LOG_NAME "br2684ctl"
20 +#define LOG_OPTION LOG_PERROR|LOG_PID
21 +#define LOG_FACILITY LOG_LOCAL2
24 int lastsock, lastitf;
25 @@ -39,10 +41,16 @@ void fatal(const char *str, int i)
29 - syslog (LOG_PID,"Daemon terminated\n");
30 + syslog (LOG_NOTICE,"Daemon terminated\n");
34 +void int_signal(int dummy)
36 + syslog (LOG_INFO,"Killed by a signal\n");
40 int create_pidfile(int num)
43 @@ -80,7 +88,7 @@ int create_br(char *nstr)
44 err=ioctl (lastsock, ATM_NEWBACKENDIF, &ni);
47 - syslog(LOG_INFO, "Interface \"%s\" created sucessfully\n",ni.ifname);
48 + syslog(LOG_NOTICE, "Interface \"%s\" created sucessfully\n",ni.ifname);
50 syslog(LOG_INFO, "Interface \"%s\" could not be created, reason: %s\n",
52 @@ -112,7 +120,7 @@ int assign_vcc(char *astr, int encap, in
53 addr.sap_addr.vpi = 0;
54 addr.sap_addr.vci = vci;
56 - syslog(LOG_INFO,"Communicating over ATM %d.%d.%d, encapsulation: %s\n", addr.sap_addr.itf,
57 + syslog(LOG_NOTICE,"Communicating over ATM %d.%d.%d, encapsulation: %s\n", addr.sap_addr.itf,
60 encap?"VC mux":"LLC");
61 @@ -261,11 +269,13 @@ int main (int argc, char **argv)
64 create_pidfile(itfnum);
65 + signal(SIGINT, int_signal);
66 + signal(SIGTERM, int_signal);
68 syslog (LOG_INFO, "RFC 1483/2684 bridge daemon started\n");
71 - while (1) sleep(30); /* to keep the sockets... */
72 + while (1) pause(); /* to keep the sockets... */
85 +br2684ctl: br2684ctl.c
86 + $(CC) $(OPTS) $(CFLAGS) $(LIBS) $< -o $@