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
20 #include "ip_common.h"
24 int preferred_family = AF_UNSPEC;
28 void ip_parse_common_args(int *argcp, char ***argvp)
36 if (strcmp(opt,"--") == 0) {
47 if (matches(opt, "-family") == 0) {
52 if (strcmp(argv[1], "inet") == 0)
53 preferred_family = AF_INET;
54 else if (strcmp(argv[1], "inet6") == 0)
55 preferred_family = AF_INET6;
56 else if (strcmp(argv[1], "link") == 0)
57 preferred_family = AF_PACKET;
59 invarg(argv[1], "invalid protocol family");
60 } else if (strcmp(opt, "-4") == 0) {
61 preferred_family = AF_INET;
62 } else if (strcmp(opt, "-6") == 0) {
63 preferred_family = AF_INET6;
64 } else if (strcmp(opt, "-0") == 0) {
65 preferred_family = AF_PACKET;
66 } else if (matches(opt, "-oneline") == 0) {
73 _SL_ = oneline ? "\\" : "\n" ;