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) {
48 if (matches(opt, "-family") == 0) {
53 if (strcmp(argv[1], "inet") == 0)
54 preferred_family = AF_INET;
55 else if (strcmp(argv[1], "inet6") == 0)
56 preferred_family = AF_INET6;
57 else if (strcmp(argv[1], "link") == 0)
58 preferred_family = AF_PACKET;
60 invarg(argv[1], "protocol family");
61 } else if (strcmp(opt, "-4") == 0) {
62 preferred_family = AF_INET;
63 } else if (strcmp(opt, "-6") == 0) {
64 preferred_family = AF_INET6;
65 } else if (strcmp(opt, "-0") == 0) {
66 preferred_family = AF_PACKET;
67 } else if (matches(opt, "-oneline") == 0) {
74 _SL_ = oneline ? "\\" : "\n" ;