X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fopenflow%2Fnicira-ext.h;h=3970e23fecea2e01ba8fe76bfb792c84aee57c5d;hb=d689a6a819c5bd4f4bde2c8766c0c7652b70eb3e;hp=3c2856f9e3949e8b5f4085221759d63a68544e1a;hpb=1e37a2d75196c6e10ac078213ad94afb4f3e219a;p=openvswitch diff --git a/include/openflow/nicira-ext.h b/include/openflow/nicira-ext.h index 3c2856f9..3970e23f 100644 --- a/include/openflow/nicira-ext.h +++ b/include/openflow/nicira-ext.h @@ -205,8 +205,8 @@ OFP_ASSERT(sizeof(struct nxt_tun_id_cookie) == 24); * OpenFlow features. In particular attempts to modify the flow table * will be rejected with an OFPBRC_EPERM error. * - * Slave controllers also do not receive asynchronous messages - * (OFPT_PACKET_IN, OFPT_FLOW_REMOVED, OFPT_PORT_STATUS). + * Slave controllers do not receive OFPT_PACKET_IN or OFPT_FLOW_REMOVED + * messages, but they do receive OFPT_PORT_STATUS messages. */ struct nx_role_request { struct nicira_header nxh; @@ -230,6 +230,7 @@ enum nx_action_subtype { NXAST_POP_QUEUE, /* struct nx_action_pop_queue */ NXAST_REG_MOVE, /* struct nx_action_reg_move */ NXAST_REG_LOAD, /* struct nx_action_reg_load */ + NXAST_NOTE /* struct nx_action_note */ }; /* Header for Nicira-defined actions. */ @@ -346,8 +347,11 @@ OFP_ASSERT(sizeof(struct nx_action_pop_queue) == 16); * bit 'c'). Bit numbering starts at 0 for the least-significant bit, 1 for * the next most significant bit, and so on. * - * 'src' and 'dst' are nxm_header values with nxm_hasmask=0. The following - * nxm_header values are potentially acceptable as 'src': + * 'src' and 'dst' are nxm_header values with nxm_hasmask=0. (It doesn't make + * sense to use nxm_hasmask=1 because the action does not do any kind of + * matching; it uses the actual value of a field.) + * + * The following nxm_header values are potentially acceptable as 'src': * * - NXM_OF_IN_PORT * - NXM_OF_ETH_DST @@ -412,7 +416,7 @@ OFP_ASSERT(sizeof(struct nx_action_reg_move) == 24); * starts at 0 for the least-significant bit, 1 for the next most significant * bit, and so on. * - * 'dst' must be one of the following: + * 'dst' is an nxm_header with nxm_hasmask=0. It must be one of the following: * * - NXM_NX_REG(idx) for idx in the switch's accepted range. * @@ -442,6 +446,24 @@ struct nx_action_reg_load { }; OFP_ASSERT(sizeof(struct nx_action_reg_load) == 24); +/* Action structure for NXAST_NOTE. + * + * This action has no effect. It is variable length. The switch does not + * attempt to interpret the user-defined 'note' data in any way. A controller + * can use this action to attach arbitrary metadata to a flow. + * + * This action might go away in the future. + */ +struct nx_action_note { + uint16_t type; /* OFPAT_VENDOR. */ + uint16_t len; /* A multiple of 8, but at least 16. */ + uint32_t vendor; /* NX_VENDOR_ID. */ + uint16_t subtype; /* NXAST_NOTE. */ + uint8_t note[6]; /* Start of user-defined data. */ + /* Possibly followed by additional user-defined data. */ +}; +OFP_ASSERT(sizeof(struct nx_action_note) == 16); + /* Wildcard for tunnel ID. */ #define NXFW_TUN_ID (1 << 25) @@ -845,7 +867,8 @@ OFP_ASSERT(sizeof(struct nx_action_reg_load) == 24); #define NXM_NX_REG(IDX) NXM_HEADER (0x0001, IDX, 4) #define NXM_NX_REG_W(IDX) NXM_HEADER_W(0x0001, IDX, 4) #define NXM_NX_REG_IDX(HEADER) NXM_FIELD(HEADER) -#define NXM_IS_NX_REG(HEADER) (!((((HEADER) ^ NXM_NX_REG(0))) & 0xffffe0ff)) +#define NXM_IS_NX_REG(HEADER) (!((((HEADER) ^ NXM_NX_REG0)) & 0xffffe1ff)) +#define NXM_IS_NX_REG_W(HEADER) (!((((HEADER) ^ NXM_NX_REG0_W)) & 0xffffe1ff)) #define NXM_NX_REG0 NXM_HEADER (0x0001, 0, 4) #define NXM_NX_REG0_W NXM_HEADER_W(0x0001, 0, 4) #define NXM_NX_REG1 NXM_HEADER (0x0001, 1, 4) @@ -873,7 +896,7 @@ OFP_ASSERT(sizeof(struct nx_action_reg_load) == 24); /* ## Requests and replies. ## */ /* ## --------------------- ## */ -enum { +enum nx_flow_format { NXFF_OPENFLOW10 = 0, /* Standard OpenFlow 1.0 compatible. */ NXFF_TUN_ID_FROM_COOKIE = 1, /* OpenFlow 1.0, plus obtain tunnel ID from * cookie. */