MCPcopy Create free account
hub / github.com/adobe/Marinus / is_local_ip

Method is_local_ip

python3_cron_scripts/libs3/IPManager.py:346–364  ·  view source on GitHub ↗

Returns true if the IP is in a local IP address range

(self, ip)

Source from the content-addressed store, hash-verified

344 return self.check_in_cidr(ip_addr, self.Akamai_IPs)
345
346 def is_local_ip(self, ip):
347 """
348 Returns true if the IP is in a local IP address range
349 """
350 if (
351 self.check_in_cidr(
352 ip,
353 [
354 IPNetwork("10.0.0.0/8"),
355 IPNetwork("172.16.0.0/12"),
356 IPNetwork("fd00::/8"),
357 IPNetwork("192.168.0.0/16"),
358 IPNetwork("127.0.0.0/8"),
359 ],
360 )
361 or ip == "255.255.255.255"
362 ):
363 return True
364 return False
365
366 def find_partner_range(self, ip):
367 """

Callers 5

insert_recordMethod · 0.95
get_domainsFunction · 0.80
get_ipsFunction · 0.80
get_mx_ipsFunction · 0.80
get_ipsFunction · 0.80

Calls 1

check_in_cidrMethod · 0.95

Tested by

no test coverage detected