Lines Matching refs:s
60 s = self.BuildSocket(version, net_test.PingSocket, netid, routing_mode)
64 s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
65 s.bind((mysockaddr, packets.PING_IDENT))
66 net_test.SetSocketTos(s, packets.PING_TOS)
74 s.sendto(packet + packets.PING_PAYLOAD, (dstsockaddr, 19321))
79 s = self.BuildSocket(version, net_test.TCPSocket, netid, routing_mode)
89 self.assertRaisesErrno(errno.EINPROGRESS, s.connect, (dstsockaddr, 53))
93 s.close()
96 s = self.BuildSocket(version, net_test.UDPSocket, netid, routing_mode)
106 s.sendto(UDP_PAYLOAD, (dstsockaddr, 53))
111 s.connect((dstsockaddr, 53))
112 s.send(UDP_PAYLOAD)
114 s.close()
117 s = self.BuildSocket(version, net_test.RawGRESocket, netid, routing_mode)
130 s.sendto(packet, (dstaddr, IPPROTO_GRE))
186 s = net_test.UDPSocket(self.GetProtocolFamily(version))
189 sport = net_test.BindRandomPort(version, s)
198 self.SelectInterface(s, netid, mode)
199 s.connect((dstaddr, 53))
217 self.SelectInterface(s, netid, mode)
226 s.send(UDP_PAYLOAD)
228 s.sendto(UDP_PAYLOAD, (dstaddr, 53))
259 self.SelectInterface(s, None, mode)
275 s = net_test.UDPSocket(AF_INET6)
278 net_test.SetFlowLabel(s, net_test.IPV6_ADDR, 0xdead)
279 s.setsockopt(net_test.SOL_IPV6, net_test.IPV6_FLOWINFO_SEND, 1)
289 s.setsockopt(net_test.SOL_IPV6, IPV6_DSTOPTS, dstopts)
290 s.setsockopt(net_test.SOL_IPV6, IPV6_UNICAST_HOPS, 255)
295 s.setsockopt(net_test.SOL_IPV6, IPV6_PKTINFO, pktinfo)
298 s.sendto(UDP_PAYLOAD, (net_test.IPV6_ADDR, 53, 0xdead, 0))
300 sport = s.getsockname()[1]
318 s = net_test.UDPSocket(family)
322 net_test.SetFlowLabel(s, net_test.IPV6_ADDR, 0xbeef)
337 s.setsockopt(net_test.SOL_IP, IP_TTL, 39)
338 s.setsockopt(net_test.SOL_IP, IP_TOS, 0x83)
341 self.SendOnNetid(version, s, dstaddr, 53, netid, UDP_PAYLOAD, cmsgs)
343 sport = s.getsockname()[1]
459 s, _ = listensocket.accept()
465 s.send(UDP_PAYLOAD)
474 mark = self.GetSocketMark(s)
477 s.close()
813 s = net_test.UDPSocket(AF_INET6)
814 self.SetSocketMark(s, netid)
816 self.assertTrue(s.sendto(UDP_PAYLOAD, (net_test.IPV6_ADDR, 1234)))
818 self.assertRaisesErrno(errno.ENETUNREACH, s.sendto, UDP_PAYLOAD,
836 s = net_test.UDPSocket(AF_INET6)
838 self.BindToDevice(s, iface)
843 s.sendto(UDP_PAYLOAD, (dstaddr, 53))
864 sport = s.getsockname()[1]
899 s = netlink.NetlinkSocket(netlink.NETLINK_ROUTE, iproute.RTMGRP_ND_USEROPT)
908 csocket.SetSocketTimeout(s.sock, 100)
910 data = s._Recv()
936 def GetSocketMTU(self, version, s): argument
938 ip6_mtuinfo = s.getsockopt(net_test.SOL_IPV6, csocket.IPV6_PATHMTU, 32)
942 return s.getsockopt(net_test.SOL_IP, csocket.IP_MTU)
944 def DisableFragmentationAndReportErrors(self, version, s): argument
946 s.setsockopt(net_test.SOL_IP, csocket.IP_MTU_DISCOVER,
948 s.setsockopt(net_test.SOL_IP, net_test.IP_RECVERR, 1)
950 s.setsockopt(net_test.SOL_IPV6, csocket.IPV6_DONTFRAG, 1)
951 s.setsockopt(net_test.SOL_IPV6, net_test.IPV6_RECVERR, 1)
955 def SendBigPacket(version, s, dstaddr, netid, payload): argument
957 s.send(payload)
959 self.SendOnNetid(version, s, dstaddr, 1234, netid, payload, [])
963 s = self.BuildSocket(version, net_test.UDPSocket, netid, mode)
964 self.DisableFragmentationAndReportErrors(version, s)
982 s.connect((dstaddr, 1234))
987 SendBigPacket(version, s, dstaddr, netid, payload)
998 SendBigPacket, version, s, dstaddr, netid, payload)
1003 self.assertEqual(packets.PTB_MTU, self.GetSocketMTU(version, s))
1005 s.close()
1254 s = socket(AF_INET6, SOCK_DGRAM, 0)
1258 s.sendto, "foo", (remoteaddr, 53))
1260 self.assertEqual(len("foo"), s.sendto("foo", (remoteaddr, 53)))
1266 os.fchown(s.fileno(), uid, -1)
1268 os.fchown(s.fileno(), -1, -1)
1270 os.fchown(s.fileno(), -1, 12345)
1272 os.fchmod(s.fileno(), 0o777)
1274 os.fchown(s.fileno(), 0, -1)