Update IANA Router Alert Options

Signed-off-by: Walinton Cambronero <walinton.cambronero@hpe.com>
This commit is contained in:
Walinton Cambronero 2016-03-21 17:50:20 -07:00
parent 9434f75b67
commit f256891447
1 changed files with 12 additions and 7 deletions

View File

@ -705,13 +705,18 @@ class PadN(Packet): # IPv6 Hop-By-Hop Option
class RouterAlert(Packet): # RFC 2711 - IPv6 Hop-By-Hop Option
name = "Router Alert"
fields_desc = [_OTypeField("otype", 0x05, _hbhopts),
ByteField("optlen", 2),
ShortEnumField("value", None,
{ 0: "Datagram contains a MLD message",
ByteField("optlen", 2),
ShortEnumField("value", None,
{ 0: "Datagram contains a MLD message",
1: "Datagram contains RSVP message",
2: "Datagram contains an Active Network message" }) ]
2: "Datagram contains an Active Network message",
68: "NSIS NATFW NSLP",
69: "MPLS OAM",
65535: "Reserved" })]
# TODO : Check IANA has not defined new values for value field of RouterAlertOption
# TODO : now that we have that option, we should do something in MLD class that need it
# TODO : Now that we have that option, we should do something in MLD class that need it
# TODO : IANA has defined ranges of values which can't be easily represented here.
# iana.org/assignments/ipv6-routeralert-values/ipv6-routeralert-values.xhtml
def alignment_delta(self, curpos): # alignment requirement : 2n+0
x = 2 ; y = 0
delta = x*((curpos - y + x - 1)/x) + y - curpos
@ -1317,8 +1322,8 @@ class _ICMPv6ML(_ICMPv6):
class ICMPv6MLQuery(_ICMPv6ML): # RFC 2710
name = "MLD - Multicast Listener Query"
type = 130
mrd = 10000
mladdr = "::" # 10s for mrd
mrd = 10000 # 10s for mrd
mladdr = "::"
overload_fields = {IPv6: { "dst": "ff02::1", "hlim": 1, "nh": 58 }}
def hashret(self):
if self.mladdr != "::":