Home
last modified time | relevance | path

Searched refs:family (Results 1 – 13 of 13) sorted by relevance

/kernel/tests/net/test/
Dsock_diag.py120 if msg.family == AF_INET or msg.family == AF_INET6:
153 if addr.family == AF_INET:
155 elif addr.family == AF_INET6:
230 family = AF_INET6 if ":" in addr else AF_INET
231 addr = inet_pton(family, addr)
232 arg = InetDiagHostcond((family, prefixlen, port)).Pack() + addr
279 if cond.family == 0:
282 addrlen = 4 if cond.family == AF_INET else 16
284 addr = inet_ntop(cond.family, addr)
317 for family in [AF_INET, AF_INET6]:
[all …]
Dcsocket_test.py31 def _BuildSocket(self, family, addr): argument
32 s = socket(family, SOCK_DGRAM, 0)
36 def CheckRecvfrom(self, family, addr): argument
37 s = self._BuildSocket(family, addr)
51 def CheckRecvmsg(self, family, addr): argument
52 s = self._BuildSocket(family, addr)
54 if family == AF_INET:
62 elif family == AF_INET6:
Dnet_test.py99 level = {AF_INET: SOL_IP, AF_INET6: SOL_IPV6}[s.family]
100 option = {AF_INET: IP_TOS, AF_INET6: IPV6_TCLASS}[s.family]
110 def Socket(family, sock_type, protocol): argument
111 s = socket(family, sock_type, protocol)
116 def PingSocket(family): argument
117 proto = {AF_INET: IPPROTO_ICMP, AF_INET6: IPPROTO_ICMPV6}[family]
118 return Socket(family, SOCK_DGRAM, proto)
129 def TCPSocket(family): argument
130 s = Socket(family, SOCK_STREAM, IPPROTO_TCP)
143 def UDPSocket(family): argument
[all …]
Diproute.py204 def _NlAttrIPAddress(self, nla_type, family, address): argument
205 return self._NlAttr(nla_type, socket.inet_pton(family, address))
272 data = socket.inet_ntop(msg.family, nla_data)
328 family = self._AddressFamily(version)
329 rtmsg = RTMsg((family, 0, 0, 0, RT_TABLE_UNSPEC,
342 family = self._AddressFamily(version)
343 rtmsg = RTMsg((family, 0, 0, 0, RT_TABLE_UNSPEC,
412 family = self._AddressFamily(version)
413 rtmsg = RTMsg((family, 0, 0, 0, 0, 0, 0, 0, 0))
421 family = self._AddressFamily(version)
[all …]
Dtcp_nuke_addr_test.py46 family, _, _, _, _ = getaddrinfo(addr, None, AF_UNSPEC, SOCK_DGRAM, 0,
48 if family == AF_INET6:
51 elif family == AF_INET:
56 raise ValueError('Address family %r not supported.' % family)
57 datagram_socket = socket(family, SOCK_DGRAM)
Dxfrm.py185 family = AF_INET6 if ":" in addr else AF_INET
186 return inet_pton(family, addr)
244 def AddSaInfo(self, selector, xfrm_id, saddr, lifetimes, reqid, family, mode, argument
251 reqid, family, mode, replay_window, flags))
261 family = AF_INET6 if ":" in dst else AF_INET
269 reqid, family, mode, 4, 0, nlattrs)
273 family = AF_INET6 if ":" in daddr else AF_INET
274 usersa_id = XfrmUsersaId((PaddedAddress(daddr), spi, family, proto))
Dcsocket.py101 family = socket.AF_INET6
106 addr = socket.inet_pton(family, addr)
107 return SockaddrIn6((family, socket.ntohs(port), socket.ntohl(flowinfo),
110 family = socket.AF_INET
112 addr = socket.inet_pton(family, addr)
113 return SockaddrIn((family, socket.ntohs(port), addr))
268 elif alen == len(SockaddrIn) and SockaddrIn(addr).family == socket.AF_INET:
270 elif alen == len(SockaddrIn6) and SockaddrIn6(addr).family == socket.AF_INET6:
Dsock_diag_test.py62 family, addr = random.choice([
66 socketpair = net_test.CreateSocketPair(family, socktype, addr)
87 family = s.getsockopt(net_test.SOL_SOCKET, net_test.SO_DOMAIN)
88 self.assertEqual(diag_msg.family, family)
263 self.assertTrue(all(d.family == AF_INET for d, _ in v4socks))
268 self.assertTrue(all(d.family == AF_INET6 for d, _ in v6socks))
617 family = {4: AF_INET, 5: AF_INET6, 6: AF_INET6}[version]
618 s = net_test.Socket(family, SOCK_STREAM, IPPROTO_TCP)
676 family = {4: AF_INET, 5: AF_INET6, 6: AF_INET6}[version]
713 family = {4: AF_INET, 5: AF_INET6, 6: AF_INET6}[version]
[all …]
Dping6_test.py265 family = s.family
274 family = AF_INET
279 if family == AF_INET:
281 elif family == AF_INET6:
284 self.fail("Unknown socket address family %d" * s.family)
287 if family == AF_INET:
552 sockaddr.family = AF_UNSPEC
558 sockaddr.family = AF_UNSPEC
564 sockaddr.family = AF_UNSPEC
Dtcp_test.py49 family = {4: AF_INET, 5: AF_INET6, 6: AF_INET6}[version]
51 s = net_test.Socket(family, SOCK_STREAM, IPPROTO_TCP)
Dmultinetwork_base.py66 family = {4: AF_INET, 6: AF_INET6}[version]
70 addr = inet_pton(family, addr)
425 if s.family == AF_INET6:
Dsrcaddr_selection_test.py91 self.assertEquals(AF_INET6 if ":" in address else AF_INET, ifa_msg.family)
Dmultinetwork_test.py332 family = self.GetProtocolFamily(version)
333 s = net_test.UDPSocket(family)