Module Import alias Import alias Import alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign AttributeStore NameLoad attr ListLoad orelse Assign AttributeStore NameLoad attr NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore AttributeLoad NameLoad attr While NameLoad body TryExcept body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Break If NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num For TupleStore NameStore NameStore Call NameLoad NameLoad body If Call NameLoad NameLoad AttributeLoad NameLoad attr body If CompareEq NameLoad BinOpSub Call NameLoad NameLoad Num body Assign NameStore NameLoad orelse Assign NameStore SubscriptLoad NameLoad Index BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr BinOpAdd NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr Assert Call NameLoad NameLoad AttributeLoad NameLoad attr Return ListComp NameLoad comprehension NameStore AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareGt Call NameLoad NameLoad Num body Return SubscriptLoad NameLoad Index Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body If BoolOpAnd Call AttributeLoad NameLoad attr NameLoad Call NameLoad NameLoad AttributeLoad NameLoad attr body Return CompareIn NameLoad ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Return CompareIn NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad Str attr GeneratorExp Call NameLoad NameLoad comprehension NameStore AttributeLoad NameLoad attr decorator_list Assign NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad
N/A N/A inspect N/A six N/A struct N/A packet_base N/A ethernet Packet N/A object N/A N/A A packet decoder/encoder class.

    An instance is used to either decode or encode a single packet.

    *data* is a bytearray to describe a raw datagram to decode.
    When decoding, a Packet object is iteratable.
    Iterated values are protocol (ethernet, ipv4, ...) headers and the payload.
    Protocol headers are instances of subclass of packet_base.PacketBase.
    The payload is a bytearray.  They are iterated in on-wire order.

    *data* should be omitted when encoding a packet.
     __init__ N/A N/A self data protocols parse_cls N/A None None N/A ethernet ethernet N/A N/A N/A N/A N/A super Packet self __init__ N/A N/A self data data N/A N/A protocols None N/A N/A N/A self protocols N/A N/A N/A N/A self protocols protocols N/A N/A self data N/A N/A N/A N/A self _parser parse_cls N/A _parser N/A N/A self cls N/A N/A N/A rest_data N/A self data N/A cls N/A N/A N/A N/A N/A proto cls rest_data N/A N/A cls parser rest_data N/A N/A N/A N/A struct error N/A N/A N/A proto N/A N/A N/A N/A N/A self protocols append proto N/A rest_data N/A N/A N/A N/A N/A self protocols append rest_data N/A serialize N/A N/A self N/A N/A N/A Encode a packet and store the resulted bytearray in self.data.

        This method is legal only when encoding a packet.
         N/A N/A self data N/A bytearray N/A r N/A N/A self protocols N/A -1 N/A N/A i p N/A enumerate r N/A N/A N/A isinstance p N/A packet_base PacketBase N/A N/A N/A i N/A N/A len r 1 N/A N/A prev None N/A N/A prev N/A r N/A N/A i 1 N/A data N/A N/A p serialize N/A self data prev N/A N/A data N/A N/A six binary_type p N/A N/A self data N/A data N/A self data N/A add_protocol N/A N/A self proto N/A N/A N/A Register a protocol *proto* for this packet.

        This method is legal only when encoding a packet.

        When encoding a packet, register a protocol (ethernet, ipv4, ...)
        header to add to this packet.
        Protocol headers should be registered in on-wire order before calling
        self.serialize.
         N/A N/A N/A N/A self protocols append proto N/A get_protocols N/A N/A self protocol N/A N/A N/A Returns a list of protocols that matches to the specified protocol.
         N/A N/A isinstance protocol N/A packet_base PacketBase N/A N/A protocol N/A protocol __class__ N/A N/A issubclass protocol N/A packet_base PacketBase N/A N/A p N/A p N/A self protocols N/A isinstance p protocol N/A get_protocol N/A N/A self protocol N/A N/A N/A Returns the firstly found protocol that matches to the
        specified protocol.
         N/A result N/A N/A self get_protocols protocol N/A N/A N/A len result 0 N/A N/A N/A result N/A 0 N/A None N/A __div__ N/A N/A self trailer N/A N/A N/A N/A N/A self add_protocol trailer N/A self N/A __truediv__ N/A N/A self trailer N/A N/A N/A N/A N/A self __div__ trailer N/A __iter__ N/A N/A self N/A N/A N/A N/A iter N/A self protocols N/A __getitem__ N/A N/A self idx N/A N/A N/A N/A N/A self protocols N/A idx N/A __setitem__ N/A N/A self idx item N/A N/A N/A N/A N/A self protocols N/A idx item N/A __delitem__ N/A N/A self idx N/A N/A N/A N/A N/A self protocols N/A idx N/A __len__ N/A N/A self N/A N/A N/A N/A len N/A self protocols N/A __contains__ N/A N/A self protocol N/A N/A N/A N/A N/A N/A inspect isclass protocol N/A issubclass protocol N/A packet_base PacketBase N/A N/A N/A protocol N/A N/A p __class__ N/A p N/A self protocols N/A N/A protocol N/A self protocols N/A __str__ N/A N/A self N/A N/A N/A N/A N/A ,  join N/A N/A repr protocol N/A protocol N/A self protocols N/A N/A __repr__ __str__ N/A _PacketBase__div__ N/A N/A self trailer N/A N/A N/A pkt N/A Packet N/A N/A N/A pkt add_protocol self N/A N/A N/A pkt add_protocol trailer N/A pkt N/A N/A N/A N/A packet_base PacketBase __div__ _PacketBase__div__ N/A N/A N/A packet_base PacketBase __truediv__ _PacketBase__div__