Module Expr Str Import alias ImportFrom alias ClassDef bases NameLoad body Expr Str Pass decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Dict decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Call NameLoad NameLoad Assign NameStore Dict For NameStore NameLoad body Assign NameStore Call NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr Str Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Return AttributeLoad NameLoad attr decorator_list Assign NameStore Call NameLoad NameLoad NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Str Assign NameStore Dict Expr Call AttributeLoad NameLoad attr Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Call NameLoad NameLoad If CompareEq Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr Str Return Dict Expr Call AttributeLoad NameLoad attr Str Assign NameStore Num For NameStore NameLoad body If CompareEq Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr Str NameLoad If CompareGt NameLoad Num body AugAssignAdd NameStore BinOpMod Str NameLoad Assign NameStore Num orelse Raise NameLoad Str AugAssignAdd NameStore Num Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call NameLoad CompareEq BinOpMod Call NameLoad NameLoad Num Num Str For NameStore Call NameLoad Num Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index BinOpAdd NameLoad Num Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index BinOpAdd NameLoad Num Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Raise NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Raise NameLoad Str decorator_list decorator_list ClassDef bases NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad AttributeLoad NameLoad attr Str Expr Call NameLoad AttributeLoad NameLoad attr Str Assign NameStore NameLoad If CompareEq AttributeLoad NameLoad attr Num body Assign NameStore Str orelse Assign NameStore Str Expr Call AttributeLoad NameLoad attr Str NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Str AugAssignAdd NameStore BinOpMod Str Call NameLoad AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Str body AugAssignAdd NameStore Str orelse Raise NameLoad BinOpMod Str NameLoad Assign NameStore ListLoad If CompareGt Call AttributeLoad AttributeLoad NameLoad attr attr Num body Expr Call AttributeLoad NameLoad attr Str For NameStore AttributeLoad NameLoad attr body AugAssignAdd NameStore BinOpMod Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore BinOpMod Str Call NameLoad Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Call NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call NameLoad AttributeLoad NameLoad attr Str Assign NameStore Num Assign NameStore Str Assign NameStore NameStore NameStore Num Expr Call AttributeLoad NameLoad attr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num For NameStore NameLoad body If CompareEq Call NameLoad NameLoad Num body AugAssignAdd NameStore Num Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad AugAssignAdd NameStore BinOpMod Str NameLoad Assign NameStore Num If CompareEq NameLoad Num body Break AugAssignAdd NameStore Num AugAssignAdd NameStore Num Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call NameLoad CompareEq NameLoad Num Str Assign NameStore SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Str Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call NameLoad CompareEq Call NameLoad NameLoad Num Str Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr Call AttributeLoad SubscriptLoad NameLoad Index Num attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpMod Str AttributeLoad NameLoad attr AugAssignAdd NameStore BinOpMod Str AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body AugAssignAdd NameStore BinOpMod Str AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpMod Str AttributeLoad NameLoad attr AugAssignAdd NameStore BinOpMod Str AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body AugAssignAdd NameStore BinOpMod Str AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpMod Str AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body AugAssignAdd NameStore BinOpMod Str Call NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareEq Call NameLoad AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Str Assign NameStore BinOpMod Str Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign TupleStore AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str SubscriptLoad AttributeLoad NameLoad attr Slice Num Num Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Num Expr Call AttributeLoad NameLoad attr Str Call NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Num Num Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict Num Num Num Num Num Num Num Num Str Str Str Str Str Str Str Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpMod Str AttributeLoad NameLoad attr AugAssignAdd NameStore BinOpMod Str Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpMod Str Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Expr Call NameLoad CompareGtE NameLoad Num Str Expr Call AttributeLoad NameLoad attr Str NameLoad If CompareEq NameLoad Num body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Str Expr Call AttributeLoad NameLoad attr Str NameLoad Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr Str Assign NameStore BinOpMod Str BinOpSub Call NameLoad AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Str NameLoad Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list ClassDef bases NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore ListLoad Expr Call AttributeLoad NameLoad attr Str For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Str SubscriptLoad AttributeLoad NameLoad attr Index NameLoad AugAssignAdd NameStore BinOpMod Str Call NameLoad NameLoad AugAssignAdd NameStore BinOpMod Str Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str For NameStore AttributeLoad NameLoad attr body If Call AttributeLoad NameLoad attr NameLoad body If CompareEq NameLoad Str body Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If BoolOpAnd CompareGtE NameLoad NameLoad CompareLtE NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad orelse Raise NameLoad BinOpMod Str NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If CompareLt NameLoad Num body Raise NameLoad Str orelse Raise NameLoad BinOpMod Str NameLoad Return NameLoad decorator_list decorator_list
N/A N/A This module implements the packet types of TFTP itself, and the
corresponding encode and decode methods for them. N/A struct TftpShared * TftpSession N/A object N/A N/A This class is the base class for the tftp client and server. Any shared
    code should be in this class. N/A N/A TftpPacketWithOptions N/A object N/A N/A This class exists to permit some TftpPacket subclasses to share code
    regarding options handling. It does not inherit from TftpPacket, as the
    goal is just to share code here, and not cause diamond inheritance. __init__ N/A N/A self N/A N/A N/A N/A self options N/A N/A setoptions N/A N/A self options N/A N/A N/A N/A N/A log debug in TftpPacketWithOptions.setoptions N/A N/A N/A log debug options: %s N/A str options N/A myoptions N/A N/A key options N/A N/A newkey N/A str key N/A N/A myoptions N/A newkey N/A str N/A options N/A key N/A N/A N/A log debug populated myoptions with %s = %s newkey N/A myoptions N/A newkey N/A N/A N/A log debug setting options hash to: %s N/A str myoptions N/A N/A self _options myoptions N/A getoptions N/A N/A self N/A N/A N/A N/A N/A log debug in TftpPacketWithOptions.getoptions N/A N/A self _options N/A N/A options N/A property getoptions setoptions decode_options N/A N/A self buffer N/A N/A N/A This method decodes the section of the buffer that contains an
        unknown number of options. It returns a dictionary of option names and
        values. N/A format ! N/A options N/A N/A N/A N/A log debug decode_options: buffer is: %s N/A repr buffer N/A N/A N/A log debug size of buffer is %d bytes N/A len buffer N/A N/A N/A len buffer 0 N/A N/A N/A N/A log debug size of buffer is zero, returning empty hash N/A N/A N/A N/A N/A log debug about to iterate options buffer counting nulls N/A length 0 N/A c buffer N/A N/A N/A N/A ord c 0 N/A N/A N/A N/A log debug found a null at length %d length N/A N/A length 0 N/A N/A format N/A %dsx length N/A length -1 N/A N/A TftpException Invalid options in buffer N/A length 1 N/A N/A N/A log debug about to unpack, format is: %s format N/A mystruct N/A N/A struct unpack format buffer N/A N/A tftpassert N/A N/A N/A len mystruct 2 0 packet with odd number of option/value pairs N/A i N/A range 0 N/A len mystruct 2 N/A N/A N/A N/A log debug setting option %s to %s N/A mystruct N/A i N/A mystruct N/A N/A i 1 N/A N/A options N/A N/A mystruct N/A i N/A mystruct N/A N/A i 1 N/A options N/A N/A TftpPacket N/A object N/A N/A This class is the parent class of all tftp packet classes. It is an
    abstract class, providing an interface, and should not be instantiated
    directly. __init__ N/A N/A self N/A N/A N/A N/A self opcode 0 N/A N/A self buffer None N/A encode N/A N/A self N/A N/A N/A The encode method of a TftpPacket takes keyword arguments specific
        to the type of packet, and packs an appropriate buffer in network-byte
        order suitable for sending over the wire.

        This is an abstract method. N/A NotImplementedError Abstract method N/A decode N/A N/A self N/A N/A N/A The decode method of a TftpPacket takes a buffer off of the wire in
        network-byte order, and decodes it, populating internal properties as
        appropriate. This can only be done once the first 2-byte opcode has
        already been decoded, but the data section does include the entire
        datagram.

        This is an abstract method. N/A NotImplementedError Abstract method N/A N/A TftpPacketInitial N/A TftpPacket TftpPacketWithOptions N/A N/A This class is a common parent class for the RRQ and WRQ packets, as
    they share quite a bit of code. __init__ N/A N/A self N/A N/A N/A N/A N/A TftpPacket __init__ self N/A N/A N/A TftpPacketWithOptions __init__ self N/A N/A self filename None N/A N/A self mode None N/A encode N/A N/A self N/A N/A N/A Encode the packet's buffer from the instance variables. N/A N/A tftpassert N/A self filename filename required in initial packet N/A N/A tftpassert N/A self mode mode required in initial packet N/A ptype None N/A N/A N/A self opcode 1 N/A N/A ptype RRQ N/A N/A ptype WRQ N/A N/A N/A log debug Encoding %s packet, filename = %s, mode = %s ptype N/A self filename N/A self mode N/A key N/A self options N/A N/A N/A N/A log debug     Option %s = %s key N/A N/A self options N/A key N/A format !H N/A format N/A %dsx N/A len N/A self filename N/A N/A N/A self mode octet N/A N/A format 5sx N/A N/A AssertionError N/A Unsupported mode: %s mode N/A options_list N/A N/A N/A N/A N/A N/A self options keys 0 N/A N/A N/A N/A log debug there are options to encode N/A key N/A self options N/A N/A format N/A %dsx N/A len key N/A N/A N/A options_list append key N/A format N/A %dsx N/A len N/A str N/A N/A self options N/A key N/A N/A N/A options_list append N/A str N/A N/A self options N/A key N/A N/A N/A log debug format is %s format N/A N/A N/A log debug options_list is %s options_list N/A N/A N/A log debug size of struct is %d N/A N/A struct calcsize format N/A N/A self buffer N/A N/A struct pack format N/A self opcode N/A self filename N/A self mode options_list N/A N/A N/A log debug buffer is %s N/A repr N/A self buffer N/A self N/A decode N/A N/A self N/A N/A N/A N/A tftpassert N/A self buffer Can't decode, buffer is empty N/A nulls 0 N/A format N/A nulls length tlength 0 N/A N/A N/A log debug in decode: about to iterate buffer counting nulls N/A subbuf N/A N/A self buffer N/A 2 N/A c subbuf N/A N/A N/A N/A ord c 0 N/A N/A nulls 1 N/A N/A N/A log debug found a null at length %d, now have %d length nulls N/A format N/A %dsx length N/A length -1 N/A N/A nulls 2 N/A N/A N/A length 1 N/A tlength 1 N/A N/A N/A log debug hopefully found end of mode at length %d tlength N/A N/A tftpassert N/A nulls 2 malformed packet N/A shortbuf N/A subbuf N/A N/A tlength 1 N/A N/A N/A log debug about to unpack buffer with format: %s format N/A N/A N/A log debug unpacking buffer: %s N/A repr shortbuf N/A mystruct N/A N/A struct unpack format shortbuf N/A N/A tftpassert N/A N/A len mystruct 2 malformed packet N/A N/A self filename N/A mystruct N/A 0 N/A N/A self mode N/A N/A N/A mystruct N/A 1 lower N/A N/A N/A log debug set filename to %s N/A self filename N/A N/A N/A log debug set mode to %s N/A self mode N/A N/A self options N/A N/A self decode_options N/A subbuf N/A N/A tlength 1 N/A self N/A N/A TftpPacketRRQ N/A TftpPacketInitial N/A N/A 
