scapy.layers.tftp

TFTP (Trivial File Transfer Protocol).

class scapy.layers.tftp.TFTP(_pkt, /, *, op=1)[source]

Bases: scapy.packet.Packet

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               OP              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                            Fig. TFTP                             
TFTP fields

op

ShortEnumField

1

payload_guess

Possible sublayers: TFTP_ACK, TFTP_DATA, TFTP_ERROR, TFTP_OACK, TFTP_RRQ, TFTP_WRQ

class scapy.layers.tftp.TFTP_ACK(_pkt, /, *, block=0)[source]

Bases: scapy.packet.Packet

aliastypes
answers(other)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             BLOCK             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                          Fig. TFTP_ACK                           
TFTP_ACK fields

block

ShortField

0

mysummary()[source]
class scapy.layers.tftp.TFTP_DATA(_pkt, /, *, block=0)[source]

Bases: scapy.packet.Packet

aliastypes
answers(other)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             BLOCK             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                          Fig. TFTP_DATA                          
TFTP_DATA fields

block

ShortField

0

mysummary()[source]
class scapy.layers.tftp.TFTP_ERROR(_pkt, /, *, errorcode=0, errormsg=b'')[source]

Bases: scapy.packet.Packet

aliastypes
answers(other)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           ERRORCODE           |            ERRORMSG           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                         Fig. TFTP_ERROR                          
TFTP_ERROR fields

errorcode

ShortEnumField

0

errormsg

StrNullField

b''

mysummary()[source]
class scapy.layers.tftp.TFTP_OACK(_pkt, /)[source]

Bases: scapy.packet.Packet

aliastypes
answers(other)[source]
fields_desc
payload_guess

Possible sublayers: TFTP_Options

class scapy.layers.tftp.TFTP_Option(_pkt, /, *, oname=b'', value=b'')[source]

Bases: scapy.packet.Packet

aliastypes
extract_padding(pkt)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             ONAME             |             VALUE             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                         Fig. TFTP_Option                         
TFTP_Option fields

oname

StrNullField

b''

value

StrNullField

b''

class scapy.layers.tftp.TFTP_Options(_pkt, /, *, options=[])[source]

Bases: scapy.packet.Packet

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            OPTIONS            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                        Fig. TFTP_Options                         
TFTP_Options fields

options

PacketListField

[]

class scapy.layers.tftp.TFTP_RRQ(_pkt, /, *, filename=b'', mode=b'octet')[source]

Bases: scapy.packet.Packet

aliastypes
answers(other)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            FILENAME           |              MODE             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                          Fig. TFTP_RRQ                           
TFTP_RRQ fields

filename

StrNullField

b''

mode

StrNullField

b'octet'

mysummary()[source]
payload_guess

Possible sublayers: TFTP_Options

class scapy.layers.tftp.TFTP_RRQ_server(self, store=None, joker=None, dir=None, ip=None, sport=None, serve_one=False, **kargs)[source]

Bases: scapy.automaton.Automaton

END(*args, **kargs)[source]
RECEIVED_ACK(*args, **kargs)[source]
RECEIVED_RRQ(*args, **kargs)[source]
SEND_FILE(*args, **kargs)[source]
WAIT_RRQ(*args, **kargs)[source]
actions = {'data_remaining': [], 'file_in_store': [], 'file_not_found': [<function TFTP_RRQ_server.send_error>], 'no_more_data': [], 'receive_rrq': [], 'received_ack': [], 'timeout_waiting_ack': []}
conditions = {'END': [], 'RECEIVED_ACK': [<function TFTP_RRQ_server.no_more_data>, <function TFTP_RRQ_server.data_remaining>], 'RECEIVED_RRQ': [<function TFTP_RRQ_server.file_in_store>, <function TFTP_RRQ_server.file_not_found>], 'SEND_FILE': [], 'WAIT_RRQ': []}
data_remaining()[source]
file_in_store()[source]
file_not_found()[source]
initial_states = [<function ATMT.state.<locals>.deco.<locals>._state_wrapper>]
ioevents = {'END': [], 'RECEIVED_ACK': [], 'RECEIVED_RRQ': [], 'SEND_FILE': [], 'WAIT_RRQ': []}
ionames = []
iosupersockets = []
master_filter(pkt)[source]
no_more_data()[source]
parse_args(store=None, joker=None, dir=None, ip=None, sport=None, serve_one=False, **kargs)[source]
receive_rrq(pkt)[source]
received_ack(pkt)[source]
recv_conditions = {'END': [], 'RECEIVED_ACK': [], 'RECEIVED_RRQ': [], 'SEND_FILE': [<function TFTP_RRQ_server.received_ack>], 'WAIT_RRQ': [<function TFTP_RRQ_server.receive_rrq>]}
send_error()[source]
states = {'END': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>, 'RECEIVED_ACK': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>, 'RECEIVED_RRQ': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>, 'SEND_FILE': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>, 'WAIT_RRQ': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>}
stop_states = []
timeout = {'END': [(None, None)], 'RECEIVED_ACK': [(None, None)], 'RECEIVED_RRQ': [(None, None)], 'SEND_FILE': [(3, <function TFTP_RRQ_server.timeout_waiting_ack>), (None, None)], 'WAIT_RRQ': [(None, None)]}
timeout_waiting_ack()[source]
class scapy.layers.tftp.TFTP_WRQ(_pkt, /, *, filename=b'', mode=b'octet')[source]

Bases: scapy.packet.Packet

aliastypes
answers(other)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            FILENAME           |              MODE             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                          Fig. TFTP_WRQ                           
TFTP_WRQ fields

