Lines Matching defs:argv
178 char **argv = *argvp;
180 if (get_u32(seq, *argv, 0))
181 invarg("\"SEQ\" is invalid", *argv);
186 *argvp = argv;
194 char **argv = *argvp;
195 int len = strlen(*argv);
197 if (len > 2 && strncmp(*argv, "0x", 2) == 0) {
200 if (get_u8(&val, *argv, 16))
201 invarg("\"FLAG\" is invalid", *argv);
205 if (strcmp(*argv, "noecn") == 0)
207 else if (strcmp(*argv, "decap-dscp") == 0)
209 else if (strcmp(*argv, "nopmtudisc") == 0)
211 else if (strcmp(*argv, "wildrecv") == 0)
213 else if (strcmp(*argv, "icmp") == 0)
215 else if (strcmp(*argv, "af-unspec") == 0)
217 else if (strcmp(*argv, "align4") == 0)
231 *argvp = argv;
236 static int xfrm_state_modify(int cmd, unsigned flags, int argc, char **argv)
273 if (strcmp(*argv, "mode") == 0) {
275 xfrm_mode_parse(&req.xsinfo.mode, &argc, &argv);
276 } else if (strcmp(*argv, "mark") == 0) {
277 xfrm_parse_mark(&mark, &argc, &argv);
278 } else if (strcmp(*argv, "reqid") == 0) {
280 xfrm_reqid_parse(&req.xsinfo.reqid, &argc, &argv);
281 } else if (strcmp(*argv, "seq") == 0) {
283 xfrm_seq_parse(&req.xsinfo.seq, &argc, &argv);
284 } else if (strcmp(*argv, "replay-window") == 0) {
286 if (get_u8(&req.xsinfo.replay_window, *argv, 0))
287 invarg("\"replay-window\" value is invalid", *argv);
288 } else if (strcmp(*argv, "replay-seq") == 0) {
290 if (get_u32(&replay.seq, *argv, 0))
291 invarg("\"replay-seq\" value is invalid", *argv);
292 } else if (strcmp(*argv, "replay-oseq") == 0) {
294 if (get_u32(&replay.oseq, *argv, 0))
295 invarg("\"replay-oseq\" value is invalid", *argv);
296 } else if (strcmp(*argv, "flag") == 0) {
298 xfrm_state_flag_parse(&req.xsinfo.flags, &argc, &argv);
299 } else if (strcmp(*argv, "sel") == 0) {
301 xfrm_selector_parse(&req.xsinfo.sel, &argc, &argv);
302 } else if (strcmp(*argv, "limit") == 0) {
304 xfrm_lifetime_cfg_parse(&req.xsinfo.lft, &argc, &argv);
305 } else if (strcmp(*argv, "encap") == 0) {
309 xfrm_encap_type_parse(&encap.encap_type, &argc, &argv);
311 if (get_u16(&encap.encap_sport, *argv, 0))
312 invarg("\"encap\" sport value is invalid", *argv);
315 if (get_u16(&encap.encap_dport, *argv, 0))
316 invarg("\"encap\" dport value is invalid", *argv);
319 get_addr(&oa, *argv, AF_UNSPEC);
323 } else if (strcmp(*argv, "coa") == 0) {
328 duparg("coa", *argv);
329 coap = *argv;
333 get_prefix(&coa, *argv, preferred_family);
335 invarg("\"coa\" address family is AF_UNSPEC", *argv);
337 invarg("\"coa\" address length is too large", *argv);
344 } else if (strcmp(*argv, "ctx") == 0) {
348 duparg("ctx", *argv);
349 sctxp = *argv;
352 context = *argv;
359 int type = xfrm_algotype_getbyname(*argv);
385 duparg("ALGO-TYPE", *argv);
386 aeadop = *argv;
390 duparg("ALGO-TYPE", *argv);
391 ealgop = *argv;
396 duparg("ALGO-TYPE", *argv);
397 aalgop = *argv;
401 duparg("ALGO-TYPE", *argv);
402 calgop = *argv;
406 invarg("\"ALGO-TYPE\" is invalid\n", *argv);
412 name = *argv;
417 key = *argv;
427 if (get_u32(&icvlen, *argv, 0))
429 *argv);
439 if (get_u32(&trunclen, *argv, 0))
441 *argv);
460 invarg("unknown", *argv);
461 idp = *argv;
465 &req.xsinfo.family, 0, &argc, &argv);
470 argc--; argv++;
559 static int xfrm_state_allocspi(int argc, char **argv)
591 if (strcmp(*argv, "mode") == 0) {
593 xfrm_mode_parse(&req.xspi.info.mode, &argc, &argv);
594 } else if (strcmp(*argv, "mark") == 0) {
595 xfrm_parse_mark(&mark, &argc, &argv);
596 } else if (strcmp(*argv, "reqid") == 0) {
598 xfrm_reqid_parse(&req.xspi.info.reqid, &argc, &argv);
599 } else if (strcmp(*argv, "seq") == 0) {
601 xfrm_seq_parse(&req.xspi.info.seq, &argc, &argv);
602 } else if (strcmp(*argv, "min") == 0) {
604 duparg("min", *argv);
605 minp = *argv;
609 if (get_u32(&req.xspi.min, *argv, 0))
610 invarg("\"min\" value is invalid", *argv);
611 } else if (strcmp(*argv, "max") == 0) {
613 duparg("max", *argv);
614 maxp = *argv;
618 if (get_u32(&req.xspi.max, *argv, 0))
619 invarg("\"max\" value is invalid", *argv);
623 invarg("unknown", *argv);
624 idp = *argv;
628 &req.xspi.info.family, 0, &argc, &argv);
636 argc--; argv++;
816 static int xfrm_state_get_or_delete(int argc, char **argv, int delete)
838 if (strcmp(*argv, "mark") == 0) {
839 xfrm_parse_mark(&mark, &argc, &argv);
842 invarg("unknown", *argv);
843 idp = *argv;
849 &argc, &argv);
859 argc--; argv++;
956 static int xfrm_state_list_or_deleteall(int argc, char **argv, int deleteall)
966 if (strcmp(*argv, "mode") == 0) {
968 xfrm_mode_parse(&filter.xsinfo.mode, &argc, &argv);
972 } else if (strcmp(*argv, "reqid") == 0) {
974 xfrm_reqid_parse(&filter.xsinfo.reqid, &argc, &argv);
978 } else if (strcmp(*argv, "flag") == 0) {
980 xfrm_state_flag_parse(&filter.xsinfo.flags, &argc, &argv);
986 invarg("unknown", *argv);
987 idp = *argv;
991 &filter.xsinfo.family, 1, &argc, &argv);
995 argc--; argv++;
1109 static int xfrm_sad_getinfo(int argc, char **argv)
1137 static int xfrm_state_flush(int argc, char **argv)
1154 if (strcmp(*argv, "proto") == 0) {
1158 duparg("proto", *argv);
1159 protop = *argv;
1163 ret = xfrm_xfrmproto_getbyname(*argv);
1165 invarg("\"XFRM-PROTO\" is invalid", *argv);
1169 invarg("unknown", *argv);
1171 argc--; argv++;
1189 int do_xfrm_state(int argc, char **argv)
1194 if (matches(*argv, "add") == 0)
1196 argc-1, argv+1);
1197 if (matches(*argv, "update") == 0)
1199 argc-1, argv+1);
1200 if (matches(*argv, "allocspi") == 0)
1201 return xfrm_state_allocspi(argc-1, argv+1);
1202 if (matches(*argv, "delete") == 0)
1203 return xfrm_state_get_or_delete(argc-1, argv+1, 1);
1204 if (matches(*argv, "deleteall") == 0 || matches(*argv, "delall") == 0)
1205 return xfrm_state_list_or_deleteall(argc-1, argv+1, 1);
1206 if (matches(*argv, "list") == 0 || matches(*argv, "show") == 0
1207 || matches(*argv, "lst") == 0)
1208 return xfrm_state_list_or_deleteall(argc-1, argv+1, 0);
1209 if (matches(*argv, "get") == 0)
1210 return xfrm_state_get_or_delete(argc-1, argv+1, 0);
1211 if (matches(*argv, "flush") == 0)
1212 return xfrm_state_flush(argc-1, argv+1);
1213 if (matches(*argv, "count") == 0) {
1214 return xfrm_sad_getinfo(argc, argv);
1216 if (matches(*argv, "help") == 0)
1218 fprintf(stderr, "Command \"%s\" is unknown, try \"ip xfrm state help\".\n", *argv);