Searched refs:sock (Results 1 – 6 of 6) sorted by relevance
/kernel/tests/net/test/ |
D | bpf_test.py | 72 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0) 73 sock.settimeout(1) 74 BpfProgAttach(sock.fileno(), prog_fd) 76 sock.bind((addr, 0)) 77 addr = sock.getsockname() 79 sock.sendto("foo", addr) 80 data, addr = csocket.Recvfrom(sock, 4096, 0) 92 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0) 93 sock.settimeout(1) 94 BpfProgAttach(sock.fileno(), prog_fd) [all …]
|
D | sock_diag_test.py | 72 def assertSocketClosed(self, sock): argument 73 self.assertRaisesErrno(ENOTCONN, sock.getpeername) 75 def assertSocketConnected(self, sock): argument 76 sock.getpeername() # No errors? Socket is alive and connected. 79 for sock in socketpair: 80 self.assertSocketClosed(sock) 111 def CloseDuringBlockingCall(self, sock, call, expected_errno): argument 112 thread = SocketExceptionThread(sock, call) 115 self.sock_diag.CloseSocketFromFd(sock) 122 self.assertSocketClosed(sock) [all …]
|
D | net_test.py | 92 def SetSocketTimeout(sock, ms): argument 95 sock.setsockopt(SOL_SOCKET, SO_RCVTIMEO, struct.pack("LL", s, us)) 152 def BindRandomPort(version, sock): argument 154 sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) 155 sock.bind((addr, 0)) 156 if sock.getsockopt(SOL_SOCKET, SO_PROTOCOL) == IPPROTO_TCP: 157 sock.listen(100) 158 port = sock.getsockname()[1] 162 def EnableFinWait(sock): argument 164 sock.setsockopt(SOL_SOCKET, SO_LINGER, struct.pack("ii", 0, 0)) [all …]
|
D | netlink.py | 137 self.sock = socket.socket(socket.AF_NETLINK, socket.SOCK_RAW, self.FAMILY) 138 self.sock.connect((0, 0)) # The kernel. 139 self.pid = self.sock.getsockname()[1] 148 self.sock.send(msg) 151 data = self.sock.recv(self.BUFSIZE)
|
D | neighbour_test.py | 83 self.sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE) 84 self.sock.bind((0, RTMGRP_NEIGH)) 85 net_test.SetNonBlocking(self.sock) 100 self.assertRaisesErrno(errno.EAGAIN, self.sock.recvfrom, 4096, MSG_PEEK) 109 msg = self.sock.recv(4096)
|
D | tcp_nuke_addr_test.py | 99 for sock in socketpair: 100 self.assertTrue(sock.getpeername())
|