package documentation

Library for reading and managing network connections.

From __init__.py:

Function drop_all_connections Flush all connections.
Function drop_connection Drop a connection by its id.
Function list_connections List all network connections.
Function __parse_connection_info Parse the connection information from a flow tag.
Function __parse_meta_connection_tag From a meta tag, extract the connection information.
def drop_all_connections(): (source)

Flush all connections.

Raises:
  • RuntimeError: if command failed to execute.
def drop_connection(connection_id: str): (source)

Drop a connection by its id.

Args:
  • connection_id: id of the connection to drop.
Raises:
  • ValueError: if the connection with the given id is not found.
  • RuntimeError: if the connection could not be dropped.
def list_connections(): (source)

List all network connections.

Returns:
dict of applications and their connections.
def __parse_connection_info(flow: Element) -> dict: (source)

Parse the connection information from a flow tag.

Args:
  • flow: ElementTree.Element with the flow tag.
Returns:
dictionary with the connection information.
def __parse_meta_connection_tag(meta: Element) -> dict: (source)

From a meta tag, extract the connection information.

Args:
  • meta: ElementTree.Element with the meta tag.
Returns:
dictionary with the connection information.