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, FTP]

This class implements File Transfer Protocol.

property name: Literal['File Transfer Protocol']

Name of current protocol.

property length: NoReturn

Header length of current protocol.

Raises:

UnsupportedCall – This protocol doesn’t support length.

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(cmmd=None, code=None, args=None, more=False, **kwargs)[source]

Make (construct) packet data.

Parameters:
Return type:

FTP

Returns:

Constructed packet data.

classmethod _make_data(data)[source]

Create key-value pairs from data for protocol construction.

Parameters:

data (FTP) – protocol data

Return type:

dict[str, Any]

Returns:

Key-value pairs for protocol construction.

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

Bases: Raw

This class implements FTP data channel transmission.

property name: Literal['FTP_DATA']

Name of current protocol.

Auxiliary Data

class pcapkit.protocols.application.ftp.Type(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

FTP packet type.

REQUEST = 'request'

Request packet.

RESPONSE = 'response'

Response packet.

static _generate_next_value_(name, start, count, last_values)

Return the lower-cased version of the member name.

Header Schemas

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

Bases: Schema

Header schema for FTP packet.

data: bytes = <BytesField data>

Packet data.

Data Models

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

Bases: Protocol

Data model for FTP protocol.

type: FTP_Type

Type.

class pcapkit.protocols.data.application.ftp.Request(*args: VT, **kwargs: VT)[source]

Bases: FTP

Data model for FTP request.

type: Literal[FTP_Type.REQUEST]

Type.

cmmd: Command

Command.

args: str

Arguments.

class pcapkit.protocols.data.application.ftp.Response(*args: VT, **kwargs: VT)[source]

Bases: FTP

Data model for FTP response.

type: Literal[FTP_Type.RESPONSE]

Type.

code: ReturnCode

Return code.

args: str

Arguments.

more: bool

More data flag.

Footnotes