ROFL-pipeline  v0.6.0dev
of_switch_pp.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 __OF_SWITCH_PP_H__
6 #define __OF_SWITCH_PP_H__
7 
8 #include <inttypes.h>
9 #include "rofl.h"
10 #include "../util/pp_guard.h" //Never forget to include the guard
11 #include "of_switch.h"
13 
14 #include "../util/logging.h"
15 
23 //C++ extern C
24 ROFL_BEGIN_DECLS
25 
26 //Wrapping of processing
48 static inline rofl_result_t of_process_packet_pipeline(const unsigned int tid, const of_switch_t* sw, struct datapacket *const pkt){
49 
50 #ifdef DEBUG
51  if(unlikely(tid >= ROFL_PIPELINE_MAX_TIDS)){
52  ROFL_PIPELINE_ERR("Invalid tid: %ui. ROFL_PIPELINE_MAX_TIDS is %u\n", tid, ROFL_PIPELINE_MAX_TIDS);
53  assert(0);
54  }
55 #endif
56 
57  __of1x_process_packet_pipeline(tid, sw, pkt);
58  /*
59  //Not necessary yet
60 
61  switch(sw->of_ver){
62  case OF_VERSION_10:
63  case OF_VERSION_12:
64  case OF_VERSION_13:
65  __of1x_process_packet_pipeline(sw, pkt);
66  break;
67  default:
68  return ROFL_FAILURE;
69  }
70  */
71  return ROFL_SUCCESS;
72 }
73 
74 //C++ extern C
75 ROFL_END_DECLS
76 
77 #endif //OF_SWITCH_PP
OpenFlow-enabled switch abstraction (version-indepedent part).
Definition: of_switch.h:55
Data packet abstraction.
Definition: datapacket.h:49
OpenFlow logical switch meta-abstraction.
OpenFlow v1.0, 1.2 and 1.3.2 pipeline packet processing routines.
static ROFL_BEGIN_DECLS rofl_result_t of_process_packet_pipeline(const unsigned int tid, const of_switch_t *sw, struct datapacket *const pkt)
Processes a packet through the OpenFlow pipeline.
Definition: of_switch_pp.h:48