nopasaran.primitives.action_primitives.http_2_server_primitives.HTTP2ServerPrimitives

class nopasaran.primitives.action_primitives.http_2_server_primitives.HTTP2ServerPrimitives

Bases: object

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

__init__()

Methods

__init__()

close_http_2_server(inputs, outputs, ...)

Close the HTTP/2 server connection gracefully.

create_http_2_server(inputs, outputs, ...)

Create an instance of HTTP2SocketServer.

receive_client_frames(inputs, outputs, ...)

Receive the client's frames and handle the tests.

send_server_frames(inputs, outputs, ...)

Send the server's frames.

start_http_2_server(inputs, outputs, ...)

Start the HTTP/2 server.

wait_for_client_ack(inputs, outputs, ...)

Wait for the client's SETTINGS_ACK frame.

wait_for_client_preface(inputs, outputs, ...)

Wait for the client's connection preface.

static close_http_2_server(inputs, outputs, state_machine)

Close the HTTP/2 server connection gracefully.

Number of input arguments: 1
  • The HTTP2SocketServer instance

Number of output arguments: 1
  • The event name

static create_http_2_server(inputs, outputs, state_machine)

Create an instance of HTTP2SocketServer.

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_client_frames(inputs, outputs, state_machine)

Receive the client’s frames and handle the tests.

Number of input arguments: 2
  • The HTTP2SocketServer instance

  • The client 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 HTTP2SocketServer 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 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_server_frames(inputs, outputs, state_machine)

Send the server’s frames.

Number of input arguments: 2
  • The HTTP2SocketServer 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 HTTP2SocketServer instance variable

  • The name of the server 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_server(inputs, outputs, state_machine)

Start the HTTP/2 server.

Number of input arguments: 4
  • The HTTP2SocketServer instance

  • The tls_enabled flag

  • The connection settings for the server

  • 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 HTTP2SocketServer 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.ERROR

  • EventNames.SERVER_STARTED

  • EventNames.TIMEOUT

static wait_for_client_ack(inputs, outputs, state_machine)

Wait for the client’s SETTINGS_ACK frame.

Number of input arguments: 1
  • The HTTP2SocketServer 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 HTTP2SocketServer 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_client_preface(inputs, outputs, state_machine)

Wait for the client’s connection preface.

Number of input arguments: 1
  • The HTTP2SocketServer 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 HTTP2SocketServer 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

  • The name of the variable to store the frames received

state_machine: The state machine object.

Returns:

None