Home
last modified time | relevance | path

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

/kernel/tests/net/test/
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:
Dtcp_metrics.py62 self.family = ctrl.GetFamily(TCP_METRICS_GENL_NAME)
93 family = AF_INET
96 family = AF_INET6
98 return self._NlAttrIPAddress(nla_type, family, address)
102 family = net_test.GetAddressFamily(version)
108 return self._NlAttrIPAddress(nla_type, family, address)
118 return self._Dump(self.family, TCP_METRICS_CMD_GET, 1)
123 self._SendCommand(self.family, TCP_METRICS_CMD_GET, 1, data,
131 self._SendCommand(self.family, TCP_METRICS_CMD_DEL, 1, data,
Dsock_diag.py119 if msg.family == AF_INET or msg.family == AF_INET6:
152 if addr.family == AF_INET:
154 elif addr.family == AF_INET6:
229 family = AF_INET6 if ":" in addr else AF_INET
230 addr = inet_pton(family, addr)
231 arg = InetDiagHostcond((family, prefixlen, port)).Pack() + addr
278 if cond.family == 0:
281 addrlen = 4 if cond.family == AF_INET else 16
283 addr = inet_ntop(cond.family, addr)
316 for family in [AF_INET, AF_INET6]:
[all …]
Dnet_test.py117 level = {AF_INET: SOL_IP, AF_INET6: SOL_IPV6}[s.family]
118 option = {AF_INET: IP_TOS, AF_INET6: IPV6_TCLASS}[s.family]
128 def Socket(family, sock_type, protocol): argument
129 s = socket(family, sock_type, protocol)
134 def PingSocket(family): argument
135 proto = {AF_INET: IPPROTO_ICMP, AF_INET6: IPPROTO_ICMPV6}[family]
136 return Socket(family, SOCK_DGRAM, proto)
147 def TCPSocket(family): argument
148 s = Socket(family, SOCK_STREAM, IPPROTO_TCP)
161 def UDPSocket(family): argument
[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)
Diproute.py322 data = socket.inet_ntop(msg.family, nla_data)
386 family = self._AddressFamily(version)
387 rtmsg = RTMsg((family, 0, 0, 0, RT_TABLE_UNSPEC,
400 family = self._AddressFamily(version)
401 rtmsg = RTMsg((family, 0, 0, 0, RT_TABLE_UNSPEC,
471 family = self._AddressFamily(version)
472 rtmsg = RTMsg((family, 0, 0, 0, 0, 0, 0, 0, 0))
480 family = self._AddressFamily(version)
481 ifaddrmsg = IfAddrMsg((family, 0, 0, 0, 0))
486 family = self._AddressFamily(version)
[all …]
Dxfrm_test.py105 family = net_test.GetAddressFamily(version)
106 s = socket(family, SOCK_DGRAM, 0)
170 s2 = socket(family, SOCK_DGRAM, 0)
188 xfrm_base.SetPolicySockopt(s, family, None)
193 xfrm_base.SetPolicySockopt(s, family, None)
199 xfrm_base.SetPolicySockopt(s, family, None)
450 family = net_test.GetAddressFamily(version)
452 s = socket(family, SOCK_DGRAM, 0)
461 xfrm_base.ApplySocketPolicy(s, family, xfrm.XFRM_POLICY_OUT,
471 family = net_test.GetAddressFamily(version)
[all …]
Dxfrm.py230 family = AF_INET6 if ":" in addr else AF_INET
231 return inet_pton(family, addr)
245 def EmptySelector(family): argument
247 return XfrmSelector(family=family)
258 family = net_test.GetAddressFamily(srcver)
260 prefixlen_s=prefixlen, prefixlen_d=prefixlen, family=family)
284 def UserTemplate(family, spi, reqid, tun_addrs): argument
310 family=family,
509 family = AF_INET6 if ":" in dst else AF_INET
558 cur, stats, seq, reqid, family, mode, replay, flags))
[all …]
Dgenetlink.py60 def _SendCommand(self, family, command, version, data, flags): argument
62 self._SendNlRequest(family, genlmsghdr.Pack() + data, flags)
64 def _Dump(self, family, command, version): argument
66 return super(GenericNetlink, self)._Dump(family, msg, Genlmsghdr, "")
Dcsocket.py114 family = socket.AF_INET6
119 addr = socket.inet_pton(family, addr)
120 return SockaddrIn6((family, socket.ntohs(port), socket.ntohl(flowinfo),
123 family = socket.AF_INET
125 addr = socket.inet_pton(family, addr)
126 return SockaddrIn((family, socket.ntohs(port), addr))
285 elif alen == len(SockaddrIn) and SockaddrIn(addr).family == socket.AF_INET:
287 elif alen == len(SockaddrIn6) and SockaddrIn6(addr).family == socket.AF_INET6:
Dxfrm_algorithm_test.py131 family = net_test.GetAddressFamily(version)
204 sock_left = socket(family, proto, 0)
208 sock_right = socket(family, proto, 0)
220 xfrm_base.ApplySocketPolicy(sock_left, family, xfrm.XFRM_POLICY_OUT,
223 xfrm_base.ApplySocketPolicy(sock_right, family, xfrm.XFRM_POLICY_IN,
226 xfrm_base.ApplySocketPolicy(sock_right, family, xfrm.XFRM_POLICY_OUT,
229 xfrm_base.ApplySocketPolicy(sock_left, family, xfrm.XFRM_POLICY_IN,
Dnetlink.py79 def _NlAttrIPAddress(self, nla_type, family, address): argument
80 return self._NlAttr(nla_type, socket.inet_pton(family, address))
149 def _OpenNetlinkSocket(self, family, groups=None): argument
150 sock = socket.socket(socket.AF_NETLINK, socket.SOCK_RAW, family)
156 def __init__(self, family): argument
159 self.sock = self._OpenNetlinkSocket(family)
Dxfrm_base.py44 def SetPolicySockopt(sock, family, opt_data): argument
46 if family == AF_INET:
53 def ApplySocketPolicy(sock, family, direction, spi, reqid, tun_addrs): argument
69 selector = xfrm.EmptySelector(family)
73 template = xfrm.UserTemplate(family, spi, reqid, tun_addrs)
Dbpf_test.py61 family = {4: socket.AF_INET, 6: socket.AF_INET6}[version]
62 sock = socket.socket(family, socket.SOCK_DGRAM, 0)
406 def checkSocketCreate(self, family, socktype, success): argument
408 sock = socket.socket(family, socktype, 0)
413 (family, socktype, os.strerror(e.errno)))
417 (family, socktype))
421 for family in [socket.AF_INET, socket.AF_INET6]:
423 self.checkSocketCreate(family, socktype, success)
Dsock_diag_test.py109 family, addr = random.choice([
113 socketpair = net_test.CreateSocketPair(family, socktype, addr)
134 family = s.getsockopt(net_test.SOL_SOCKET, net_test.SO_DOMAIN)
135 self.assertEqual(diag_msg.family, family)
340 self.assertTrue(all(d.family == AF_INET for d, _ in v4socks))
345 self.assertTrue(all(d.family == AF_INET6 for d, _ in v6socks))
409 family = net_test.GetAddressFamily(version)
410 s = socket(family, SOCK_DGRAM, 0)
791 family = {4: AF_INET, 5: AF_INET6, 6: AF_INET6}[version]
792 s = net_test.Socket(family, SOCK_STREAM, IPPROTO_TCP)
[all …]
Dqtaguid_test.py84 family = {4: AF_INET, 6: AF_INET6}[version]
85 s = socket(family, SOCK_DGRAM, 0)
101 family = {4: AF_INET, 6: AF_INET6}[version]
102 s = socket(family, SOCK_DGRAM, 0)
112 s2 = socket(family, SOCK_DGRAM, 0)
Dpf_key_test.py53 state4, attrs4 = [(s, a) for s, a in sainfos if s.family == AF_INET][0]
54 state6, attrs6 = [(s, a) for s, a in sainfos if s.family == AF_INET6][0]
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:
568 sockaddr.family = AF_UNSPEC
574 sockaddr.family = AF_UNSPEC
580 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.py67 family = {4: AF_INET, 6: AF_INET6}[version]
71 addr = inet_pton(family, addr)
468 if s.family == AF_INET6:
Dpf_key.py232 prefixlen = {AF_INET: 32, AF_INET6: 128}[addr.family]
Dxfrm_tunnel_test.py239 family = AF_INET if version == 4 else AF_INET6
240 self.assertEquals(inet_ntop(family, vti_info_data["IFLA_VTI_LOCAL"]),
242 self.assertEquals(inet_ntop(family, vti_info_data["IFLA_VTI_REMOTE"]),
Dsrcaddr_selection_test.py91 self.assertEquals(AF_INET6 if ":" in address else AF_INET, ifa_msg.family)
Dmultinetwork_test.py294 family = self.GetProtocolFamily(version)
295 s = net_test.UDPSocket(family)