コード例 #1
0
 def i2h(self, pkt, x):
     if x is None:
         try:
             x = conf.neighbor.resolve(pkt, pkt.payload)
         except socket.error:
             pass
         if x is None:
             x = "ff:ff:ff:ff:ff:ff"
             warning("Mac address to reach destination not found. Using broadcast.")  # noqa: E501
     return MACField.i2h(self, pkt, x)
コード例 #2
0
ファイル: l2.py プロジェクト: plorinquer/scapy
 def i2h(self, pkt, x):
     if x is None:
         try:
             x = conf.neighbor.resolve(pkt, pkt.payload)
         except socket.error:
             pass
         if x is None:
             x = "ff:ff:ff:ff:ff:ff"
             warning("Mac address to reach destination not found. Using broadcast.")  # noqa: E501
     return MACField.i2h(self, pkt, x)
コード例 #3
0
 def i2h(self, pkt, x):
     if x is None:
         iff = self.getif(pkt)
         if iff is None:
             iff = conf.iface
         if iff:
             try:
                 x = get_if_hwaddr(iff)
             except Exception as e:
                 warning("Could not get the source MAC: %s" % e)
         if x is None:
             x = "00:00:00:00:00:00"
     return MACField.i2h(self, pkt, x)
コード例 #4
0
 def i2h(self, pkt, x):
     if x is None:
         iff = self.getif(pkt)
         if iff is None:
             iff = conf.iface
         if iff:
             try:
                 x = get_if_hwaddr(iff)
             except:
                 pass
         if x is None:
             x = "00:00:00:00:00:00"
     return MACField.i2h(self, pkt, x)
コード例 #5
0
ファイル: l2.py プロジェクト: commial/scapy
 def i2h(self, pkt, x):
     if x is None:
         iff = self.getif(pkt)
         if iff is None:
             iff = conf.iface
         if iff:
             try:
                 x = get_if_hwaddr(iff)
             except Exception as e:
                 warning("Could not get the source MAC: %s" % e)
         if x is None:
             x = "00:00:00:00:00:00"
     return MACField.i2h(self, pkt, x)