::

            2 bytes    string   1 byte     string   1 byte
            -----------------------------------------------
    RRQ/  | 01/02 |  Filename  |   0  |    Mode    |   0  |
    WRQ     -----------------------------------------------
     __init__ N/A N/A self N/A N/A N/A N/A N/A TftpPacketInitial __init__ self N/A N/A self opcode 1 N/A __str__ N/A N/A self N/A N/A N/A s N/A RRQ packet: filename = %s N/A self filename N/A s N/A  mode = %s N/A self mode N/A N/A self options N/A N/A s N/A 
    options = %s N/A self options N/A s N/A N/A TftpPacketWRQ N/A TftpPacketInitial N/A N/A 
::

            2 bytes    string   1 byte     string   1 byte
            -----------------------------------------------
    RRQ/  | 01/02 |  Filename  |   0  |    Mode    |   0  |
    WRQ     -----------------------------------------------
     __init__ N/A N/A self N/A N/A N/A N/A N/A TftpPacketInitial __init__ self N/A N/A self opcode 2 N/A __str__ N/A N/A self N/A N/A N/A s N/A WRQ packet: filename = %s N/A self filename N/A s N/A  mode = %s N/A self mode N/A N/A self options N/A N/A s N/A 
    options = %s N/A self options N/A s N/A N/A TftpPacketDAT N/A TftpPacket N/A N/A 
