scapy.contrib.rtr module

class scapy.contrib.rtr.RTR

Bases: scapy.packet.Packet

Dummy RPKI to Router generic packet for pre-sorting the packet type eg. https://tools.ietf.org/html/rfc6810#section-5.2

aliastypes = [<class 'scapy.contrib.rtr.RTR'>, <class 'scapy.packet.Packet'>]
classmethod dispatch_hook(_pkt=None, *args, **kargs)

Attribution of correct type depending on version and pdu_type

class scapy.contrib.rtr.RTRCacheReset

Bases: scapy.packet.Packet

Cache Reset packet from section 5.9 https://tools.ietf.org/html/rfc6810#section-5.9

aliastypes = [<class 'scapy.contrib.rtr.RTRCacheReset'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (RTRCacheReset).rtr_version>, <Field (RTRCacheReset).pdu_type>, <Field (RTRCacheReset).reserved>, <Field (RTRCacheReset).length>]
class scapy.contrib.rtr.RTRCacheResponse

Bases: scapy.packet.Packet

Cache Response packet from section 5.5 https://tools.ietf.org/html/rfc6810#section-5.5

aliastypes = [<class 'scapy.contrib.rtr.RTRCacheResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (RTRCacheResponse).rtr_version>, <Field (RTRCacheResponse).pdu_type>, <Field (RTRCacheResponse).session_id>, <Field (RTRCacheResponse).length>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
class scapy.contrib.rtr.RTREndofDatav0

Bases: scapy.packet.Packet

End of Data packet from version 0 standard section 5.8 https://tools.ietf.org/html/rfc6810#section-5.8

aliastypes = [<class 'scapy.contrib.rtr.RTREndofDatav0'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (RTREndofDatav0).rtr_version>, <Field (RTREndofDatav0).pdu_type>, <Field (RTREndofDatav0).session_id>, <Field (RTREndofDatav0).length>, <Field (RTREndofDatav0).serial_number>]
class scapy.contrib.rtr.RTREndofDatav1

Bases: scapy.packet.Packet

End of Data packet from version 1 standard section 5.8 https://tools.ietf.org/html/rfc8210#section-5.8

aliastypes = [<class 'scapy.contrib.rtr.RTREndofDatav1'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (RTREndofDatav1).rtr_version>, <Field (RTREndofDatav1).pdu_type>, <Field (RTREndofDatav1).session_id>, <Field (RTREndofDatav1).length>, <Field (RTREndofDatav1).serial_number>, <Field (RTREndofDatav1).refresh_interval>, <Field (RTREndofDatav1).retry_interval>, <Field (RTREndofDatav1).expire_interval>]
class scapy.contrib.rtr.RTRErrorReport

Bases: scapy.packet.Packet

Error Report packet from section 5.10 https://tools.ietf.org/html/rfc6810#section-5.10

aliastypes = [<class 'scapy.contrib.rtr.RTRErrorReport'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (RTRErrorReport).rtr_version>, <Field (RTRErrorReport).pdu_type>, <Field (RTRErrorReport).error_code>, <Field (RTRErrorReport).length>, <Field (RTRErrorReport).length_of_encaps_PDU>, <Field (RTRErrorReport).erroneous_PDU>, <Field (RTRErrorReport).length_of_error_text>, <Field (RTRErrorReport).error_text>]
post_build(pkt, pay)

DEV: called right after the current layer is build.

Parameters:
  • pkt (str) – the current packet (build by self_buil function)
  • pay (str) – the packet payload (build by do_build_payload function)
Returns:

a string of the packet with the payload

class scapy.contrib.rtr.RTRIPv4Prefix

Bases: scapy.packet.Packet

IPv4 Prefix packet from section 5.6 https://tools.ietf.org/html/rfc6810#section-5.6

aliastypes = [<class 'scapy.contrib.rtr.RTRIPv4Prefix'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (RTRIPv4Prefix).rtr_version>, <Field (RTRIPv4Prefix).pdu_type>, <Field (RTRIPv4Prefix).reserved>, <Field (RTRIPv4Prefix).length>, <Field (RTRIPv4Prefix).flags>, <Field (RTRIPv4Prefix).shortest_length>, <Field (RTRIPv4Prefix).longest_length>, <Field (RTRIPv4Prefix).zeros>, <Field (RTRIPv4Prefix).prefix>, <Field (RTRIPv4Prefix).asn>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
class scapy.contrib.rtr.RTRIPv6Prefix

Bases: scapy.packet.Packet

IPv6 Prefix packet from section 5.7 https://tools.ietf.org/html/rfc6810#section-5.7

aliastypes = [<class 'scapy.contrib.rtr.RTRIPv6Prefix'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (RTRIPv6Prefix).rtr_version>, <Field (RTRIPv6Prefix).pdu_type>, <Field (RTRIPv6Prefix).reserved>, <Field (RTRIPv6Prefix).length>, <Field (RTRIPv6Prefix).flags>, <Field (RTRIPv6Prefix).shortest_length>, <Field (RTRIPv6Prefix).longest_length>, <Field (RTRIPv6Prefix).zeros>, <Field (RTRIPv6Prefix).prefix>, <Field (RTRIPv6Prefix).asn>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
class scapy.contrib.rtr.RTRResetQuery

Bases: scapy.packet.Packet

Reset Query packet from section 5.4 https://tools.ietf.org/html/rfc6810#section-5.4

aliastypes = [<class 'scapy.contrib.rtr.RTRResetQuery'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (RTRResetQuery).rtr_version>, <Field (RTRResetQuery).pdu_type>, <Field (RTRResetQuery).reserved>, <Field (RTRResetQuery).length>]
class scapy.contrib.rtr.RTRRouterKey

Bases: scapy.packet.Packet

Router Key packet from version 1 standard section 5.10 https://tools.ietf.org/html/rfc8210#section-5.10

aliastypes = [<class 'scapy.contrib.rtr.RTRRouterKey'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (RTRRouterKey).rtr_version>, <Field (RTRRouterKey).pdu_type>, <Field (RTRRouterKey).flags>, <Field (RTRRouterKey).zeros>, <Field (RTRRouterKey).length>, <Field (RTRRouterKey).subject_key_identifier>, <Field (RTRRouterKey).asn>, <Field (RTRRouterKey).subject_PKI>]
post_build(pkt, pay)

DEV: called right after the current layer is build.

Parameters:
  • pkt (str) – the current packet (build by self_buil function)
  • pay (str) – the packet payload (build by do_build_payload function)
Returns:

a string of the packet with the payload

class scapy.contrib.rtr.RTRSerialNotify

Bases: scapy.packet.Packet

Serial Notify packet from section 5.2 https://tools.ietf.org/html/rfc6810#section-5.2

aliastypes = [<class 'scapy.contrib.rtr.RTRSerialNotify'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (RTRSerialNotify).rtr_version>, <Field (RTRSerialNotify).pdu_type>, <Field (RTRSerialNotify).session_id>, <Field (RTRSerialNotify).length>, <Field (RTRSerialNotify).serial_number>]
class scapy.contrib.rtr.RTRSerialQuery

Bases: scapy.packet.Packet

Serial Query packet from section 5.3 https://tools.ietf.org/html/rfc6810#section-5.3

aliastypes = [<class 'scapy.contrib.rtr.RTRSerialQuery'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (RTRSerialQuery).rtr_version>, <Field (RTRSerialQuery).pdu_type>, <Field (RTRSerialQuery).session_id>, <Field (RTRSerialQuery).length>, <Field (RTRSerialQuery).serial_number>]