File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / miniupnpd / bsd / testifacewatcher.c
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 00:32:35 2013 UTC (11 years, 5 months ago) by misho
Branches: miniupnpd, elwix, MAIN
CVS tags: v1_8p0, v1_8, HEAD
1.8

    1: /* $Id: testifacewatcher.c,v 1.1.1.2 2013/07/22 00:32:35 misho Exp $ */
    2: 
    3: #include <syslog.h>
    4: 
    5: int
    6: OpenAndConfInterfaceWatchSocket(void);
    7: 
    8: void
    9: ProcessInterfaceWatchNotify(int s);
   10: 
   11: const char * ext_if_name;
   12: volatile sig_atomic_t should_send_public_address_change_notif = 0;
   13: 
   14: int main(int argc, char * * argv)
   15: {
   16: 	int s;
   17: 
   18: 	ext_if_name = "ep0";
   19: 	openlog("testifacewatcher", LOG_CONS|LOG_PERROR, LOG_USER);
   20: 
   21: 	syslog(LOG_DEBUG, "test");
   22: 	s = OpenAndConfInterfaceWatchSocket();
   23: 	for(;;) {
   24: 		if(should_send_public_address_change_notif) {
   25: 			syslog(LOG_DEBUG, "should_send_public_address_change_notif !");
   26: 			should_send_public_address_change_notif = 0;
   27: 		}
   28: 		ProcessInterfaceWatchNotify(s);
   29: 	}
   30: 	closelog();
   31: 	return 0;
   32: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>