8275c4861d576590aeb53a3c3a083f84de55b1da
2 * Copyright (C) 2014 John Crispin <blogic@openwrt.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 2.1
6 * as published by the Free Software Foundation
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
15 #include <sys/types.h>
23 #include <sys/types.h>
24 #include <arpa/inet.h>
25 #include <sys/socket.h>
26 #include <netinet/in.h>
27 #include <arpa/nameser.h>
28 #include <asm/byteorder.h>
31 #include <libubox/uloop.h>
39 #include "interface.h"
41 static char *iface_name
= "eth0";
44 signal_shutdown(int signal
)
50 main(int argc
, char **argv
)
54 while ((ch
= getopt(argc
, argv
, "t:i:d")) != -1) {
61 fprintf(stderr
, "invalid ttl\n");
77 if (interface_add(iface_name
)) {
78 fprintf(stderr
, "Failed to add interface %s\n", iface_name
);
82 signal(SIGPIPE
, SIG_IGN
);
83 signal(SIGTERM
, signal_shutdown
);
84 signal(SIGKILL
, signal_shutdown
);
97 vlist_flush(&interfaces
);