ait.dsn.cfdp.cfdp module

class ait.dsn.cfdp.cfdp.CFDP(entity_id, *args, **kwargs)

Bases: object

CFDP processor class. Handles sending and receiving of PDUs and management of transactions.

cancel(transaction_id)

Cancel.request – user request to cancel transaction

connect(rcv_host, send_host=None)

Connect to UDP sockets for sending and receiving PDUs. Will only connect to socket for receiving if send socket is not specified.

Args

rcv_host (tuple): (hostname, port) to receive PDUs on. send_host (Optional, tuple): (hostname, port) to send PDUs to, defaults to None.

disconnect()

Close sockets, kill handlers, dump MIB

incoming_pdu_queue = <Queue>
ingest(pdu_path)

Ingest pdu from file

mib = <ait.dsn.cfdp.mib.MIB object>
outgoing_pdu_queue = <Queue>
pdu_counter = 1
put(destination_id, source_path, destination_path, transmission_mode=None)

Initiates a Put request by invoking Transaction Start procedures and Copy File procedures

Other parameters not yet implemented:
  • segmentation control

  • fault handler overrides

  • flow label

  • messages to user

  • filestore requests

report(transaction_id)

Report.request – user request for status report of transaction

resume(transaction_id)

Resume.request – user request to resume transaction

send(pdu)

Send a PDU. Adds the PDU to the outbound queue.

Arguments:
pdu:

An instance of a PDU subclass (EOF, MD, etc)

suspend(transaction_id)

Suspend.request – user request to suspend transaction

transaction_counter = 0
ait.dsn.cfdp.cfdp.read_incoming_pdu(pdu)

Converts PDU binary to the correct type of PDU object

Arguments:
pdu:

An encoded binary string representing a CFDP PDU

ait.dsn.cfdp.cfdp.read_pdus_from_filesys(instance)

Read PDUs that have been written to file (in place of receiving over socket)

ait.dsn.cfdp.cfdp.read_pdus_from_socket(instance)

Read PDUs from a socket over UDP

ait.dsn.cfdp.cfdp.receiving_handler(instance)

Receives incoming PDUs on incoming_pdu_queue and routes them to the intended state machine instance

ait.dsn.cfdp.cfdp.send_to_filesys_handler(instance)

Handler to take PDUs from the outgoing queue and send. Currently writes PDUs to file.

ait.dsn.cfdp.cfdp.send_to_socket_handler(instance)

Handler to take PDUs from the outgoing queue and send over socket.

ait.dsn.cfdp.cfdp.transaction_handler(instance)

Handler to cycle through existing transactions and check timers or prompt sending of PDUs

ait.dsn.cfdp.cfdp.write_outgoing_pdu(pdu, pdu_filename=None, output_directory=None)

Helper function to write pdu to file, in lieu of sending over some other transport layer

Arguments:
pdu:

An instance of a PDU subclass (EOF, MD, etc)

pdu_filename:

Filename to which the PDU will be written. If not specified, defaults to <dest_entity_id>_<current_time>.pdu