Lines Matching refs:version
90 def MakePktInfo(version, addr, ifindex):
91 family = {4: AF_INET, 6: AF_INET6}[version]
93 addr = {4: "0.0.0.0", 6: "::"}[version]
96 if version == 6:
172 def _RouterAddress(netid, version):
173 if version == 6:
175 elif version == 4:
178 raise ValueError("Don't support IPv%s" % version)
189 def MyAddress(cls, version, netid):
191 6: cls._MyIPv6Address(netid)}[version]
205 def GetProtocolFamily(self, version):
206 return {4: AF_INET, 6: AF_INET6}[version]
253 for version in [4, 6]:
258 router = cls._RouterAddress(netid, version)
264 cls.iproute.UidRangeRule(version, is_add, start, end, table,
266 cls.iproute.OifRule(version, is_add, iface, table, cls.PRIORITY_OIF)
267 cls.iproute.FwmarkRule(version, is_add, netid, table,
279 do_routing = (version == 4 or cls.AUTOCONF_TABLE_OFFSET is None)
281 if version == 4:
283 cls.iproute.AddNeighbour(version, router, macaddr, ifindex)
285 cls.iproute.AddRoute(version, table, "default", 0, router, ifindex)
286 if version == 6:
287 cls.iproute.AddRoute(version, table,
291 cls.iproute.DelRoute(version, table, "default", 0, router, ifindex)
292 if version == 6:
293 cls.iproute.DelRoute(version, table,
295 if version == 4:
296 cls.iproute.DelNeighbour(version, router, macaddr, ifindex)
302 for version in [4, 6]:
304 cls.iproute.DefaultRule(version, is_add, table, cls.PRIORITY_DEFAULT)
332 def _ICMPRatelimitFilename(cls, version):
334 6: "ipv6/icmp/ratelimit"}[version]
337 def _SetICMPRatelimit(cls, version, limit):
338 cls.SetSysctl(cls._ICMPRatelimitFilename(version), limit)
355 for version in [4, 6]:
356 cls._SetICMPRatelimit(version, 0)
366 for version in [4, 6]:
367 cls.iproute.UnreachableRule(version, True, 1000)
376 for version in [4, 6]:
378 cls.iproute.UnreachableRule(version, False, 1000)
416 def GetRemoteAddress(self, version):
417 return {4: self.IPV4_ADDR, 6: self.IPV6_ADDR}[version]
432 def BuildSocket(self, version, constructor, netid, routing_mode):
435 family = self.GetProtocolFamily(version)
443 def SendOnNetid(self, version, s, dstaddr, dstport, netid, payload, cmsgs):
445 pktinfo = MakePktInfo(version, None, self.ifindices[netid])
448 6: (net_test.SOL_IPV6, IPV6_PKTINFO)}[version]
590 def Combinations(self, version):
597 myaddr = self.MyAddress(version, dest_ip_netid)
598 remoteaddr = self.GetRemoteAddress(version)