diff --git a/.rootkeys b/.rootkeys index 65b76373ef..c6cb0d2d68 100644 --- a/.rootkeys +++ b/.rootkeys @@ -195,8 +195,6 @@ 3f8bcf29ulZIC9rC4wM70H_q4s6VPg tools/misc/xen_log.c 3f13d81eQ9Vz-h-6RDGFkNR9CRP95g tools/misc/xen_nat_enable 3f13d81e6Z6806ihYYUw8GVKNkYnuw tools/misc/xen_nat_enable.README -3fafbef1fJFKCcJLq-ffpauvpM10jQ tools/misc/xen_netwatch.c -3fafd0abTbQjsCr5W3DDyNdqdJezrA tools/misc/xen_netwatch_redhatscript 3f1668d4F29Jsw0aC0bJEIkOBiagiQ tools/misc/xen_read_console.c 3f87ba90EUVPQLVOlFG0sW89BCwouQ tools/misc/xen_refresh_dev.c 3f72f1bdJPsV3JCnBqs9ddL9tr6D2g xen/COPYING diff --git a/tools/misc/Makefile b/tools/misc/Makefile index f7d874baed..e3ac944e54 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -7,7 +7,7 @@ HDRS = $(wildcard *.h) SRCS = $(wildcard *.c) OBJS = $(patsubst %.c,%.o,$(SRCS)) -TARGETS = xen_read_console xen_cpuperf xen_refresh_dev xen_netwatch +TARGETS = xen_read_console xen_cpuperf xen_refresh_dev INSTALL = $(TARGETS) xen-mkdevnodes xen_nat_enable xen-clone @@ -26,9 +26,6 @@ clean: $(RM) *.o $(TARGETS) $(MAKE) -C miniterm clean -xen_netwatch: %: %.c $(HDRS) Makefile - $(CC) $(CFLAGS) -o $@ $< - %: %.c $(HDRS) Makefile $(CC) $(CFLAGS) $(EXTRA_INC) -o $@ $< diff --git a/tools/misc/xen_netwatch.c b/tools/misc/xen_netwatch.c deleted file mode 100644 index 9e1194e329..0000000000 --- a/tools/misc/xen_netwatch.c +++ /dev/null @@ -1,225 +0,0 @@ -/****************************************************************************** - * xen_netwatch.c - * - * Watch for network interfaces changing state (IFF_UP), and call a standard - * script '/etc/xen/netwatch up|down'. Logging from the netwatch - * daemon is written to '/var/xen/netwatch' -- other programs can therefore - * watch that file to take action on interface state changes. - * - * Note that, apart from the names of the default action script and log file, - * this program is not actually Xen-dependent. - * - * Copyright (c) 2003, K A Fraser - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#define DEFAULT_SCRIPT "/etc/xen/netwatch" -#define DEFAULT_LOGFILE "/var/xen/netwatch" - -#define LOG(_f, _a...) \ - do { \ - time_t now = time(NULL); \ - char *tstr = ctime(&now); \ - char *p = strchr(tstr, '\n'); if (p) *p = '\0'; \ - fprintf(logfd, "%s: " _f "\n", tstr, ## _a); \ - fflush(logfd); \ - } while ( 0 ) - -#define EXIT do { LOG("Exiting."); return 1; } while ( 0 ) - -static void daemonise(void) -{ - int i; - struct rlimit rlim; - - /* Close all file handles we inherited from our parent. */ - if ( getrlimit(RLIMIT_NOFILE, &rlim) == 0 ) - for ( i = 0; i < rlim.rlim_cur; i++ ) - close(i); - - /* Lose the controlling tty. */ - setsid(); -} - -void handle_child_death(int dummy) -{ - (void)waitpid(-1, NULL, WNOHANG); -} - -int main(int argc, char **argv) -{ - char *logfile = DEFAULT_LOGFILE; - char *scriptfile = DEFAULT_SCRIPT; - FILE *logfd; - int i, nlfd, unixfd, bytes, last_index = ~0; - unsigned int last_flags = ~0; - char buffer[8192]; - struct sockaddr_nl nladdr; - struct nlmsghdr *nlmsg; - struct ifinfomsg *ifi; - struct ifreq ifr; - struct sigaction sigchld; - - for ( i = 1; i < argc; i++ ) - { - if ( strncmp("-s", argv[i], 2) == 0 ) - { - scriptfile = argv[i] + 2; - } - else if ( strncmp("-l", argv[i], 2) == 0 ) - { - logfile = argv[i] + 2; - } - else - { - printf("Usage: %s [-s