5 #ifndef __PHYSICAL_SWITCH_H__
6 #define __PHYSICAL_SWITCH_H__
95 #ifndef PHYSICAL_SWITCH_MAX_LS
100 #define PHYSICAL_SWITCH_MAX_LS 64
103 #ifndef PHYSICAL_SWITCH_MAX_NUM_PHY_PORTS
108 #define PHYSICAL_SWITCH_MAX_NUM_PHY_PORTS 1024
111 #ifndef PHYSICAL_SWITCH_MAX_NUM_VIR_PORTS
116 #define PHYSICAL_SWITCH_MAX_NUM_VIR_PORTS 256
119 #ifndef PHYSICAL_SWITCH_MAX_NUM_TUN_PORTS
124 #define PHYSICAL_SWITCH_MAX_NUM_TUN_PORTS 32
127 #define PHYSICAL_SWITCH_MAX_NUM_META_PORTS 8
131 typedef void platform_physical_switch_state_t;
158 unsigned int num_of_logical_switches;
174 switch_port_t meta_ports[PHYSICAL_SWITCH_MAX_NUM_META_PORTS];
183 platform_mutex_t* mutex;
186 platform_physical_switch_state_t* platform_state;
195 unsigned int num_of_lsis;
433 return &psw->monitoring;
484 void __physical_switch_generate_matching_algorithm_list(
void);
490 #endif //PHYSICAL_SWITCH
#define PHYSICAL_SWITCH_MAX_NUM_VIR_PORTS
Maximum number of virtual ports.
OpenFlow-enabled switch abstraction (version-indepedent part).
Defines the locking interface used by the library. The user of the library MUST provide an implementa...
struct dpid_list dpid_list_t
List of dpids (snapshots)
rofl_result_t physical_switch_add_logical_switch(of_switch_t *sw)
Add a logical switch to the pool.
ROFL_BEGIN_DECLS rofl_result_t physical_switch_init(void)
Initializes the physical switch.
rofl_result_t physical_switch_detach_all_ports_from_logical_switch(of_switch_t *sw)
Detaches all the ports from the logical switch.
rofl_result_t get_logical_switch_ports(of_switch_t *sw, logical_switch_port_t **ports, unsigned int *num_of_ports, unsigned int *logical_sw_max_ports)
Retrieve the physical port list.
of_switch_t ** physical_switch_get_logical_switches(unsigned int *max_switches)
Retrieves the list of logical switches within the logical switch.
of_switch_snapshot_t * physical_switch_get_logical_switch_snapshot(const uint64_t dpid)
Generates a snapshot of the current running state of a LSI, which can be safely read and iterated ove...
rofl_result_t physical_switch_remove_logical_switch(of_switch_t *sw)
Attemps to remove AND destroy a previously added logical switch from the pool.
Container of the monitoring state.
Port abstraction and API.
void dpid_list_destroy(dpid_list_t *list)
Destroy a previously generated list of dpids.
switch_port_t ** physical_switch_get_virtual_ports(unsigned int *max_ports)
Get the reference to the virtual ports.
switch_port_t * all_meta_port
Special meta port: ALL.
#define PHYSICAL_SWITCH_MAX_NUM_PHY_PORTS
Maximum number of phyisical ports.
rofl_result_t physical_switch_remove_port(const char *name)
Removes and destroys a port from the physical_switch pool referenced by its nameAttempts to remove AN...
rofl_result_t physical_switch_attach_port_to_logical_switch_at_port_num(switch_port_t *port, of_switch_t *sw, unsigned int port_num)
Attaches port to logical switch at port number port_num.
rofl_result_t physical_switch_attach_port_to_logical_switch(switch_port_t *port, of_switch_t *sw, unsigned int *port_num)
Attaches port to logical switch.
#define PHYSICAL_SWITCH_MAX_LS
Maximum number of logical switches that can be instantiated.
rofl_result_t physical_switch_detach_port_num_from_logical_switch(unsigned int port_num, of_switch_t *sw)
Detaches port located at port_num from logical switch sw.
switch_port_t ** physical_switch_get_tunnel_ports(unsigned int *max_ports)
Get the reference to the physical ports.
switch_port_t * physical_switch_get_port_by_name(const char *name)
Retrieve a physical switch port by name.
List of dpids (snapshots)
switch_port_snapshot_t * physical_switch_get_port_snapshot(const char *name)
Gets a snapshot of the current port state, if it exists.
rofl_result_t physical_switch_detach_port_from_logical_switch(switch_port_t *port, of_switch_t *sw)
Detaches port from logical switch sw.
switch_port_t ** physical_switch_get_physical_ports(unsigned int *max_ports)
Get the reference to the physical ports.
physical_switch_t * get_physical_switch(void)
Get the reference to the (unique) physical switch.
Keeps the state of the physical switch (device), including ports and logical switch instances...
struct physical_switch physical_switch_t
Keeps the state of the physical switch (device), including ports and logical switch instances...
of_switch_t * physical_switch_get_logical_switch_by_dpid(const uint64_t dpid)
Attemps to retrieve a logical switch from the pool by its dpid.
rofl_result_t physical_switch_add_port(switch_port_t *port)
Adds a port to the physical_switch pool portAttempts to add a port to the physical switch pool port...
switch_port_t * physical_switch_get_port_by_num(const uint64_t dpid, unsigned int port_num)
Retrieve a port attached to logical switch with dpid at port num.
OpenFlow logical switch meta-abstraction.
void physical_switch_destroy(void)
Destroys the physical switch state.
#define PHYSICAL_SWITCH_MAX_NUM_TUN_PORTS
Maximum number of tunnel ports.
dpid_list_t * physical_switch_get_all_lsi_dpids(void)
Get the list of existing LSI DPIDs.
of_switch_t * physical_switch_get_logical_switch_attached_to_port(const switch_port_t port)
Attemps to retrieve the logical switch attached to the port.
switch_port_t * in_port_meta_port
Special meta port: IN_PORT.
switch_port_name_list_t * physical_switch_get_all_port_names(void)
Gets a list of port names of all (currently) available port names.
rofl_result_t physical_switch_remove_logical_switch_by_dpid(const uint64_t dpid)
Attemps to remove AND destroy a previously added logical switch from the pool by dpid.
switch_port_t * flood_meta_port
Special meta port: FLOOD.
This file contains the abstractions to monitor particular elements of the platform, like sensors or other hardware state.
static monitoring_state_t * physical_switch_get_monitoring(void)
Retrieves the monitoring state of the physicals witch.