~ubuntu-branches/ubuntu/wily/openvswitch/wily

« back to all changes in this revision

Viewing changes to include/openflow/openflow-common.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-08-10 11:35:15 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20150810113515-575vj06oq29emxsn
Tags: 2.4.0~git20150810.97bab95-0ubuntu1
* New upstream snapshot from 2.4 branch:
  - d/*: Align any relevant packaging changes with upstream.
* d/*: wrap-and-sort.
* d/openvswitch-{common,vswitch}.install: Correct install location for
  bash completion files.
* d/tests/openflow.py: Explicitly use ovs-testcontroller as provided
  by 2.4.0 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
#ifndef OPENFLOW_COMMON_H
51
51
#define OPENFLOW_COMMON_H 1
52
52
 
53
 
#include "openvswitch/types.h"
 
53
#include <openvswitch/types.h>
54
54
 
55
55
#ifdef SWIG
56
56
#define OFP_ASSERT(EXPR)        /* SWIG can't handle OFP_ASSERT. */
98
98
 *
99
99
 *    - ONF_VENDOR_ID is being used within the ONF "extensibility" working
100
100
 *      group to identify extensions being proposed for standardization.
 
101
 *
 
102
 * The list is sorted numerically.
101
103
 */
102
104
#define OF_VENDOR_ID    0
 
105
#define HPL_VENDOR_ID   0x000004EA /* HP Labs. */
 
106
#define NTR_VENDOR_ID   0x00001540 /* Netronome. */
103
107
#define NX_VENDOR_ID    0x00002320 /* Nicira. */
104
108
#define ONF_VENDOR_ID   0x4f4e4600 /* Open Networking Foundation. */
105
109
 
268
272
enum ofp_packet_in_reason {
269
273
    OFPR_NO_MATCH,          /* No matching flow. */
270
274
    OFPR_ACTION,            /* Action explicitly output to controller. */
271
 
    OFPR_INVALID_TTL        /* Packet has invalid TTL. */,
 
275
    OFPR_INVALID_TTL,       /* Packet has invalid TTL. */
 
276
    OFPR_ACTION_SET,        /* Output to controller in action set */
 
277
    OFPR_GROUP,             /* Output to controller in group bucket */
 
278
    OFPR_PACKET_OUT,        /* Output to controller in packet-out */
272
279
    OFPR_N_REASONS
273
280
};
274
281
 
286
293
    OFPFF_CHECK_OVERLAP = 1 << 1,  /* Check for overlapping entries first. */
287
294
};
288
295
 
289
 
/* Action header for OFPAT10_VENDOR and OFPAT11_EXPERIMEMNTER.
290
 
 * The rest of the body is vendor-defined. */
291
 
struct ofp_action_vendor_header {
292
 
    ovs_be16 type;                  /* OFPAT10_VENDOR. */
293
 
    ovs_be16 len;                   /* Length is a multiple of 8. */
294
 
    ovs_be32 vendor;                /* Vendor ID, which takes the same form
295
 
                                       as in "struct ofp_vendor_header". */
296
 
};
297
 
OFP_ASSERT(sizeof(struct ofp_action_vendor_header) == 8);
298
 
 
299
 
/* Action header that is common to all actions.  The length includes the
300
 
 * header and any padding used to make the action 64-bit aligned.
301
 
 * NB: The length of an action *must* always be a multiple of eight. */
302
 
struct ofp_action_header {
303
 
    ovs_be16 type;                  /* One of OFPAT*. */
304
 
    ovs_be16 len;                   /* Length of action, including this
305
 
                                       header.  This is the length of action,
306
 
                                       including any padding to make it
307
 
                                       64-bit aligned. */
308
 
    uint8_t pad[4];
309
 
};
310
 
OFP_ASSERT(sizeof(struct ofp_action_header) == 8);
311
 
 
312
 
/* Action structure for OFPAT10_SET_VLAN_VID and OFPAT11_SET_VLAN_VID. */
313
 
struct ofp_action_vlan_vid {
314
 
    ovs_be16 type;                  /* Type. */
315
 
    ovs_be16 len;                   /* Length is 8. */
316
 
    ovs_be16 vlan_vid;              /* VLAN id. */
317
 
    uint8_t pad[2];
318
 
};
319
 
OFP_ASSERT(sizeof(struct ofp_action_vlan_vid) == 8);
320
 
 
321
 
/* Action structure for OFPAT10_SET_VLAN_PCP and OFPAT11_SET_VLAN_PCP. */
322
 
struct ofp_action_vlan_pcp {
323
 
    ovs_be16 type;                  /* Type. */
324
 
    ovs_be16 len;                   /* Length is 8. */
325
 
    uint8_t vlan_pcp;               /* VLAN priority. */
326
 
    uint8_t pad[3];
327
 
};
328
 
OFP_ASSERT(sizeof(struct ofp_action_vlan_pcp) == 8);
329
 
 
330
 
/* Action structure for OFPAT10_SET_DL_SRC/DST and OFPAT11_SET_DL_SRC/DST. */
331
 
struct ofp_action_dl_addr {
332
 
    ovs_be16 type;                  /* Type. */
333
 
    ovs_be16 len;                   /* Length is 16. */
334
 
    uint8_t dl_addr[OFP_ETH_ALEN];  /* Ethernet address. */
335
 
    uint8_t pad[6];
336
 
};
337
 
OFP_ASSERT(sizeof(struct ofp_action_dl_addr) == 16);
338
 
 
339
 
/* Action structure for OFPAT10_SET_NW_SRC/DST and OFPAT11_SET_NW_SRC/DST. */
340
 
struct ofp_action_nw_addr {
341
 
    ovs_be16 type;                  /* Type. */
342
 
    ovs_be16 len;                   /* Length is 8. */
343
 
    ovs_be32 nw_addr;               /* IP address. */
344
 
};
345
 
OFP_ASSERT(sizeof(struct ofp_action_nw_addr) == 8);
346
 
 
347
 
/* Action structure for OFPAT10_SET_NW_TOS and OFPAT11_SET_NW_TOS. */
348
 
struct ofp_action_nw_tos {
349
 
    ovs_be16 type;                  /* Type.. */
350
 
    ovs_be16 len;                   /* Length is 8. */
351
 
    uint8_t nw_tos;                 /* DSCP in high 6 bits, rest ignored. */
352
 
    uint8_t pad[3];
353
 
};
354
 
OFP_ASSERT(sizeof(struct ofp_action_nw_tos) == 8);
355
 
 
356
 
/* Action structure for OFPAT10_SET_TP_SRC/DST and OFPAT11_SET_TP_SRC/DST. */
357
 
struct ofp_action_tp_port {
358
 
    ovs_be16 type;                  /* Type. */
359
 
    ovs_be16 len;                   /* Length is 8. */
360
 
    ovs_be16 tp_port;               /* TCP/UDP port. */
361
 
    uint8_t pad[2];
362
 
};
363
 
OFP_ASSERT(sizeof(struct ofp_action_tp_port) == 8);
364
 
 
365
296
/* Why was this flow removed? */
366
297
enum ofp_flow_removed_reason {
367
298
    OFPRR_IDLE_TIMEOUT,         /* Flow idle time exceeded idle_timeout. */
370
301
    OFPRR_GROUP_DELETE,         /* Group was removed. */
371
302
    OFPRR_METER_DELETE,         /* Meter was removed. */
372
303
    OFPRR_EVICTION,             /* Switch eviction to free resources. */
 
304
 
 
305
    OVS_OFPRR_NONE              /* OVS internal_use only, keep last!. */
373
306
};
374
307
 
375
308
/* What changed about the physical port */