filename

StrNullField

b''

mode

StrNullField

b'octet'

mysummary()[source]
payload_guess

Possible sublayers: TFTP_Options

class scapy.layers.tftp.TFTP_WRQ_server(self, ip=None, sport=None, *args, **kargs)[source]

Bases: scapy.automaton.Automaton

BEGIN(*args, **kargs)[source]
DATA(*args, **kargs)[source]
END(*args, **kargs)[source]
WAIT_DATA(*args, **kargs)[source]
ack_WRQ(pkt)[source]
ack_data()[source]
actions = {'receive_WRQ': [<function TFTP_WRQ_server.ack_WRQ>], 'receive_data': [<function TFTP_WRQ_server.ack_data>], 'resend_ack': []}
conditions = {'BEGIN': [], 'DATA': [], 'END': [], 'WAIT_DATA': []}
initial_states = [<function ATMT.state.<locals>.deco.<locals>._state_wrapper>]
ioevents = {'BEGIN': [], 'DATA': [], 'END': [], 'WAIT_DATA': []}
ionames = []
iosupersockets = []
master_filter(pkt)[source]
parse_args(ip=None, sport=None, *args, **kargs)[source]
receive_WRQ(pkt)[source]
receive_data(pkt)[source]
recv_conditions = {'BEGIN': [<function TFTP_WRQ_server.receive_WRQ>], 'DATA': [], 'END': [], 'WAIT_DATA': [<function TFTP_WRQ_server.receive_data>]}
resend_ack()[source]
states = {'BEGIN': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>, 'DATA': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>, 'END': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>, 'WAIT_DATA': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>}
stop_states = []
timeout = {'BEGIN': [(None, None)], 'DATA': [(None, None)], 'END': [(None, None)], 'WAIT_DATA': [(1, <function TFTP_WRQ_server.resend_ack>), (None, None)]}
class scapy.layers.tftp.TFTP_read(self, filename, server, sport=None, port=69, **kargs)[source]

Bases: scapy.automaton.Automaton

BEGIN(*args, **kargs)[source]
END(*args, **kargs)[source]
ERROR(*args, **kargs)[source]
RECEIVING(*args, **kargs)[source]
WAITING(*args, **kargs)[source]
actions = {'receive_data': [<function TFTP_read.send_ack>], 'receive_error': [], 'timeout_waiting': [<function TFTP_read.retransmit_last_packet>]}
conditions = {'BEGIN': [], 'END': [], 'ERROR': [], 'RECEIVING': [], 'WAITING': []}
initial_states = [<function ATMT.state.<locals>.deco.<locals>._state_wrapper>]
ioevents = {'BEGIN': [], 'END': [], 'ERROR': [], 'RECEIVING': [], 'WAITING': []}
ionames = []
iosupersockets = []
master_filter(pkt)[source]
parse_args(filename, server, sport=None, port=69, **kargs)[source]
receive_data(pkt)[source]
receive_error(pkt)[source]
recv_conditions = {'BEGIN': [], 'END': [], 'ERROR': [], 'RECEIVING': [], 'WAITING': [<function TFTP_read.receive_data>, <function TFTP_read.receive_error>]}
retransmit_last_packet()[source]
send_ack()[source]
states = {'BEGIN': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>, 'END': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>, 'ERROR': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>, 'RECEIVING': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>, 'WAITING': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>}
stop_states = []
timeout = {'BEGIN': [(None, None)], 'END': [(None, None)], 'ERROR': [(None, None)], 'RECEIVING': [(None, None)], 'WAITING': [(3, <function TFTP_read.timeout_waiting>), (None, None)]}
timeout_waiting()[source]
class scapy.layers.tftp.TFTP_write(self, filename, data, server, sport=None, port=69, **kargs)[source]

Bases: scapy.automaton.Automaton

BEGIN(*args, **kargs)[source]
END(*args, **kargs)[source]
ERROR(*args, **kargs)[source]
SEND_DATA(*args, **kargs)[source]
WAITING_ACK(*args, **kargs)[source]
actions = {'received_ack': [], 'received_error': [], 'timeout_waiting': [<function TFTP_write.retransmit_last_packet>]}
conditions = {'BEGIN': [], 'END': [], 'ERROR': [], 'SEND_DATA': [], 'WAITING_ACK': []}
initial_states = [<function ATMT.state.<locals>.deco.<locals>._state_wrapper>]
ioevents = {'BEGIN': [], 'END': [], 'ERROR': [], 'SEND_DATA': [], 'WAITING_ACK': []}
ionames = []
iosupersockets = []
master_filter(pkt)[source]
parse_args(filename, data, server, sport=None, port=69, **kargs)[source]
received_ack(pkt)[source]
received_error(pkt)[source]
recv_conditions = {'BEGIN': [], 'END': [], 'ERROR': [], 'SEND_DATA': [], 'WAITING_ACK': [<function TFTP_write.received_ack>, <function TFTP_write.received_error>]}
retransmit_last_packet()[source]
states = {'BEGIN': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>, 'END': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>, 'ERROR': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>, 'SEND_DATA': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>, 'WAITING_ACK': <function ATMT.state.<locals>.deco.<locals>._state_wrapper>}
stop_states = []
timeout = {'BEGIN': [(None, None)], 'END': [(None, None)], 'ERROR': [(None, None)], 'SEND_DATA': [(None, None)], 'WAITING_ACK': [(3, <function TFTP_write.timeout_waiting>), (None, None)]}
timeout_waiting()[source]