class CDPMsgProtoHello(CDPMsgGeneric): name = "Protocol Hello" type = 0x0008 fields_desc = [XShortEnumField("type", 0x0008, _cdp_tlv_types), ShortField("len", 32), OUIField("oui", 0x00000c), XShortField("protocol_id", 0x0), # TLV length (len) - 2 (type) - 2 (len) - 3 (OUI) - 2 # (Protocol ID) StrLenField("data", "", length_from=lambda p: p.len - 9)]
class PPP_ECP_Option_OUI(PPP_ECP_Option): fields_desc = [ ByteEnumField("type", 0, _PPP_ecpopttypes), FieldLenField("len", None, length_of="data", fmt="B", adjust=lambda _, val: val + 6), OUIField("oui", 0), ByteField("subtype", 0), StrLenField("data", "", length_from=lambda pkt: pkt.len - 6), ]
class SNAP(Packet): name = "SNAP" fields_desc = [ OUIField("OUI", 0x000000), XShortEnumField("code", 0x000, ETHER_TYPES) ]