ROFL-pipeline  v0.6.0dev
datapacket.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 __DATAPACKET_H__
6 #define __DATAPACKET_H__
7 
8 #include <stdbool.h>
9 #include <sys/time.h>
10 #include "../openflow/of_switch.h"
11 
12 //OF1.X
13 #include "../openflow/openflow1x/pipeline/of1x_action.h"
14 //Add more here...
15 
29 /* Write actions */
30 typedef union of_write_actions{
31  //OF1.X
33  //Add more here...
35 
36 //Typedef to void. This is dependant to the version of the pipeline
37 typedef void platform_datapacket_state_t;
38 
49 typedef struct datapacket{
50 
51  //Packet identifier
52  uint64_t id;
53 
54  //Pointer to the switch which is processing the packet
55  of_switch_t const* sw;
56 
57  //Generic OpenFlow metadata and write actions
58  uint64_t __metadata;
59  of_write_actions_t write_actions;
60 
61  //OpenFlow 1.3 cookie
62  uint64_t __cookie;
63 
68  bool is_replica;
69 
78  platform_datapacket_state_t* platform_state;
79 
81 
82 static inline void __init_packet_metadata(datapacket_t *const pkt){
83  pkt->__metadata = 0ULL;
84  pkt->__cookie = 0ULL;
85 };
86 
87 #endif //DATAPACKET
88 
OpenFlow-enabled switch abstraction (version-indepedent part).
Definition: of_switch.h:55
platform_datapacket_state_t * platform_state
Platform specific state.
Definition: datapacket.h:78
bool is_replica
Flag indicating if it is a replica of the original packet (used for multi-output matches) ...
Definition: datapacket.h:68
Write actions structure.
Definition: of1x_action.h:330
Data packet abstraction.
Definition: datapacket.h:49
struct datapacket datapacket_t
Data packet abstraction.