Lines Matching +full:port +full:- +full:specific
1 // SPDX-License-Identifier: GPL-2.0
36 unsigned short port; member
113 .port = 8097,
127 .port = 8097,
197 .descr = "bind6 deny specific IP & port",
201 /* if (ip == expected && port == expected) */
223 .port = 8193,
227 .descr = "bind4 allow specific IP & port",
231 /* if (ip == expected && port == expected) */
253 .port = 4098,
257 .descr = "bind4 deny specific IP & port of TCP, and retry",
261 /* if (ip == expected && port == expected) */
283 .port = 4098,
288 .descr = "bind4 deny specific IP & port of UDP, and retry",
292 /* if (ip == expected && port == expected) */
314 .port = 4098,
319 .descr = "bind6 deny specific IP & port, and retry",
323 /* if (ip == expected && port == expected) */
345 .port = 8193,
381 for (len = MAX_INSNS - 1; len > 0; --len) in probe_prog_length()
414 unsigned short port, unsigned short port_retry) in bind_sock() argument
419 int sockfd = -1; in bind_sock()
432 addr4->sin_family = domain; in bind_sock()
433 addr4->sin_port = htons(port); in bind_sock()
434 if (inet_pton(domain, ip, (void *)&addr4->sin_addr) != 1) in bind_sock()
439 addr6->sin6_family = domain; in bind_sock()
440 addr6->sin6_port = htons(port); in bind_sock()
441 if (inet_pton(domain, ip, (void *)&addr6->sin6_addr) != 1) in bind_sock()
447 if (bind(sockfd, (const struct sockaddr *)&addr, len) == -1) { in bind_sock()
462 addr4->sin_port = htons(port_retry); in bind_sock()
464 addr6->sin6_port = htons(port_retry); in bind_sock()
465 if (bind(sockfd, (const struct sockaddr *)&addr, len) == -1) { in bind_sock()
474 res = -1; in bind_sock()
482 int progfd = -1; in run_test_case()
486 printf("Test case: %s .. ", test->descr); in run_test_case()
487 progfd = load_sock_prog(test->insns, test->expected_attach_type); in run_test_case()
489 if (test->result == LOAD_REJECT) in run_test_case()
495 if (attach_sock_prog(cgfd, progfd, test->attach_type) < 0) { in run_test_case()
496 if (test->result == ATTACH_REJECT) in run_test_case()
502 res = bind_sock(test->domain, test->type, test->ip, test->port, in run_test_case()
503 test->port_retry); in run_test_case()
504 if (res > 0 && test->result == res) in run_test_case()
508 err = -1; in run_test_case()
511 if (progfd != -1) in run_test_case()
512 bpf_prog_detach(cgfd, test->attach_type); in run_test_case()
531 return fails ? -1 : 0; in run_tests()
536 int cgfd = -1; in main()
551 err = -1; in main()