:orphan: .. index:: pair: group; Open vSwitch flow rule handling .. _doxid-group__ovs__flow__rule: Open vSwitch flow rule handling =============================== .. toctree:: :hidden: struct_ovs_flow_rule.rst Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block // typedefs typedef struct :ref:`ovs_flow_rule` :ref:`ovs_flow_rule`; // structs struct :ref:`ovs_flow_rule`; // global functions :ref:`te_errno` :ref:`ovs_flow_rule_parse`(const char* rule_str, :ref:`ovs_flow_rule`* rule); void :ref:`ovs_flow_rule_fini`(:ref:`ovs_flow_rule`* rule); :ref:`te_errno` :ref:`ovs_flow_rule_to_string`(:ref:`ovs_flow_rule`* rule, char** rule_str); :ref:`te_errno` :ref:`ovs_flow_rule_to_ofctl`(:ref:`ovs_flow_rule`* rule, char** rule_str); :ref:`te_errno` :ref:`ovs_flow_rule_str_get_field`(const char* rule, const char* field, const char** value, size_t* value_len); .. _details-group__ovs__flow__rule: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Typedefs -------- .. index:: pair: typedef; ovs_flow_rule .. _doxid-group__ovs__flow__rule_1gad4bb66c9d356027684a86ac7dcf559a2: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`ovs_flow_rule` ovs_flow_rule Open vSwitch flow rule descriptor structure Global Functions ---------------- .. index:: pair: function; ovs_flow_rule_parse .. _doxid-group__ovs__flow__rule_1gab213058ea9979dd0be8c62e0f87868e0: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` ovs_flow_rule_parse(const char* rule_str, :ref:`ovs_flow_rule`* rule) Parse the given string into an Open vSwitch flow rule. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rule_str - Flow rule string representation. * - rule - Flow rule descriptor structure. .. rubric:: Returns: Status code. .. index:: pair: function; ovs_flow_rule_fini .. _doxid-group__ovs__flow__rule_1ga785b0c086e1388e69c15c8beacc1c3db: .. ref-code-block:: cpp :class: doxyrest-title-code-block void ovs_flow_rule_fini(:ref:`ovs_flow_rule`* rule) Free the additional memory used by the flow rule descriptor structure. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rule - Flow rule descriptor structure. .. rubric:: Returns: Nothing. .. index:: pair: function; ovs_flow_rule_to_string .. _doxid-group__ovs__flow__rule_1ga0b0f1b4989ed55d1e836557840382b2b: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` ovs_flow_rule_to_string(:ref:`ovs_flow_rule`* rule, char** rule_str) Format the flow rule including all metadata. The function allocates a memory buffer for the resulting string, it is the user's responsibility to free it. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rule - Flow rule descriptor structure. * - rule_str - Where to store the resulting string. .. rubric:: Returns: Status code. .. index:: pair: function; ovs_flow_rule_to_ofctl .. _doxid-group__ovs__flow__rule_1gab94ee6d487dbd1c5657d796a2f760797: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` ovs_flow_rule_to_ofctl(:ref:`ovs_flow_rule`* rule, char** rule_str) Format the flow rule according to Open vSwitch's ovs-ofctl expectations. The function allocates a memory buffer for the resulting string, it is the user's responsibility to free it. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rule - Flow rule descriptor structure. * - rule_str - Where to store the resulting string. .. rubric:: Returns: Status code. .. index:: pair: function; ovs_flow_rule_str_get_field .. _doxid-group__ovs__flow__rule_1ga3a837467360a7919e6c0394f12a56918: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` ovs_flow_rule_str_get_field(const char* rule, const char* field, const char** value, size_t* value_len) Given a string representation of some flow rule, extract the value of the field with user-provided name. The function does not allocate anything, the value pointer is guaranteed to be within the same string buffer or NULL. If present, the mask will be included in the result. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rule - Flow rule in string form. * - field - Field whose value needs to be extracted. * - value - Value start address. * - value_len - Length of the value. .. rubric:: Returns: Status code.