FTP - File Transfer Protocol

pcapkit.protocols.application.ftp contains FTP only, which implements extractor for File Transfer Protocol (FTP) *.

class pcapkit.protocols.application.ftp.FTP(file=None, length=None, **kwargs)[source]

Bases: Application[FTP]

This class implements File Transfer Protocol.

Parameters
  • *args (Any) – Arbitrary positional arguments.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type

Protocol[PT]

property name: Literal['File Transfer Protocol']

Name of current protocol.

Return type

Literal[‘File Transfer Protocol’]

property length: NoReturn

Header length of current protocol.

Raises

UnsupportedCall – This protocol doesn’t support length.

Return type

NoReturn

read(length=None, **kwargs)[source]

Read File Transfer Protocol (FTP).

Parameters
  • length (Optional[int]) – Length of packet data.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type

FTP

Returns

Parsed packet data.

Raises

ProtocolError – If the packet is malformed.

make(**kwargs)[source]

Make (construct) packet data.

Parameters
  • arguments. (Arbitrary keyword) –

  • kwargs (Any) –

Return type

NoReturn

Returns

Constructed packet data.

Data Structures

class pcapkit.protocols.data.application.ftp.FTP(type)[source]

Bases: Info

Data model for FTP protocol.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

type: Literal['response', 'request']

Type.

class pcapkit.protocols.data.application.ftp.Request(type, command, arg, raw)[source]

Bases: FTP

Data model for FTP request.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

type: Literal['request']

Type.

command: CommandType

Command.

arg: Optional[str]

Arguments.

raw: Optional[bytes]

Raw data.

class pcapkit.protocols.data.application.ftp.Response(type, code, arg, mf, raw)[source]

Bases: FTP

Data model for FTP response.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

type: Literal['response']

Type.

code: ReturnCode

Return code.

arg: Optional[str]

Arguments.

mf: bool

More data flag.

raw: Optional[bytes]

Raw data.


*

https://en.wikipedia.org/wiki/File_Transfer_Protocol