Lines Matching +full:test +full:- +full:rules

1 /* This test is a demo of using get_socket_uid and get_socket_cookie
6 * TEST:
7 * ./run_cookie_uid_helper_example.sh -option
9 * -t: do traffic monitoring test, the program will continuously
22 * -s: do getsockopt SO_COOKIE test, the program will set up a pair of
92 /* pc2-4: save &socketCookie to r7 for future usage*/ in prog_load()
93 BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_0, -8), in prog_load()
95 BPF_ALU64_IMM(BPF_ADD, BPF_REG_7, -8), in prog_load()
97 * pc5-8: set up the registers for BPF_FUNC_map_lookup_elem, in prog_load()
107 * Otherwise do pc10-22 to setup a new data entry. in prog_load()
119 -32 + (__s16)offsetof(struct stats, uid)), in prog_load()
121 -32 + (__s16)offsetof(struct stats, packets), 1), in prog_load()
129 -32 + (__s16)offsetof(struct stats, bytes)), in prog_load()
138 BPF_ALU64_IMM(BPF_ADD, BPF_REG_3, -32), in prog_load()
144 * pc24-30 update the packet info to a exist data entry, it can in prog_load()
174 char rules[256]; in prog_attach_iptables() local
182 ret = snprintf(rules, sizeof(rules), in prog_attach_iptables()
183 "iptables -A OUTPUT -m bpf --object-pinned %s -j ACCEPT", in prog_attach_iptables()
185 if (ret < 0 || ret >= sizeof(rules)) { in prog_attach_iptables()
189 ret = system(rules); in prog_attach_iptables()
203 while (bpf_map_get_next_key(map_fd, &curN, &nextN) > -1) { in print_table()
237 if (bind(s_rcv, (struct sockaddr *)&si_other, sizeof(si_other)) == -1) in udp_client()
246 if (res != -1) in udp_client()
251 if (res == -1) in udp_client()
279 " bpfObjName -option\n" in usage()
280 " -t traffic monitor test\n" in usage()
281 " -s getsockopt cookie test\n"); in usage()
298 while ((opt = getopt(argc, argv, "ts")) != -1) { in main()
310 return -1; in main()