ROFL-pipeline  v0.6.0dev
Data Structures | Macros | Typedefs | Enumerations
of1x_utils.h File Reference
#include <inttypes.h>
#include "../../of_switch.h"

Go to the source code of this file.

Data Structures

struct  of1x_ver_req_t
 

Macros

#define OF1X_MIN_VERSION   OF_VERSION_10
 
#define OF1X_MAX_VERSION   OF_VERSION_13
 
#define OF1X_BIT0_MASK   1<<0
 
#define OF1X_BIT1_MASK   1<<1
 
#define OF1X_BIT2_MASK   1<<2
 
#define OF1X_BIT3_MASK   1<<3
 
#define OF1X_BIT4_MASK   1<<4
 
#define OF1X_BIT5_MASK   1<<5
 
#define OF1X_BIT6_MASK   1<<6
 
#define OF1X_BIT7_MASK   1<<7
 
#define OF1X_4MSBITS_MASK   0xF0
 
#define OF1X_4LSBITS_MASK   0x0F
 
#define OF1X_6MSBITS_MASK   0xFC
 
#define OF1X_2LSBITS_MASK   0x03
 
#define OF1X_3LSBITS_MASK   0x07
 
#define OF1X_3MSBITS_MASK   0xE0
 
#define OF1X_2MSBITS_MASK   0xC0
 
#define OF1X_6LSBITS_MASK   0x3F
 
#define OF1X_BITS_2AND3_MASK   0x30
 
#define OF1X_BITS_4AND5_MASK   0x30
 
#define OF1X_BITS_12AND3_MASK   0x0E
 
#define OF1X_SHIFT_LEFT(x, y)   (x<<y)
 
#define OF1X_SHIFT_RIGHT(x, y)   (x>>y)
 
#define OF1X_SWAP_AND_SHIFT_64(x, y)
 
#define OF1X_MAC_ALIGN(x)   OF1X_SHIFT_LEFT(x, 16)
 ALIGNING FUNCTIONS FOR THE PROTOCOL VALUES ///. More...
 
#define OF1X_MAC_VALUE(x)   OF1X_SHIFT_RIGHT(x, 16)
 
#define OF1X_VLAN_PCP_ALIGN(x)   OF1X_SHIFT_LEFT(x, 5)
 
#define OF1X_VLAN_PCP_VALUE(x)   OF1X_SHIFT_RIGHT(x, 5)
 
#define OF1X_MPLS_LABEL_ALIGN(x)   OF1X_SHIFT_LEFT(x, 12)
 
#define OF1X_MPLS_LABEL_VALUE(x)   OF1X_SHIFT_RIGHT(x, 12)
 
#define OF1X_MPLS_TC_ALIGN(x)   OF1X_SHIFT_LEFT(x, 1)
 
#define OF1X_MPLS_TC_VALUE(x)   OF1X_SHIFT_RIGHT(x, 1)
 
#define OF1X_IP_DSCP_ALIGN(x)   OF1X_SHIFT_LEFT(x, 2)
 
#define OF1X_IP_DSCP_VALUE(x)   OF1X_SHIFT_RIGHT(x, 2)
 
#define OF1X_IP6_FLABEL_ALIGN(x)   OF1X_SHIFT_LEFT(x, 8)
 
#define OF1X_IP6_FLABEL_VALUE(x)   OF1X_SHIFT_RIGHT(x, 8)
 
#define OF1X_ALIGN_64_BIT(x)   (((x/8)+1)*8)
 

Typedefs

typedef enum rofl_of1x_fm_result rofl_of1x_fm_result_t
 Extended flowmod return codes. More...
 
typedef enum
of1x_mutex_acquisition_required 
of1x_mutex_acquisition_required_t
 
typedef struct of1x_ver_req_t of1x_ver_req_t
 

Enumerations

enum  rofl_of1x_fm_result { ROFL_OF1X_FM_SUCCESS = EXIT_SUCCESS, ROFL_OF1X_FM_FAILURE = EXIT_FAILURE, ROFL_OF1X_FM_OVERLAP }
 Extended flowmod return codes. More...
 
enum  of1x_mutex_acquisition_required { MUTEX_NOT_ACQUIRED = 0, MUTEX_ALREADY_ACQUIRED_BY_TIMER_EXPIRATION, MUTEX_ALREADY_ACQUIRED_NON_STRICT_SEARCH }
 

Detailed Description

Author
Marc Sune<marc.sune (at) bisdn.de>

Definition in file of1x_utils.h.

Macro Definition Documentation

#define OF1X_MAC_ALIGN (   x)    OF1X_SHIFT_LEFT(x, 16)

ALIGNING FUNCTIONS FOR THE PROTOCOL VALUES ///.

Definition at line 166 of file of1x_utils.h.

#define OF1X_SWAP_AND_SHIFT_64 (   x,
 
)
Value:
do{ \
x=__bswap_64(x); \
x>>=y; \
}while(0)

Definition at line 156 of file of1x_utils.h.