::

            2 bytes    2 bytes       n bytes
            ---------------------------------
    DATA  | 03    |   Block #  |    Data    |
            ---------------------------------
     __init__ N/A N/A self N/A N/A N/A N/A N/A TftpPacket __init__ self N/A N/A self opcode 3 N/A N/A self blocknumber 0 N/A N/A self data None N/A __str__ N/A N/A self N/A N/A N/A s N/A DAT packet: block %s N/A self blocknumber N/A N/A self data N/A N/A s N/A 
    data: %d bytes N/A len N/A self data N/A s N/A encode N/A N/A self N/A N/A N/A Encode the DAT packet. This method populates self.buffer, and
        returns self for easy method chaining. N/A N/A N/A len N/A self data 0 N/A N/A N/A N/A log debug Encoding an empty DAT packet N/A format N/A !HH%ds N/A len N/A self data N/A N/A self buffer N/A N/A struct pack format N/A self opcode N/A self blocknumber N/A self data N/A self N/A decode N/A N/A self N/A N/A N/A Decode self.buffer into instance variables. It returns self for
        easy method chaining. N/A N/A N/A self blocknumber N/A N/A struct unpack !H N/A N/A self buffer N/A 2 4 N/A N/A N/A log debug decoding DAT packet, block number %d N/A self blocknumber N/A N/A N/A log debug should be %d bytes in the packet total N/A len N/A self buffer N/A N/A self data N/A N/A self buffer N/A 4 N/A N/A N/A log debug found %d bytes of data N/A len N/A self data N/A self N/A N/A TftpPacketACK N/A TftpPacket N/A N/A 
