Lines Matching refs:argv

320 static char **parse_bytes(char **argv, const char *name, unsigned char *val,  in parse_bytes()  argument
326 if (is_prefix(*argv, "hex")) { in parse_bytes()
328 argv++; in parse_bytes()
331 while (i < n && argv[i]) { in parse_bytes()
332 val[i] = strtoul(argv[i], &endptr, base); in parse_bytes()
334 p_err("error parsing byte: %s", argv[i]); in parse_bytes()
345 return argv + i; in parse_bytes()
362 static int parse_elem(char **argv, struct bpf_map_info *info, in parse_elem() argument
366 if (!*argv) { in parse_elem()
373 if (is_prefix(*argv, "key")) { in parse_elem()
382 argv = parse_bytes(argv + 1, "key", key, key_size); in parse_elem()
383 if (!argv) in parse_elem()
386 return parse_elem(argv, info, NULL, value, key_size, value_size, in parse_elem()
388 } else if (is_prefix(*argv, "value")) { in parse_elem()
399 argv++; in parse_elem()
408 if (!argv[0] || !argv[1]) { in parse_elem()
413 fd = map_parse_fd(&argc, &argv); in parse_elem()
426 if (!argv[0] || !argv[1]) { in parse_elem()
430 if (is_prefix(*argv, "id")) in parse_elem()
434 fd = prog_parse_fd(&argc, &argv); in parse_elem()
441 argv = parse_bytes(argv, "value", value, value_size); in parse_elem()
442 if (!argv) in parse_elem()
448 return parse_elem(argv, info, key, NULL, key_size, value_size, in parse_elem()
450 } else if (is_prefix(*argv, "any") || is_prefix(*argv, "noexist") || in parse_elem()
451 is_prefix(*argv, "exist")) { in parse_elem()
453 p_err("flags specified multiple times: %s", *argv); in parse_elem()
457 if (is_prefix(*argv, "any")) in parse_elem()
459 else if (is_prefix(*argv, "noexist")) in parse_elem()
461 else if (is_prefix(*argv, "exist")) in parse_elem()
464 return parse_elem(argv + 1, info, key, value, key_size, in parse_elem()
468 p_err("expected key or value, got: %s", *argv); in parse_elem()
646 static int do_show_subset(int argc, char **argv) in do_show_subset() argument
659 nb_fds = map_parse_fds(&argc, &argv, &fds); in do_show_subset()
690 static int do_show(int argc, char **argv) in do_show() argument
710 return do_show_subset(argc, argv); in do_show()
914 static int do_dump(int argc, char **argv) in do_dump() argument
931 nb_fds = map_parse_fds(&argc, &argv, &fds); in do_dump()
1007 static int do_update(int argc, char **argv) in do_update() argument
1019 fd = map_parse_fd_and_info(&argc, &argv, &info, &len); in do_update()
1027 err = parse_elem(argv, &info, key, value, info.key_size, in do_update()
1090 static int do_lookup(int argc, char **argv) in do_lookup() argument
1101 fd = map_parse_fd_and_info(&argc, &argv, &info, &len); in do_lookup()
1109 err = parse_elem(argv, &info, key, NULL, info.key_size, 0, NULL, NULL); in do_lookup()
1141 static int do_getnext(int argc, char **argv) in do_getnext() argument
1152 fd = map_parse_fd_and_info(&argc, &argv, &info, &len); in do_getnext()
1165 err = parse_elem(argv, &info, key, NULL, info.key_size, 0, in do_getnext()
1212 static int do_delete(int argc, char **argv) in do_delete() argument
1223 fd = map_parse_fd_and_info(&argc, &argv, &info, &len); in do_delete()
1234 err = parse_elem(argv, &info, key, NULL, info.key_size, 0, NULL, NULL); in do_delete()
1251 static int do_pin(int argc, char **argv) in do_pin() argument
1255 err = do_pin_any(argc, argv, map_parse_fd); in do_pin()
1261 static int do_create(int argc, char **argv) in do_create() argument
1275 if (is_prefix(*argv, "type")) { in do_create()
1283 attr.map_type = map_type_from_str(*argv); in do_create()
1285 p_err("unrecognized map type: %s", *argv); in do_create()
1289 } else if (is_prefix(*argv, "name")) { in do_create()
1292 } else if (is_prefix(*argv, "key")) { in do_create()
1293 if (parse_u32_arg(&argc, &argv, &attr.key_size, in do_create()
1296 } else if (is_prefix(*argv, "value")) { in do_create()
1297 if (parse_u32_arg(&argc, &argv, &attr.value_size, in do_create()
1300 } else if (is_prefix(*argv, "entries")) { in do_create()
1301 if (parse_u32_arg(&argc, &argv, &attr.max_entries, in do_create()
1304 } else if (is_prefix(*argv, "flags")) { in do_create()
1305 if (parse_u32_arg(&argc, &argv, &attr.map_flags, in do_create()
1308 } else if (is_prefix(*argv, "dev")) { in do_create()
1316 attr.map_ifindex = if_nametoindex(*argv); in do_create()
1319 *argv, strerror(errno)); in do_create()
1323 } else if (is_prefix(*argv, "inner_map")) { in do_create()
1331 inner_map_fd = map_parse_fd_and_info(&argc, &argv, in do_create()
1337 p_err("unknown arg %s", *argv); in do_create()
1370 static int do_pop_dequeue(int argc, char **argv) in do_pop_dequeue() argument
1381 fd = map_parse_fd_and_info(&argc, &argv, &info, &len); in do_pop_dequeue()
1413 static int do_freeze(int argc, char **argv) in do_freeze() argument
1420 fd = map_parse_fd(&argc, &argv); in do_freeze()
1442 static int do_help(int argc, char **argv) in do_help() argument
1484 bin_name, argv[-2]); in do_help()
1510 int do_map(int argc, char **argv) in do_map() argument
1512 return cmd_select(cmds, argc, argv, do_help); in do_map()