ROFL-hal  v0.6.0dev
of1x_driver.h
Go to the documentation of this file.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 #ifndef OF1X_DRIVER_H
6 #define OF1X_DRIVER_H
7 
8 #include <inttypes.h>
9 #include <rofl/datapath/pipeline/openflow/openflow1x/of1x_switch.h>
10 #include <rofl/datapath/pipeline/openflow/openflow1x/pipeline/of1x_flow_entry.h>
11 #include <rofl/datapath/pipeline/openflow/openflow1x/pipeline/of1x_action.h>
12 #include "../../hal.h"
13 #include "../../hal_utils.h"
14 
22 //C++ extern C
23 HAL_BEGIN_DECLS
24 
33 hal_result_t hal_driver_of1x_set_port_drop_received_config(uint64_t dpid, unsigned int port_num, bool drop_received);
34 
43 hal_result_t hal_driver_of1x_set_port_no_flood_config(uint64_t dpid, unsigned int port_num, bool no_flood);
44 
53 hal_result_t hal_driver_of1x_set_port_forward_config(uint64_t dpid, unsigned int port_num, bool forward);
54 
63 hal_result_t hal_driver_of1x_set_port_generate_packet_in_config(uint64_t dpid, unsigned int port_num, bool generate_packet_in);
64 
73 hal_result_t hal_driver_of1x_set_port_advertise_config(uint64_t dpid, unsigned int port_num, uint32_t advertise);
74 
83 hal_result_t hal_driver_of1x_set_pipeline_config(uint64_t dpid, unsigned int flags, uint16_t miss_send_len);
84 
85 
94 hal_result_t hal_driver_of1x_set_table_config(uint64_t dpid, unsigned int table_id, of1x_flow_table_miss_config_t config);
95 
107 hal_result_t hal_driver_of1x_process_packet_out(uint64_t dpid, uint32_t buffer_id, uint32_t in_port, of1x_action_group_t* action_group, uint8_t* buffer, uint32_t buffer_size);
108 
133 hal_result_t hal_driver_of1x_process_flow_mod_add(uint64_t dpid, uint8_t table_id, of1x_flow_entry_t** flow_entry, uint32_t buffer_id, bool check_overlap, bool reset_counts);
134 
152 hal_result_t hal_driver_of1x_process_flow_mod_modify(uint64_t dpid, uint8_t table_id, of1x_flow_entry_t** flow_entry, uint32_t buffer_id, of1x_flow_removal_strictness_t strictness, bool reset_counts);
153 
154 
175 hal_result_t hal_driver_of1x_process_flow_mod_delete(uint64_t dpid, uint8_t table_id, of1x_flow_entry_t* flow_entry, uint32_t out_port, uint32_t out_group, of1x_flow_removal_strictness_t strictness);
176 
192 of1x_stats_flow_msg_t* hal_driver_of1x_get_flow_stats(uint64_t dpid, uint8_t table_id, uint32_t cookie, uint32_t cookie_mask, uint32_t out_port, uint32_t out_group, of1x_match_group_t *const matches);
193 
209 of1x_stats_flow_aggregate_msg_t* hal_driver_of1x_get_flow_aggregate_stats(uint64_t dpid, uint8_t table_id, uint32_t cookie, uint32_t cookie_mask, uint32_t out_port, uint32_t out_group, of1x_match_group_t *const matches);
210 
220 rofl_of1x_gm_result_t hal_driver_of1x_group_mod_add(uint64_t dpid, of1x_group_type_t type, uint32_t id, of1x_bucket_list_t **buckets);
221 
231 rofl_of1x_gm_result_t hal_driver_of1x_group_mod_modify(uint64_t dpid, of1x_group_type_t type, uint32_t id, of1x_bucket_list_t **buckets);
232 
239 rofl_of1x_gm_result_t hal_driver_of1x_group_mod_delete(uint64_t dpid, uint32_t id);
240 
246 of1x_stats_group_desc_msg_t *hal_driver_of1x_get_group_desc_stats(uint64_t dpid);
247 
254 of1x_stats_group_msg_t* hal_driver_of1x_get_group_stats(uint64_t dpid, uint32_t id);
255 
256 // [+] Add more here..
257 
258 //C++ extern C
259 HAL_END_DECLS
260 
261 
262 #endif /* OF1X_DRIVER_H */
263 
264 
hal_result_t hal_driver_of1x_set_table_config(uint64_t dpid, unsigned int table_id, of1x_flow_table_miss_config_t config)
Instructs driver to set table configuration(default action)
hal_result_t hal_driver_of1x_set_port_forward_config(uint64_t dpid, unsigned int port_num, bool forward)
Instructs driver to modify port config state.
of1x_stats_flow_aggregate_msg_t * hal_driver_of1x_get_flow_aggregate_stats(uint64_t dpid, uint8_t table_id, uint32_t cookie, uint32_t cookie_mask, uint32_t out_port, uint32_t out_group, of1x_match_group_t *const matches)
Recovers the aggregated flow stats given a set of matches.
hal_result_t hal_driver_of1x_set_port_generate_packet_in_config(uint64_t dpid, unsigned int port_num, bool generate_packet_in)
Instructs driver to modify port config state.
hal_result_t hal_driver_of1x_set_port_no_flood_config(uint64_t dpid, unsigned int port_num, bool no_flood)
Instructs driver to modify port config state.
of1x_stats_group_msg_t * hal_driver_of1x_get_group_stats(uint64_t dpid, uint32_t id)
Instructs driver to fetch the GROUP statistics.
hal_result_t hal_driver_of1x_set_pipeline_config(uint64_t dpid, unsigned int flags, uint16_t miss_send_len)
Instructs driver to process a PACKET_OUT event.
rofl_of1x_gm_result_t hal_driver_of1x_group_mod_modify(uint64_t dpid, of1x_group_type_t type, uint32_t id, of1x_bucket_list_t **buckets)
Instructs driver to modify the GROUP with identification ID.
hal_result_t hal_driver_of1x_process_packet_out(uint64_t dpid, uint32_t buffer_id, uint32_t in_port, of1x_action_group_t *action_group, uint8_t *buffer, uint32_t buffer_size)
Instructs driver to process a PACKET_OUT event.
of1x_stats_group_desc_msg_t * hal_driver_of1x_get_group_desc_stats(uint64_t dpid)
Retrieves a copy of the group and bucket structure.
hal_result_t hal_driver_of1x_set_port_advertise_config(uint64_t dpid, unsigned int port_num, uint32_t advertise)
Instructs driver to modify port advertise flags.
of1x_stats_flow_msg_t * hal_driver_of1x_get_flow_stats(uint64_t dpid, uint8_t table_id, uint32_t cookie, uint32_t cookie_mask, uint32_t out_port, uint32_t out_group, of1x_match_group_t *const matches)
Recovers the flow stats given a set of matches.
HAL_BEGIN_DECLS hal_result_t hal_driver_of1x_set_port_drop_received_config(uint64_t dpid, unsigned int port_num, bool drop_received)
Instructs driver to modify port config state.
rofl_of1x_gm_result_t hal_driver_of1x_group_mod_delete(uint64_t dpid, uint32_t id)
Instructs driver to delete the GROUP with identification ID.
rofl_of1x_gm_result_t hal_driver_of1x_group_mod_add(uint64_t dpid, of1x_group_type_t type, uint32_t id, of1x_bucket_list_t **buckets)
Instructs driver to add a new GROUP.
enum hal_result hal_result_t
HAL return values.
hal_result_t hal_driver_of1x_process_flow_mod_delete(uint64_t dpid, uint8_t table_id, of1x_flow_entry_t *flow_entry, uint32_t out_port, uint32_t out_group, of1x_flow_removal_strictness_t strictness)
Instructs driver to process a FLOW_MOD eventThe remove flow entry will remove and destroy any exisiti...
hal_result_t hal_driver_of1x_process_flow_mod_add(uint64_t dpid, uint8_t table_id, of1x_flow_entry_t **flow_entry, uint32_t buffer_id, bool check_overlap, bool reset_counts)
Instructs driver to process a FLOW_MOD add eventThis method will add a flow_entry to the table of the...
hal_result_t hal_driver_of1x_process_flow_mod_modify(uint64_t dpid, uint8_t table_id, of1x_flow_entry_t **flow_entry, uint32_t buffer_id, of1x_flow_removal_strictness_t strictness, bool reset_counts)
Instructs driver to process a FLOW_MOD modify eventThe modify flow entry will modify any exisiting en...