Lines Matching refs:idx
32 static int do_attach(int idx, int prog_fd, int map_fd, const char *name) in do_attach() argument
36 err = bpf_set_link_xdp_fd(idx, prog_fd, xdp_flags); in do_attach()
43 err = bpf_map_update_elem(map_fd, &idx, &idx, 0); in do_attach()
50 static int do_detach(int idx, const char *name) in do_detach() argument
54 err = bpf_set_link_xdp_fd(idx, -1, xdp_flags); in do_detach()
86 int opt, i, idx, err; in main() local
152 idx = if_nametoindex(argv[i]); in main()
153 if (!idx) in main()
154 idx = strtoul(argv[i], NULL, 0); in main()
156 if (!idx) { in main()
161 err = do_detach(idx, argv[i]); in main()
165 err = do_attach(idx, prog_fd, map_fd, argv[i]); in main()