1 /* vi: set sw=4 ts=4: */
3 * ip.c "ip" utility frontend.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
10 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
15 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
22 #include "ip_common.h"
25 int preferred_family = AF_UNSPEC;
29 void ip_parse_common_args(int *argcp, char ***argvp)
37 if (strcmp(opt,"--") == 0) {
49 if (matches(opt, "-family") == 0) {
54 if (strcmp(argv[1], "inet") == 0)
55 preferred_family = AF_INET;
56 else if (strcmp(argv[1], "inet6") == 0)
57 preferred_family = AF_INET6;
58 else if (strcmp(argv[1], "link") == 0)
59 preferred_family = AF_PACKET;
61 invarg(argv[1], "protocol family");
62 } else if (strcmp(opt, "-4") == 0) {
63 preferred_family = AF_INET;
64 } else if (strcmp(opt, "-6") == 0) {
65 preferred_family = AF_INET6;
66 } else if (strcmp(opt, "-0") == 0) {
67 preferred_family = AF_PACKET;
68 } else if (matches(opt, "-oneline") == 0) {
76 _SL_ = oneline ? "\\" : "\n" ;