summaryrefslogtreecommitdiffstats
path: root/scripts/external_libs
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2017-01-29 17:14:41 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2017-02-02 13:42:36 +0200
commit39000f461de6b85877db85488b1cc7f1fad9d359 (patch)
tree8ffa214f3876009bf8778881c63b6c245244ac41 /scripts/external_libs
parent790059069915a700905f4746b22a9a4a6cadc6ad (diff)
ipv6 scan & ping
Change-Id: I4f8112b4c942d149da5ea3f0ee01ac82d7fe32cc Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'scripts/external_libs')
-rw-r--r--scripts/external_libs/scapy-2.3.1/python2/scapy/layers/inet6.py40
-rw-r--r--scripts/external_libs/scapy-2.3.1/python3/scapy/layers/inet6.py40
2 files changed, 78 insertions, 2 deletions
diff --git a/scripts/external_libs/scapy-2.3.1/python2/scapy/layers/inet6.py b/scripts/external_libs/scapy-2.3.1/python2/scapy/layers/inet6.py
index 46cd85e5..b4202a76 100644
--- a/scripts/external_libs/scapy-2.3.1/python2/scapy/layers/inet6.py
+++ b/scripts/external_libs/scapy-2.3.1/python2/scapy/layers/inet6.py
@@ -1113,7 +1113,7 @@ icmp6typescls = { 1: "ICMPv6DestUnreach",
140: "ICMPv6NIReply",
141: "ICMPv6ND_INDSol",
142: "ICMPv6ND_INDAdv",
- #143: Do Me - RFC 3810
+ 143: "ICMPv6MLReportV2",
144: "ICMPv6HAADRequest",
145: "ICMPv6HAADReply",
146: "ICMPv6MPSol",
@@ -1143,6 +1143,7 @@ icmp6typesminhdrlen = { 1: 8,
#140
141: 8,
142: 8,
+ 143: 16,
144: 8,
145: 8,
146: 8,
@@ -1186,6 +1187,14 @@ icmp6types = { 1 : "Destination unreachable",
200 : "Private Experimentation",
201 : "Private Experimentation" }
+mldv2_group_types = {
+ 1: 'Mode is include (1)',
+ 2: 'Mode is exclude (2)',
+ 3: 'Change to include mode (3)',
+ 4: 'Change to exclude mode (4)',
+ 5: 'Alloc new sources (5)',
+ 6: 'Block old sources (6)',
+ }
class _ICMPv6(Packet):
name = "ICMPv6 dummy class"
@@ -1345,6 +1354,35 @@ class ICMPv6MLDone(_ICMPv6ML): # RFC 2710
overload_fields = {IPv6: { "dst": "ff02::2", "hlim": 1, "nh": 58}}
+class ICMPv6MLReportV2(_ICMPv6): # RFC 3810
+ name = 'MLDv2 - Multicast Listener Report'
+ fields_desc = [ ByteEnumField('type', 143, icmp6types),
+ ByteField('code', 0),
+ XShortField('cksum', None),
+ ShortField('reserved', 0),
+ ShortField('records_count', 1) ] # for now it's fixed 1 record
+ overload_fields = {IPv6: { 'dst': 'ff02::16', 'hlim': 1, 'nh': 58 }}
+
+ def default_payload_class(self, p):
+ return MLDv2Addr
+
+
+# assumes empty aux
+class MLDv2Addr(Packet):
+ name = 'MLDv2 - Address group'
+ fields_desc = [
+ ByteEnumField('type', 3, mldv2_group_types),
+ ByteField('aux_len', 0),
+ ShortField('len', 0),
+ IP6Field('multicast_addr', '::'),
+ IP6ListField('addrlist', [], count_from = lambda pkt:pkt.len)
+ ]
+
+ def default_payload_class(self, p):
+ return MLDv2Addr
+
+
+
########## ICMPv6 MRD - Multicast Router Discovery (RFC 4286) ###############
# TODO:
diff --git a/scripts/external_libs/scapy-2.3.1/python3/scapy/layers/inet6.py b/scripts/external_libs/scapy-2.3.1/python3/scapy/layers/inet6.py
index c2e4a037..ddfdc4ae 100644
--- a/scripts/external_libs/scapy-2.3.1/python3/scapy/layers/inet6.py
+++ b/scripts/external_libs/scapy-2.3.1/python3/scapy/layers/inet6.py
@@ -1121,7 +1121,7 @@ icmp6typescls = { 1: "ICMPv6DestUnreach",
140: "ICMPv6NIReply",
141: "ICMPv6ND_INDSol",
142: "ICMPv6ND_INDAdv",
- #143: Do Me - RFC 3810
+ 143: "ICMPv6MLReportV2",
144: "ICMPv6HAADRequest",
145: "ICMPv6HAADReply",
146: "ICMPv6MPSol",
@@ -1151,6 +1151,7 @@ icmp6typesminhdrlen = { 1: 8,
#140
141: 8,
142: 8,
+ 143: 16,
144: 8,
145: 8,
146: 8,
@@ -1194,6 +1195,14 @@ icmp6types = { 1 : "Destination unreachable",
200 : "Private Experimentation",
201 : "Private Experimentation" }
+mldv2_group_types = {
+ 1: 'Mode is include (1)',
+ 2: 'Mode is exclude (2)',
+ 3: 'Change to include mode (3)',
+ 4: 'Change to exclude mode (4)',
+ 5: 'Alloc new sources (5)',
+ 6: 'Block old sources (6)',
+ }
class _ICMPv6(Packet):
name = "ICMPv6 dummy class"
@@ -1353,6 +1362,35 @@ class ICMPv6MLDone(_ICMPv6ML): # RFC 2710
overload_fields = {IPv6: { "dst": "ff02::2", "hlim": 1, "nh": 58}}
+class ICMPv6MLReportV2(_ICMPv6): # RFC 3810
+ name = 'MLDv2 - Multicast Listener Report'
+ fields_desc = [ ByteEnumField('type', 143, icmp6types),
+ ByteField('code', 0),
+ XShortField('cksum', None),
+ ShortField('reserved', 0),
+ ShortField('records_count', 1) ] # for now it's fixed 1 record
+ overload_fields = {IPv6: { 'dst': 'ff02::16', 'hlim': 1, 'nh': 58 }}
+
+ def default_payload_class(self, p):
+ return MLDv2Addr
+
+
+# assumes empty aux
+class MLDv2Addr(Packet):
+ name = 'MLDv2 - Address group'
+ fields_desc = [
+ ByteEnumField('type', 3, mldv2_group_types),
+ ByteField('aux_len', 0),
+ ShortField('len', 0),
+ IP6Field('multicast_addr', '::'),
+ IP6ListField('addrlist', [], count_from = lambda pkt:pkt.len)
+ ]
+
+ def default_payload_class(self, p):
+ return MLDv2Addr
+
+
+
########## ICMPv6 MRD - Multicast Router Discovery (RFC 4286) ###############
# TODO: