nopasaran.primitives.action_primitives.http_2_client_primitives.HTTP2ClientPrimitives

class nopasaran.primitives.action_primitives.http_2_client_primitives.HTTP2ClientPrimitives

Bases: object

Class containing HTTP/2 client action primitives for the state machine.

__init__()

Methods

__init__()

close_http_2_client(inputs, outputs, ...)

Close the HTTP/2 client connection gracefully.

create_http_2_client(inputs, outputs, ...)

Create an instance of HTTP2SocketClient. Number of input arguments: 2 - The host - The port.

receive_server_frames(inputs, outputs, ...)

Wait for server's frames.

send_client_frames(inputs, outputs, ...)

Send frames to the server.

start_http_2_client(inputs, outputs, ...)

Start the HTTP/2 client.

wait_for_server_ack(inputs, outputs, ...)

Wait for the server's SETTINGS_ACK frame.

wait_for_server_preface(inputs, outputs, ...)

Wait for the server's SETTINGS frame.

static close_http_2_client(inputs, outputs, state_machine)

Close the HTTP/2 client connection gracefully.

Number of input arguments: 1
  • The HTTP2SocketClient instance

Number of output arguments: 1
  • The event name

static create_http_2_client(inputs, outputs, state_machine)

Create an instance of HTTP2SocketClient. Number of input arguments: 2

  • The host

  • The port

Number of output arguments: 1
  • The created HTTP2SocketServer instance

Args:

inputs (List[str]): The list of input variable names. No input arguments for this method.

outputs (List[str]): The list of output variable names. It contains one output argument:
  • The name of the variable to store the HTTP2SocketServer instance.

state_machine: The state machine object.

Returns:

None

static receive_server_frames(inputs, outputs, state_machine)

Wait for server’s frames.

Number of input arguments: 2
  • The HTTP2SocketClient instance

  • The server frames to receive

Number of output arguments: 3
  • The event name

  • The message

  • The frames received

Args:
inputs (List[str]): The list of input variable names containing:
  • The name of the HTTP2SocketClient instance variable

  • The name of the server frames variable

outputs (List[str]): The list of output variable names. It contains three output arguments:
  • The name of the variable to store the event name

  • The name of the variable to store the message

  • The name of the variable to store the frames received

state_machine: The state machine object.

Returns:

None

Possible events:
  • EventNames.TIMEOUT

  • EventNames.RESET_RECEIVED

  • EventNames.GOAWAY_RECEIVED

  • EventNames.REJECTED

  • EventNames.RECEIVED_FRAMES

static send_client_frames(inputs, outputs, state_machine)

Send frames to the server.

Number of input arguments: 2
  • The HTTP2SocketClient instance

  • The frames to send

Number of output arguments: 3
  • The event name

  • The frames sent

  • The message

Args:
inputs (List[str]): The list of input variable names containing:
  • The name of the HTTP2SocketClient instance variable

  • The name of the client frames variable

outputs (List[str]): The list of output variable names. It contains two output arguments:
  • The name of the variable to store the event name

  • The name of the variable to store the frames sent

  • The name of the variable to store the message

state_machine: The state machine object.

Returns:

None

Possible events:
  • EventNames.FRAMES_SENT

  • EventNames.GOAWAY_RECEIVED

  • EventNames.RESET_RECEIVED

  • EventNames.REJECTED

static start_http_2_client(inputs, outputs, state_machine)

Start the HTTP/2 client.

Number of input arguments: 4
  • The HTTP2SocketClient instance

  • The tls_enabled flag

  • The connection settings for the client

  • The cloudflare_origin flag

Number of output arguments: 2
  • The event name

  • The message

Args:
inputs (List[str]): The list of input variable names containing:
  • The name of the HTTP2SocketClient instance variable

  • The name of the tls_enabled flag variable

  • The name of the connection settings variable

  • The name of the cloudflare_origin flag variable

outputs (List[str]): The list of output variable names. It contains two output arguments:
  • The name of the variable to store the event name

  • The name of the variable to store the message

state_machine: The state machine object.

Returns:

None

Possible events:
  • EventNames.TIMEOUT

  • EventNames.ERROR

  • EventNames.REJECTED

  • EventNames.CLIENT_STARTED

static wait_for_server_ack(inputs, outputs, state_machine)

Wait for the server’s SETTINGS_ACK frame.

Number of input arguments: 1
  • The HTTP2SocketClient instance

Number of output arguments: 2
  • The event name

  • The message

Args:
inputs (List[str]): The list of input variable names containing:
  • The name of the HTTP2SocketClient instance variable

outputs (List[str]): The list of output variable names. It contains two output arguments:
  • The name of the variable to store the event name

  • The name of the variable to store the message

state_machine: The state machine object.

Returns:

None

static wait_for_server_preface(inputs, outputs, state_machine)

Wait for the server’s SETTINGS frame.

Number of input arguments: 1
  • The HTTP2SocketClient instance

Number of output arguments: 3
  • The event name

  • The message

  • The frames received

Args:
inputs (List[str]): The list of input variable names containing:
  • The name of the HTTP2SocketClient instance variable

outputs (List[str]): The list of output variable names. It contains three output arguments:
  • The name of the variable to store the event name

  • The name of the variable to store the message

  • The name of the variable to store the frames received

state_machine: The state machine object.

Returns:

None