MCPcopy Index your code
hub / github.com/secdev/scapy / name2addr

Method name2addr

scapy/base_classes.py:186–199  ·  view source on GitHub ↗
(cls, name)

Source from the content-addressed store, hash-verified

184
185 @classmethod
186 def name2addr(cls, name):
187 # type: (str) -> str
188 try:
189 return next(
190 addr_port[0]
191 for family, _, _, _, addr_port in
192 socket.getaddrinfo(name, None, cls.family)
193 if family == cls.family
194 )
195 except socket.error:
196 if re.search("(^|\\.)[0-9]+-[0-9]+($|\\.)", name) is not None:
197 raise Scapy_Exception("Ranges are no longer accepted in %s()" %
198 cls.__name__)
199 raise
200
201 @classmethod
202 def ip2int(cls, addr):

Callers 2

ip2intMethod · 0.80
ip2intMethod · 0.80

Calls 2

Scapy_ExceptionClass · 0.90
searchMethod · 0.45

Tested by

no test coverage detected