Пример #1
0
    0x88CD: 'SERCOS_III',
    0x88E1: 'HomePlugAV',
    0x88E3: 'MediaRedundancyProtocol',
    0x88E5: 'IEEE8021ae',
    0x88E7: 'IEEE8021ah',
    0x88F7: 'IEEE1588',
    0x8902: 'IEEE8021ag',
    0x8906: 'FCoE',
    0x8914: 'FCoEInitialization',
    0x8915: 'RoCE',
    0x891D: 'TTE',
    0x892F: 'HSR',
    0x9000: 'EthernetConfigTest'
}

EtherTypeRev_dict = reverse_dict(EtherType_dict)

# For Ethernet / VLAN automatic type setting:
# it is required that the payload has one of the EtherType_dict value
# as name attribute


class Ethernet(Envelope):
    _GEN = (
        Buf('dst', val=6 * b'\0', bl=48, rep=REPR_HEX),
        Buf('src', val=6 * b'\0', bl=48, rep=REPR_HEX),
        Uint16('type', rep=REPR_HEX)  # val automated
    )

    def __init__(self, *args, **kwargs):
        Envelope.__init__(self, *args, **kwargs)
Пример #2
0
    131 : 'PIPE',
    132 : 'SCTP',
    133 : 'FC',
    134 : 'RSVP-E2E-IGNORE',
    135 : 'Mobility',
    136 : 'UDPLite',
    137 : 'MPLS-in-IP',
    138 : 'manet',
    139 : 'HIP',
    140 : 'Shim6',
    253 : 'Experimentation',
    254 : 'Experimentation',
    255 : 'Reserved'
    }

IPProtRev_dict = reverse_dict(IPProt_dict)
    
IPv4Opt_dict = {
    0: 'EndofOptions',
    1: 'NoOperation',
    7: 'RecordRoute',
    10: 'ExperimentalMeasurement',
    11: 'MTUProbe',
    12: 'MTUReply',
    15: 'ENCODE',
    25: 'Quick-Start',
    30: 'RFC3692-styleExperiment',
    68: 'TimeStamp',
    82: 'Traceroute',
    94: 'RFC3692-styleExperiment',
    130: 'Security',