/kernel/tests/net/test/ |
D | tcp_repair_test.py | 65 def assertSocketNotConnected(self, sock): argument 66 self.assertRaisesErrno(ENOTCONN, sock.getpeername) 68 def assertSocketConnected(self, sock): argument 69 sock.getpeername() # No errors? Socket is alive and connected. 99 def receiveFin(self, netid, version, sock): argument 100 self.assertSocketConnected(sock) 107 def sendData(self, netid, version, sock, payload): argument 108 sock.send(payload) 137 sock = self.createConnectedSocket(version, netid) 138 sock.setsockopt(SOL_TCP, TCP_REPAIR, TCP_REPAIR_ON) [all …]
|
D | nf_test.py | 49 sock = net_test.TCPSocket(net_test.GetAddressFamily(version)) 51 self.SelectInterface(sock, netid, "mark") 55 sock.connect((addr, 53)) 68 sock = net_test.UDPSocket(net_test.GetAddressFamily(version)) 70 self.SelectInterface(sock, netid, "mark") 74 sock.sendto(net_test.UDP_PAYLOAD, (addr, 53))
|
D | sock_diag_test.py | 119 def assertSocketClosed(self, sock): argument 120 self.assertRaisesErrno(ENOTCONN, sock.getpeername) 122 def assertSocketConnected(self, sock): argument 123 sock.getpeername() # No errors? Socket is alive and connected. 126 for sock in socketpair: 127 self.assertSocketClosed(sock) 158 def _EventDuringBlockingCall(self, sock, call, expected_errno, event): argument 169 thread = SocketExceptionThread(sock, call) 172 event(sock) 182 self.assertSocketClosed(sock) [all …]
|
D | bpf_test.py | 131 sock = socket.socket(family, socket.SOCK_DGRAM, 0) 133 BpfProgAttachSocket(sock.fileno(), prog_fd) 134 net_test.SetNonBlocking(sock) 136 sock.bind((addr, 0)) 137 addr = sock.getsockname() 140 sock.sendto("foo", addr) 141 data, retaddr = csocket.Recvfrom(sock, 4096, 0) 144 return sock 228 self.sock = None 235 if self.sock: [all …]
|
D | net_test.py | 171 def BindRandomPort(version, sock): argument 173 sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) 174 sock.bind((addr, 0)) 175 if sock.getsockopt(SOL_SOCKET, SO_PROTOCOL) == IPPROTO_TCP: 176 sock.listen(100) 177 port = sock.getsockname()[1] 181 def EnableFinWait(sock): argument 183 sock.setsockopt(SOL_SOCKET, SO_LINGER, struct.pack("ii", 0, 0)) 186 def DisableFinWait(sock): argument 188 sock.setsockopt(SOL_SOCKET, SO_LINGER, struct.pack("ii", 1, 0))
|
D | tcp_fastopen_test.py | 47 def assertSocketNotConnected(self, sock): argument 48 self.assertRaisesErrno(ENOTCONN, sock.getpeername) 50 def assertSocketConnected(self, sock): argument 51 sock.getpeername() # No errors? Socket is alive and connected.
|
D | xfrm_algorithm_test.py | 336 def TcpServer(sock, client_port): argument 338 sock.listen(1) 340 accepted, peer = sock.accept() 349 sock.close() 351 def UdpServer(sock, client_port): argument 354 data, peer = sock.recvfrom(2048) 358 sock.sendto("hello response", peer) 362 sock.close()
|
D | xfrm_test.py | 263 def _VerifyUdpEncapSocket(self, netid, remoteaddr, myaddr, encap_port, sock, argument 266 sock.sendto(net_test.UDP_PAYLOAD, (remoteaddr, 53)) 267 srcport = sock.getsockname()[1] 493 sock = net_test.UDPSocket(family) 494 self.SelectInterface(sock, netid, "mark") 495 sock.bind((local_addr, 0)) 496 local_port = sock.getsockname()[1] 500 sock, family, xfrm.XFRM_POLICY_OUT, 0xABCD, 123, 503 sock, family, xfrm.XFRM_POLICY_IN, 0x9876, 456, 516 msg, addr = sock.recvfrom(1024) [all …]
|
D | tcp_nuke_addr_test.py | 99 for sock in socketpair: 100 self.assertTrue(sock.getpeername())
|
D | pf_key.py | 199 self.sock = socket(AF_KEY, SOCK_RAW, PF_KEY_V2) 200 net_test.SetNonBlocking(self.sock) 204 reply = self.sock.recv(4096) 216 self.sock.send(msg.Pack() + extensions)
|
D | neighbour_test.py | 92 self.sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE) 93 self.sock.bind((0, RTMGRP_NEIGH)) 94 net_test.SetNonBlocking(self.sock) 144 self.assertRaisesErrno(errno.EAGAIN, self.sock.recvfrom, 4096, MSG_PEEK) 153 msg = self.sock.recv(4096)
|
D | csocket.py | 95 def SetSocketTimeout(sock, ms): argument 98 sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVTIMEO,
|