scapy.layers.tftp module

TFTP (Trivial File Transfer Protocol).

class scapy.layers.tftp.TFTP

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.tftp.TFTP'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (TFTP).op>]
payload_guess = [({'op': 1}, <class 'scapy.layers.tftp.TFTP_RRQ'>), ({'op': 2}, <class 'scapy.layers.tftp.TFTP_WRQ'>), ({'op': 3}, <class 'scapy.layers.tftp.TFTP_DATA'>), ({'op': 4}, <class 'scapy.layers.tftp.TFTP_ACK'>), ({'op': 5}, <class 'scapy.layers.tftp.TFTP_ERROR'>), ({'op': 6}, <class 'scapy.layers.tftp.TFTP_OACK'>)]
class scapy.layers.tftp.TFTP_ACK

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.tftp.TFTP_ACK'>, <class 'scapy.packet.Packet'>]
answers(other)

DEV: true if self is an answer from other

fields_desc = [<Field (TFTP_ACK).block>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.layers.tftp.TFTP_DATA

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.tftp.TFTP_DATA'>, <class 'scapy.packet.Packet'>]
answers(other)

DEV: true if self is an answer from other

fields_desc = [<Field (TFTP_DATA).block>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.layers.tftp.TFTP_ERROR

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.tftp.TFTP_ERROR'>, <class 'scapy.packet.Packet'>]
answers(other)

DEV: true if self is an answer from other

fields_desc = [<Field (TFTP_ERROR).errorcode>, <Field (TFTP_ERROR).errormsg>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.layers.tftp.TFTP_OACK

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.tftp.TFTP_OACK'>, <class 'scapy.packet.Packet'>]
answers(other)

DEV: true if self is an answer from other

fields_desc = []
payload_guess = [({}, <class 'scapy.layers.tftp.TFTP_Options'>)]
class scapy.layers.tftp.TFTP_Option

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.tftp.TFTP_Option'>, <class 'scapy.packet.Packet'>]
extract_padding(pkt)

DEV: to be overloaded to extract current layer’s padding.

Parameters:s (str) – the current layer
Returns:a couple of strings (actual layer, padding)
fields_desc = [<Field (TFTP_Option).oname>, <Field (TFTP_Option).value>]
class scapy.layers.tftp.TFTP_Options

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.tftp.TFTP_Options'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (TFTP_Options).options>]
class scapy.layers.tftp.TFTP_RRQ

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.tftp.TFTP_RRQ'>, <class 'scapy.packet.Packet'>]
answers(other)

DEV: true if self is an answer from other

fields_desc = [<Field (TFTP_RRQ).filename>, <Field (TFTP_RRQ).mode>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

payload_guess = [({}, <class 'scapy.layers.tftp.TFTP_Options'>)]
class scapy.layers.tftp.TFTP_RRQ_server(*args, **kargs)

Bases: scapy.automaton.Automaton

END(*args, **kargs)
RECEIVED_ACK(*args, **kargs)
RECEIVED_RRQ(*args, **kargs)
SEND_FILE(*args, **kargs)
WAIT_RRQ(*args, **kargs)
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()
file_in_store()
file_not_found()
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)
no_more_data()
parse_args(store=None, joker=None, dir=None, ip=None, sport=None, serve_one=False, **kargs)
receive_rrq(pkt)
received_ack(pkt)
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()
state = None
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>}
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()
class scapy.layers.tftp.TFTP_WRQ

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.tftp.TFTP_WRQ'>, <class 'scapy.packet.Packet'>]
answers(other)

DEV: true if self is an answer from other

fields_desc = [<Field (TFTP_WRQ).filename>, <Field (TFTP_WRQ).mode>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

payload_guess = [({}, <class 'scapy.layers.tftp.TFTP_Options'>)]
class scapy.layers.tftp.TFTP_WRQ_server(*args, **kargs)

Bases: scapy.automaton.Automaton

BEGIN(*args, **kargs)
DATA(*args, **kargs)
END(*args, **kargs)
WAIT_DATA(*args, **kargs)
ack_WRQ(pkt)
ack_data()
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)
parse_args(ip=None, sport=None, *args, **kargs)
receive_WRQ(pkt)
receive_data(pkt)
recv_conditions = {'BEGIN': [<function TFTP_WRQ_server.receive_WRQ>], 'DATA': [], 'END': [], 'WAIT_DATA': [<function TFTP_WRQ_server.receive_data>]}
resend_ack()
state = None
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>}
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(*args, **kargs)

Bases: scapy.automaton.Automaton

BEGIN(*args, **kargs)
END(*args, **kargs)
ERROR(*args, **kargs)
RECEIVING(*args, **kargs)
WAITING(*args, **kargs)
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)
parse_args(filename, server, sport=None, port=69, **kargs)
receive_data(pkt)
receive_error(pkt)
recv_conditions = {'BEGIN': [], 'END': [], 'ERROR': [], 'RECEIVING': [], 'WAITING': [<function TFTP_read.receive_data>, <function TFTP_read.receive_error>]}
retransmit_last_packet()
send_ack()
state = None
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>}
timeout = {'BEGIN': [(None, None)], 'END': [(None, None)], 'ERROR': [(None, None)], 'RECEIVING': [(None, None)], 'WAITING': [(3, <function TFTP_read.timeout_waiting>), (None, None)]}
timeout_waiting()
class scapy.layers.tftp.TFTP_write(*args, **kargs)

Bases: scapy.automaton.Automaton

BEGIN(*args, **kargs)
END(*args, **kargs)
ERROR(*args, **kargs)
SEND_DATA(*args, **kargs)
WAITING_ACK(*args, **kargs)
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)
parse_args(filename, data, server, sport=None, port=69, **kargs)
received_ack(pkt)
received_error(pkt)
recv_conditions = {'BEGIN': [], 'END': [], 'ERROR': [], 'SEND_DATA': [], 'WAITING_ACK': [<function TFTP_write.received_ack>, <function TFTP_write.received_error>]}
retransmit_last_packet()
state = None
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>}
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()