Lines Matching refs:proto
13 static char *afstr(int af, int proto) in afstr() argument
15 if (proto == IPPROTO_TCP) in afstr()
21 int sk_peek_offset_probe(sa_family_t af, int proto) in sk_peek_offset_probe() argument
23 int type = (proto == IPPROTO_TCP ? SOCK_STREAM : SOCK_DGRAM); in sk_peek_offset_probe()
28 s = socket(af, type, proto); in sk_peek_offset_probe()
35 printf("%s does not support SO_PEEK_OFF\n", afstr(af, proto)); in sk_peek_offset_probe()
57 static int sk_peek_offset_test(sa_family_t af, int proto) in sk_peek_offset_test() argument
59 int type = (proto == IPPROTO_TCP ? SOCK_STREAM : SOCK_DGRAM); in sk_peek_offset_test()
75 s[0] = recv_sock = socket(af, type, proto); in sk_peek_offset_test()
76 s[1] = socket(af, type, proto); in sk_peek_offset_test()
90 if (proto == IPPROTO_TCP && listen(s[0], 0) < 0) { in sk_peek_offset_test()
98 if (proto == IPPROTO_TCP) { in sk_peek_offset_test()
158 printf("%s with MSG_PEEK_OFF works correctly\n", afstr(af, proto)); in sk_peek_offset_test()
161 if (proto == IPPROTO_TCP && recv_sock >= 0) in sk_peek_offset_test()
170 static int do_test(int proto) in do_test() argument
174 res4 = sk_peek_offset_probe(AF_INET, proto); in do_test()
175 res6 = sk_peek_offset_probe(AF_INET6, proto); in do_test()
181 res4 = sk_peek_offset_test(AF_INET, proto); in do_test()
184 res6 = sk_peek_offset_test(AF_INET6, proto); in do_test()