X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fopenflow%2Fopenflow-1.2.h;h=55463134066e04b1e25a4e850d37876fed6fdb79;hb=85b20fd6ee585f462e012fbcc7f966a81edab2ed;hp=3aaa056fce166a74d58243440b3462dc3073c1d8;hpb=cb6e2b01787b71c39678e9ef98e3b9374a7db378;p=sliver-openvswitch.git diff --git a/include/openflow/openflow-1.2.h b/include/openflow/openflow-1.2.h index 3aaa056fc..554631340 100644 --- a/include/openflow/openflow-1.2.h +++ b/include/openflow/openflow-1.2.h @@ -32,7 +32,7 @@ */ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira Networks. + * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. * Copyright (c) 2012 Horms Solutions Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -55,14 +55,6 @@ #include "openflow/openflow-1.1.h" -/* OpenFlow 1.2 specific message types, in addition to the common message - * types. */ -enum ofp12_type { - /* Controller role change request messages. */ - OFPT12_ROLE_REQUEST = 24, /* Controller/switch message */ - OFPT12_ROLE_REPLY, /* Controller/switch message */ -}; - /* * OXM Class IDs. * The high order bit differentiate reserved classes from member classes. @@ -114,16 +106,28 @@ enum oxm12_ofb_match_fields { OFPXMT12_OFB_IPV6_ND_TLL, /* Target link-layer for ND. */ OFPXMT12_OFB_MPLS_LABEL, /* MPLS label. */ OFPXMT12_OFB_MPLS_TC, /* MPLS TC. */ + /* Following added in OpenFlow 1.3 */ + OFPXMT12_OFB_MPLS_BOS, /* MPLS BoS bit. */ + OFPXMT12_OFB_PBB_ISID, /* PBB I-SID. */ + OFPXMT12_OFB_TUNNEL_ID, /* Logical Port Metadata */ + OFPXMT12_OFB_IPV6_EXTHDR, /* IPv6 Extension Header pseudo-field */ + + /* End Marker */ + OFPXMT12_OFB_MAX, }; +#define OFPXMT12_MASK ((1ULL << OFPXMT12_OFB_MAX) - 1) + /* OXM implementation makes use of NXM as they are the same format * with different field definitions */ #define OXM_HEADER(FIELD, LENGTH) \ - NXM_HEADER(OFPXMC12_OPENFLOW_BASIC, FIELD, LENGTH) + NXM_HEADER(OFPXMC12_OPENFLOW_BASIC, FIELD, LENGTH) #define OXM_HEADER_W(FIELD, LENGTH) \ - NXM_HEADER_W(OFPXMC12_OPENFLOW_BASIC, FIELD, LENGTH) + NXM_HEADER_W(OFPXMC12_OPENFLOW_BASIC, FIELD, LENGTH) + +#define IS_OXM_HEADER(header) (NXM_VENDOR(header) == OFPXMC12_OPENFLOW_BASIC) #define OXM_OF_IN_PORT OXM_HEADER (OFPXMT12_OFB_IN_PORT, 4) #define OXM_OF_IN_PHY_PORT OXM_HEADER (OFPXMT12_OFB_IN_PHY_PORT, 4) @@ -173,6 +177,13 @@ enum oxm12_ofb_match_fields { #define OXM_OF_IPV6_ND_TLL OXM_HEADER (OFPXMT12_OFB_IPV6_ND_TLL, 6) #define OXM_OF_MPLS_LABEL OXM_HEADER (OFPXMT12_OFB_MPLS_LABEL, 4) #define OXM_OF_MPLS_TC OXM_HEADER (OFPXMT12_OFB_MPLS_TC, 1) +#define OXM_OF_MPLS_BOS OXM_HEADER (OFPXMT12_OFB_MPLS_BOS, 1) +#define OXM_OF_PBB_ISID OXM_HEADER (OFPXMT12_OFB_PBB_ISID, 4) +#define OXM_OF_PBB_ISID_W OXM_HEADER_W (OFPXMT12_OFB_PBB_ISID, 4) +#define OXM_OF_TUNNEL_ID OXM_HEADER (OFPXMT12_OFB_TUNNEL_ID, 8) +#define OXM_OF_TUNNEL_ID_W OXM_HEADER_W (OFPXMT12_OFB_TUNNEL_ID, 8) +#define OXM_OF_IPV6_EXTHDR OXM_HEADER (OFPXMT12_OFB_IPV6_EXTHDR, 2) +#define OXM_OF_IPV6_EXTHDR_W OXM_HEADER_W (OFPXMT12_OFB_IPV6_EXTHDR, 2) /* The VLAN id is 12-bits, so we can use the entire 16 bits to indicate * special conditions. @@ -182,6 +193,19 @@ enum ofp12_vlan_id { OFPVID12_NONE = 0x0000, /* No VLAN id was set. */ }; +/* Bit definitions for IPv6 Extension Header pseudo-field. */ +enum ofp12_ipv6exthdr_flags { + OFPIEH12_NONEXT = 1 << 0, /* "No next header" encountered. */ + OFPIEH12_ESP = 1 << 1, /* Encrypted Sec Payload header present. */ + OFPIEH12_AUTH = 1 << 2, /* Authentication header present. */ + OFPIEH12_DEST = 1 << 3, /* 1 or 2 dest headers present. */ + OFPIEH12_FRAG = 1 << 4, /* Fragment header present. */ + OFPIEH12_ROUTER = 1 << 5, /* Router header present. */ + OFPIEH12_HOP = 1 << 6, /* Hop-by-hop header present. */ + OFPIEH12_UNREP = 1 << 7, /* Unexpected repeats encountered. */ + OFPIEH12_UNSEQ = 1 << 8 /* Unexpected sequencing encountered. */ +}; + /* Header for OXM experimenter match fields. */ struct ofp12_oxm_experimenter_header { ovs_be32 oxm_header; /* oxm_class = OFPXMC_EXPERIMENTER */ @@ -191,43 +215,26 @@ struct ofp12_oxm_experimenter_header { OFP_ASSERT(sizeof(struct ofp12_oxm_experimenter_header) == 8); enum ofp12_action_type { - OFPAT12_OUTPUT = 0, /* Output to switch port. */ - OFPAT12_COPY_TTL_OUT = 11, /* Copy TTL "outwards" -- from next-to-outermost - to outermost */ - OFPAT12_COPY_TTL_IN, /* Copy TTL "inwards" -- from outermost to - next-to-outermost */ - OFPAT12_SET_MPLS_TTL, /* MPLS TTL */ - OFPAT12_DEC_MPLS_TTL, /* Decrement MPLS TTL */ - OFPAT12_PUSH_VLAN, /* Push a new VLAN tag */ - OFPAT12_POP_VLAN, /* Pop the outer VLAN tag */ - OFPAT12_PUSH_MPLS, /* Push a new MPLS tag */ - OFPAT12_POP_MPLS, /* Pop the outer MPLS tag */ - OFPAT12_SET_QUEUE, /* Set queue id when outputting to a port */ - OFPAT12_GROUP, /* Apply group. */ - OFPAT12_SET_NW_TTL, /* IP TTL. */ - OFPAT12_DEC_NW_TTL, /* Decrement IP TTL. */ - OFPAT12_SET_FIELD, /* Set a header field using OXM TLV format. */ - OFPAT12_EXPERIMENTER = 0xffff + OFPAT12_SET_FIELD = 25, /* Set a header field using OXM TLV format. */ }; enum ofp12_controller_max_len { - OFPCML12_MAX = 0xffe5, /* maximum max_len value which can be used - * to request a specific byte length. */ - OFPCML12_NO_BUFFER = 0xffff /* indicates that no buffering should be - * applied and the whole packet is to be - * sent to the controller. */ + OFPCML12_MAX = 0xffe5, /* maximum max_len value which can be used + * to request a specific byte length. */ + OFPCML12_NO_BUFFER = 0xffff /* indicates that no buffering should be + * applied and the whole packet is to be + * sent to the controller. */ }; /* Action structure for OFPAT12_SET_FIELD. */ struct ofp12_action_set_field { ovs_be16 type; /* OFPAT12_SET_FIELD. */ ovs_be16 len; /* Length is padded to 64 bits. */ + ovs_be32 dst; /* OXM TLV header */ /* Followed by: - * - Exactly oxm_len bytes containing a single OXM TLV, then * - Exactly ((oxm_len + 4) + 7)/8*8 - (oxm_len + 4) (between 0 and 7) * bytes of all-zero bytes */ - uint8_t field[4]; /* OXM TLV - Make compiler happy */ }; OFP_ASSERT(sizeof(struct ofp12_action_set_field) == 8); @@ -262,7 +269,6 @@ enum ofp12_queue_properties { /* Body of reply to OFPST_TABLE request. */ struct ofp12_table_stats { - struct ofp11_stats_msg osm; uint8_t table_id; /* Identifier of table. Lower numbered tables are consulted first. */ uint8_t pad[7]; /* Align to 64-bits. */ @@ -288,17 +294,16 @@ struct ofp12_table_stats { ovs_be64 lookup_count; /* Number of packets looked up in table. */ ovs_be64 matched_count; /* Number of packets that hit table. */ }; -OFP_ASSERT(sizeof(struct ofp12_table_stats) == 144); +OFP_ASSERT(sizeof(struct ofp12_table_stats) == 128); /* Body of reply to OFPST12_GROUP_FEATURES request. Group features. */ struct ofp12_group_features_stats { - struct ofp11_stats_msg osm; ovs_be32 types; /* Bitmap of OFPGT_* values supported. */ ovs_be32 capabilities; /* Bitmap of OFPGFC12_* capability supported. */ ovs_be32 max_groups[4]; /* Maximum number of groups for each type. */ ovs_be32 actions[4]; /* Bitmaps of OFPAT_* that are supported. */ }; -OFP_ASSERT(sizeof(struct ofp12_group_features_stats) == 56); +OFP_ASSERT(sizeof(struct ofp12_group_features_stats) == 40); /* Group configuration flags */ enum ofp12_group_capabilities { @@ -319,12 +324,11 @@ OFP_ASSERT(sizeof(struct ofp12_experimenter_stats_header) == 8); /* Role request and reply message. */ struct ofp12_role_request { - struct ofp_header header; /* Type OFPT12_ROLE_REQUEST/OFPT12_ROLE_REPLY. */ ovs_be32 role; /* One of OFPCR12_ROLE_*. */ uint8_t pad[4]; /* Align to 64 bits. */ ovs_be64 generation_id; /* Master Election Generation Id */ }; -OFP_ASSERT(sizeof(struct ofp12_role_request) == 24); +OFP_ASSERT(sizeof(struct ofp12_role_request) == 16); /* Controller roles. */ enum ofp12_controller_role { @@ -336,7 +340,6 @@ enum ofp12_controller_role { /* Packet received on port (datapath -> controller). */ struct ofp12_packet_in { - struct ofp_header header; ovs_be32 buffer_id; /* ID assigned by datapath. */ ovs_be16 total_len; /* Full length of frame. */ uint8_t reason; /* Reason packet is being sent (one of OFPR_*) */ @@ -352,11 +355,10 @@ struct ofp12_packet_in { /* uint8_t pad[2]; Align to 64 bit + 16 bit */ /* uint8_t data[0]; Ethernet frame */ }; -OFP_ASSERT(sizeof(struct ofp12_packet_in) == 16); +OFP_ASSERT(sizeof(struct ofp12_packet_in) == 8); /* Flow removed (datapath -> controller). */ struct ofp12_flow_removed { - struct ofp_header header; ovs_be64 cookie; /* Opaque controller-issued identifier. */ ovs_be16 priority; /* Priority level of flow entry. */ @@ -372,6 +374,6 @@ struct ofp12_flow_removed { ovs_be64 byte_count; /* struct ofp12_match match; Description of fields. Variable size. */ }; -OFP_ASSERT(sizeof(struct ofp12_flow_removed) == 48); +OFP_ASSERT(sizeof(struct ofp12_flow_removed) == 40); #endif /* openflow/openflow-1.2.h */