Ticket #59: scapy-hsrp-opcodes-states.patch

File scapy-hsrp-opcodes-states.patch, 1.1 kB (added by lobo@c3a.de, 4 months ago)

Patch for Scapy 2.x

  • a/scapy/layers/hsrp.py

    old new  
    1111    name = "HSRP" 
    1212    fields_desc = [ 
    1313        ByteField("version", 0), 
    14         ByteEnumField("opcode", 0, { 0:"Hello"}), 
    15         ByteEnumField("state", 16, { 16:"Active"}), 
     14        ByteEnumField("opcode", 0, { 0:"Hello", 1:"Coup", 2:"Resign", 3:"Advertise"}), 
     15        ByteEnumField("state", 16, { 0:"Initial", 1:"Learn", 2:"Listen", 4:"Speak", 8:"Standby", 16:"Active"}), 
    1616        ByteField("hellotime", 3), 
    1717        ByteField("holdtime", 10), 
    1818        ByteField("priority", 120), 
     
    2020        ByteField("reserved", 0), 
    2121        StrFixedLenField("auth","cisco",8), 
    2222        IPField("virtualIP","192.168.1.1") ] 
    23          
    2423 
    2524 
    26          
    27          
     25 
     26 
     27 
    2828bind_layers( UDP,           HSRP,          dport=1985, sport=1985)