::

            2 bytes    2 bytes
            -------------------
    ACK   | 04    |   Block #  |
            --------------------
     __init__ N/A N/A self N/A N/A N/A N/A N/A TftpPacket __init__ self N/A N/A self opcode 4 N/A N/A self blocknumber 0 N/A __str__ N/A N/A self N/A N/A N/A N/A ACK packet: block %d N/A self blocknumber N/A encode N/A N/A self N/A N/A N/A N/A N/A log debug encoding ACK: opcode = %d, block = %d N/A self opcode N/A self blocknumber N/A N/A self buffer N/A N/A struct pack !HH N/A self opcode N/A self blocknumber N/A self N/A decode N/A N/A self N/A N/A N/A N/A N/A len N/A self buffer 4 N/A N/A N/A N/A log debug detected TFTP ACK but request is too large, will truncate N/A N/A N/A log debug buffer was: %s N/A repr N/A self buffer N/A N/A self buffer N/A N/A self buffer N/A 0 4 N/A N/A N/A self opcode N/A self blocknumber N/A N/A struct unpack !HH N/A self buffer N/A N/A N/A log debug decoded ACK packet: opcode = %d, block = %d N/A self opcode N/A self blocknumber N/A self N/A N/A TftpPacketERR N/A TftpPacket N/A N/A 
