miniupnp/miniupnpd/bsd/testifacewatcher.c

33 lines
709 B
C
Raw Permalink Normal View History

2012-05-24 16:17:31 +00:00
/* $Id: testifacewatcher.c,v 1.2 2012/05/21 08:55:10 nanard Exp $ */
2011-09-28 19:13:20 +00:00
#include <syslog.h>
int
OpenAndConfInterfaceWatchSocket(void);
void
ProcessInterfaceWatchNotify(int s);
const char * ext_if_name;
2012-05-24 16:17:31 +00:00
volatile sig_atomic_t should_send_public_address_change_notif = 0;
2011-09-28 19:13:20 +00:00
int main(int argc, char * * argv)
{
int s;
ext_if_name = "ep0";
openlog("testifacewatcher", LOG_CONS|LOG_PERROR, LOG_USER);
syslog(LOG_DEBUG, "test");
s = OpenAndConfInterfaceWatchSocket();
for(;;) {
if(should_send_public_address_change_notif) {
syslog(LOG_DEBUG, "should_send_public_address_change_notif !");
should_send_public_address_change_notif = 0;
}
ProcessInterfaceWatchNotify(s);
}
closelog();
return 0;
}