Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
openflow_common.h
1 /*
2  * openflow.h
3  *
4  * Created on: 02.03.2013
5  * Author: andi
6  */
7 
8 #ifndef OPENFLOW_COMMON_H_
9 #define OPENFLOW_COMMON_H_ 1
10 
11 #ifdef __KERNEL__
12 #include <linux/types.h>
13 #else
14 #include <stdint.h>
15 #endif
16 
17 #ifdef SWIG
18 #define OFP_ASSERT(EXPR) /* SWIG can't handle OFP10_ASSERT. */
19 #elif !defined(__cplusplus)
20 /* Build-time assertion for use in a declaration context. */
21 #define OFP_ASSERT(EXPR) \
22  extern int (*build_assert(void))[ sizeof(struct { \
23  unsigned int build_assert_failed : (EXPR) ? 1 : -1; })]
24 #else /* __cplusplus */
25 #define OFP_ASSERT(_EXPR) typedef int build_assert_failed[(_EXPR) ? 1 : -1]
26 #endif /* __cplusplus */
27 
28 #ifndef SWIG
29 #define OFP_PACKED __attribute__((packed))
30 #else
31 #define OFP_PACKED /* SWIG doesn't understand __attribute. */
32 #endif
33 
34 
35 namespace rofl {
36 
37 #define OFP_MAX_TABLE_NAME_LEN 32
38 #define OFP_MAX_PORT_NAME_LEN 16
39 
40 #define OFP_TCP_PORT 6633
41 #define OFP_SSL_PORT 6633
42 
43 //#define OFP_VERSION_UNKNOWN 0
44 
45 #define OFP_ETH_ALEN 6 /* Bytes in an Ethernet address. */
46 
47 namespace openflow {
48 
49  enum ofp_version_t {
50  OFP_VERSION_UNKNOWN = 0,
51  };
52 
53  enum ofp_buffer_t {
54  OFP_NO_BUFFER = 0xffffffff,
55  };
56 
57  /* Header on all OpenFlow packets. */
58  struct ofp_header {
59  uint8_t version; /* OFP10_VERSION. */
60  uint8_t type; /* One of the OFP10T_ constants. */
61  uint16_t length; /* Length including this ofp10_header. */
62  uint32_t xid; /* Transaction id associated with this packet.
63  Replies use the same id as was in the request
64  to facilitate pairing. */
65  uint8_t body[0];
66  };
67  OFP_ASSERT(sizeof(struct ofp_header) == 8);
68 
69  enum ofp_type {
70  /* Immutable messages. */
71  OFPT_HELLO = 0, /* Symmetric message */
72  OFPT_ERROR = 1, /* Symmetric message */
73  OFPT_ECHO_REQUEST = 2, /* Symmetric message */
74  OFPT_ECHO_REPLY = 3, /* Symmetric message */
75  OFPT_EXPERIMENTER = 4, /* Symmetric message */
76 
77  /* Switch configuration messages. */
78  OFPT_FEATURES_REQUEST = 5, /* Controller/switch message */
79  OFPT_FEATURES_REPLY = 6, /* Controller/switch message */
80  OFPT_GET_CONFIG_REQUEST = 7, /* Controller/switch message */
81  OFPT_GET_CONFIG_REPLY = 8, /* Controller/switch message */
82  OFPT_SET_CONFIG = 9, /* Controller/switch message */
83 
84  /* Asynchronous messages. */
85  OFPT_PACKET_IN = 10, /* Async message */
86  OFPT_FLOW_REMOVED = 11, /* Async message */
87  OFPT_PORT_STATUS = 12, /* Async message */
88 
89  /* Controller command messages. */
90  OFPT_PACKET_OUT = 13, /* Controller/switch message */
91  OFPT_FLOW_MOD = 14, /* Controller/switch message */
92  OFPT_GROUP_MOD = 15, /* Controller/switch message */
93  OFPT_PORT_MOD = 16, /* Controller/switch message */
94  OFPT_TABLE_MOD = 17, /* Controller/switch message */
95 
96  /* Multipart messages. */
97  OFPT_MULTIPART_REQUEST = 18, /* Controller/switch message */
98  OFPT_MULTIPART_REPLY = 19, /* Controller/switch message */
99  OFPT_STATS_REQUEST = 18, /* Controller/switch message */
100  OFPT_STATS__REPLY = 19, /* Controller/switch message */
101 
102  /* Barrier messages. */
103  OFPT_BARRIER_REQUEST = 20, /* Controller/switch message */
104  OFPT_BARRIER_REPLY = 21, /* Controller/switch message */
105 
106  /* Queue Configuration messages. */
107  OFPT_QUEUE_GET_CONFIG_REQUEST = 22, /* Controller/switch message */
108  OFPT_QUEUE_GET_CONFIG_REPLY = 23, /* Controller/switch message */
109 
110  /* Controller role change request messages. */
111  OFPT_ROLE_REQUEST = 24, /* Controller/switch message */
112  OFPT_ROLE_REPLY = 25, /* Controller/switch message */
113 
114  /* Asynchronous message configuration. */
115  OFPT_GET_ASYNC_REQUEST = 26, /* Controller/switch message */
116  OFPT_GET_ASYNC_REPLY = 27, /* Controller/switch message */
117  OFPT_SET_ASYNC = 28, /* Controller/switch message */
118 
119  /* Meters and rate limiters configuration messages. */
120  OFPT_METER_MOD = 29, /* Controller/switch message */
121  };
122 
123  /* OFPT_ERROR: Error message (datapath -> controller). */
124  struct ofp_error_msg {
125  struct ofp_header header;
126 
127  uint16_t type;
128  uint16_t code;
129  uint8_t data[0]; /* Variable-length data. Interpreted based
130  on the type and code. No padding. */
131  };
132  OFP_ASSERT(sizeof(struct ofp_error_msg) == 12);
133 
134 
135  enum ofp_flow_mod_command {
136  OFPFC_ADD, /* New flow. */
137  OFPFC_MODIFY, /* Modify all matching flows. */
138  OFPFC_MODIFY_STRICT, /* Modify entry strictly matching wildcards and
139  priority. */
140  OFPFC_DELETE, /* Delete all matching flows. */
141  OFPFC_DELETE_STRICT /* Delete entry strictly matching wildcards and
142  priority. */
143  };
144 
145  /* Group commands */
146  enum ofp_group_mod_command {
147  OFPGC_ADD = 0, /* New group. */
148  OFPGC_MODIFY = 1, /* Modify all matching groups. */
149  OFPGC_DELETE = 2, /* Delete all matching groups. */
150  };
151 
152  /* What changed about the physical port */
153  enum ofp_port_reason {
154  OFPPR_ADD, /* The port was added. */
155  OFPPR_DELETE, /* The port was removed. */
156  OFPPR_MODIFY /* Some attribute of the port has changed. */
157  };
158 
159 
160  enum ofp_instruction_type {
161  OFPIT_GOTO_TABLE = 1, /* Setup the next table in the lookup
162  pipeline */
163  OFPIT_WRITE_METADATA = 2, /* Setup the metadata field for use later in
164  pipeline */
165  OFPIT_WRITE_ACTIONS = 3, /* Write the action(s) onto the datapath action
166  set */
167  OFPIT_APPLY_ACTIONS = 4, /* Applies the action(s) immediately */
168  OFPIT_CLEAR_ACTIONS = 5, /* Clears all actions from the datapath
169  action set */
170  OFPIT_METER = 6, /* Apply meter (rate limiter) */
171  OFPIT_EXPERIMENTER = 0xFFFF /* Experimenter instruction */
172  };
173 
174 
175  /* Generic ofp_instruction structure */
177  uint16_t type; /* Instruction type */
178  uint16_t len; /* Length of this struct in bytes. */
179  uint8_t body[0];
180  //uint8_t pad[4]; /* Align to 64-bits */
181  };
182  OFP_ASSERT(sizeof(struct ofp_instruction) == 4);
183 
184 
185 
186  struct ofp_action {
187  uint16_t type; /* One of OFPAT_*. */
188  uint16_t len; /* Length of action, including this
189  header. This is the length of action,
190  including any padding to make it
191  64-bit aligned. */
192  uint8_t body[0];
193  //uint8_t pad[4];
194  };
195  OFP_ASSERT(sizeof(struct ofp_action) == 4);
196 
197 
198 
199  /* Action header that is common to all actions. The length includes the
200  * header and any padding used to make the action 64-bit aligned.
201  * NB: The length of an action *must* always be a multiple of eight. */
203  uint16_t type; /* One of OFPAT_*. */
204  uint16_t len; /* Length of action, including this
205  header. This is the length of action,
206  including any padding to make it
207  64-bit aligned. */
208  uint8_t pad[4];
209  };
210  OFP_ASSERT(sizeof(struct ofp_action_header) == 8);
211 
212  enum ofp_action_type {
213  OFPAT_OUTPUT = 0, /* Output to switch port. */
214  // OF1.0 only actions
215  OFPAT_SET_VLAN_VID = 1, /* Set the 802.1q VLAN id. */
216  OFPAT_SET_VLAN_PCP = 2, /* Set the 802.1q priority. */
217  OFPAT_STRIP_VLAN = 3, /* Strip the 802.1q header. */
218  OFPAT_SET_DL_SRC = 4, /* Ethernet source address. */
219  OFPAT_SET_DL_DST = 5, /* Ethernet destination address. */
220  OFPAT_SET_NW_SRC = 6, /* IP source address. */
221  OFPAT_SET_NW_DST = 7, /* IP destination address. */
222  OFPAT_SET_NW_TOS = 8, /* IP ToS (DSCP field, 6 bits). */
223  OFPAT_SET_TP_SRC = 9, /* TCP/UDP source port. */
224  OFPAT_SET_TP_DST = 10, /* TCP/UDP destination port. */
225  // OF1.0 only actions (end)
226  // Please note: #0 and #11 needs special care in OF10 and OF12
227  OFPAT_COPY_TTL_OUT = 11, /* Copy TTL "outwards" -- from next-to-outermost to outermost */
228  OFPAT_COPY_TTL_IN = 12, /* Copy TTL "inwards" -- from outermost to next-to-outermost */
229  OFPAT_SET_MPLS_TTL = 15, /* MPLS TTL */
230  OFPAT_DEC_MPLS_TTL = 16, /* Decrement MPLS TTL */
231  OFPAT_PUSH_VLAN = 17, /* Push a new VLAN tag */
232  OFPAT_POP_VLAN = 18, /* Pop the outer VLAN tag */
233  OFPAT_PUSH_MPLS = 19, /* Push a new MPLS tag */
234  OFPAT_POP_MPLS = 20, /* Pop the outer MPLS tag */
235  OFPAT_SET_QUEUE = 21, /* Set queue id when outputting to a port */
236  OFPAT_GROUP = 22, /* Apply group. */
237  OFPAT_SET_NW_TTL = 23, /* IP TTL. */
238  OFPAT_DEC_NW_TTL = 24, /* Decrement IP TTL. */
239  OFPAT_SET_FIELD = 25, /* Set a header field using OXM TLV format. */
240  OFPAT_PUSH_PBB = 26, /* Push a new PBB service tag (I-TAG) */
241  OFPAT_POP_PBB = 27, /* Pop the outer PBB service tag (I-TAG) */
242  OFPAT_EXPERIMENTER = 0xffff
243  };
244 
245 
246 
248  uint32_t oxm_id;
249  uint8_t data[0];
250  } __attribute__((packed));
251 
252 
253  struct ofp_oxm_hdr {
254  uint16_t oxm_class; /* oxm_class */
255  uint8_t oxm_field; /* includes has_mask bit! */
256  uint8_t oxm_length; /* oxm_length */
257  } __attribute__((packed));
258 
259 
260 
261  // OXM_OF_VLAN_PCP /* 3 bits */
262  // OXM_OF_IP_DSCP /* 6 bits */
263  // OXM_OF_IP_ECN /* 2 bits */
264  // OXM_OF_IP_PROTO /* 8 bits */
265  // OXM_OF_ICMPV4_TYPE
266  // OXM_OF_ICMPV4_CODE
267  // OXM_OF_ICMPV6_TYPE
268  // OXM_OF_ICMPV6_CODE
269  // OXM_OF_MPLS_TC /* 3 bits */
271  struct ofp_oxm_hdr hdr; /* oxm header */
272  uint8_t byte;
273  uint8_t mask;
274  } __attribute__((packed));
275 
276 
277  // OXM_OF_ETH_TYPE
278  // OXM_OF_VLAN_VID (mask)
279  // OXM_OF_TCP_SRC
280  // OXM_OF_TCP_DST
281  // OXM_OF_UDP_SRC
282  // OXM_OF_UDP_DST
283  // OXM_OF_SCTP_SRC
284  // OXM_OF_SCTP_DST
285  // OXM_OF_ARP_OP
287  struct ofp_oxm_hdr hdr; /* oxm header */
288  uint16_t word; /* network byte order */
289  uint16_t mask;
290  } __attribute__((packed));
291 
292 
293  // OXM_OF_PBB_ISID
295  struct ofp_oxm_hdr hdr; /* oxm header */
296  uint8_t word[3]; /* network byte order */
297  uint8_t mask[3]; /* only valid, when oxm_hasmask=1 */
298  } __attribute__((packed));
299 
300 
301  // OXM_OF_IN_PORT
302  // OXM_OF_IN_PHY_PORT
303  // OXM_OF_IPV4_SRC (mask)
304  // OXM_OF_IPV4_DST (mask)
305  // OXM_OF_ARP_SPA (mask)
306  // OXM_OF_ARP_THA (mask)
307  // OXM_OF_IPV6_FLABEL (mask)
308  // OXM_OF_MPLS_LABEL
310  struct ofp_oxm_hdr hdr; /* oxm header */
311  uint32_t dword; /* network byte order */
312  uint32_t mask; /* only valid, when oxm_hasmask=1 */
313  } __attribute__((packed));
314 
315 
316  // OXM_OF_IPV6_ND_SLL
317  // OXM_OF_IPV6_ND_TLL
319  struct ofp_oxm_hdr hdr; /* oxm header */
320  uint8_t value[6];
321  uint8_t mask[6]; /* only valid, when oxm_hasmask=1 */
322  } __attribute__((packed));
323 
324  // OXM_OF_METADATA (mask)
326  struct ofp_oxm_hdr hdr; /* oxm header */
327  uint64_t word;
328  uint64_t mask;
329  } __attribute__((packed));
330 
331 
332  // OXM_OF_ETH_DST (mask)
333  // OXM_OF_ETH_SRC (mask)
335  struct ofp_oxm_hdr hdr; /* oxm header */
336  uint8_t addr[OFP_ETH_ALEN];
337  uint8_t mask[OFP_ETH_ALEN]; /* only valid, when oxm_hasmask=1 */
338  } __attribute__((packed));
339 
340 
341  // OXM_OF_IPV6_SRC (mask)
342  // OXM_OF_IPV6_DST (mask)
343  // OXM_OF_IPV6_ND_TARGET
345  struct ofp_oxm_hdr hdr; /* oxm header */
346  uint8_t addr[16];
347  uint8_t mask[16]; /* only valid, when oxm_hasmask=1 */
348  } __attribute__((packed));
349 
350 
351  /* OXM Class IDs.
352  * The high order bit differentiate reserved classes from member classes.
353  * Classes 0x0000 to 0x7FFF are member classes, allocated by ONF.
354  * Classes 0x8000 to 0xFFFE are reserved classes, reserved for standardisation.
355  */
356  enum ofp_oxm_class {
357  OFPXMC_NXM_0 = 0x0000, /* Backward compatibility with NXM */
358  OFPXMC_NXM_1 = 0x0001, /* Backward compatibility with NXM */
359  OFPXMC_OPENFLOW_BASIC = 0x8000, /* Basic class for OpenFlow */
360  OFPXMC_EXPERIMENTER = 0xFFFF, /* Experimenter class */
361  };
362 
363 
364  //Only common parts
365  enum ofp_flow_mod_flags {
366  OFPFF_SEND_FLOW_REM = 1 << 0, /* Send flow removed message when flow
367  * expires or is deleted. */
368  OFPFF_CHECK_OVERLAP = 1 << 1, /* Check for overlapping entries first. */
369  };
370 
371  /* OXM Flow match field types for OpenFlow basic class. */
372  enum oxm_ofb_match_fields {
373  OFPXMT_OFB_IN_PORT = 0, /* Switch input port. */ // required
374  OFPXMT_OFB_IN_PHY_PORT = 1, /* Switch physical input port. */
375  OFPXMT_OFB_METADATA = 2, /* Metadata passed between tables. */
376  OFPXMT_OFB_ETH_DST = 3, /* Ethernet destination address. */ // required
377  OFPXMT_OFB_ETH_SRC = 4, /* Ethernet source address. */ // required
378  OFPXMT_OFB_ETH_TYPE = 5, /* Ethernet frame type. */ // required
379  OFPXMT_OFB_VLAN_VID = 6, /* VLAN id. */
380  OFPXMT_OFB_VLAN_PCP = 7, /* VLAN priority. */
381  OFPXMT_OFB_IP_DSCP = 8, /* IP DSCP (6 bits in ToS field). */
382  OFPXMT_OFB_IP_ECN = 9, /* IP ECN (2 bits in ToS field). */
383  OFPXMT_OFB_IP_PROTO = 10, /* IP protocol. */ // required
384  OFPXMT_OFB_IPV4_SRC = 11, /* IPv4 source address. */ // required
385  OFPXMT_OFB_IPV4_DST = 12, /* IPv4 destination address. */ // required
386  OFPXMT_OFB_TCP_SRC = 13, /* TCP source port. */ // required
387  OFPXMT_OFB_TCP_DST = 14, /* TCP destination port. */ // required
388  OFPXMT_OFB_UDP_SRC = 15, /* UDP source port. */ // required
389  OFPXMT_OFB_UDP_DST = 16, /* UDP destination port. */ // required
390  OFPXMT_OFB_SCTP_SRC = 17, /* SCTP source port. */
391  OFPXMT_OFB_SCTP_DST = 18, /* SCTP destination port. */
392  OFPXMT_OFB_ICMPV4_TYPE = 19, /* ICMP type. */
393  OFPXMT_OFB_ICMPV4_CODE = 20, /* ICMP code. */
394  OFPXMT_OFB_ARP_OP = 21, /* ARP opcode. */
395  OFPXMT_OFB_ARP_SPA = 22, /* ARP source IPv4 address. */
396  OFPXMT_OFB_ARP_TPA = 23, /* ARP target IPv4 address. */
397  OFPXMT_OFB_ARP_SHA = 24, /* ARP source hardware address. */
398  OFPXMT_OFB_ARP_THA = 25, /* ARP target hardware address. */
399  OFPXMT_OFB_IPV6_SRC = 26, /* IPv6 source address. */ // required
400  OFPXMT_OFB_IPV6_DST = 27, /* IPv6 destination address. */ // required
401  OFPXMT_OFB_IPV6_FLABEL = 28, /* IPv6 Flow Label */
402  OFPXMT_OFB_ICMPV6_TYPE = 29, /* ICMPv6 type. */
403  OFPXMT_OFB_ICMPV6_CODE = 30, /* ICMPv6 code. */
404  OFPXMT_OFB_IPV6_ND_TARGET = 31, /* Target address for ND. */
405  OFPXMT_OFB_IPV6_ND_SLL = 32, /* Source link-layer for ND. */
406  OFPXMT_OFB_IPV6_ND_TLL = 33, /* Target link-layer for ND. */
407  OFPXMT_OFB_MPLS_LABEL = 34, /* MPLS label. */
408  OFPXMT_OFB_MPLS_TC = 35, /* MPLS TC. */
409  OFPXMT_OFB_MPLS_BOS = 36, /* MPLS BoS bit. */
410  OFPXMT_OFB_PBB_ISID = 37, /* PBB I-SID. */
411  OFPXMT_OFB_TUNNEL_ID = 38, /* Logical Port Metadata. */
412  OFPXMT_OFB_IPV6_EXTHDR = 39, /* IPv6 Extension Header pseudo-field */
413  /* max value */
414  OFPXMT_OFB_MAX,
415  };
416 
417 #define HAS_MASK_FLAG (1 << 8)
418 
419  /* OXM Flow match field types for OpenFlow basic class. */
420  enum oxm_tlv_match_fields {
421  OXM_TLV_BASIC_IN_PORT = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IN_PORT << 9) | 4, /* Switch input port. */ // required
422  OXM_TLV_BASIC_IN_PHY_PORT = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IN_PHY_PORT << 9) | 4, /* Switch physical input port. */
423  OXM_TLV_BASIC_METADATA = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_METADATA << 9) | 8, /* Metadata passed between tables. */
424  OXM_TLV_BASIC_METADATA_MASK = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_METADATA << 9) | 16 | HAS_MASK_FLAG,
425  OXM_TLV_BASIC_ETH_DST = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ETH_DST << 9) | 6, /* Ethernet destination address. */ // required
426  OXM_TLV_BASIC_ETH_DST_MASK = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ETH_DST << 9) | 12 | HAS_MASK_FLAG,
427  OXM_TLV_BASIC_ETH_SRC = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ETH_SRC << 9) | 6, /* Ethernet source address. */ // required
428  OXM_TLV_BASIC_ETH_SRC_MASK = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ETH_SRC << 9) | 12 | HAS_MASK_FLAG,
429  OXM_TLV_BASIC_ETH_TYPE = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ETH_TYPE << 9) | 2, /* Ethernet frame type. */ // required
430  OXM_TLV_BASIC_VLAN_VID = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_VLAN_VID << 9) | 2, /* VLAN id. */
431  OXM_TLV_BASIC_VLAN_VID_MASK = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_VLAN_VID << 9) | 4 | HAS_MASK_FLAG,
432  OXM_TLV_BASIC_VLAN_PCP = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_VLAN_PCP << 9) | 1, /* VLAN priority. */
433  OXM_TLV_BASIC_IP_DSCP = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IP_DSCP << 9) | 1, /* IP DSCP (6 bits in ToS field). */
434  OXM_TLV_BASIC_IP_ECN = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IP_ECN << 9) | 1, /* IP ECN (2 bits in ToS field). */
435  OXM_TLV_BASIC_IP_PROTO = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IP_PROTO << 9) | 1, /* IP protocol. */ // required
436  OXM_TLV_BASIC_IPV4_SRC = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IPV4_SRC << 9) | 4, /* IPv4 source address. */ // required
437  OXM_TLV_BASIC_IPV4_SRC_MASK = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IPV4_SRC << 9) | 8 | HAS_MASK_FLAG,
438  OXM_TLV_BASIC_IPV4_DST = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IPV4_DST << 9) | 4, /* IPv4 destination address. */ // required
439  OXM_TLV_BASIC_IPV4_DST_MASK = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IPV4_DST << 9) | 8 | HAS_MASK_FLAG,
440  OXM_TLV_BASIC_TCP_SRC = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_TCP_SRC << 9) | 2, /* TCP source port. */ // required
441  OXM_TLV_BASIC_TCP_DST = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_TCP_DST << 9) | 2, /* TCP destination port. */ // required
442  OXM_TLV_BASIC_UDP_SRC = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_UDP_SRC << 9) | 2, /* UDP source port. */ // required
443  OXM_TLV_BASIC_UDP_DST = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_UDP_DST << 9) | 2, /* UDP destination port. */ // required
444  OXM_TLV_BASIC_SCTP_SRC = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_SCTP_SRC << 9) | 2, /* SCTP source port. */
445  OXM_TLV_BASIC_SCTP_DST = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_SCTP_DST << 9) | 2, /* SCTP destination port. */
446  OXM_TLV_BASIC_ICMPV4_TYPE = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ICMPV4_TYPE << 9) | 1, /* ICMP type. */
447  OXM_TLV_BASIC_ICMPV4_CODE = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ICMPV4_CODE << 9) | 1, /* ICMP code. */
448  OXM_TLV_BASIC_ARP_OP = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ARP_OP << 9) | 2, /* ARP opcode. */
449  OXM_TLV_BASIC_ARP_SPA = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ARP_SPA << 9) | 4, /* ARP source IPv4 address. */
450  OXM_TLV_BASIC_ARP_SPA_MASK = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ARP_SPA << 9) | 8 | HAS_MASK_FLAG,
451  OXM_TLV_BASIC_ARP_TPA = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ARP_TPA << 9) | 4, /* ARP target IPv4 address. */
452  OXM_TLV_BASIC_ARP_TPA_MASK = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ARP_TPA << 9) | 8 | HAS_MASK_FLAG,
453  OXM_TLV_BASIC_ARP_SHA = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ARP_SHA << 9) | 6, /* ARP source hardware address. */
454  OXM_TLV_BASIC_ARP_SHA_MASK = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ARP_SHA << 9) | 12 | HAS_MASK_FLAG,
455  OXM_TLV_BASIC_ARP_THA = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ARP_THA << 9) | 6, /* ARP target hardware address. */
456  OXM_TLV_BASIC_ARP_THA_MASK = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ARP_THA << 9) | 12 | HAS_MASK_FLAG,
457  OXM_TLV_BASIC_IPV6_SRC = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IPV6_SRC << 9) | 16, /* IPv6 source address. */ // required
458  OXM_TLV_BASIC_IPV6_SRC_MASK = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IPV6_SRC << 9) | 32 | HAS_MASK_FLAG,
459  OXM_TLV_BASIC_IPV6_DST = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IPV6_DST << 9) | 16, /* IPv6 destination address. */ // required
460  OXM_TLV_BASIC_IPV6_DST_MASK = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IPV6_DST << 9) | 32 | HAS_MASK_FLAG,
461  OXM_TLV_BASIC_IPV6_FLABEL = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IPV6_FLABEL << 9) | 4, /* IPv6 Flow Label */
462  OXM_TLV_BASIC_IPV6_FLABEL_MASK = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IPV6_FLABEL << 9) | 8| HAS_MASK_FLAG, /* IPv6 Flow Label */
463  OXM_TLV_BASIC_ICMPV6_TYPE = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ICMPV6_TYPE << 9) | 1, /* ICMPv6 type. */
464  OXM_TLV_BASIC_ICMPV6_CODE = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_ICMPV6_CODE << 9) | 1, /* ICMPv6 code. */
465  OXM_TLV_BASIC_IPV6_ND_TARGET= (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IPV6_ND_TARGET << 9) | 16,/* Target address for ND. */
466  OXM_TLV_BASIC_IPV6_ND_SLL = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IPV6_ND_SLL << 9) | 6, /* Source link-layer for ND. */
467  OXM_TLV_BASIC_IPV6_ND_TLL = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IPV6_ND_TLL << 9) | 6, /* Target link-layer for ND. */
468  OXM_TLV_BASIC_MPLS_LABEL = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_MPLS_LABEL << 9) | 4, /* MPLS label. */
469  OXM_TLV_BASIC_MPLS_TC = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_MPLS_TC << 9) | 1, /* MPLS TC. */
470  OXM_TLV_BASIC_MPLS_BOS = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_MPLS_BOS << 9) | 1, /* MPLS BoS bit. */
471  OXM_TLV_BASIC_PBB_ISID = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_PBB_ISID << 9) | 3, /* PBB I-SID. */
472  OXM_TLV_BASIC_PBB_ISID_MASK = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_PBB_ISID << 9) | 6 | HAS_MASK_FLAG,
473  OXM_TLV_BASIC_TUNNEL_ID = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_TUNNEL_ID << 9) | 8, /* Logical Port Metadata. */
474  OXM_TLV_BASIC_TUNNEL_ID_MASK= (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_TUNNEL_ID << 9) | 16 | HAS_MASK_FLAG,
475  OXM_TLV_BASIC_IPV6_EXTHDR = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IPV6_EXTHDR << 9) | 4, /* IPv6 Extension Header pseudo-field */
476  OXM_TLV_BASIC_IPV6_EXTHDR_MASK = (OFPXMC_OPENFLOW_BASIC << 16) | (OFPXMT_OFB_IPV6_EXTHDR << 9) | 8 | HAS_MASK_FLAG, /* IPv6 Extension Header pseudo-field */
477  };
478 
479 
480  /* The VLAN id is 12-bits, so we can use the entire 16 bits to indicate
481  * special conditions.
482  */
483  enum ofp_vlan_id {
484  OFPVID_PRESENT = 0x1000, /* Bit that indicate that a VLAN id is set */
485  OFPVID_NONE = 0x0000, /* No VLAN id was set. */
486  };
487 
488 
489 
490 
491 
492  /* Fields to match against flows */
493  struct ofp_match {
494  uint16_t type; /* One of OFPMT_* */
495  uint16_t length; /* Length of ofp_match (excluding padding) */
496  /* Followed by:
497  * - Exactly (length - 4) (possibly 0) bytes containing OXM TLVs, then
498  * - Exactly ((length + 7)/8*8 - length) (between 0 and 7) bytes of
499  * all-zero bytes
500  * In summary, ofp_match is padded as needed, to make its overall size
501  * a multiple of 8, to preserve alignement in structures using it.
502  */
503  uint8_t oxm_fields[4];
504  /* OXMs start here - Make compiler happy */
505  };
506  OFP_ASSERT(sizeof(struct ofp_match) == 8);
507 
508 
509  /* The match type indicates the match structure (set of fields that compose the
510  * match) in use. The match type is placed in the type field at the beginning
511  * of all match structures. The "OpenFlow Extensible Match" type corresponds
512  * to OXM TLV format described below and must be supported by all OpenFlow
513  * switches. Extensions that define other match types may be published on the
514  * ONF wiki. Support for extensions is optional.
515  */
516  enum ofp_match_type {
517  OFPMT_STANDARD = 0, /* Deprecated. */
518  OFPMT_OXM = 1, /* OpenFlow Extensible Match */
519  };
520 
521 
522  enum ofp_port_no {
523  /* Maximum number of physical switch ports. */
524  OFPP_MAX = 0xffffff00,
525 
526  /* Fake output "ports". */
527  OFPP_IN_PORT = 0xfffffff8, /* Send the packet out the input port. This
528  virtual port must be explicitly used
529  in order to send back out of the input
530  port. */
531  OFPP_TABLE = 0xfffffff9, /* Submit the packet to the first flow table
532  NB: This destination port can only be
533  used in packet-out messages. */
534  OFPP_NORMAL = 0xfffffffa, /* Process with normal L2/L3 switching. */
535  OFPP_FLOOD = 0xfffffffb, /* All physical ports in VLAN, except input
536  port and those blocked or link down. */
537  OFPP_ALL = 0xfffffffc, /* All physical ports except input port. */
538  OFPP_CONTROLLER = 0xfffffffd, /* Send to controller. */
539  OFPP_LOCAL = 0xfffffffe, /* Local openflow "port". */
540  OFPP_ANY = 0xffffffff /* Wildcard port used only for flow mod
541  (delete) and flow stats requests. Selects
542  all flows regardless of output port
543  (including flows with no output port). */
544  };
545 
546 
547  /* Group numbering. Groups can use any number up to OFPG_MAX. */
548  enum ofp_group {
549  /* Last usable group number. */
550  OFPG_MAX = 0xffffff00,
551 
552  /* Fake groups. */
553  OFPG_ALL = 0xfffffffc, /* Represents all groups for group delete
554  commands. */
555  OFPG_ANY = 0xffffffff /* Wildcard group used only for flow stats
556  requests. Selects all flows regardless of
557  group (including flows with no group).
558  */
559  };
560 
561  enum ofp_group_type {
562  OFPGT_ALL = 0, /* All (multicast/broadcast) group. */
563  OFPGT_SELECT = 1, /* Select group. */
564  OFPGT_INDIRECT = 2, /* Indirect group. */
565  OFPGT_FF = 3, /* Fast failover group. */
566  };
567 
568  /* Bucket for use in groups. */
569  struct ofp_bucket {
570  uint16_t len; /* Length the bucket in bytes, including
571  this header and any padding to make it
572  64-bit aligned. */
573  uint16_t weight; /* Relative weight of bucket. Only
574  defined for select groups. */
575  uint32_t watch_port; /* Port whose state affects whether this
576  bucket is live. Only required for fast
577  failover groups. */
578  uint32_t watch_group; /* Group whose state affects whether this
579  bucket is live. Only required for fast
580  failover groups. */
581  uint8_t pad[4];
582  struct ofp_action_header actions[0]; /* The action length is inferred
583  from the length field in the
584  header. */
585  };
586  OFP_ASSERT(sizeof(struct ofp_bucket) == 16);
587 
588 
589 
590  /* Values for ’type’ in ofp_error_message. These values are immutable: they
591  * will not change in future versions of the protocol (although new values may
592  * be added). */
593  enum ofp_error_type {
594  OFPET_HELLO_FAILED = 0, /* Hello protocol failed. */
595  OFPET_BAD_REQUEST = 1, /* Request was not understood. */
596  OFPET_BAD_ACTION = 2, /* Error in action description. */
597  OFPET_BAD_INSTRUCTION = 3, /* Error in instruction list. */
598  OFPET_BAD_MATCH = 4, /* Error in match. */
599  OFPET_FLOW_MOD_FAILED = 5, /* Problem modifying flow entry. */
600  OFPET_GROUP_MOD_FAILED = 6, /* Problem modifying group entry. */
601  OFPET_PORT_MOD_FAILED = 7, /* Port mod request failed. */
602  OFPET_TABLE_MOD_FAILED = 8, /* Table mod request failed. */
603  OFPET_QUEUE_OP_FAILED = 9, /* Queue operation failed. */
604  OFPET_SWITCH_CONFIG_FAILED = 10, /* Switch config request failed. */
605  OFPET_ROLE_REQUEST_FAILED = 11, /* Controller Role request failed. */
606  OFPET_METER_MOD_FAILED = 12, /* Error in meter. */
607  OFPET_TABLE_FEATURES_FAILED = 13, /* Setting table features failed. */
608  OFPET_EXPERIMENTER = 0xffff /* Experimenter error messages. */
609  };
610 
611 
612  /* ofp_error_msg 'code' values for OFPET_HELLO_FAILED. 'data' contains an
613  * ASCII text string that may give failure details. */
614  enum ofp_hello_failed_code {
615  OFPHFC_INCOMPATIBLE = 0, /* No compatible version. */
616  OFPHFC_EPERM = 1, /* Permissions error. */
617  };
618 
619  /* ofp_error_msg ’code’ values for OFPET_BAD_REQUEST. ’data’ contains at least
620  * the first 64 bytes of the failed request. */
621  enum ofp_bad_request_code {
622  OFPBRC_BAD_VERSION = 0, /* ofp_header.version not supported. */
623  OFPBRC_BAD_TYPE = 1, /* ofp_header.type not supported. */
624  OFPBRC_BAD_STAT = 2, /* ofp_stats_request.type not supported. */
625  OFPBRC_BAD_EXPERIMENTER = 3, /* Experimenter id not supported
626  * (in ofp_experimenter_header or
627  * ofp_stats_request or ofp_stats_reply). */
628  OFPBRC_BAD_EXP_TYPE = 4, /* Experimenter type not supported. */
629  OFPBRC_EPERM = 5, /* Permissions error. */
630  OFPBRC_BAD_LEN = 6, /* Wrong request length for type. */
631  OFPBRC_BUFFER_EMPTY = 7, /* Specified buffer has already been used. */
632  OFPBRC_BUFFER_UNKNOWN = 8, /* Specified buffer does not exist. */
633  OFPBRC_BAD_TABLE_ID = 9, /* Specified table-id invalid or does not
634  * exist. */
635  OFPBRC_IS_SLAVE = 10, /* Denied because controller is slave. */
636  OFPBRC_BAD_PORT = 11, /* Invalid port. */
637  OFPBRC_BAD_PACKET = 12, /* Invalid packet in packet-out. */
638  OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13, /* ofp_multipart_request
639  * overflowed the assigned buffer. */
640  };
641 
642 
643  /* ofp_error_msg 'code' values for OFPET_BAD_ACTION. 'data' contains at least
644  * the first 64 bytes of the failed request. */
645  enum ofp_bad_action_code {
646  OFPBAC_BAD_TYPE = 0, /* Unknown action type. */
647  OFPBAC_BAD_LEN = 1, /* Length problem in actions. */
648  OFPBAC_BAD_EXPERIMENTER = 2, /* Unknown experimenter id specified. */
649  OFPBAC_BAD_EXP_TYPE = 3, /* Unknown action type for experimenter id. */
650  OFPBAC_BAD_OUT_PORT = 4, /* Problem validating output port. */
651  OFPBAC_BAD_ARGUMENT = 5, /* Bad action argument. */
652  OFPBAC_EPERM = 6, /* Permissions error. */
653  OFPBAC_TOO_MANY = 7, /* Can't handle this many actions. */
654  OFPBAC_BAD_QUEUE = 8, /* Problem validating output queue. */
655  OFPBAC_BAD_OUT_GROUP = 9, /* Invalid group id in forward action. */
656  OFPBAC_MATCH_INCONSISTENT = 10, /* Action can't apply for this match. */
657  OFPBAC_UNSUPPORTED_ORDER = 11, /* Action order is unsupported for the action
658  * list in an Apply-Actions instruction */
659  OFPBAC_BAD_TAG = 12, /* Actions uses an unsupported
660  * tag/encap. */
661  OFPBAC_BAD_SET_TYPE = 13, /* Unsupported type in SET_FIELD action. */
662  OFPBAC_BAD_SET_LEN = 14, /* Length problem in SET_FIELD action. */
663  OFPBAC_BAD_SET_ARGUMENT = 15, /* Bad argument in SET_FIELD action. */
664  };
665 
666  /* ofp_error_msg 'code' values for OFPET_BAD_INSTRUCTION. 'data' contains at least
667  * the first 64 bytes of the failed request. */
668  enum ofp_bad_instruction_code {
669  OFPBIC_UNKNOWN_INST = 0, /* Unknown instruction. */
670  OFPBIC_UNSUP_INST = 1, /* Switch or table does not support the
671  * instruction. */
672  OFPBIC_BAD_TABLE_ID = 2, /* Invalid Table-ID specified. */
673  OFPBIC_UNSUP_METADATA = 3, /* Metadata value unsupported by datapath. */
674  OFPBIC_UNSUP_METADATA_MASK = 4, /* Metadata mask value unsupported by
675  * datapath. */
676  OFPBIC_BAD_EXPERIMENTER = 5, /* Specific experimenter instruction
677  * unsupported. */
678  OFPBIC_BAD_EXP_TYPE = 6, /* Unknown instruction for experimenter id. */
679  OFPBIC_BAD_LEN = 7, /* Length problem in instructions. */
680  OFPBIC_EPERM = 8, /* Permissions error. */
681  };
682 
683  /* ofp_error_msg 'code' values for OFPET_BAD_MATCH. 'data' contains at least
684  * the first 64 bytes of the failed request. */
685  enum ofp_bad_match_code {
686  OFPBMC_BAD_TYPE = 0, /* Unsupported match type specified by the match */
687  OFPBMC_BAD_LEN = 1, /* Length problem in match. */
688  OFPBMC_BAD_TAG = 2, /* Match uses an unsupported tag/encap. */
689  OFPBMC_BAD_DL_ADDR_MASK = 3, /* Unsupported datalink addr mask - switch
690  * does not support arbitrary datalink
691  * address mask. */
692  OFPBMC_BAD_NW_ADDR_MASK = 4, /* Unsupported network addr mask - switch
693  * does not support arbitrary network
694  * address mask. */
695  OFPBMC_BAD_WILDCARDS = 5, /* Unsupported combination of fields masked
696  * or omitted in the match. */
697  OFPBMC_BAD_FIELD = 6, /* Unsupported field type in the match. */
698  OFPBMC_BAD_VALUE = 7, /* Unsupported value in a match field. */
699  OFPBMC_BAD_MASK = 8, /* Unsupported mask specified in the match,
700  * field is not dl-address or nw-address. */
701  OFPBMC_BAD_PREREQ = 9, /* A prerequisite was not met. */
702  OFPBMC_DUP_FIELD = 10, /* A field type was duplicated. */
703  OFPBMC_EPERM = 11, /* Permissions error. */
704  };
705 
706  /* ofp_error_msg 'code' values for OFPET_FLOW_MOD_FAILED. 'data' contains
707  * at least the first 64 bytes of the failed request. */
708  enum ofp_flow_mod_failed_code {
709  OFPFMFC_UNKNOWN = 0, /* Unspecified error. */
710  OFPFMFC_TABLE_FULL = 1, /* Flow not added because table was full. */
711  OFPFMFC_BAD_TABLE_ID = 2, /* Table does not exist */
712  OFPFMFC_OVERLAP = 3, /* Attempted to add overlapping flow with
713  * CHECK_OVERLAP flag set. */
714  OFPFMFC_EPERM = 4, /* Permissions error. */
715  OFPFMFC_BAD_TIMEOUT = 5, /* Flow not added because of unsupported
716  * idle/hard timeout. */
717  OFPFMFC_BAD_COMMAND = 6, /* Unsupported or unknown command. */
718  OFPFMFC_BAD_FLAGS = 7, /* Unsupported or unknown flags. */
719  };
720 
721  /* ofp_error_msg 'code' values for OFPET_GROUP_MOD_FAILED. 'data' contains
722  * at least the first 64 bytes of the failed request. */
723  enum ofp_group_mod_failed_code {
724  OFPGMFC_GROUP_EXISTS = 0, /* Group not added because a group ADD
725  * attempted to replace an
726  * already-present group. */
727  OFPGMFC_INVALID_GROUP = 1, /* Group not added because Group specified
728  * is invalid. */
729  OFPGMFC_WEIGHT_UNSUPPORTED = 2, /* Switch does not support unequal load
730  * sharing with select groups. */
731  OFPGMFC_OUT_OF_GROUPS = 3, /* The group table is full. */
732  OFPGMFC_OUT_OF_BUCKETS = 4, /* The maximum number of action buckets
733  * for a group has been exceeded. */
734  OFPGMFC_CHAINING_UNSUPPORTED = 5, /* Switch does not support groups that
735  * forward to groups. */
736  OFPGMFC_WATCH_UNSUPPORTED = 6, /* This group cannot watch the
737  watch_port or watch_group specified. */
738  OFPGMFC_LOOP = 7, /* Group entry would cause a loop. */
739  OFPGMFC_UNKNOWN_GROUP = 8, /* Group not modified because a group
740  MODIFY attempted to modify a
741  non-existent group. */
742  OFPGMFC_CHAINED_GROUP = 9, /* Group not deleted because another
743  group is forwarding to it. */
744  OFPGMFC_BAD_TYPE = 10, /* Unsupported or unknown group type. */
745  OFPGMFC_BAD_COMMAND = 11, /* Unsupported or unknown command. */
746  OFPGMFC_BAD_BUCKET = 12, /* Error in bucket. */
747  OFPGMFC_BAD_WATCH = 13, /* Error in watch port/group. */
748  OFPGMFC_EPERM = 14, /* Permissions error. */
749  };
750 
751  /* ofp_error_msg 'code' values for OFPET_PORT_MOD_FAILED. 'data' contains
752  * at least the first 64 bytes of the failed request. */
753  enum ofp_port_mod_failed_code {
754  OFPPMFC_BAD_PORT = 0, /* Specified port number does not exist. */
755  OFPPMFC_BAD_HW_ADDR = 1, /* Specified hardware address does not
756  * match the port number. */
757  OFPPMFC_BAD_CONFIG = 2, /* Specified config is invalid. */
758  OFPPMFC_BAD_ADVERTISE = 3, /* Specified advertise is invalid. */
759  OFPPMFC_EPERM = 4, /* Permissions error. */
760  };
761 
762  /* ofp_error_msg 'code' values for OFPET_TABLE_MOD_FAILED. 'data' contains
763  * at least the first 64 bytes of the failed request. */
764  enum ofp_table_mod_failed_code {
765  OFPTMFC_BAD_TABLE = 0, /* Specified table does not exist. */
766  OFPTMFC_BAD_CONFIG = 1, /* Specified config is invalid. */
767  OFPTMFC_EPERM = 2, /* Permissions error. */
768  };
769 
770  /* ofp_error msg 'code' values for OFPET_QUEUE_OP_FAILED. 'data' contains
771  * at least the first 64 bytes of the failed request */
772  enum ofp_queue_op_failed_code {
773  OFPQOFC_BAD_PORT = 0, /* Invalid port (or port does not exist). */
774  OFPQOFC_BAD_QUEUE = 1, /* Queue does not exist. */
775  OFPQOFC_EPERM = 2, /* Permissions error. */
776  };
777 
778  /* ofp_error_msg 'code' values for OFPET_SWITCH_CONFIG_FAILED. 'data' contains
779  * at least the first 64 bytes of the failed request. */
780  enum ofp_switch_config_failed_code {
781  OFPSCFC_BAD_FLAGS = 0, /* Specified flags is invalid. */
782  OFPSCFC_BAD_LEN = 1, /* Specified len is invalid. */
783  OFPSCFC_EPERM = 2, /* Permissions error. */
784  };
785 
786  /* ofp_error_msg ’code’ values for OFPET_ROLE_REQUEST_FAILED. ’data’ contains
787  * at least the first 64 bytes of the failed request. */
788  enum ofp_role_request_failed_code {
789  OFPRRFC_STALE = 0, /* Stale Message: old generation_id. */
790  OFPRRFC_UNSUP = 1, /* Controller role change unsupported. */
791  OFPRRFC_BAD_ROLE = 2, /* Invalid role. */
792  };
793 
794  /* ofp_error_msg ’code’ values for OFPET_METER_MOD_FAILED. ’data’ contains
795  * at least the first 64 bytes of the failed request. */
796  enum ofp_meter_mod_failed_code {
797  OFPMMFC_UNKNOWN = 0, /* Unspecified error. */
798  OFPMMFC_METER_EXISTS = 1, /* Meter not added because a Meter ADD
799  * attempted to replace an existing Meter. */
800  OFPMMFC_INVALID_METER = 2, /* Meter not added because Meter specified
801  * is invalid. */
802  OFPMMFC_UNKNOWN_METER = 3, /* Meter not modified because a Meter
803  * MODIFY attempted to modify a non-existent
804  * Meter. */
805  OFPMMFC_BAD_COMMAND = 4, /* Unsupported or unknown command. */
806  OFPMMFC_BAD_FLAGS = 5, /* Flag configuration unsupported. */
807  OFPMMFC_BAD_RATE = 6, /* Rate unsupported. */
808  OFPMMFC_BAD_BURST = 7, /* Burst size unsupported. */
809  OFPMMFC_BAD_BAND = 8, /* Band unsupported. */
810  OFPMMFC_BAD_BAND_VALUE = 9, /* Band value unsupported. */
811  OFPMMFC_OUT_OF_METERS = 10, /* No more meters available. */
812  OFPMMFC_OUT_OF_BANDS = 11, /* The maximum number of properties
813  * for a meter has been exceeded. */
814  };
815 
816  /* ofp_error_msg ’code’ values for OFPET_TABLE_FEATURES_FAILED. ’data’ contains
817  * at least the first 64 bytes of the failed request. */
818  enum ofp_table_features_failed_code {
819  OFPTFFC_BAD_TABLE = 0, /* Specified table does not exist. */
820  OFPTFFC_BAD_METADATA = 1, /* Invalid metadata mask. */
821  OFPTFFC_BAD_TYPE = 2, /* Unknown property type. */
822  OFPTFFC_BAD_LEN = 3, /* Length problem in properties. */
823  OFPTFFC_BAD_ARGUMENT = 4, /* Unsupported property value. */
824  OFPTFFC_EPERM = 5, /* Permissions error. */
825  };
826 
827 
828  enum ofp_error_ids {
829  /* HELLO_FAILED */
830  OFPETC_HELLO_FAILED_INCOMPATIBLE = (OFPET_HELLO_FAILED << 16) | OFPHFC_INCOMPATIBLE, /* No compatible version. */
831  OFPETC_HELLO_FAILED_EPERM = (OFPET_HELLO_FAILED << 16) | OFPHFC_EPERM, /* Permissions error. */
832 
833 
834  /* BAD_REQUEST */
835  OFPETC_BAD_REQUEST_BAD_VERSION = (OFPET_BAD_REQUEST << 16) | OFPBRC_BAD_VERSION, /* ofp_header.version not supported. */
836  OFPETC_BAD_REQUEST_BAD_TYPE = (OFPET_BAD_REQUEST << 16) | OFPBRC_BAD_TYPE, /* ofp_header.type not supported. */
837  OFPETC_BAD_REQUEST_BAD_STAT = (OFPET_BAD_REQUEST << 16) | OFPBRC_BAD_STAT, /* ofp_stats_request.type not supported. */
838  OFPETC_BAD_REQUEST_BAD_EXPERIMENTER = (OFPET_BAD_REQUEST << 16) | OFPBRC_BAD_EXPERIMENTER, /* Experimenter id not supported
839  * (in ofp_experimenter_header or
840  * ofp_stats_request or ofp_stats_reply). */
841 
842 
843  OFPETC_BAD_REQUEST_BAD_EXP_TYPE = (OFPET_BAD_REQUEST << 16) | OFPBRC_BAD_EXP_TYPE, /* Experimenter type not supported. */
844  OFPETC_BAD_REQUEST_EPERM = (OFPET_BAD_REQUEST << 16) | OFPBRC_EPERM, /* Permissions error. */
845  OFPETC_BAD_REQUEST_BAD_LEN = (OFPET_BAD_REQUEST << 16) | OFPBRC_BAD_LEN, /* Wrong request length for type. */
846  OFPETC_BAD_REQUEST_BUFFER_EMPTY = (OFPET_BAD_REQUEST << 16) | OFPBRC_BUFFER_EMPTY, /* Specified buffer has already been used. */
847  OFPETC_BAD_REQUEST_BUFFER_UNKNOWN = (OFPET_BAD_REQUEST << 16) | OFPBRC_BUFFER_UNKNOWN,/* Specified buffer does not exist. */
848  OFPETC_BAD_REQUEST_BAD_TABLE_ID = (OFPET_BAD_REQUEST << 16) | OFPBRC_BAD_TABLE_ID, /* Specified table-id invalid or does not exist. */
849  OFPETC_BAD_REQUEST_IS_SLAVE = (OFPET_BAD_REQUEST << 16) | OFPBRC_IS_SLAVE, /* Denied because controller is slave. */
850  OFPETC_BAD_REQUEST_BAD_PORT = (OFPET_BAD_REQUEST << 16) | OFPBRC_BAD_PORT, /* Invalid port. */
851  OFPETC_BAD_REQUEST_BAD_PACKET = (OFPET_BAD_REQUEST << 16) | OFPBRC_BAD_PACKET, /* Invalid packet in packet-out. */
852  OFPETC_BAD_REQUEST_MULTIPART_BUFFER_OVERFLOW = (OFPET_BAD_REQUEST << 16) | OFPBRC_MULTIPART_BUFFER_OVERFLOW,
853  /* ofp_multipart_request
854  * overflowed the assigned buffer. */
855 
856 
857  /* BAD_ACTION */
858  OFPETC_BAD_ACTION_BAD_TYPE = (OFPET_BAD_ACTION << 16) | OFPBAC_BAD_TYPE, /* Unknown action type. */
859  OFPETC_BAD_ACTION_BAD_LEN = (OFPET_BAD_ACTION << 16) | OFPBAC_BAD_LEN, /* Length problem in actions. */
860  OFPETC_BAD_ACTION_BAD_EXPERIMENTER = (OFPET_BAD_ACTION << 16) | OFPBAC_BAD_EXPERIMENTER, /* Unknown experimenter id specified. */
861  OFPETC_BAD_ACTION_BAD_EXP_TYPE = (OFPET_BAD_ACTION << 16) | OFPBAC_BAD_EXP_TYPE, /* Unknown action type for experimenter id. */
862  OFPETC_BAD_ACTION_BAD_OUT_PORT = (OFPET_BAD_ACTION << 16) | OFPBAC_BAD_OUT_PORT, /* Problem validating output port. */
863  OFPETC_BAD_ACTION_BAD_ARGUMENT = (OFPET_BAD_ACTION << 16) | OFPBAC_BAD_ARGUMENT, /* Bad action argument. */
864  OFPETC_BAD_ACTION_EPERM = (OFPET_BAD_ACTION << 16) | OFPBAC_EPERM, /* Permissions error. */
865  OFPETC_BAD_ACTION_TOO_MANY = (OFPET_BAD_ACTION << 16) | OFPBAC_TOO_MANY, /* Can't handle this many actions. */
866  OFPETC_BAD_ACTION_BAD_QUEUE = (OFPET_BAD_ACTION << 16) | OFPBAC_BAD_QUEUE, /* Problem validating output queue. */
867  OFPETC_BAD_ACTION_BAD_OUT_GROUP = (OFPET_BAD_ACTION << 16) | OFPBAC_BAD_OUT_GROUP, /* Invalid group id in forward action. */
868  OFPETC_BAD_ACTION_MATCH_INCONSISTENT= (OFPET_BAD_ACTION << 16) | OFPBAC_MATCH_INCONSISTENT, /* Action can't apply for this match. */
869  OFPETC_BAD_ACTION_UNSUPPORTED_ORDER = (OFPET_BAD_ACTION << 16) | OFPBAC_UNSUPPORTED_ORDER, /* Action order is unsupported for the action
870  * list in an Apply-Actions instruction */
871  OFPETC_BAD_ACTION_BAD_TAG = (OFPET_BAD_ACTION << 16) | OFPBAC_BAD_TAG, /* Actions uses an unsupported
872  * tag/encap. */
873  OFPETC_BAD_ACTION_BAD_SET_TYPE = (OFPET_BAD_ACTION << 16) | OFPBAC_BAD_SET_TYPE, /* Unsupported type in SET_FIELD action. */
874  OFPETC_BAD_ACTION_BAD_SET_LEN = (OFPET_BAD_ACTION << 16) | OFPBAC_BAD_SET_LEN, /* Length problem in SET_FIELD action. */
875  OFPETC_BAD_ACTION_BAD_SET_ARGUMENT = (OFPET_BAD_ACTION << 16) | OFPBAC_BAD_SET_ARGUMENT, /* Bad argument in SET_FIELD action. */
876 
877 
878 
879  /* BAD_INSTRUCTION */
880  OFPETC_BAD_INSTRUCTION_UNKNOWN_INST = (OFPET_BAD_INSTRUCTION << 16) | OFPBIC_UNKNOWN_INST, /* Unknown instruction. */
881  OFPETC_BAD_INSTRUCTION_UNSUP_INST = (OFPET_BAD_INSTRUCTION << 16) | OFPBIC_UNSUP_INST, /* Switch or table does not support the
882  * instruction. */
883  OFPETC_BAD_INSTRUCTION_BAD_TABLE_ID = (OFPET_BAD_INSTRUCTION << 16) | OFPBIC_BAD_TABLE_ID, /* Invalid Table-ID specified. */
884  OFPETC_BAD_INSTRUCTION_UNSUP_METADATA = (OFPET_BAD_INSTRUCTION << 16) | OFPBIC_UNSUP_METADATA, /* Metadata value unsupported by datapath. */
885  OFPETC_BAD_INSTRUCTION_UNSUP_METADATA_MASK = (OFPET_BAD_INSTRUCTION << 16) | OFPBIC_UNSUP_METADATA_MASK, /* Metadata mask value unsupported by
886  * datapath. */
887  OFPETC_BAD_INSTRUCTION_BAD_EXPERIMENTER = (OFPET_BAD_INSTRUCTION << 16) | OFPBIC_BAD_EXPERIMENTER, /* Specific experimenter instruction
888  * unsupported. */
889  OFPETC_BAD_INSTRUCTION_BAD_EXP_TYPE = (OFPET_BAD_INSTRUCTION << 16) | OFPBIC_BAD_EXP_TYPE, /* Unknown instruction for experimenter id. */
890  OFPETC_BAD_INSTRUCTION_BAD_LEN = (OFPET_BAD_INSTRUCTION << 16) | OFPBIC_BAD_LEN, /* Length problem in instructions. */
891  OFPETC_BAD_INSTRUCTION_EPERM = (OFPET_BAD_INSTRUCTION << 16) | OFPBIC_EPERM, /* Permissions error. */
892 
893 
894  /* BAD_MATCH */
895  OFPETC_BAD_MATCH_BAD_TYPE = (OFPET_BAD_MATCH << 16) | OFPBMC_BAD_TYPE, /* Unsupported match type specified by the match */
896  OFPETC_BAD_MATCH_BAD_LEN = (OFPET_BAD_MATCH << 16) | OFPBMC_BAD_LEN, /* Length problem in match. */
897  OFPETC_BAD_MATCH_BAD_TAG = (OFPET_BAD_MATCH << 16) | OFPBMC_BAD_TAG, /* Match uses an unsupported tag/encap. */
898  OFPETC_BAD_MATCH_BAD_DL_ADDR_MASK = (OFPET_BAD_MATCH << 16) | OFPBMC_BAD_DL_ADDR_MASK, /* Unsupported datalink addr mask - switch
899  * does not support arbitrary datalink
900  * address mask. */
901  OFPETC_BAD_MATCH_BAD_NW_ADDR_MASK = (OFPET_BAD_MATCH << 16) | OFPBMC_BAD_NW_ADDR_MASK, /* Unsupported network addr mask - switch
902  * does not support arbitrary network
903  * address mask. */
904  OFPETC_BAD_MATCH_BAD_WILDCARDS = (OFPET_BAD_MATCH << 16) | OFPBMC_BAD_WILDCARDS, /* Unsupported combination of fields masked
905  * or omitted in the match. */
906  OFPETC_BAD_MATCH_BAD_FIELD = (OFPET_BAD_MATCH << 16) | OFPBMC_BAD_FIELD, /* Unsupported field type in the match. */
907  OFPETC_BAD_MATCH_BAD_VALUE = (OFPET_BAD_MATCH << 16) | OFPBMC_BAD_VALUE, /* Unsupported value in a match field. */
908  OFPETC_BAD_MATCH_BAD_MASK = (OFPET_BAD_MATCH << 16) | OFPBMC_BAD_MASK, /* Unsupported mask specified in the match,
909  * field is not dl-address or nw-address. */
910  OFPETC_BAD_MATCH_BAD_PREREQ = (OFPET_BAD_MATCH << 16) | OFPBMC_BAD_PREREQ, /* A prerequisite was not met. */
911  OFPETC_BAD_MATCH_DUP_FIELD = (OFPET_BAD_MATCH << 16) | OFPBMC_DUP_FIELD, /* A field type was duplicated. */
912  OFPETC_BAD_MATCH_EPERM = (OFPET_BAD_MATCH << 16) | OFPBMC_EPERM, /* Permissions error. */
913 
914 
915  /* FLOW_MOD_FAILED */
916  OFPETC_FLOW_MOD_UNKNOWN = (OFPET_FLOW_MOD_FAILED << 16) | OFPFMFC_UNKNOWN, /* Unspecified error. */
917  OFPETC_FLOW_MOD_TABLE_FULL = (OFPET_FLOW_MOD_FAILED << 16) | OFPFMFC_TABLE_FULL, /* Flow not added because table was full. */
918  OFPETC_FLOW_MOD_BAD_TABLE_ID = (OFPET_FLOW_MOD_FAILED << 16) | OFPFMFC_BAD_TABLE_ID, /* Table does not exist */
919  OFPETC_FLOW_MOD_OVERLAP = (OFPET_FLOW_MOD_FAILED << 16) | OFPFMFC_OVERLAP, /* Attempted to add overlapping flow with
920  * CHECK_OVERLAP flag set. */
921  OFPETC_FLOW_MOD_EPERM = (OFPET_FLOW_MOD_FAILED << 16) | OFPFMFC_EPERM, /* Permissions error. */
922  OFPETC_FLOW_MOD_BAD_TIMEOUT = (OFPET_FLOW_MOD_FAILED << 16) | OFPFMFC_BAD_TIMEOUT, /* Flow not added because of unsupported
923  * idle/hard timeout. */
924  OFPETC_FLOW_MOD_BAD_COMMAND = (OFPET_FLOW_MOD_FAILED << 16) | OFPFMFC_BAD_COMMAND, /* Unsupported or unknown command. */
925  OFPETC_FLOW_MOD_BAD_FLAGS = (OFPET_FLOW_MOD_FAILED << 16) | OFPFMFC_BAD_FLAGS, /* Unsupported or unknown flags. */
926 
927  /* GROUP_MOD_FAILED */
928  OFPETC_GROUP_MOD_GROUP_EXISTS = (OFPET_GROUP_MOD_FAILED << 16) | OFPGMFC_GROUP_EXISTS, /* Group not added because a group ADD
929  * attempted to replace an
930  * already-present group. */
931  OFPETC_GROUP_MOD_INVALID_GROUP = (OFPET_GROUP_MOD_FAILED << 16) | OFPGMFC_INVALID_GROUP, /* Group not added because Group specified
932  * is invalid. */
933  OFPETC_GROUP_MOD_WEIGHT_UNSUPPORTED = (OFPET_GROUP_MOD_FAILED << 16) | OFPGMFC_WEIGHT_UNSUPPORTED, /* Switch does not support unequal load
934  * sharing with select groups. */
935  OFPETC_GROUP_MOD_OUT_OF_GROUPS = (OFPET_GROUP_MOD_FAILED << 16) | OFPGMFC_OUT_OF_GROUPS, /* The group table is full. */
936  OFPETC_GROUP_MOD_OUT_OF_BUCKETS = (OFPET_GROUP_MOD_FAILED << 16) | OFPGMFC_OUT_OF_BUCKETS, /* The maximum number of action buckets
937  * for a group has been exceeded. */
938  OFPETC_GROUP_MOD_CHAINING_UNSUPPORTED= (OFPET_GROUP_MOD_FAILED << 16) | OFPGMFC_CHAINING_UNSUPPORTED, /* Switch does not support groups that
939  * forward to groups. */
940  OFPETC_GROUP_MOD_WATCH_UNSUPPORTED = (OFPET_GROUP_MOD_FAILED << 16) | OFPGMFC_WATCH_UNSUPPORTED, /* This group cannot watch the
941  watch_port or watch_group specified. */
942  OFPETC_GROUP_MOD_LOOP = (OFPET_GROUP_MOD_FAILED << 16) | OFPGMFC_LOOP, /* Group entry would cause a loop. */
943  OFPETC_GROUP_MOD_UNKNOWN_GROUP = (OFPET_GROUP_MOD_FAILED << 16) | OFPGMFC_UNKNOWN_GROUP, /* Group not modified because a group
944  MODIFY attempted to modify a
945  non-existent group. */
946  OFPETC_GROUP_MOD_CHAINED_GROUP = (OFPET_GROUP_MOD_FAILED << 16) | OFPGMFC_CHAINED_GROUP, /* Group not deleted because another
947  group is forwarding to it. */
948  OFPETC_GROUP_MOD_BAD_TYPE = (OFPET_GROUP_MOD_FAILED << 16) | OFPGMFC_BAD_TYPE, /* Unsupported or unknown group type. */
949  OFPETC_GROUP_MOD_BAD_COMMAND = (OFPET_GROUP_MOD_FAILED << 16) | OFPGMFC_BAD_COMMAND, /* Unsupported or unknown command. */
950  OFPETC_GROUP_MOD_BAD_BUCKET = (OFPET_GROUP_MOD_FAILED << 16) | OFPGMFC_BAD_BUCKET, /* Error in bucket. */
951  OFPETC_GROUP_MOD_BAD_WATCH = (OFPET_GROUP_MOD_FAILED << 16) | OFPGMFC_BAD_WATCH, /* Error in watch port/group. */
952  OFPETC_GROUP_MOD_EPERM = (OFPET_GROUP_MOD_FAILED << 16) | OFPGMFC_EPERM, /* Permissions error. */
953 
954  /* PORT_MOD_FAILED */
955  OFPETC_PORT_MOD_BAD_PORT = (OFPET_PORT_MOD_FAILED << 16) | OFPPMFC_BAD_PORT, /* Specified port number does not exist. */
956  OFPETC_PORT_MOD_BAD_HW_ADDR = (OFPET_PORT_MOD_FAILED << 16) | OFPPMFC_BAD_HW_ADDR, /* Specified hardware address does not
957  * match the port number. */
958  OFPETC_PORT_MOD_BAD_CONFIG = (OFPET_PORT_MOD_FAILED << 16) | OFPPMFC_BAD_CONFIG, /* Specified config is invalid. */
959  OFPETC_PORT_MOD_BAD_ADVERTISE = (OFPET_PORT_MOD_FAILED << 16) | OFPPMFC_BAD_ADVERTISE, /* Specified advertise is invalid. */
960  OFPETC_PORT_MOD_EPERM = (OFPET_PORT_MOD_FAILED << 16) | OFPPMFC_EPERM, /* Permissions error. */
961 
962  /* TABLE_MOD_FAILED */
963  OFPETC_TABLE_MOD_BAD_TABLE = (OFPET_TABLE_MOD_FAILED << 16) | OFPTMFC_BAD_TABLE, /* Specified table does not exist. */
964  OFPETC_TABLE_MOD_BAD_CONFIG = (OFPET_TABLE_MOD_FAILED << 16) | OFPTMFC_BAD_CONFIG, /* Specified config is invalid. */
965  OFPETC_TABLE_MOD_EPERM = (OFPET_TABLE_MOD_FAILED << 16) | OFPTMFC_EPERM, /* Permissions error. */
966 
967  /* QUEUE_OP_FAILED */
968  OFPETC_QUEUE_OP_BAD_PORT = (OFPET_QUEUE_OP_FAILED << 16) | OFPQOFC_BAD_PORT, /* Invalid port (or port does not exist). */
969  OFPETC_QUEUE_OP_BAD_QUEUE = (OFPET_QUEUE_OP_FAILED << 16) | OFPQOFC_BAD_QUEUE, /* Queue does not exist. */
970  OFPETC_QUEUE_OP_EPERM = (OFPET_QUEUE_OP_FAILED << 16) | OFPQOFC_EPERM, /* Permissions error. */
971 
972  /* SWITCH_CONFIG_FAILED */
973  OFPETC_SWITCH_CONFIG_BAD_FLAGS = (OFPET_SWITCH_CONFIG_FAILED << 16) | OFPSCFC_BAD_FLAGS, /* Specified flags is invalid. */
974  OFPETC_SWITCH_CONFIG_BAD_LEN = (OFPET_SWITCH_CONFIG_FAILED << 16) | OFPSCFC_BAD_LEN, /* Specified len is invalid. */
975  OFPETC_SWITCH_CONFIG_EPERM = (OFPET_SWITCH_CONFIG_FAILED << 16) | OFPSCFC_EPERM, /* Permissions error. */
976 
977  /* ROLE_REQUEST */
978  OFPETC_ROLE_REQUEST_STALE = (OFPET_ROLE_REQUEST_FAILED << 16) | OFPRRFC_STALE, /* Stale Message: old generation_id. */
979  OFPETC_ROLE_REQUEST_UNSUP = (OFPET_ROLE_REQUEST_FAILED << 16) | OFPRRFC_UNSUP, /* Controller role change unsupported. */
980  OFPETC_ROLE_REQUEST_BAD_ROLE = (OFPET_ROLE_REQUEST_FAILED << 16) | OFPRRFC_BAD_ROLE, /* Invalid role. */
981 
982  /* METER_MOD_FAILED */
983  OFPETC_METER_MOD_UNKNOWN = (OFPET_METER_MOD_FAILED << 16) | OFPMMFC_UNKNOWN, /* Unspecified error. */
984  OFPETC_METER_MOD_METER_EXISTS = (OFPET_METER_MOD_FAILED << 16) | OFPMMFC_METER_EXISTS, /* Meter not added because a Meter ADD
985  * attempted to replace an existing Meter. */
986  OFPETC_METER_MOD_INVALID_METER = (OFPET_METER_MOD_FAILED << 16) | OFPMMFC_INVALID_METER, /* Meter not added because Meter specified
987  * is invalid. */
988  OFPETC_METER_MOD_UNKNOWN_METER = (OFPET_METER_MOD_FAILED << 16) | OFPMMFC_UNKNOWN_METER, /* Meter not modified because a Meter
989  * MODIFY attempted to modify a non-existent
990  * Meter. */
991  OFPETC_METER_MOD_BAD_COMMAND = (OFPET_METER_MOD_FAILED << 16) | OFPMMFC_BAD_COMMAND, /* Unsupported or unknown command. */
992  OFPETC_METER_MOD_BAD_FLAGS = (OFPET_METER_MOD_FAILED << 16) | OFPMMFC_BAD_FLAGS, /* Flag configuration unsupported. */
993  OFPETC_METER_MOD_BAD_RATE = (OFPET_METER_MOD_FAILED << 16) | OFPMMFC_BAD_RATE, /* Rate unsupported. */
994  OFPETC_METER_MOD_BAD_BURST = (OFPET_METER_MOD_FAILED << 16) | OFPMMFC_BAD_BURST, /* Burst size unsupported. */
995  OFPETC_METER_MOD_BAD_BAND = (OFPET_METER_MOD_FAILED << 16) | OFPMMFC_BAD_BAND, /* Band unsupported. */
996  OFPETC_METER_MOD_BAD_BAND_VALUE = (OFPET_METER_MOD_FAILED << 16) | OFPMMFC_BAD_BAND_VALUE, /* Band value unsupported. */
997  OFPETC_METER_MOD_OUT_OF_METERS = (OFPET_METER_MOD_FAILED << 16) | OFPMMFC_OUT_OF_METERS, /* No more meters available. */
998  OFPETC_METER_MOD_OUT_OF_BANDS = (OFPET_METER_MOD_FAILED << 16) | OFPMMFC_OUT_OF_BANDS, /* The maximum number of properties
999  * for a meter has been exceeded. */
1000 
1001  /* TABLE_FEATURES_FAILED */
1002  OFPETC_TABLE_FEATURES_BAD_TABLE = (OFPET_TABLE_FEATURES_FAILED << 16) | OFPTFFC_BAD_TABLE, /* Specified table does not exist. */
1003  OFPETC_TABLE_FEATURES_BAD_METADATA = (OFPET_TABLE_FEATURES_FAILED << 16) | OFPTFFC_BAD_METADATA, /* Invalid metadata mask. */
1004  OFPETC_TABLE_FEATURES_BAD_TYPE = (OFPET_TABLE_FEATURES_FAILED << 16) | OFPTFFC_BAD_TYPE, /* Unknown property type. */
1005  OFPETC_TABLE_FEATURES_BAD_LEN = (OFPET_TABLE_FEATURES_FAILED << 16) | OFPTFFC_BAD_LEN, /* Length problem in properties. */
1006  OFPETC_TABLE_FEATURES_BAD_ARGUMENT = (OFPET_TABLE_FEATURES_FAILED << 16) | OFPTFFC_BAD_ARGUMENT, /* Unsupported property value. */
1007  OFPETC_TABLE_FEATURES_EPERM = (OFPET_TABLE_FEATURES_FAILED << 16) | OFPTFFC_EPERM, /* Permissions error. */
1008 
1009  /* EXPERIMENTER */
1010  OFPETC_EXPERIMENTER = (OFPET_EXPERIMENTER << 16), /* Experimenter error messages. */
1011  };
1012 
1013 
1014 
1015  enum ofp_multipart_types {
1016  /* Description of this OpenFlow switch.
1017  * The request body is empty.
1018  * The reply body is struct ofp_desc. */
1019  OFPMP_DESC = 0,
1020 
1021  /* Individual flow statistics.
1022  * The request body is struct ofp_flow_stats_request.
1023  * The reply body is an array of struct ofp_flow_stats. */
1024  OFPMP_FLOW = 1,
1025 
1026  /* Aggregate flow statistics.
1027  * The request body is struct ofp_aggregate_stats_request.
1028  * The reply body is struct ofp_aggregate_stats_reply. */
1029  OFPMP_AGGREGATE = 2,
1030 
1031  /* Flow table statistics.
1032  * The request body is empty.
1033  * The reply body is an array of struct ofp_table_stats. */
1034  OFPMP_TABLE = 3,
1035 
1036  /* Port statistics.
1037  * The request body is struct ofp_port_stats_request.
1038  * The reply body is an array of struct ofp_port_stats. */
1039  OFPMP_PORT_STATS = 4,
1040 
1041  /* Queue statistics for a port
1042  * The request body is struct ofp_queue_stats_request.
1043  * The reply body is an array of struct ofp_queue_stats */
1044  OFPMP_QUEUE = 5,
1045 
1046  /* Group counter statistics.
1047  * The request body is struct ofp_group_stats_request.
1048  * The reply is an array of struct ofp_group_stats. */
1049  OFPMP_GROUP = 6,
1050 
1051  /* Group description.
1052  * The request body is empty.
1053  * The reply body is an array of struct ofp_group_desc_stats. */
1054  OFPMP_GROUP_DESC = 7,
1055 
1056  /* Group features.
1057  * The request body is empty.
1058  * The reply body is struct ofp_group_features. */
1059  OFPMP_GROUP_FEATURES = 8,
1060 
1061  /* Meter statistics.
1062  * The request body is struct ofp_meter_multipart_requests.
1063  * The reply body is an array of struct ofp_meter_stats. */
1064  OFPMP_METER = 9,
1065 
1066  /* Meter configuration.
1067  * The request body is struct ofp_meter_multipart_requests.
1068  * The reply body is an array of struct ofp_meter_config. */
1069  OFPMP_METER_CONFIG = 10,
1070 
1071  /* Meter features.
1072  * The request body is empty.
1073  * The reply body is struct ofp_meter_features. */
1074  OFPMP_METER_FEATURES = 11,
1075 
1076  /* Table features.
1077  * The request body is either empty or contains an array of
1078  * struct ofp_table_features containing the controller’s
1079  * desired view of the switch. If the switch is unable to
1080  * set the specified view an error is returned.
1081  * The reply body is an array of struct ofp_table_features. */
1082  OFPMP_TABLE_FEATURES = 12,
1083 
1084  /* Port description.
1085  * The request body is empty.
1086  * The reply body is an array of struct ofp_port. */
1087  OFPMP_PORT_DESC = 13,
1088 
1089  /* Experimenter extension.
1090  * The request and reply bodies begin with
1091  * struct ofp_experimenter_multipart_header.
1092  * The request and reply bodies are otherwise experimenter-defined. */
1093  OFPMP_EXPERIMENTER = 0xffff
1094  };
1095 
1096 
1097 }; // end of namespace openflow
1098 }; // end of namespace rofl
1099 
1100 #include "rofl/common/openflow/openflow_experimental.h"
1101 
1102 #endif /* OPENFLOW_COMMON_H_ */
Definition: openflow_common.h:493
Definition: openflow_common.h:202
Definition: openflow_common.h:247
Definition: openflow_common.h:309
Definition: openflow_common.h:270
Definition: openflow_common.h:286
Definition: openflow_common.h:569
Definition: openflow_common.h:318
Definition: openflow_common.h:176
Definition: openflow_common.h:325
Definition: openflow_common.h:58
Definition: openflow_common.h:294
Definition: openflow_common.h:186
Definition: openflow_common.h:124
Definition: openflow_common.h:334
Definition: openflow_common.h:253
Definition: openflow_common.h:344