Lines Matching refs:argv
176 int iplink_parse(int argc, char **argv, struct iplink_req *req,
188 if (strcmp(*argv, "up") == 0) {
191 } else if (strcmp(*argv, "down") == 0) {
194 } else if (strcmp(*argv, "name") == 0) {
196 *name = *argv;
197 } else if (matches(*argv, "link") == 0) {
199 *link = *argv;
200 } else if (matches(*argv, "address") == 0) {
202 len = ll_addr_a2n(abuf, sizeof(abuf), *argv);
206 } else if (matches(*argv, "broadcast") == 0 ||
207 strcmp(*argv, "brd") == 0) {
209 len = ll_addr_a2n(abuf, sizeof(abuf), *argv);
213 } else if (matches(*argv, "txqueuelen") == 0 ||
214 strcmp(*argv, "qlen") == 0 ||
215 matches(*argv, "txqlen") == 0) {
218 duparg("txqueuelen", *argv);
219 if (get_integer(&qlen, *argv, 0))
220 invarg("Invalid \"txqueuelen\" value\n", *argv);
222 } else if (strcmp(*argv, "mtu") == 0) {
225 duparg("mtu", *argv);
226 if (get_integer(&mtu, *argv, 0))
227 invarg("Invalid \"mtu\" value\n", *argv);
229 } else if (strcmp(*argv, "netns") == 0) {
232 duparg("netns", *argv);
233 if (get_integer(&netns, *argv, 0))
234 invarg("Invalid \"netns\" value\n", *argv);
236 } else if (strcmp(*argv, "multicast") == 0) {
239 if (strcmp(*argv, "on") == 0) {
241 } else if (strcmp(*argv, "off") == 0) {
245 } else if (strcmp(*argv, "allmulticast") == 0) {
248 if (strcmp(*argv, "on") == 0) {
250 } else if (strcmp(*argv, "off") == 0) {
254 } else if (strcmp(*argv, "promisc") == 0) {
257 if (strcmp(*argv, "on") == 0) {
259 } else if (strcmp(*argv, "off") == 0) {
263 } else if (strcmp(*argv, "trailers") == 0) {
266 if (strcmp(*argv, "off") == 0) {
268 } else if (strcmp(*argv, "on") == 0) {
272 } else if (strcmp(*argv, "arp") == 0) {
275 if (strcmp(*argv, "on") == 0) {
277 } else if (strcmp(*argv, "off") == 0) {
282 } else if (matches(*argv, "dynamic") == 0) {
285 if (strcmp(*argv, "on") == 0) {
287 } else if (strcmp(*argv, "off") == 0) {
292 } else if (matches(*argv, "type") == 0) {
294 *type = *argv;
295 argc--; argv++;
297 } else if (matches(*argv, "alias") == 0) {
300 *argv, strlen(*argv));
301 argc--; argv++;
304 if (strcmp(*argv, "dev") == 0) {
307 if (matches(*argv, "help") == 0)
310 duparg2("dev", *argv);
311 *dev = *argv;
313 argc--; argv++;
319 static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
337 ret = iplink_parse(argc, argv, &req, &name, &type, &link, &dev);
342 argv += ret;
357 lu->parse_opt(lu, argc, argv, &req.n))
362 if (matches(*argv, "help") == 0)
365 "Try \"ip link help\".\n", *argv);
610 static int do_set(int argc, char **argv)
624 if (strcmp(*argv, "up") == 0) {
627 } else if (strcmp(*argv, "down") == 0) {
630 } else if (strcmp(*argv, "name") == 0) {
632 newname = *argv;
633 } else if (matches(*argv, "address") == 0) {
635 newaddr = *argv;
636 } else if (matches(*argv, "broadcast") == 0 ||
637 strcmp(*argv, "brd") == 0) {
639 newbrd = *argv;
640 } else if (matches(*argv, "txqueuelen") == 0 ||
641 strcmp(*argv, "qlen") == 0 ||
642 matches(*argv, "txqlen") == 0) {
645 duparg("txqueuelen", *argv);
646 if (get_integer(&qlen, *argv, 0))
647 invarg("Invalid \"txqueuelen\" value\n", *argv);
648 } else if (strcmp(*argv, "mtu") == 0) {
651 duparg("mtu", *argv);
652 if (get_integer(&mtu, *argv, 0))
653 invarg("Invalid \"mtu\" value\n", *argv);
654 } else if (strcmp(*argv, "multicast") == 0) {
657 if (strcmp(*argv, "on") == 0) {
659 } else if (strcmp(*argv, "off") == 0) {
663 } else if (strcmp(*argv, "allmulticast") == 0) {
666 if (strcmp(*argv, "on") == 0) {
668 argv, "off") == 0) {
672 } else if (strcmp(*argv, "promisc") == 0) {
675 if (strcmp(*argv, "on") == 0) {
677 } else if (strcmp(*argv, "off") == 0) {
681 } else if (strcmp(*argv, "trailers") == 0) {
684 if (strcmp(*argv, "off") == 0) {
686 } else if (strcmp(*argv, "on") == 0) {
690 } else if (strcmp(*argv, "arp") == 0) {
693 if (strcmp(*argv, "on") == 0) {
695 } else if (strcmp(*argv, "off") == 0) {
700 } else if (matches(*argv, "dynamic") == 0) {
703 if (strcmp(*argv, "on") == 0) {
705 } else if (strcmp(*argv, "off") == 0) {
711 if (strcmp(*argv, "dev") == 0) {
714 if (matches(*argv, "help") == 0)
717 duparg2("dev", *argv);
718 dev = *argv;
720 argc--; argv++;
773 int do_iplink(int argc, char **argv)
777 if (matches(*argv, "add") == 0)
780 argc-1, argv+1);
781 if (matches(*argv, "set") == 0 ||
782 matches(*argv, "change") == 0)
784 argc-1, argv+1);
785 if (matches(*argv, "replace") == 0)
788 argc-1, argv+1);
789 if (matches(*argv, "delete") == 0)
791 argc-1, argv+1);
794 if (matches(*argv, "set") == 0)
795 return do_set(argc-1, argv+1);
798 if (matches(*argv, "show") == 0 ||
799 matches(*argv, "lst") == 0 ||
800 matches(*argv, "list") == 0)
801 return ipaddr_list_link(argc-1, argv+1);
802 if (matches(*argv, "help") == 0)
807 fprintf(stderr, "Command \"%s\" is unknown, try \"ip link help\".\n", *argv);