summaryrefslogtreecommitdiffstats
path: root/scripts/external_libs
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-10-27 11:43:17 +0300
committerHanoh Haim <hhaim@cisco.com>2016-10-27 11:43:45 +0300
commit6cf5aa4153da4874a22af51f96d0029f73979460 (patch)
tree689f72075d0cd921231ae9325d371dd5161358b2 /scripts/external_libs
parent1782ef7a71c3e031fc5d1343c27ed2c8e45fd4ad (diff)
fix scapy_service ARP issue and add more layers in the service
Signed-off-by: Hanoh Haim <hhaim@cisco.com>
Diffstat (limited to 'scripts/external_libs')
-rw-r--r--scripts/external_libs/scapy-2.3.1/python2/scapy/fields.py4
-rw-r--r--scripts/external_libs/scapy-2.3.1/python2/scapy/layers/l2.py35
-rw-r--r--scripts/external_libs/scapy-2.3.1/python3/scapy/fields.py4
-rw-r--r--scripts/external_libs/scapy-2.3.1/python3/scapy/layers/l2.py35
4 files changed, 2 insertions, 76 deletions
diff --git a/scripts/external_libs/scapy-2.3.1/python2/scapy/fields.py b/scripts/external_libs/scapy-2.3.1/python2/scapy/fields.py
index 8bb8c970..df85875a 100644
--- a/scripts/external_libs/scapy-2.3.1/python2/scapy/fields.py
+++ b/scripts/external_libs/scapy-2.3.1/python2/scapy/fields.py
@@ -242,9 +242,7 @@ class SourceIPField(IPField):
self.dstname = dstname
def i2m(self, pkt, x):
if x is None:
- iff,x,gw = pkt.route()
- if x is None:
- x = "0.0.0.0"
+ x="16.0.0.1"
return IPField.i2m(self, pkt, x)
def i2h(self, pkt, x):
if x is None:
diff --git a/scripts/external_libs/scapy-2.3.1/python2/scapy/layers/l2.py b/scripts/external_libs/scapy-2.3.1/python2/scapy/layers/l2.py
index 3f80ed7d..bb093042 100644
--- a/scripts/external_libs/scapy-2.3.1/python2/scapy/layers/l2.py
+++ b/scripts/external_libs/scapy-2.3.1/python2/scapy/layers/l2.py
@@ -84,49 +84,14 @@ def getmacbyip(ip, chainCC=0):
class DestMACField(MACField):
def __init__(self, name):
MACField.__init__(self, name, None)
- def i2h(self, pkt, x):
- if x is None:
- x = conf.neighbor.resolve(pkt,pkt.payload)
- if x is None:
- x = "ff:ff:ff:ff:ff:ff"
- warning("Mac address to reach destination not found. Using broadcast.")
- return MACField.i2h(self, pkt, x)
- def i2m(self, pkt, x):
- return MACField.i2m(self, pkt, self.i2h(pkt, x))
class SourceMACField(MACField):
def __init__(self, name):
MACField.__init__(self, name, None)
- def i2h(self, pkt, x):
- if x is None:
- iff,a,gw = pkt.payload.route()
- 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)
- def i2m(self, pkt, x):
- return MACField.i2m(self, pkt, self.i2h(pkt, x))
class ARPSourceMACField(MACField):
def __init__(self, name):
MACField.__init__(self, name, None)
- def i2h(self, pkt, x):
- if x is None:
- iff,a,gw = pkt.route()
- 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)
- def i2m(self, pkt, x):
- return MACField.i2m(self, pkt, self.i2h(pkt, x))
diff --git a/scripts/external_libs/scapy-2.3.1/python3/scapy/fields.py b/scripts/external_libs/scapy-2.3.1/python3/scapy/fields.py
index 5482ce87..66ccd552 100644
--- a/scripts/external_libs/scapy-2.3.1/python3/scapy/fields.py
+++ b/scripts/external_libs/scapy-2.3.1/python3/scapy/fields.py
@@ -250,9 +250,7 @@ class SourceIPField(IPField):
self.dstname = dstname
def i2m(self, pkt, x):
if x is None:
- iff,x,gw = pkt.route()
- if x is None:
- x = "0.0.0.0"
+ x="16.0.0.1"
return IPField.i2m(self, pkt, x)
def i2h(self, pkt, x):
if x is None:
diff --git a/scripts/external_libs/scapy-2.3.1/python3/scapy/layers/l2.py b/scripts/external_libs/scapy-2.3.1/python3/scapy/layers/l2.py
index 0d0a1c78..3a57f9c4 100644
--- a/scripts/external_libs/scapy-2.3.1/python3/scapy/layers/l2.py
+++ b/scripts/external_libs/scapy-2.3.1/python3/scapy/layers/l2.py
@@ -84,49 +84,14 @@ def getmacbyip(ip, chainCC=0):
class DestMACField(MACField):
def __init__(self, name):
MACField.__init__(self, name, None)
- def i2h(self, pkt, x):
- if x is None:
- x = conf.neighbor.resolve(pkt,pkt.payload)
- if x is None:
- x = "ff:ff:ff:ff:ff:ff"
- warning("Mac address to reach destination not found. Using broadcast.")
- return MACField.i2h(self, pkt, x)
- def i2m(self, pkt, x):
- return MACField.i2m(self, pkt, self.i2h(pkt, x))
class SourceMACField(MACField):
def __init__(self, name):
MACField.__init__(self, name, None)
- def i2h(self, pkt, x):
- if x is None:
- iff,a,gw = pkt.payload.route()
- 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)
- def i2m(self, pkt, x):
- return MACField.i2m(self, pkt, self.i2h(pkt, x))
class ARPSourceMACField(MACField):
def __init__(self, name):
MACField.__init__(self, name, None)
- def i2h(self, pkt, x):
- if x is None:
- iff,a,gw = pkt.route()
- 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)
- def i2m(self, pkt, x):
- return MACField.i2m(self, pkt, self.i2h(pkt, x))