2 * ip.c "ip" utility frontend.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
9 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
14 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
18 #include "ip_common.h"
22 int preferred_family = AF_UNSPEC;
26 void ip_parse_common_args(int *argcp, char ***argvp)
34 if (strcmp(opt,"--") == 0) {
45 if (matches(opt, "-family") == 0) {
48 if (strcmp(argv[1], "inet") == 0)
49 preferred_family = AF_INET;
50 else if (strcmp(argv[1], "inet6") == 0)
51 preferred_family = AF_INET6;
52 else if (strcmp(argv[1], "link") == 0)
53 preferred_family = AF_PACKET;
55 invarg(argv[1], "invalid protocol family");
56 } else if (strcmp(opt, "-4") == 0) {
57 preferred_family = AF_INET;
58 } else if (strcmp(opt, "-6") == 0) {
59 preferred_family = AF_INET6;
60 } else if (strcmp(opt, "-0") == 0) {
61 preferred_family = AF_PACKET;
62 } else if (matches(opt, "-oneline") == 0) {
69 _SL_ = oneline ? "\\" : "\n" ;