-
Notifications
You must be signed in to change notification settings - Fork 1
/
ofc_pkt.h
135 lines (120 loc) · 2.58 KB
/
ofc_pkt.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/********************************************************************
*
* Filename: ofc_pkt.h
*
* Description: This file contains structures for OpenFlow control
* packet headers
*
*******************************************************************/
#ifndef __OFC_PKT_H__
#define __OFC_PKT_H__
typedef struct
{
__u32 hi;
__u32 lo;
} tOfcEightByte;
typedef struct
{
__u8 version;
__u8 type;
__u16 length;
__u32 xid;
} tOfcOfHdr;
typedef struct
{
__u16 type;
__u16 length;
__u8 aPad[4];
} tOfcMatchTlv;
typedef struct
{
__u16 Class;
__u8 field;
__u8 length;
__u8 aValue[0];
} tOfcMatchOxmTlv;
typedef struct
{
__u16 type;
__u16 length;
} tOfcInstrTlv;
typedef struct
{
__u16 type;
__u16 length;
} tOfcActionTlv;
typedef struct
{
__u8 impDatapathId[2];
__u8 macDatapathId[OFC_MAC_ADDR_LEN];
__u32 maxBuffers;
__u8 maxTables;
__u8 auxilaryId;
__u8 pad[2];
__u32 capabilities;
__u32 reserved;
} tOfcFeatReply;
typedef struct
{
tOfcEightByte cookie;
tOfcEightByte cookieMask;
__u8 tableId;
__u8 command;
__u16 idleTimeout;
__u16 hardTimeout;
__u16 priority;
__u32 bufId;
__u32 outPort;
__u32 outGrp;
__u16 flags;
__u8 aPad[2];
tOfcMatchTlv OfpMatch;
tOfcInstrTlv OfpInstr[0];
} tOfcFlowModHdr;
typedef struct
{
__u32 bufId;
__u16 totLength;
__u8 reason;
__u8 tableId;
tOfcEightByte cookie;
tOfcMatchTlv matchTlv;
} tOfcPktInHdr;
typedef struct
{
__u32 bufId;
__u32 inPort;
__u16 actionsLen;
__u8 aPad[6];
} tOfcPktOutHdr;
typedef struct
{
__u16 type;
__u16 flags;
__u8 pad[4];
} tOfcMultipartHeader;
typedef struct
{
char mfcDesc[OFC_DESCR_STRING_LEN];
char hwDesc[OFC_DESCR_STRING_LEN];
char swDesc[OFC_DESCR_STRING_LEN];
char serialNum[OFC_SERIAL_NUM_LEN];
char dpDesc[OFC_DESCR_STRING_LEN];
} tOfcMultipartSwDesc;
typedef struct
{
__u32 portNo;
__u8 pad[4];
__u8 hwAddr[OFC_MAC_ADDR_LEN];
__u8 pad2[2];
char ifName[OFC_MAX_IFNAME_LEN];
__u32 config;
__u32 state;
__u32 curr;
__u32 advertised;
__u32 supported;
__u32 peer;
__u32 currSpeed;
__u32 maxSpeed;
} tOfcMultipartPortDesc;
#endif /* __OFC_PKT_H__ */