Home | History | Annotate | Download | only in ip

Lines Matching defs:argv

664 	char **argv = *argvp;
667 if (get_u32(&mark->v, *argv, 0)) {
668 invarg("Illegal \"mark\" value\n", *argv);
677 if (strcmp(*argv, "mask") == 0) {
679 if (get_u32(&mark->m, *argv, 0)) {
680 invarg("Illegal \"mark\" mask\n", *argv);
689 *argvp = argv;
1005 char **argv = *argvp;
1013 if (strcmp(*argv, "src") == 0) {
1016 get_prefix(&src, *argv, preferred_family);
1018 invarg("\"src\" address family is AF_UNSPEC", *argv);
1026 } else if (strcmp(*argv, "dst") == 0) {
1029 get_prefix(&dst, *argv, preferred_family);
1031 invarg("\"dst\" address family is AF_UNSPEC", *argv);
1039 } else if (strcmp(*argv, "proto") == 0) {
1044 ret = xfrm_xfrmproto_getbyname(*argv);
1046 invarg("\"XFRM-PROTO\" is invalid", *argv);
1052 } else if (strcmp(*argv, "spi") == 0) {
1056 if (get_u32(&spi, *argv, 0))
1057 invarg("\"SPI\" is invalid", *argv);
1075 invarg("the same address family is required between \"src\" and \"dst\"", *argv);
1083 *argvp = argv;
1091 char **argv = *argvp;
1093 if (matches(*argv, "transport") == 0)
1095 else if (matches(*argv, "tunnel") == 0)
1097 else if (matches(*argv, "ro") == 0)
1099 else if (matches(*argv, "in_trigger") == 0)
1101 else if (matches(*argv, "beet") == 0)
1104 invarg("\"MODE\" is invalid", *argv);
1107 *argvp = argv;
1115 char **argv = *argvp;
1117 if (strcmp(*argv, "espinudp-nonike") == 0)
1119 else if (strcmp(*argv, "espinudp") == 0)
1122 invarg("\"ENCAP-TYPE\" is invalid", *argv);
1125 *argvp = argv;
1134 char **argv = *argvp;
1136 if (get_u32(reqid, *argv, 0))
1137 invarg("\"REQID\" is invalid", *argv);
1140 *argvp = argv;
1149 char **argv = *argvp;
1157 if (strcmp(*argv, "proto") == 0) {
1162 if (strcmp(*argv, "any") == 0)
1166 pp = getprotobyname(*argv);
1170 if (get_u8(&upspec, *argv, 0))
1171 invarg("\"PROTO\" is invalid", *argv);
1178 } else if (strcmp(*argv, "sport") == 0) {
1179 sportp = *argv;
1183 if (get_u16(&sel->sport, *argv, 0))
1184 invarg("\"PORT\" is invalid", *argv);
1191 } else if (strcmp(*argv, "dport") == 0) {
1192 dportp = *argv;
1196 if (get_u16(&sel->dport, *argv, 0))
1197 invarg("\"PORT\" is invalid", *argv);
1204 } else if (strcmp(*argv, "type") == 0) {
1205 typep = *argv;
1209 if (get_u16(&sel->sport, *argv, 0) ||
1211 invarg("\"type\" value is invalid", *argv);
1218 } else if (strcmp(*argv, "code") == 0) {
1219 codep = *argv;
1223 if (get_u16(&sel->dport, *argv, 0) ||
1225 invarg("\"code\" value is invalid", *argv);
1231 } else if (strcmp(*argv, "key") == 0) {
1234 grekey = *argv;
1238 if (strchr(*argv, '.'))
1239 uval = htonl(get_addr32(*argv));
1241 if (get_unsigned(&uval, *argv, 0)<0) {
1299 *argvp = argv;
1307 char **argv = *argvp;
1316 if (strcmp(*argv, "src") == 0) {
1319 get_prefix(&src, *argv, preferred_family);
1321 invarg("\"src\" address family is AF_UNSPEC", *argv);
1329 } else if (strcmp(*argv, "dst") == 0) {
1332 get_prefix(&dst, *argv, preferred_family);
1334 invarg("\"dst\" address family is AF_UNSPEC", *argv);
1342 } else if (strcmp(*argv, "dev") == 0) {
1347 if (strcmp(*argv, "none") == 0)
1350 ifindex = ll_name_to_index(*argv);
1352 invarg("\"DEV\" is invalid", *argv);
1363 upspecp = *argv;
1364 xfrm_selector_upspec_parse(sel, &argc, &argv);
1375 invarg("the same address family is required between \"src\" and \"dst\"", *argv);
1381 *argvp = argv;
1390 char **argv = *argvp;
1393 if (strcmp(*argv, "time-soft") == 0) {
1395 ret = get_u64(&lft->soft_add_expires_seconds, *argv, 0);
1397 invarg("\"time-soft\" value is invalid", *argv);
1398 } else if (strcmp(*argv, "time-hard") == 0) {
1400 ret = get_u64(&lft->hard_add_expires_seconds, *argv, 0);
1402 invarg("\"time-hard\" value is invalid", *argv);
1403 } else if (strcmp(*argv, "time-use-soft") == 0) {
1405 ret = get_u64(&lft->soft_use_expires_seconds, *argv, 0);
1407 invarg("\"time-use-soft\" value is invalid", *argv);
1408 } else if (strcmp(*argv, "time-use-hard") == 0) {
1410 ret = get_u64(&lft->hard_use_expires_seconds, *argv, 0);
1412 invarg("\"time-use-hard\" value is invalid", *argv);
1413 } else if (strcmp(*argv, "byte-soft") == 0) {
1415 ret = get_u64(&lft->soft_byte_limit, *argv, 0);
1417 invarg("\"byte-soft\" value is invalid", *argv);
1418 } else if (strcmp(*argv, "byte-hard") == 0) {
1420 ret = get_u64(&lft->hard_byte_limit, *argv, 0);
1422 invarg("\"byte-hard\" value is invalid", *argv);
1423 } else if (strcmp(*argv, "packet-soft") == 0) {
1425 ret = get_u64(&lft->soft_packet_limit, *argv, 0);
1427 invarg("\"packet-soft\" value is invalid", *argv);
1428 } else if (strcmp(*argv, "packet-hard") == 0) {
1430 ret = get_u64(&lft->hard_packet_limit, *argv, 0);
1432 invarg("\"packet-hard\" value is invalid", *argv);
1434 invarg("\"LIMIT\" is invalid", *argv);
1437 *argvp = argv;
1442 int do_xfrm(int argc, char **argv)
1449 if (matches(*argv, "state") == 0 ||
1450 matches(*argv, "sa") == 0)
1451 return do_xfrm_state(argc-1, argv+1);
1452 else if (matches(*argv, "policy") == 0)
1453 return do_xfrm_policy(argc-1, argv+1);
1454 else if (matches(*argv, "monitor") == 0)
1455 return do_xfrm_monitor(argc-1, argv+1);
1456 else if (matches(*argv, "help") == 0) {
1458 fprintf(stderr, "xfrm Object \"%s\" is unknown.\n", *argv);