ROFL-hal
v0.6.0dev
|
The HAL driver management APIs are the APIs exposed by the driver that can be consumed to manage the specific device dataplane in a platform agnostic fashion. More...
Modules | |
HAL driver OpenFlow specific management interface | |
HAL driver OpenFlow specific management interface. | |
Data Structures | |
struct | driver_info_t |
Driver information structure. More... | |
Functions | |
HAL_BEGIN_DECLS hal_result_t | hal_driver_init (hal_extension_ops_t *extensions, const char *extra_params) |
Initialises driver. More... | |
void | hal_driver_get_info (driver_info_t *info) |
Get the information of the driver (code-name, version, usage...) More... | |
hal_result_t | hal_driver_destroy (void) |
Destroy driver state. More... | |
monitored_entity_t * | hal_driver_get_chassis_info (void) |
Get the chassis information in the form of a monitored entity. More... | |
bool | hal_driver_switch_exists (uint64_t dpid) |
Switch management functions. More... | |
dpid_list_t * | hal_driver_get_all_lsi_dpids (void) |
Retrieve the list of LSIs dpids. More... | |
hal_result_t | hal_driver_create_switch (char *name, uint64_t dpid, of_version_t of_version, unsigned int num_of_tables, int *ma_list) |
Instruct driver to create an OF logical switch. More... | |
of_switch_snapshot_t * | hal_driver_get_switch_snapshot_by_dpid (uint64_t dpid) |
Retrieves a snapshot of the current state of a switch port, if the port name is found. More... | |
hal_result_t | hal_driver_destroy_switch_by_dpid (uint64_t dpid) |
Instructs the driver to destroy the switch with the specified dpid. More... | |
bool | hal_driver_port_exists (const char *name) |
Checks if a port with the specified name exists. More... | |
switch_port_name_list_t * | hal_driver_get_all_port_names (void) |
Retrieve the list of names of the available ports of the platform. More... | |
switch_port_snapshot_t * | hal_driver_get_port_snapshot_by_name (const char *name) |
Retrieves a snapshot of the current state of a switch port, if the port name is found. More... | |
switch_port_snapshot_t * | hal_driver_get_port_snapshot_by_num (uint64_t dpid, unsigned int port_num) |
Retrieves a snapshot of the current state of the port of the Logical Switch Instance with dpid at port_num, if exists. More... | |
hal_result_t | hal_driver_attach_port_to_switch (uint64_t dpid, const char *name, unsigned int *port_num) |
Attempts to attach a system's port to switch, at port_num if defined, otherwise in the first empty port number. More... | |
hal_result_t | hal_driver_connect_switches (uint64_t dpid_lsi1, unsigned int *port_num1, switch_port_snapshot_t **port1, uint64_t dpid_lsi2, unsigned int *port_num2, switch_port_snapshot_t **port2) |
Attempts to connect two logical switches via a virtual port. More... | |
hal_result_t | hal_driver_detach_port_from_switch (uint64_t dpid, const char *name) |
Detaches a port from the switch. More... | |
hal_result_t | hal_driver_detach_port_from_switch_at_port_num (uint64_t dpid, const unsigned int port_num) |
Detaches port_num of the logical switch identified with dpid. More... | |
hal_result_t | hal_driver_bring_port_up (const char *name) |
Brings up a system's port. More... | |
hal_result_t | hal_driver_bring_port_down (const char *name) |
Brings down a system's port. More... | |
hal_result_t | hal_driver_bring_port_up_by_num (uint64_t dpid, unsigned int port_num) |
Brings up a port from a Logical Switch Instance. More... | |
hal_result_t | hal_driver_bring_port_down_by_num (uint64_t dpid, unsigned int port_num) |
Brings down a port from a Logical Switch Instance. More... | |
monitoring_snapshot_state_t * | hal_driver_get_monitoring_snapshot (uint64_t rev) |
Retrieve a snapshot of the monitoring state. More... | |
hal_result_t | hal_driver_list_matching_algorithms (of_version_t of_version, const char *const **name_list, int *count) |
get a list of available matching algorithms More... | |
The HAL driver management APIs are the APIs exposed by the driver that can be consumed to manage the specific device dataplane in a platform agnostic fashion.
hal_result_t hal_driver_attach_port_to_switch | ( | uint64_t | dpid, |
const char * | name, | ||
unsigned int * | port_num | ||
) |
Attempts to attach a system's port to switch, at port_num if defined, otherwise in the first empty port number.
dpid | Datapath ID of the switch to attach the ports to |
name | Port name (system's name) |
port_num | If *port_num is non-zero, try to attach to port_num of the logical switch, otherwise try to attach to the first available port and return the result in port_num |
hal_result_t hal_driver_bring_port_down | ( | const char * | name | ) |
Brings down a system's port.
The function shall call the CMM with the appropriate port_status_changed message.
name | Port system name |
hal_result_t hal_driver_bring_port_down_by_num | ( | uint64_t | dpid, |
unsigned int | port_num | ||
) |
Brings down a port from a Logical Switch Instance.
The function shall call the CMM with the appropriate port_status_changed message.
dpid | DatapathID |
port_num | Port number |
hal_result_t hal_driver_bring_port_up | ( | const char * | name | ) |
Brings up a system's port.
The function shall call the CMM with the appropriate port_status_changed message.
name | Port system name |
hal_result_t hal_driver_bring_port_up_by_num | ( | uint64_t | dpid, |
unsigned int | port_num | ||
) |
Brings up a port from a Logical Switch Instance.
The function shall call the CMM with the appropriate port_status_changed message.
dpid | DatapathID |
port_num | Port number |
hal_result_t hal_driver_connect_switches | ( | uint64_t | dpid_lsi1, |
unsigned int * | port_num1, | ||
switch_port_snapshot_t ** | port1, | ||
uint64_t | dpid_lsi2, | ||
unsigned int * | port_num2, | ||
switch_port_snapshot_t ** | port2 | ||
) |
Attempts to connect two logical switches via a virtual port.
Driver may or may not support this functionality. On success, the two ports must be functional and process packets and the driver MUST inform the CMM of the new ports via two separate port_add messages, with the appropriate information of attachment of the ports.
dpid_lsi1 | Datapath ID of the LSI1 |
port_num1 | If *port_num is non-zero, try to attach to port_num of the logical switch, otherwise try to attach to the first available port and return the result in port_num |
port1 | A pointer to a snapshot of the virtual port attached to the LS1 that MUST be destroyed using switch_port_destroy_snapshot() |
dpid_lsi2 | Datapath ID of the LSI2 |
port_num2 | If *port_num is non-zero, try to attach to port_num of the logical switch, otherwise try to attach to the first available port and return the result in port_num |
port1 | A pointer to a snapshot of the virtual port attached to the LS2 that MUST be destroyed using switch_port_destroy_snapshot() |
hal_result_t hal_driver_create_switch | ( | char * | name, |
uint64_t | dpid, | ||
of_version_t | of_version, | ||
unsigned int | num_of_tables, | ||
int * | ma_list | ||
) |
Instruct driver to create an OF logical switch.
hal_result_t hal_driver_destroy | ( | void | ) |
Destroy driver state.
Allows platform state to be properly released.
hal_result_t hal_driver_destroy_switch_by_dpid | ( | uint64_t | dpid | ) |
Instructs the driver to destroy the switch with the specified dpid.
hal_result_t hal_driver_detach_port_from_switch | ( | uint64_t | dpid, |
const char * | name | ||
) |
Detaches a port from the switch.
If as a consequence of the detachment of a port, one or more ports are deleted and detached (e.g. virtual ports or links), the driver MUST inform the CMM of these deletions via separate port_delete messages, with the appropriate information of attachment (marked as attached and with a valid dpid).
dpid | Datapath ID of the switch to detach the ports |
name | Port name (system's name) |
hal_result_t hal_driver_detach_port_from_switch_at_port_num | ( | uint64_t | dpid, |
const unsigned int | port_num | ||
) |
Detaches port_num of the logical switch identified with dpid.
dpid | Datapath ID of the switch to detach the ports |
port_num | Port number |
dpid_list_t* hal_driver_get_all_lsi_dpids | ( | void | ) |
Retrieve the list of LSIs dpids.
List | of available dpids, which MUST be deleted using dpid_list_destroy(). |
switch_port_name_list_t* hal_driver_get_all_port_names | ( | void | ) |
Retrieve the list of names of the available ports of the platform.
You may want to call hal_driver_get_port_snapshot_by_name(name) to get more information of the port
List | of available port names, which MUST be deleted using switch_port_name_list_destroy(). |
monitored_entity_t* hal_driver_get_chassis_info | ( | void | ) |
Get the chassis information in the form of a monitored entity.
void hal_driver_get_info | ( | driver_info_t * | info | ) |
Get the information of the driver (code-name, version, usage...)
monitoring_snapshot_state_t* hal_driver_get_monitoring_snapshot | ( | uint64_t | rev | ) |
Retrieve a snapshot of the monitoring state.
If rev is 0, or the current monitoring has changed (monitoring->rev != rev), a new snapshot of the monitoring state is made. Warning: this is expensive.
rev | Last seen revision. Set to 0 to always get a new snapshot |
switch_port_snapshot_t* hal_driver_get_port_snapshot_by_name | ( | const char * | name | ) |
Retrieves a snapshot of the current state of a switch port, if the port name is found.
The snapshot MUST be deleted using switch_port_destroy_snapshot()
switch_port_snapshot_t* hal_driver_get_port_snapshot_by_num | ( | uint64_t | dpid, |
unsigned int | port_num | ||
) |
Retrieves a snapshot of the current state of the port of the Logical Switch Instance with dpid at port_num, if exists.
The snapshot MUST be deleted using switch_port_destroy_snapshot()
dpid | DatapathID |
port_num | Port number |
of_switch_snapshot_t* hal_driver_get_switch_snapshot_by_dpid | ( | uint64_t | dpid | ) |
Retrieves a snapshot of the current state of a switch port, if the port name is found.
The snapshot MUST be deleted using of_switch_destroy_snapshot()
Pointer | to of_switch_snapshot_t instance or NULL |
HAL_BEGIN_DECLS hal_result_t hal_driver_init | ( | hal_extension_ops_t * | extensions, |
const char * | extra_params | ||
) |
Initialises driver.
Before using the HAL_DRIVER routines, higher layers must allow driver to initialise itself
extensions | Driver must set all the function pointers for supported extensions or NULL. If none are supported, struct can be entirely memset to 0. |
extra_params | Driver specific extra parameters string. Refer to the usage for details of this parameter. Most drivers do not use it |
hal_result_t hal_driver_list_matching_algorithms | ( | of_version_t | of_version, |
const char *const ** | name_list, | ||
int * | count | ||
) |
get a list of available matching algorithms
of_version | |
name_list | |
count |
bool hal_driver_port_exists | ( | const char * | name | ) |
Checks if a port with the specified name exists.
bool hal_driver_switch_exists | ( | uint64_t | dpid | ) |
Switch management functions.
All of the functions related to switch creation and destruction port management and other configuration Checks if an LSI with the specified dpid exists