2 * ip.c "ip" utility frontend.
4 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
6 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
11 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
19 #include <sys/socket.h>
20 #include <netinet/in.h>
23 #include "libiproute/utils.h"
24 #include "libiproute/ip_common.h"
28 int ip_main(int argc, char **argv)
30 int ret = EXIT_FAILURE;
32 ip_parse_common_args(&argc, &argv);
35 #ifdef CONFIG_FEATURE_IP_ADDRESS
36 if (matches(argv[1], "address") == 0) {
37 ret = do_ipaddr(argc-2, argv+2);
40 #ifdef CONFIG_FEATURE_IP_ROUTE
41 if (matches(argv[1], "route") == 0) {
42 ret = do_iproute(argc-2, argv+2);
45 #ifdef CONFIG_FEATURE_IP_LINK
46 if (matches(argv[1], "link") == 0) {
47 ret = do_iplink(argc-2, argv+2);
50 #ifdef CONFIG_FEATURE_IP_TUNNEL
51 if (matches(argv[1], "tunnel") == 0 || strcmp(argv[1], "tunl") == 0) {
52 ret = do_iptunnel(argc-2, argv+2);