Lines Matching refs:rv
119 int rv = socket(AF_UNIX, SOCK_DGRAM | SOCK_NONBLOCK, 0); in TEST() local
121 ASSERT_GE(rv, 3); in TEST()
122 unique_fd unixfd(rv); in TEST()
124 rv = open("/dev/net/tun", O_RDWR | O_NONBLOCK); in TEST()
126 ASSERT_GE(rv, 3); in TEST()
127 unique_fd tun(rv); in TEST()
129 rv = open("/dev/net/tun", O_RDWR | O_NONBLOCK); in TEST()
131 ASSERT_GE(rv, 3); in TEST()
132 unique_fd tap(rv); in TEST()
144 rv = ioctl(tun, TUNSETIFF, &tun_ifr); in TEST()
146 ASSERT_EQ(rv, 0); in TEST()
148 rv = ioctl(tap, TUNSETIFF, &tap_ifr); in TEST()
150 ASSERT_EQ(rv, 0); in TEST()
153 rv = open("/proc/sys/net/ipv6/conf/tap_bpftest/disable_ipv6", O_WRONLY); in TEST()
155 ASSERT_GE(rv, 3); in TEST()
156 unique_fd f(rv); in TEST()
158 rv = write(f, "1\n", 2); in TEST()
160 ASSERT_EQ(rv, 2); in TEST()
162 rv = close(f.release()); in TEST()
164 ASSERT_EQ(rv, 0); in TEST()
173 rv = ioctl(unixfd, SIOCSIFMTU, &tun_ifr); in TEST()
175 ASSERT_EQ(rv, 0); in TEST()
178 rv = ioctl(unixfd, SIOCSIFMTU, &tap_ifr); in TEST()
180 ASSERT_EQ(rv, 0); in TEST()
182 rv = ioctl(unixfd, SIOCGIFFLAGS, &tun_ifr); in TEST()
184 ASSERT_EQ(rv, 0); in TEST()
186 rv = ioctl(unixfd, SIOCGIFFLAGS, &tap_ifr); in TEST()
188 ASSERT_EQ(rv, 0); in TEST()
194 rv = ioctl(unixfd, SIOCSIFFLAGS, &tun_ifr); in TEST()
196 ASSERT_EQ(rv, 0); in TEST()
198 rv = ioctl(unixfd, SIOCSIFFLAGS, &tap_ifr); in TEST()
200 ASSERT_EQ(rv, 0); in TEST()
202 rv = tcQdiscAddDevClsact(tunif); in TEST()
203 ASSERT_EQ(rv, 0); in TEST()
209 rv = tcFilterAddDevIngressTether(tunif, bpfFd, /* ethernet*/ false); in TEST()
210 ASSERT_EQ(rv, 0); in TEST()
216 rv = getTetherIngressMapFd(); in TEST()
217 ASSERT_GE(rv, 3); in TEST()
218 bpfIngressMap.reset(rv); in TEST()
220 rv = getTetherStatsMapFd(); in TEST()
221 ASSERT_GE(rv, 3); in TEST()
222 bpfStatsMap.reset(rv); in TEST()
224 rv = getTetherLimitMapFd(); in TEST()
225 ASSERT_GE(rv, 3); in TEST()
226 bpfLimitMap.reset(rv); in TEST()
263 rv = write(tun, pkt, pkt_size); in TEST()
265 ASSERT_EQ(rv, pkt_size); in TEST()
272 rv = poll(&p, 1, 1000 /*milliseconds*/); in TEST()
273 if (rv == 0) { in TEST()
281 EXPECT_EQ(rv, 1); in TEST()
286 rv = read(tap, buf, sizeof(buf)); in TEST()
288 EXPECT_EQ(rv, ETH_HLEN + pkt_size); in TEST()
290 if (rv < 0) break; in TEST()