::

            2 bytes  2 bytes        string    1 byte
            ----------------------------------------
    ERROR | 05    |  ErrorCode |   ErrMsg   |   0  |
            ----------------------------------------

    Error Codes

    Value     Meaning

    0         Not defined, see error message (if any).
    1         File not found.
    2         Access violation.
    3         Disk full or allocation exceeded.
    4         Illegal TFTP operation.
    5         Unknown transfer ID.
    6         File already exists.
    7         No such user.
    8         Failed to negotiate options
     __init__ N/A N/A self N/A N/A N/A N/A N/A TftpPacket __init__ self N/A N/A self opcode 5 N/A N/A self errorcode 0 N/A N/A self errmsg None N/A N/A self errmsgs N/A 1 2 3 4 5 6 7 8 File not found Access violation Disk full or allocation exceeded Illegal TFTP operation Unknown transfer ID File already exists No such user Failed to negotiate options N/A __str__ N/A N/A self N/A N/A N/A s N/A ERR packet: errorcode = %d N/A self errorcode N/A s N/A 
    msg = %s N/A N/A N/A self errmsgs get N/A self errorcode N/A s N/A encode N/A N/A self N/A N/A N/A Encode the DAT packet based on instance variables, populating
        self.buffer, returning self. N/A format N/A !HH%dsx N/A len N/A N/A self errmsgs N/A N/A self errorcode N/A N/A N/A log debug encoding ERR packet with format %s format N/A N/A self buffer N/A N/A struct pack format N/A self opcode N/A self errorcode N/A N/A self errmsgs N/A N/A self errorcode N/A self N/A decode N/A N/A self N/A N/A N/A Decode self.buffer, populating instance variables and return self. N/A buflen N/A len N/A self buffer N/A N/A tftpassert N/A buflen 4 malformed ERR packet, too short N/A N/A N/A log debug Decoding ERR packet, length %s bytes buflen N/A N/A buflen 4 N/A N/A N/A N/A log debug Allowing this affront to the RFC of a 4-byte packet N/A format !HH N/A N/A N/A log debug Decoding ERR packet with format: %s format N/A N/A N/A self opcode N/A self errorcode N/A N/A struct unpack format N/A self buffer N/A N/A N/A N/A log debug Good ERR packet > 4 bytes N/A format N/A !HH%dsx N/A N/A len N/A self buffer 5 N/A N/A N/A log debug Decoding ERR packet with format: %s format N/A N/A N/A self opcode N/A self errorcode N/A self errmsg N/A N/A struct unpack format N/A self buffer N/A N/A N/A log error N/A ERR packet - errorcode: %d, message: %s N/A N/A self errorcode N/A self errmsg N/A self N/A N/A TftpPacketOACK N/A TftpPacket TftpPacketWithOptions N/A N/A 
::

    +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
    |  opc  |  opt1  | 0 | value1 | 0 |  optN  | 0 | valueN | 0 |
    +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
     __init__ N/A N/A self N/A N/A N/A N/A N/A TftpPacket __init__ self N/A N/A N/A TftpPacketWithOptions __init__ self N/A N/A self opcode 6 N/A __str__ N/A N/A self N/A N/A N/A N/A OACK packet:
    options = %s N/A self options N/A encode N/A N/A self N/A N/A N/A format !H N/A options_list N/A N/A N/A N/A log debug in TftpPacketOACK.encode N/A key N/A self options N/A N/A N/A N/A log debug looping on option key %s key N/A N/A N/A log debug value is %s N/A N/A self options N/A key N/A format N/A %dsx N/A len key N/A format N/A %dsx N/A len N/A N/A self options N/A key N/A N/A N/A options_list append key N/A N/A N/A options_list append N/A N/A self options N/A key N/A N/A self buffer N/A N/A struct pack format N/A self opcode options_list N/A self N/A decode N/A N/A self N/A N/A N/A N/A self options N/A N/A self decode_options N/A N/A self buffer N/A 2 N/A self N/A match_options N/A N/A self options N/A N/A N/A This method takes a set of options, and tries to match them with
        its own. It can accept some changes in those options from the server as
        part of a negotiation. Changed or unchanged, it will return a dict of
        the options so that the session can update itself to the negotiated
        options. N/A name N/A self options N/A N/A N/A N/A options has_key name N/A N/A N/A name blksize N/A N/A size N/A int N/A N/A self options N/A name N/A N/A N/A size MIN_BLKSIZE N/A size MAX_BLKSIZE N/A N/A N/A N/A log debug negotiated blksize of %d bytes size N/A N/A TftpException N/A blksize %s option outside allowed range size N/A N/A N/A name tsize N/A N/A size N/A int N/A N/A self options N/A name N/A N/A size 0 N/A N/A TftpException Negative file sizes not supported N/A N/A TftpException N/A Unsupported option: %s name N/A True N/A N/A