ROFL-pipeline  v0.6.0dev
of1x_pipeline.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_PIPELINE_H__
6 #define __OF1X_PIPELINE_H__
7 
8 #include <stdlib.h>
9 #include "rofl.h"
10 #include "of1x_flow_table.h"
11 #include "of1x_group_table.h"
12 #include "../../../common/bitmap.h"
13 #include "../../../common/datapacket.h"
14 #include "../../of_switch.h"
15 
16 #define OF1X_MAX_FLOWTABLES 255 //As per 1.2 spec
17 #define OF1X_FLOW_TABLE_ALL 0xFF //As per 1.2 spec
18 #define OF1X_DEFAULT_MISS_SEND_LEN 128 //As per 1.2 spec
19 
31  OF1X_CAP_FLOW_STATS = 1 << 0, /* Flow statistics. */
32  OF1X_CAP_TABLE_STATS = 1 << 1, /* Table statistics. */
33  OF1X_CAP_PORT_STATS = 1 << 2, /* Port statistics. */
34  OF1X_CAP_GROUP_STATS = 1 << 3, /* Group statistics. Added in OF1.1 (caution OF wire protocol collides with STP) */
35  OF1X_CAP_IP_REASM = 1 << 5, /* Can reassemble IP fragments. */
36  OF1X_CAP_QUEUE_STATS = 1 << 6, /* Queue statistics. */
37  OF1X_CAP_ARP_MATCH_IP = 1 << 7, /* Match IP addresses in ARP pkts. Invalid for OF13 */
38  OF1X_CAP_PORT_BLOCKED = 1 << 8, /* Match IP addresses in ARP pkts. Added in OF1.3 */
39 
40  //Deprecated (OF1.0)
41  OF1X_CAP_STP = 1 << 31 /* STP capable switch (OF1.0 ONLY) */
42 };
43 
44 //Fwd declaration
45 struct of1x_switch;
46 
50 typedef struct of1x_pipeline{
51 
52  //Number of tables
53  unsigned int num_of_tables;
54 
55  //Number of buffers
56  unsigned int num_of_buffers;
57 
58  //Capabilities bitmap (OF1X_CAP_FLOW_STATS, OF1X_CAP_TABLE_STATS, ...)
59  bitmap32_t capabilities;
60 
61  //Miss send length
62  uint16_t miss_send_len;
63 
64  //Array of tables;
65  of1x_flow_table_t* tables;
66 
67  //Group table
68  of1x_group_table_t* groups;
69 
70  //Reference back
71  struct of1x_switch* sw;
73 
74 //Snapshot
76 
77 //C++ extern C
78 ROFL_BEGIN_DECLS
79 
80 /* Pipeline mgmt */
81 rofl_result_t __of1x_init_pipeline(struct of1x_switch* sw, const unsigned int num_of_tables, enum of1x_matching_algorithm_available* list);
82 rofl_result_t __of1x_destroy_pipeline(of1x_pipeline_t* pipeline);
83 
84 //Purge of all entries in the pipeline (reset)
85 rofl_result_t __of1x_purge_pipeline_entries(of1x_pipeline_t* pipeline);
86 
87 //Set the default tables(flow and group tables) configuration according to the new version
88 rofl_result_t __of1x_set_pipeline_tables_defaults(of1x_pipeline_t* pipeline, of_version_t version);
89 
90 //
91 // Snapshots
92 //
93 
94 //Creates a snapshot of the running pipeline of an LSI
95 rofl_result_t __of1x_pipeline_get_snapshot(of1x_pipeline_t* pipeline, of1x_pipeline_snapshot_t* snapshot);
96 
97 //Destroy a previously generated snapshot
98 void __of1x_pipeline_destroy_snapshot(of1x_pipeline_snapshot_t* snapshot);
99 
100 
101 //C++ extern C
102 ROFL_END_DECLS
103 
104 #endif //OF1X_PIPELINE
struct of1x_pipeline of1x_pipeline_t
OpenFlow v1.0, 1.2 and 1.3.2 pipeline abstraction data structure.
OpenFlow v1.0, 1.2 and 1.3.2 flow table abstraction.
OpenFlow-enabled v1.0, 1.2 and 1.3.2 switch abstraction.
Definition: of1x_switch.h:28
OpenFlow v1.0, 1.2 and 1.3.2 flow table abstraction.
of1x_capabilities
Capabilities supported by the datapath pipeline.
Definition: of1x_pipeline.h:30
OpenFlow v1.0, 1.2 and 1.3.2 pipeline abstraction data structure.
Definition: of1x_pipeline.h:50
OpenFlow v1.0, 1.2 and 1.3.2 group table subsystem.