scapy.layers.hsrp module

HSRP (Hot Standby Router Protocol): proprietary redundancy protocol for Cisco routers. # noqa: E501

class scapy.layers.hsrp.HSRP

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.hsrp.HSRP'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (HSRP).version>, <Field (HSRP).opcode>, <Field (HSRP).state>, <Field (HSRP).hellotime>, <Field (HSRP).holdtime>, <Field (HSRP).priority>, <Field (HSRP).group>, <Field (HSRP).reserved>, <Field (HSRP).auth>, <Field (HSRP).virtualIP>]
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.layers.hsrp.HSRPmd5

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.hsrp.HSRPmd5'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (HSRPmd5).type>, <Field (HSRPmd5).len>, <Field (HSRPmd5).algo>, <Field (HSRPmd5).padding>, <Field (HSRPmd5).flags>, <Field (HSRPmd5).sourceip>, <Field (HSRPmd5).keyid>, <Field (HSRPmd5).authdigest>]
post_build(p, 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