directflow¶
DirectFlow management and status module
DirectFlow is a software feature that allows OpenFlow-like rules to be programmed in switch hardware manually. Because a DirectFlow enabled switch allows normal forwarding features to operate, it gives operators a reliable way of building for the exceptional “just this one feature” parts of their network in a flexible manner. This module allows for the management of DirectFlow configuration as well as reactions to changes in status of flows.
-
namespace
eos
-
class
flow_handler
: public eos::base_handler<directflow_mgr, flow_handler>¶ - #include <directflow.h>
Flow handler.
A flow handler is notified when the status of configured flows changes.
Public Functions
-
explicit
flow_handler
(directflow_mgr*)¶
-
inline directflow_mgr *
get_directflow_mgr
() const¶
-
void
watch_all_flows
(bool)¶ Registers this class to receive updates on changes to flow state. Expects a boolean signifying whether notifications should be propagated to this instance or not.
-
void
watch_flow
(std::string const&, bool)¶ Registers this class to receive updates on changes to flow state for the given flow name. Expects the name of the flow to watch and a boolean signifying whether notifications should be propagated to this instance or not.
-
virtual void
on_flow_status
(std::string const&, flow_status_t)¶ Handler called when flow status changes.
-
explicit
-
class
flow_entry_iter_t
: public eos::iter_base<flow_entry_t, flow_entry_iter_impl>¶ - #include <directflow.h>
An iterator providing forwards iteration through the configured flows.
Private Functions
-
explicit
flow_entry_iter_t
(flow_entry_iter_impl*const)¶
Friends
- friend class flow_entry_iter_impl
-
explicit
-
class
directflow_mgr
: public eos::base_mgr<flow_handler, std::string>¶ - #include <directflow.h>
DirectFlow configuration and status manager.
Public Functions
-
virtual
~directflow_mgr
()¶
-
virtual flow_entry_iter_t
flow_entry_iter
() const = 0¶ Iterate across all configured flows.
-
virtual bool
exists
(std::string const&) const = 0¶ Tests for existence of a flow entry with the given name.
-
virtual flow_entry_t
flow_entry
(std::string const&) const = 0¶ Return the flow entry with the given name.
-
virtual void
flow_entry_set
(flow_entry_t const&) = 0¶ Insert or update a flow.
-
virtual flow_status_t
flow_status
(std::string const &name) const = 0¶ Return the status of the given flow.
-
virtual flow_rejected_reason_t
flow_rejected_reason
(std::string const &name) const = 0¶ The reason a flow was not programmed. Only valid if the flow’s status is FLOW_REJECTED
-
virtual flow_counters_t
flow_counters
(std::string const &name) const = 0¶ Return the counters for a flow.
Protected Functions
-
directflow_mgr
()¶
Private Members
-
directflow_mgr
Friends
- friend class flow_handler
-
virtual
-
class
Type definitions in directflow¶
-
namespace
eos
-
Enums
-
enum
flow_status_t
¶ Flow entry status.
Values:
-
enumerator
FLOW_STATUS_UNKNOWN
¶
-
enumerator
FLOW_CREATED
¶ Flow created or modified in hardware.
-
enumerator
FLOW_DELETED
¶ Flow removed from hardware.
-
enumerator
FLOW_REJECTED
¶ Flow not created.
-
enumerator
FLOW_PENDING
¶ Flow requesting hardware resources.
-
enumerator
FLOW_HW_TABLE_PENDING
¶ Flow request submitted for tcam resource entry.
-
enumerator
FLOW_REQUEST_ACCEPTED
¶ Flow request accepted.
-
enumerator
-
enum
flow_rejected_reason_t
¶ Reason why a flow was not successfully created in hardware.
Values:
-
enumerator
FLOW_REJECTED_BAD_MATCH
¶ Flow not created due to bad match criteria.
-
enumerator
FLOW_REJECTED_BAD_ACTION
¶ Flow not created due to bad action criteria.
-
enumerator
FLOW_REJECTED_HW_TABLE_FULL
¶ Flow not created due to insufficient resources.
-
enumerator
FLOW_REJECTED_OTHER
¶ Flow not created for some other reason.
-
enumerator
FLOW_REJECTED_ACTIONS_UNSUPPORTED
¶ Flow not created due to unsupported action set.
-
enumerator
FLOW_REJECTED_TIMEOUT_NOT_SUPPORTED
¶ Flow not created due to unsupported timeouts set.
-
enumerator
-
class
flow_match_field_set_t
¶ - #include <directflow.h>
Defines the set of fields to match on flow.
Public Functions
-
flow_match_field_set_t
()¶
-
void
input_intfs_is
(bool enabled)¶
-
bool
input_intfs
() const¶
-
void
eth_src_is
(bool enabled)¶
-
bool
eth_src
() const¶
-
void
eth_dst_is
(bool enabled)¶
-
bool
eth_dst
() const¶
-
void
eth_type_is
(bool enabled)¶
-
bool
eth_type
() const¶
-
void
vlan_id_is
(bool enabled)¶
-
bool
vlan_id
() const¶
-
void
cos_is
(bool enabled)¶
-
bool
cos
() const¶
-
void
ip_src_is
(bool enabled)¶
-
bool
ip_src
() const¶
-
void
ip_dst_is
(bool enabled)¶
-
bool
ip_dst
() const¶
-
bool
operator==
(flow_match_field_set_t const &other) const¶
-
bool
operator!=
(flow_match_field_set_t const &other) const¶
-
bool
operator<
(flow_match_field_set_t const &other) const¶
-
uint32_t
hash
() const¶ The hash function for type flow_match_field_set_t.
-
void
mix_me
(hash_mix &h) const¶ The hash mix function for type flow_match_field_set_t.
Private Members
-
uint32_t
match_bitset_
¶
Friends
- friend class flow_helper
-
friend std::ostream &
operator<<
(std::ostream &os, const flow_match_field_set_t &obj)¶ A utility stream operator that adds a string representation of flow_match_field_set_t to the ostream.
-
-
class
flow_match_t
¶ - #include <directflow.h>
Match criteria for a flow.
Public Functions
-
flow_match_t
()¶
-
flow_match_t
(const flow_match_t &other)¶
-
flow_match_t &
operator=
(flow_match_t const &other)¶
-
flow_match_t
(flow_match_t &&other) noexcept¶
-
flow_match_t &
operator=
(flow_match_t &&other) noexcept¶
-
flow_match_field_set_t
match_field_set
() const¶ Getter for ‘match_field_set’: the fields to match on.
-
void
match_field_set_is
(flow_match_field_set_t match_field_set)¶ Setter for ‘match_field_set’.
-
std::set<intf_id_t> const &
input_intfs
() const¶ Getter for ‘input_intfs’: the input interfaces to match on.
-
eth_addr_t
eth_src
() const¶ Getter for ‘eth_src’: the source Ethernet address to match on.
-
void
eth_src_is
(eth_addr_t eth_src)¶ Setter for ‘eth_src’.
-
void
eth_src_is
(eth_addr_t src, eth_addr_t mask)¶
-
eth_addr_t
eth_src_mask
() const¶
-
void
eth_src_mask_is
(eth_addr_t eth_src_mask)¶
-
eth_addr_t
eth_dst
() const¶ Getter for ‘eth_dst’: the destination Ethernet address to match on.
-
void
eth_dst_is
(eth_addr_t eth_dst)¶ Setter for ‘eth_dst’.
-
void
eth_dst_is
(eth_addr_t dst, eth_addr_t mask)¶
-
eth_addr_t
eth_dst_mask
() const¶
-
void
eth_dst_mask_is
(eth_addr_t eth_dst_mask)¶
-
eth_type_t
eth_type
() const¶ Getter for ‘eth_type’: the Ethernet type to match on.
-
void
eth_type_is
(eth_type_t eth_type)¶ Setter for ‘eth_type’.
-
cos_t
cos
() const¶ Getter for ‘cos’: the class of service to match on, only used if vlan_id is set to something other than 0.
-
bool
operator==
(flow_match_t const &other) const¶
-
bool
operator!=
(flow_match_t const &other) const¶
-
bool
operator<
(flow_match_t const &other) const¶
-
uint32_t
hash
() const¶ The hash function for type flow_match_t.
-
void
mix_me
(hash_mix &h) const¶ The hash mix function for type flow_match_t.
Public Static Functions
-
static void
operator delete
(void*) noexcept¶
Friends
-
friend std::ostream &
operator<<
(std::ostream &os, const flow_match_t &obj)¶ A utility stream operator that adds a string representation of flow_match_t to the ostream.
-
-
class
flow_action_set_t
¶ - #include <directflow.h>
Defines the set of enabled actions.
Public Functions
-
flow_action_set_t
()¶
-
void
set_output_intfs_is
(bool enabled)¶
-
bool
set_output_intfs
() const¶
-
void
set_vlan_id_is
(bool enabled)¶
-
bool
set_vlan_id
() const¶
-
void
set_cos_is
(bool enabled)¶
-
bool
set_cos
() const¶
-
void
set_eth_src_is
(bool enabled)¶
-
bool
set_eth_src
() const¶
-
void
set_eth_dst_is
(bool enabled)¶
-
bool
set_eth_dst
() const¶
-
void
set_ip_src_is
(bool enabled)¶
-
bool
set_ip_src
() const¶
-
void
set_ip_dst_is
(bool enabled)¶
-
bool
set_ip_dst
() const¶
-
bool
operator==
(flow_action_set_t const &other) const¶
-
bool
operator!=
(flow_action_set_t const &other) const¶
-
uint32_t
hash
() const¶ The hash function for type flow_action_set_t.
-
void
mix_me
(hash_mix &h) const¶ The hash mix function for type flow_action_set_t.
Private Members
-
uint32_t
action_bitset_
¶
Friends
- friend class flow_helper
-
friend std::ostream &
operator<<
(std::ostream &os, const flow_action_set_t &obj)¶ A utility stream operator that adds a string representation of flow_action_set_t to the ostream.
-
-
class
flow_action_t
¶ - #include <directflow.h>
Defines the actions to take on a matching flow.
Public Functions
-
flow_action_t
()¶
-
flow_action_t
(const flow_action_t &other)¶
-
flow_action_t &
operator=
(flow_action_t const &other)¶
-
flow_action_t
(flow_action_t &&other) noexcept¶
-
flow_action_t &
operator=
(flow_action_t &&other) noexcept¶
-
flow_action_set_t
action_set
() const¶ Getter for ‘action_set’: actions that are enabled.
-
void
action_set_is
(flow_action_set_t action_set)¶ Setter for ‘action_set’.
-
std::set<intf_id_t> const &
output_intfs
() const¶ Getter for ‘output_intfs’: 0 or more the output interfaces, passing in the empty set will cause the packet to be dropped.
-
eth_addr_t
eth_src
() const¶ Getter for ‘eth_src’: the source Ethernet address.
-
void
eth_src_is
(eth_addr_t eth_src)¶ Setter for ‘eth_src’.
-
eth_addr_t
eth_dst
() const¶ Getter for ‘eth_dst’: the destination Ethernet address.
-
void
eth_dst_is
(eth_addr_t eth_dst)¶ Setter for ‘eth_dst’.
-
bool
operator==
(flow_action_t const &other) const¶
-
bool
operator!=
(flow_action_t const &other) const¶
-
uint32_t
hash
() const¶ The hash function for type flow_action_t.
-
void
mix_me
(hash_mix &h) const¶ The hash mix function for type flow_action_t.
Public Static Functions
-
static void
operator delete
(void*) noexcept¶
Friends
-
friend std::ostream &
operator<<
(std::ostream &os, const flow_action_t &obj)¶ A utility stream operator that adds a string representation of flow_action_t to the ostream.
-
-
class
flow_entry_t
¶ - #include <directflow.h>
Defines a flow entry.
Public Functions
-
flow_entry_t
()¶
-
flow_entry_t
(std::string const &name, flow_match_t match, flow_action_t action, flow_priority_t priority)¶
-
flow_entry_t
(const flow_entry_t &other)¶
-
flow_entry_t &
operator=
(flow_entry_t const &other)¶
-
flow_entry_t
(flow_entry_t &&other) noexcept¶
-
flow_entry_t &
operator=
(flow_entry_t &&other) noexcept¶
-
flow_match_t
match
() const¶
-
flow_action_t
action
() const¶
-
flow_priority_t
priority
() const¶
-
bool
operator==
(flow_entry_t const &other) const¶
-
bool
operator!=
(flow_entry_t const &other) const¶
-
uint32_t
hash
() const¶ The hash function for type flow_entry_t.
-
void
mix_me
(hash_mix &h) const¶ The hash mix function for type flow_entry_t.
Public Static Functions
-
static void
operator delete
(void*) noexcept¶
Friends
-
friend std::ostream &
operator<<
(std::ostream &os, const flow_entry_t &obj)¶ A utility stream operator that adds a string representation of flow_entry_t to the ostream.
-
-
class
flow_counters_t
¶ - #include <directflow.h>
Defines counters for a flow.
Public Functions
-
flow_counters_t
()¶
-
flow_counters_t
(const flow_counters_t &other)¶
-
flow_counters_t &
operator=
(flow_counters_t const &other)¶
-
flow_counters_t
(flow_counters_t &&other) noexcept¶
-
flow_counters_t &
operator=
(flow_counters_t &&other) noexcept¶
-
uint64_t
bytes
() const¶
-
uint64_t
packets
() const¶
-
bool
operator==
(flow_counters_t const &other) const¶
-
bool
operator!=
(flow_counters_t const &other) const¶
-
uint32_t
hash
() const¶ The hash function for type flow_counters_t.
-
void
mix_me
(hash_mix &h) const¶ The hash mix function for type flow_counters_t.
Public Static Functions
-
static void
operator delete
(void*) noexcept¶
Friends
- friend class flow_helper
-
friend std::ostream &
operator<<
(std::ostream &os, const flow_counters_t &obj)¶ A utility stream operator that adds a string representation of flow_counters_t to the ostream.
-
-
enum