Commit 6c5ffb9a authored by Stephen Hemminger's avatar Stephen Hemminger

iplink: cleanup whitespace and checkpatch issues

Mostly just use of {} and whitespace.
parent ab872442
...@@ -77,10 +77,10 @@ void iplink_usage(void) ...@@ -77,10 +77,10 @@ void iplink_usage(void)
fprintf(stderr, " [ vf NUM [ mac LLADDR ]\n"); fprintf(stderr, " [ vf NUM [ mac LLADDR ]\n");
fprintf(stderr, " [ vlan VLANID [ qos VLAN-QOS ] ]\n"); fprintf(stderr, " [ vlan VLANID [ qos VLAN-QOS ] ]\n");
fprintf(stderr, " [ rate TXRATE ] ] \n"); fprintf(stderr, " [ rate TXRATE ] ]\n");
fprintf(stderr, " [ spoofchk { on | off} ] ] \n"); fprintf(stderr, " [ spoofchk { on | off} ] ]\n");
fprintf(stderr, " [ query_rss { on | off} ] ] \n"); fprintf(stderr, " [ query_rss { on | off} ] ]\n");
fprintf(stderr, " [ state { auto | enable | disable} ] ]\n"); fprintf(stderr, " [ state { auto | enable | disable} ] ]\n");
fprintf(stderr, " [ master DEVICE ]\n"); fprintf(stderr, " [ master DEVICE ]\n");
fprintf(stderr, " [ nomaster ]\n"); fprintf(stderr, " [ nomaster ]\n");
...@@ -105,7 +105,9 @@ static void usage(void) ...@@ -105,7 +105,9 @@ static void usage(void)
static int on_off(const char *msg, const char *realval) static int on_off(const char *msg, const char *realval)
{ {
fprintf(stderr, "Error: argument of \"%s\" must be \"on\" or \"off\", not \"%s\"\n", msg, realval); fprintf(stderr,
"Error: argument of \"%s\" must be \"on\" or \"off\", not \"%s\"\n",
msg, realval);
return -1; return -1;
} }
...@@ -267,6 +269,7 @@ static int iplink_parse_vf(int vf, int *argcp, char ***argvp, ...@@ -267,6 +269,7 @@ static int iplink_parse_vf(int vf, int *argcp, char ***argvp,
NEXT_ARG(); NEXT_ARG();
if (matches(*argv, "mac") == 0) { if (matches(*argv, "mac") == 0) {
struct ifla_vf_mac ivm; struct ifla_vf_mac ivm;
NEXT_ARG(); NEXT_ARG();
ivm.vf = vf; ivm.vf = vf;
len = ll_addr_a2n((char *)ivm.mac, 32, *argv); len = ll_addr_a2n((char *)ivm.mac, 32, *argv);
...@@ -275,19 +278,19 @@ static int iplink_parse_vf(int vf, int *argcp, char ***argvp, ...@@ -275,19 +278,19 @@ static int iplink_parse_vf(int vf, int *argcp, char ***argvp,
addattr_l(&req->n, sizeof(*req), IFLA_VF_MAC, &ivm, sizeof(ivm)); addattr_l(&req->n, sizeof(*req), IFLA_VF_MAC, &ivm, sizeof(ivm));
} else if (matches(*argv, "vlan") == 0) { } else if (matches(*argv, "vlan") == 0) {
struct ifla_vf_vlan ivv; struct ifla_vf_vlan ivv;
NEXT_ARG(); NEXT_ARG();
if (get_unsigned(&ivv.vlan, *argv, 0)) { if (get_unsigned(&ivv.vlan, *argv, 0))
invarg("Invalid \"vlan\" value\n", *argv); invarg("Invalid \"vlan\" value\n", *argv);
}
ivv.vf = vf; ivv.vf = vf;
ivv.qos = 0; ivv.qos = 0;
if (NEXT_ARG_OK()) { if (NEXT_ARG_OK()) {
NEXT_ARG(); NEXT_ARG();
if (matches(*argv, "qos") == 0) { if (matches(*argv, "qos") == 0) {
NEXT_ARG(); NEXT_ARG();
if (get_unsigned(&ivv.qos, *argv, 0)) { if (get_unsigned(&ivv.qos, *argv, 0))
invarg("Invalid \"qos\" value\n", *argv); invarg("Invalid \"qos\" value\n", *argv);
}
} else { } else {
/* rewind arg */ /* rewind arg */
PREV_ARG(); PREV_ARG();
...@@ -296,10 +299,11 @@ static int iplink_parse_vf(int vf, int *argcp, char ***argvp, ...@@ -296,10 +299,11 @@ static int iplink_parse_vf(int vf, int *argcp, char ***argvp,
addattr_l(&req->n, sizeof(*req), IFLA_VF_VLAN, &ivv, sizeof(ivv)); addattr_l(&req->n, sizeof(*req), IFLA_VF_VLAN, &ivv, sizeof(ivv));
} else if (matches(*argv, "rate") == 0) { } else if (matches(*argv, "rate") == 0) {
struct ifla_vf_tx_rate ivt; struct ifla_vf_tx_rate ivt;
NEXT_ARG(); NEXT_ARG();
if (get_unsigned(&ivt.rate, *argv, 0)) { if (get_unsigned(&ivt.rate, *argv, 0))
invarg("Invalid \"rate\" value\n", *argv); invarg("Invalid \"rate\" value\n", *argv);
}
ivt.vf = vf; ivt.vf = vf;
if (!new_rate_api) if (!new_rate_api)
addattr_l(&req->n, sizeof(*req), addattr_l(&req->n, sizeof(*req),
...@@ -323,6 +327,7 @@ static int iplink_parse_vf(int vf, int *argcp, char ***argvp, ...@@ -323,6 +327,7 @@ static int iplink_parse_vf(int vf, int *argcp, char ***argvp,
} else if (matches(*argv, "spoofchk") == 0) { } else if (matches(*argv, "spoofchk") == 0) {
struct ifla_vf_spoofchk ivs; struct ifla_vf_spoofchk ivs;
NEXT_ARG(); NEXT_ARG();
if (matches(*argv, "on") == 0) if (matches(*argv, "on") == 0)
ivs.setting = 1; ivs.setting = 1;
...@@ -335,6 +340,7 @@ static int iplink_parse_vf(int vf, int *argcp, char ***argvp, ...@@ -335,6 +340,7 @@ static int iplink_parse_vf(int vf, int *argcp, char ***argvp,
} else if (matches(*argv, "query_rss") == 0) { } else if (matches(*argv, "query_rss") == 0) {
struct ifla_vf_rss_query_en ivs; struct ifla_vf_rss_query_en ivs;
NEXT_ARG(); NEXT_ARG();
if (matches(*argv, "on") == 0) if (matches(*argv, "on") == 0)
ivs.setting = 1; ivs.setting = 1;
...@@ -347,6 +353,7 @@ static int iplink_parse_vf(int vf, int *argcp, char ***argvp, ...@@ -347,6 +353,7 @@ static int iplink_parse_vf(int vf, int *argcp, char ***argvp,
} else if (matches(*argv, "state") == 0) { } else if (matches(*argv, "state") == 0) {
struct ifla_vf_link_state ivl; struct ifla_vf_link_state ivl;
NEXT_ARG(); NEXT_ARG();
if (matches(*argv, "auto") == 0) if (matches(*argv, "auto") == 0)
ivl.link_state = IFLA_VF_LINK_STATE_AUTO; ivl.link_state = IFLA_VF_LINK_STATE_AUTO;
...@@ -390,7 +397,8 @@ static int iplink_parse_vf(int vf, int *argcp, char ***argvp, ...@@ -390,7 +397,8 @@ static int iplink_parse_vf(int vf, int *argcp, char ***argvp,
} }
int iplink_parse(int argc, char **argv, struct iplink_req *req, int iplink_parse(int argc, char **argv, struct iplink_req *req,
char **name, char **type, char **link, char **dev, int *group, int *index) char **name, char **type, char **link, char **dev,
int *group, int *index)
{ {
int ret, len; int ret, len;
char abuf[32]; char abuf[32];
...@@ -457,7 +465,8 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, ...@@ -457,7 +465,8 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
NEXT_ARG(); NEXT_ARG();
if (netns != -1) if (netns != -1)
duparg("netns", *argv); duparg("netns", *argv);
if ((netns = netns_get_fd(*argv)) >= 0) netns = netns_get_fd(*argv);
if (netns >= 0)
addattr_l(&req->n, sizeof(*req), IFLA_NET_NS_FD, &netns, 4); addattr_l(&req->n, sizeof(*req), IFLA_NET_NS_FD, &netns, 4);
else if (get_integer(&netns, *argv, 0) == 0) else if (get_integer(&netns, *argv, 0) == 0)
addattr_l(&req->n, sizeof(*req), IFLA_NET_NS_PID, &netns, 4); addattr_l(&req->n, sizeof(*req), IFLA_NET_NS_PID, &netns, 4);
...@@ -466,54 +475,60 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, ...@@ -466,54 +475,60 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
} else if (strcmp(*argv, "multicast") == 0) { } else if (strcmp(*argv, "multicast") == 0) {
NEXT_ARG(); NEXT_ARG();
req->i.ifi_change |= IFF_MULTICAST; req->i.ifi_change |= IFF_MULTICAST;
if (strcmp(*argv, "on") == 0) {
if (strcmp(*argv, "on") == 0)
req->i.ifi_flags |= IFF_MULTICAST; req->i.ifi_flags |= IFF_MULTICAST;
} else if (strcmp(*argv, "off") == 0) { else if (strcmp(*argv, "off") == 0)
req->i.ifi_flags &= ~IFF_MULTICAST; req->i.ifi_flags &= ~IFF_MULTICAST;
} else else
return on_off("multicast", *argv); return on_off("multicast", *argv);
} else if (strcmp(*argv, "allmulticast") == 0) { } else if (strcmp(*argv, "allmulticast") == 0) {
NEXT_ARG(); NEXT_ARG();
req->i.ifi_change |= IFF_ALLMULTI; req->i.ifi_change |= IFF_ALLMULTI;
if (strcmp(*argv, "on") == 0) {
if (strcmp(*argv, "on") == 0)
req->i.ifi_flags |= IFF_ALLMULTI; req->i.ifi_flags |= IFF_ALLMULTI;
} else if (strcmp(*argv, "off") == 0) { else if (strcmp(*argv, "off") == 0)
req->i.ifi_flags &= ~IFF_ALLMULTI; req->i.ifi_flags &= ~IFF_ALLMULTI;
} else else
return on_off("allmulticast", *argv); return on_off("allmulticast", *argv);
} else if (strcmp(*argv, "promisc") == 0) { } else if (strcmp(*argv, "promisc") == 0) {
NEXT_ARG(); NEXT_ARG();
req->i.ifi_change |= IFF_PROMISC; req->i.ifi_change |= IFF_PROMISC;
if (strcmp(*argv, "on") == 0) {
if (strcmp(*argv, "on") == 0)
req->i.ifi_flags |= IFF_PROMISC; req->i.ifi_flags |= IFF_PROMISC;
} else if (strcmp(*argv, "off") == 0) { else if (strcmp(*argv, "off") == 0)
req->i.ifi_flags &= ~IFF_PROMISC; req->i.ifi_flags &= ~IFF_PROMISC;
} else else
return on_off("promisc", *argv); return on_off("promisc", *argv);
} else if (strcmp(*argv, "trailers") == 0) { } else if (strcmp(*argv, "trailers") == 0) {
NEXT_ARG(); NEXT_ARG();
req->i.ifi_change |= IFF_NOTRAILERS; req->i.ifi_change |= IFF_NOTRAILERS;
if (strcmp(*argv, "off") == 0) {
if (strcmp(*argv, "off") == 0)
req->i.ifi_flags |= IFF_NOTRAILERS; req->i.ifi_flags |= IFF_NOTRAILERS;
} else if (strcmp(*argv, "on") == 0) { else if (strcmp(*argv, "on") == 0)
req->i.ifi_flags &= ~IFF_NOTRAILERS; req->i.ifi_flags &= ~IFF_NOTRAILERS;
} else else
return on_off("trailers", *argv); return on_off("trailers", *argv);
} else if (strcmp(*argv, "arp") == 0) { } else if (strcmp(*argv, "arp") == 0) {
NEXT_ARG(); NEXT_ARG();
req->i.ifi_change |= IFF_NOARP; req->i.ifi_change |= IFF_NOARP;
if (strcmp(*argv, "on") == 0) {
if (strcmp(*argv, "on") == 0)
req->i.ifi_flags &= ~IFF_NOARP; req->i.ifi_flags &= ~IFF_NOARP;
} else if (strcmp(*argv, "off") == 0) { else if (strcmp(*argv, "off") == 0)
req->i.ifi_flags |= IFF_NOARP; req->i.ifi_flags |= IFF_NOARP;
} else else
return on_off("arp", *argv); return on_off("arp", *argv);
} else if (strcmp(*argv, "vf") == 0) { } else if (strcmp(*argv, "vf") == 0) {
struct rtattr *vflist; struct rtattr *vflist;
NEXT_ARG(); NEXT_ARG();
if (get_integer(&vf, *argv, 0)) { if (get_integer(&vf, *argv, 0))
invarg("Invalid \"vf\" value\n", *argv); invarg("Invalid \"vf\" value\n", *argv);
}
vflist = addattr_nest(&req->n, sizeof(*req), vflist = addattr_nest(&req->n, sizeof(*req),
IFLA_VFINFO_LIST); IFLA_VFINFO_LIST);
if (dev_index == 0) if (dev_index == 0)
...@@ -525,6 +540,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, ...@@ -525,6 +540,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
addattr_nest_end(&req->n, vflist); addattr_nest_end(&req->n, vflist);
} else if (matches(*argv, "master") == 0) { } else if (matches(*argv, "master") == 0) {
int ifindex; int ifindex;
NEXT_ARG(); NEXT_ARG();
ifindex = ll_name_to_index(*argv); ifindex = ll_name_to_index(*argv);
if (!ifindex) if (!ifindex)
...@@ -533,16 +549,18 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, ...@@ -533,16 +549,18 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
&ifindex, 4); &ifindex, 4);
} else if (matches(*argv, "nomaster") == 0) { } else if (matches(*argv, "nomaster") == 0) {
int ifindex = 0; int ifindex = 0;
addattr_l(&req->n, sizeof(*req), IFLA_MASTER, addattr_l(&req->n, sizeof(*req), IFLA_MASTER,
&ifindex, 4); &ifindex, 4);
} else if (matches(*argv, "dynamic") == 0) { } else if (matches(*argv, "dynamic") == 0) {
NEXT_ARG(); NEXT_ARG();
req->i.ifi_change |= IFF_DYNAMIC; req->i.ifi_change |= IFF_DYNAMIC;
if (strcmp(*argv, "on") == 0) {
if (strcmp(*argv, "on") == 0)
req->i.ifi_flags |= IFF_DYNAMIC; req->i.ifi_flags |= IFF_DYNAMIC;
} else if (strcmp(*argv, "off") == 0) { else if (strcmp(*argv, "off") == 0)
req->i.ifi_flags &= ~IFF_DYNAMIC; req->i.ifi_flags &= ~IFF_DYNAMIC;
} else else
return on_off("dynamic", *argv); return on_off("dynamic", *argv);
} else if (matches(*argv, "type") == 0) { } else if (matches(*argv, "type") == 0) {
NEXT_ARG(); NEXT_ARG();
...@@ -563,6 +581,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, ...@@ -563,6 +581,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
invarg("Invalid \"group\" value\n", *argv); invarg("Invalid \"group\" value\n", *argv);
} else if (strcmp(*argv, "mode") == 0) { } else if (strcmp(*argv, "mode") == 0) {
int mode; int mode;
NEXT_ARG(); NEXT_ARG();
mode = get_link_mode(*argv); mode = get_link_mode(*argv);
if (mode < 0) if (mode < 0)
...@@ -570,6 +589,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, ...@@ -570,6 +589,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
addattr8(&req->n, sizeof(*req), IFLA_LINKMODE, mode); addattr8(&req->n, sizeof(*req), IFLA_LINKMODE, mode);
} else if (strcmp(*argv, "state") == 0) { } else if (strcmp(*argv, "state") == 0) {
int state; int state;
NEXT_ARG(); NEXT_ARG();
state = get_operstate(*argv); state = get_operstate(*argv);
if (state < 0) if (state < 0)
...@@ -595,6 +615,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, ...@@ -595,6 +615,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
} else if (matches(*argv, "addrgenmode") == 0) { } else if (matches(*argv, "addrgenmode") == 0) {
struct rtattr *afs, *afs6; struct rtattr *afs, *afs6;
int mode; int mode;
NEXT_ARG(); NEXT_ARG();
mode = get_addr_gen_mode(*argv); mode = get_addr_gen_mode(*argv);
if (mode < 0) if (mode < 0)
...@@ -613,9 +634,9 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, ...@@ -613,9 +634,9 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
addattr32(&req->n, sizeof(*req), IFLA_LINK_NETNSID, addattr32(&req->n, sizeof(*req), IFLA_LINK_NETNSID,
link_netnsid); link_netnsid);
} else { } else {
if (strcmp(*argv, "dev") == 0) { if (strcmp(*argv, "dev") == 0)
NEXT_ARG(); NEXT_ARG();
}
if (matches(*argv, "help") == 0) if (matches(*argv, "help") == 0)
usage(); usage();
if (*dev) if (*dev)
...@@ -953,14 +974,14 @@ static int get_address(const char *dev, int *htype) ...@@ -953,14 +974,14 @@ static int get_address(const char *dev, int *htype)
me.sll_family = AF_PACKET; me.sll_family = AF_PACKET;
me.sll_ifindex = ifr.ifr_ifindex; me.sll_ifindex = ifr.ifr_ifindex;
me.sll_protocol = htons(ETH_P_LOOP); me.sll_protocol = htons(ETH_P_LOOP);
if (bind(s, (struct sockaddr*)&me, sizeof(me)) == -1) { if (bind(s, (struct sockaddr *)&me, sizeof(me)) == -1) {
perror("bind"); perror("bind");
close(s); close(s);
return -1; return -1;
} }
alen = sizeof(me); alen = sizeof(me);
if (getsockname(s, (struct sockaddr*)&me, &alen) == -1) { if (getsockname(s, (struct sockaddr *)&me, &alen) == -1) {
perror("getsockname"); perror("getsockname");
close(s); close(s);
return -1; return -1;
...@@ -1051,63 +1072,70 @@ static int do_set(int argc, char **argv) ...@@ -1051,63 +1072,70 @@ static int do_set(int argc, char **argv)
} else if (strcmp(*argv, "multicast") == 0) { } else if (strcmp(*argv, "multicast") == 0) {
NEXT_ARG(); NEXT_ARG();
mask |= IFF_MULTICAST; mask |= IFF_MULTICAST;
if (strcmp(*argv, "on") == 0) {
if (strcmp(*argv, "on") == 0)
flags |= IFF_MULTICAST; flags |= IFF_MULTICAST;
} else if (strcmp(*argv, "off") == 0) { else if (strcmp(*argv, "off") == 0)
flags &= ~IFF_MULTICAST; flags &= ~IFF_MULTICAST;
} else else
return on_off("multicast", *argv); return on_off("multicast", *argv);
} else if (strcmp(*argv, "allmulticast") == 0) { } else if (strcmp(*argv, "allmulticast") == 0) {
NEXT_ARG(); NEXT_ARG();
mask |= IFF_ALLMULTI; mask |= IFF_ALLMULTI;
if (strcmp(*argv, "on") == 0) {
if (strcmp(*argv, "on") == 0)
flags |= IFF_ALLMULTI; flags |= IFF_ALLMULTI;
} else if (strcmp(*argv, "off") == 0) { else if (strcmp(*argv, "off") == 0)
flags &= ~IFF_ALLMULTI; flags &= ~IFF_ALLMULTI;
} else else
return on_off("allmulticast", *argv); return on_off("allmulticast", *argv);
} else if (strcmp(*argv, "promisc") == 0) { } else if (strcmp(*argv, "promisc") == 0) {
NEXT_ARG(); NEXT_ARG();
mask |= IFF_PROMISC; mask |= IFF_PROMISC;
if (strcmp(*argv, "on") == 0) {
if (strcmp(*argv, "on") == 0)
flags |= IFF_PROMISC; flags |= IFF_PROMISC;
} else if (strcmp(*argv, "off") == 0) { else if (strcmp(*argv, "off") == 0)
flags &= ~IFF_PROMISC; flags &= ~IFF_PROMISC;
} else else
return on_off("promisc", *argv); return on_off("promisc", *argv);
} else if (strcmp(*argv, "trailers") == 0) { } else if (strcmp(*argv, "trailers") == 0) {
NEXT_ARG(); NEXT_ARG();
mask |= IFF_NOTRAILERS; mask |= IFF_NOTRAILERS;
if (strcmp(*argv, "off") == 0) {
if (strcmp(*argv, "off") == 0)
flags |= IFF_NOTRAILERS; flags |= IFF_NOTRAILERS;
} else if (strcmp(*argv, "on") == 0) { else if (strcmp(*argv, "on") == 0)
flags &= ~IFF_NOTRAILERS; flags &= ~IFF_NOTRAILERS;
} else else
return on_off("trailers", *argv); return on_off("trailers", *argv);
} else if (strcmp(*argv, "arp") == 0) { } else if (strcmp(*argv, "arp") == 0) {
NEXT_ARG(); NEXT_ARG();
mask |= IFF_NOARP; mask |= IFF_NOARP;
if (strcmp(*argv, "on") == 0) {
if (strcmp(*argv, "on") == 0)
flags &= ~IFF_NOARP; flags &= ~IFF_NOARP;
} else if (strcmp(*argv, "off") == 0) { else if (strcmp(*argv, "off") == 0)
flags |= IFF_NOARP; flags |= IFF_NOARP;
} else else
return on_off("arp", *argv); return on_off("arp", *argv);
} else if (matches(*argv, "dynamic") == 0) { } else if (matches(*argv, "dynamic") == 0) {
NEXT_ARG(); NEXT_ARG();
mask |= IFF_DYNAMIC; mask |= IFF_DYNAMIC;
if (strcmp(*argv, "on") == 0) {
if (strcmp(*argv, "on") == 0)
flags |= IFF_DYNAMIC; flags |= IFF_DYNAMIC;
} else if (strcmp(*argv, "off") == 0) { else if (strcmp(*argv, "off") == 0)
flags &= ~IFF_DYNAMIC; flags &= ~IFF_DYNAMIC;
} else else
return on_off("dynamic", *argv); return on_off("dynamic", *argv);
} else { } else {
if (strcmp(*argv, "dev") == 0) { if (strcmp(*argv, "dev") == 0)
NEXT_ARG(); NEXT_ARG();
}
if (matches(*argv, "help") == 0) if (matches(*argv, "help") == 0)
usage(); usage();
if (dev) if (dev)
duparg2("dev", *argv); duparg2("dev", *argv);
dev = *argv; dev = *argv;
...@@ -1171,11 +1199,10 @@ static void do_help(int argc, char **argv) ...@@ -1171,11 +1199,10 @@ static void do_help(int argc, char **argv)
if (argc <= 0) { if (argc <= 0) {
usage(); usage();
return ; return;
} }
lu = get_link_kind(*argv); lu = get_link_kind(*argv);
if (lu && lu->print_help) if (lu && lu->print_help)
lu->print_help(lu, argc-1, argv+1, stdout); lu->print_help(lu, argc-1, argv+1, stdout);
else else
...@@ -1209,10 +1236,12 @@ int do_iplink(int argc, char **argv) ...@@ -1209,10 +1236,12 @@ int do_iplink(int argc, char **argv)
return do_set(argc-1, argv+1); return do_set(argc-1, argv+1);
#endif #endif
} }
if (matches(*argv, "show") == 0 || if (matches(*argv, "show") == 0 ||
matches(*argv, "lst") == 0 || matches(*argv, "lst") == 0 ||
matches(*argv, "list") == 0) matches(*argv, "list") == 0)
return ipaddr_list_link(argc-1, argv+1); return ipaddr_list_link(argc-1, argv+1);
if (matches(*argv, "help") == 0) { if (matches(*argv, "help") == 0) {
do_help(argc-1, argv+1); do_help(argc-1, argv+1);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment