1 /* vi: set sw=4 ts=4: */
3 * ip.c "ip" utility frontend.
5 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
7 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
12 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
20 #include <sys/socket.h>
21 #include <netinet/in.h>
24 #include "libiproute/utils.h"
25 #include "libiproute/ip_common.h"
29 int ip_main(int argc, char **argv)
31 int ret = EXIT_FAILURE;
33 ip_parse_common_args(&argc, &argv);
36 #ifdef CONFIG_FEATURE_IP_ADDRESS
37 if (matches(argv[1], "address") == 0) {
38 ret = do_ipaddr(argc-2, argv+2);
41 #ifdef CONFIG_FEATURE_IP_ROUTE
42 if (matches(argv[1], "route") == 0) {
43 ret = do_iproute(argc-2, argv+2);
46 #ifdef CONFIG_FEATURE_IP_LINK
47 if (matches(argv[1], "link") == 0) {
48 ret = do_iplink(argc-2, argv+2);
51 #ifdef CONFIG_FEATURE_IP_TUNNEL
52 if (matches(argv[1], "tunnel") == 0 || strcmp(argv[1], "tunl") == 0) {
53 ret = do_iptunnel(argc-2, argv+2);