コード例 #1
0
 def h2i(self, pkt, x):
     if type(x) is str:
         try:
             inet_aton(x)
         except socket.error:
             x = Net(x)
     elif type(x) is list:
         x = [self.h2i(pkt, n) for n in x]
     return x
コード例 #2
0
ファイル: fields.py プロジェクト: wuhlcom/scapy
 def h2i(self, pkt, x):
     if isinstance(x, basestring):
         try:
             inet_aton(x)
         except socket.error:
             x = Net(x)
     elif type(x) is list:
         x = [self.h2i(pkt, n) for n in x]
     return x
コード例 #3
0
ファイル: volatile.py プロジェクト: wuhlcom/scapy
 def __init__(self, iptemplate="0.0.0.0/0"):
     self.ip = Net(iptemplate)