From patchwork Fri Oct 2 21:16:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Stringer X-Patchwork-Id: 525804 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id C7259140D79 for ; Sat, 3 Oct 2015 07:17:04 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id B914F22C4A4; Fri, 2 Oct 2015 14:16:36 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v1.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 0493E22C49A for ; Fri, 2 Oct 2015 14:16:35 -0700 (PDT) Received: from bar3.cudamail.com (bar1 [192.168.15.1]) by mx3v1.cudamail.com (Postfix) with ESMTP id 72EFD618616 for ; Fri, 2 Oct 2015 15:16:34 -0600 (MDT) X-ASG-Debug-ID: 1443820593-03dd7b65e132730001-byXFYA Received: from mx3-pf1.cudamail.com ([192.168.14.2]) by bar3.cudamail.com with ESMTP id Nm8ABUT7zfxBRRVX (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 02 Oct 2015 15:16:34 -0600 (MDT) X-Barracuda-Envelope-From: joestringer@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.2 Received: from unknown (HELO mail-pa0-f45.google.com) (209.85.220.45) by mx3-pf1.cudamail.com with ESMTPS (RC4-SHA encrypted); 2 Oct 2015 21:16:33 -0000 Received-SPF: unknown (mx3-pf1.cudamail.com: Multiple SPF records returned) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.45 Received: by pablk4 with SMTP id lk4so115632433pab.3 for ; Fri, 02 Oct 2015 14:16:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=T0Qcz+5bwoM7kAUWPsBw8FKIE++djXBnuH/Nc9MkmIU=; b=ev1lG2X2yDIVTgdYiLJTnMiHPx3r/6tvf6KRll3icM5bS5uiGa1i3fSvDJc0qqAUHA 6NVFuN+tfsC1gM5grB31DcFZfLB1dAOLz4R024wyNciT8cqbKyhmETrUuMaRpHor9T7P 1AXCjbr2bBv+K5xB9sXB7J/Jf6eiJRTJ2NxiMmHjsCxF/BuaqOYMCx9Pew+hkYVCPoFe UL+V6ML5zEwe2Fuugyw0kDYTIMSwrf3GetL00ArRsBI2LthDo6rbM53dwC+KR0Y1e8Os HC6+zJmw8dZ6/IgkaSyjdkPfI3ULWbD3PbCuMZs/fPz2FJGlWUFkPn7y574W+nOw93ES ff3A== X-Gm-Message-State: ALoCoQk/QFnaaY3SfiEzt7T3oSDT570oDxCaUE48ujHfuSvx/+LwznlDmT3NxPjeQabBkazqEzeG X-Received: by 10.66.219.8 with SMTP id pk8mr12389280pac.138.1443820593249; Fri, 02 Oct 2015 14:16:33 -0700 (PDT) Received: from localhost.localdomain ([208.91.2.4]) by smtp.gmail.com with ESMTPSA id z6sm13633900pbt.51.2015.10.02.14.16.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Oct 2015 14:16:32 -0700 (PDT) X-CudaMail-Envelope-Sender: joestringer@nicira.com X-Barracuda-Apparent-Source-IP: 208.91.2.4 From: Joe Stringer To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V1-1001056916 X-CudaMail-DTE: 100215 X-CudaMail-Originating-IP: 209.85.220.45 Date: Fri, 2 Oct 2015 14:16:12 -0700 X-ASG-Orig-Subj: [##CM-V1-1001056916##][PATCHv4 05/11] ofp-actions: Pass ofp_version to decode functions. Message-Id: <1443820578-9287-6-git-send-email-joestringer@nicira.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1443820578-9287-1-git-send-email-joestringer@nicira.com> References: <1443820578-9287-1-git-send-email-joestringer@nicira.com> X-Barracuda-Connect: UNKNOWN[192.168.14.2] X-Barracuda-Start-Time: 1443820594 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCHv4 05/11] ofp-actions: Pass ofp_version to decode functions. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" A future patch will make use of this version parameter to pass nested attributes. Prepare for that by adding the parameter as an unused variable for the existing functions. Signed-off-by: Joe Stringer Acked-by: Ben Pfaff --- build-aux/extract-ofp-actions | 9 +-- lib/ofp-actions.c | 133 +++++++++++++++++++++++++++++++++--------- 2 files changed, 109 insertions(+), 33 deletions(-) diff --git a/build-aux/extract-ofp-actions b/build-aux/extract-ofp-actions index 5242093..3a72349 100755 --- a/build-aux/extract-ofp-actions +++ b/build-aux/extract-ofp-actions @@ -314,7 +314,7 @@ def extract_ofp_actions(fn, definitions): print """\ static enum ofperr ofpact_decode(const struct ofp_action_header *a, enum ofp_raw_action_type raw, - uint64_t arg, struct ofpbuf *out) + enum ofp_version version, uint64_t arg, struct ofpbuf *out) { switch (raw) {\ """ @@ -333,7 +333,7 @@ ofpact_decode(const struct ofp_action_header *a, enum ofp_raw_action_type raw, arg = "%s(arg)" % hton else: arg = "arg" - print " return decode_%s(%s, out);" % (enum, arg) + print " return decode_%s(%s, version, out);" % (enum, arg) print print """\ default: @@ -348,15 +348,16 @@ ofpact_decode(const struct ofp_action_header *a, enum ofp_raw_action_type raw, base_argtype = versions[0]["base_argtype"] if base_argtype != 'void': if base_argtype.startswith('struct'): - prototype += "const %s *, " % base_argtype + prototype += "const %s *, enum ofp_version, " % base_argtype else: - prototype += "%s, " % base_argtype + prototype += "%s, enum ofp_version, " % base_argtype prototype += "struct ofpbuf *);" print prototype print """ static enum ofperr ofpact_decode(const struct ofp_action_header *, enum ofp_raw_action_type raw, + enum ofp_version version, uint64_t arg, struct ofpbuf *out); """ diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index 0b22ce1..4f0215f 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -399,6 +399,7 @@ OFP_ASSERT(sizeof(struct ofp11_action_output) == 16); static enum ofperr decode_OFPAT_RAW10_OUTPUT(const struct ofp10_action_output *oao, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { struct ofpact_output *output; @@ -412,7 +413,8 @@ decode_OFPAT_RAW10_OUTPUT(const struct ofp10_action_output *oao, static enum ofperr decode_OFPAT_RAW11_OUTPUT(const struct ofp11_action_output *oao, - struct ofpbuf *out) + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { struct ofpact_output *output; enum ofperr error; @@ -485,7 +487,9 @@ format_OUTPUT(const struct ofpact_output *a, struct ds *s) /* Group actions. */ static enum ofperr -decode_OFPAT_RAW11_GROUP(uint32_t group_id, struct ofpbuf *out) +decode_OFPAT_RAW11_GROUP(uint32_t group_id, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { ofpact_put_GROUP(out)->group_id = group_id; return 0; @@ -541,6 +545,7 @@ OFP_ASSERT(sizeof(struct nx_action_controller) == 16); static enum ofperr decode_NXAST_RAW_CONTROLLER(const struct nx_action_controller *nac, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { struct ofpact_controller *oc; @@ -664,6 +669,7 @@ OFP_ASSERT(sizeof(struct ofp10_action_enqueue) == 16); static enum ofperr decode_OFPAT_RAW10_ENQUEUE(const struct ofp10_action_enqueue *oae, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { struct ofpact_enqueue *enqueue; @@ -776,6 +782,7 @@ OFP_ASSERT(sizeof(struct nx_action_output_reg2) == 24); static enum ofperr decode_NXAST_RAW_OUTPUT_REG(const struct nx_action_output_reg *naor, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { struct ofpact_output_reg *output_reg; @@ -796,7 +803,8 @@ decode_NXAST_RAW_OUTPUT_REG(const struct nx_action_output_reg *naor, static enum ofperr decode_NXAST_RAW_OUTPUT_REG2(const struct nx_action_output_reg2 *naor, - struct ofpbuf *out) + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { struct ofpact_output_reg *output_reg; enum ofperr error; @@ -1012,13 +1020,16 @@ decode_bundle(bool load, const struct nx_action_bundle *nab, } static enum ofperr -decode_NXAST_RAW_BUNDLE(const struct nx_action_bundle *nab, struct ofpbuf *out) +decode_NXAST_RAW_BUNDLE(const struct nx_action_bundle *nab, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { return decode_bundle(false, nab, out); } static enum ofperr decode_NXAST_RAW_BUNDLE_LOAD(const struct nx_action_bundle *nab, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { return decode_bundle(true, nab, out); @@ -1090,13 +1101,17 @@ decode_set_vlan_vid(uint16_t vid, bool push_vlan_if_needed, struct ofpbuf *out) } static enum ofperr -decode_OFPAT_RAW10_SET_VLAN_VID(uint16_t vid, struct ofpbuf *out) +decode_OFPAT_RAW10_SET_VLAN_VID(uint16_t vid, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { return decode_set_vlan_vid(vid, true, out); } static enum ofperr -decode_OFPAT_RAW11_SET_VLAN_VID(uint16_t vid, struct ofpbuf *out) +decode_OFPAT_RAW11_SET_VLAN_VID(uint16_t vid, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { return decode_set_vlan_vid(vid, false, out); } @@ -1177,13 +1192,17 @@ decode_set_vlan_pcp(uint8_t pcp, bool push_vlan_if_needed, struct ofpbuf *out) } static enum ofperr -decode_OFPAT_RAW10_SET_VLAN_PCP(uint8_t pcp, struct ofpbuf *out) +decode_OFPAT_RAW10_SET_VLAN_PCP(uint8_t pcp, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { return decode_set_vlan_pcp(pcp, true, out); } static enum ofperr -decode_OFPAT_RAW11_SET_VLAN_PCP(uint8_t pcp, struct ofpbuf *out) +decode_OFPAT_RAW11_SET_VLAN_PCP(uint8_t pcp, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { return decode_set_vlan_pcp(pcp, false, out); } @@ -1300,7 +1319,9 @@ format_STRIP_VLAN(const struct ofpact_null *a, struct ds *s) /* Push VLAN action. */ static enum ofperr -decode_OFPAT_RAW11_PUSH_VLAN(ovs_be16 eth_type, struct ofpbuf *out) +decode_OFPAT_RAW11_PUSH_VLAN(ovs_be16 eth_type, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { if (eth_type != htons(ETH_TYPE_VLAN_8021Q)) { /* XXX 802.1AD(QinQ) isn't supported at the moment */ @@ -1363,6 +1384,7 @@ OFP_ASSERT(sizeof(struct ofp_action_dl_addr) == 16); static enum ofperr decode_OFPAT_RAW_SET_DL_SRC(const struct ofp_action_dl_addr *a, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { ofpact_put_SET_ETH_SRC(out)->mac = a->dl_addr; @@ -1371,6 +1393,7 @@ decode_OFPAT_RAW_SET_DL_SRC(const struct ofp_action_dl_addr *a, static enum ofperr decode_OFPAT_RAW_SET_DL_DST(const struct ofp_action_dl_addr *a, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { ofpact_put_SET_ETH_DST(out)->mac = a->dl_addr; @@ -1441,14 +1464,18 @@ format_SET_ETH_DST(const struct ofpact_mac *a, struct ds *s) /* Set IPv4 address actions. */ static enum ofperr -decode_OFPAT_RAW_SET_NW_SRC(ovs_be32 ipv4, struct ofpbuf *out) +decode_OFPAT_RAW_SET_NW_SRC(ovs_be32 ipv4, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { ofpact_put_SET_IPV4_SRC(out)->ipv4 = ipv4; return 0; } static enum ofperr -decode_OFPAT_RAW_SET_NW_DST(ovs_be32 ipv4, struct ofpbuf *out) +decode_OFPAT_RAW_SET_NW_DST(ovs_be32 ipv4, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { ofpact_put_SET_IPV4_DST(out)->ipv4 = ipv4; return 0; @@ -1513,7 +1540,9 @@ format_SET_IPV4_DST(const struct ofpact_ipv4 *a, struct ds *s) /* Set IPv4/v6 TOS actions. */ static enum ofperr -decode_OFPAT_RAW_SET_NW_TOS(uint8_t dscp, struct ofpbuf *out) +decode_OFPAT_RAW_SET_NW_TOS(uint8_t dscp, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { if (dscp & ~IP_DSCP_MASK) { return OFPERR_OFPBAC_BAD_ARGUMENT; @@ -1563,7 +1592,9 @@ format_SET_IP_DSCP(const struct ofpact_dscp *a, struct ds *s) /* Set IPv4/v6 ECN actions. */ static enum ofperr -decode_OFPAT_RAW11_SET_NW_ECN(uint8_t ecn, struct ofpbuf *out) +decode_OFPAT_RAW11_SET_NW_ECN(uint8_t ecn, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { if (ecn & ~IP_ECN_MASK) { return OFPERR_OFPBAC_BAD_ARGUMENT; @@ -1615,7 +1646,9 @@ format_SET_IP_ECN(const struct ofpact_ecn *a, struct ds *s) /* Set IPv4/v6 TTL actions. */ static enum ofperr -decode_OFPAT_RAW11_SET_NW_TTL(uint8_t ttl, struct ofpbuf *out) +decode_OFPAT_RAW11_SET_NW_TTL(uint8_t ttl, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { ofpact_put_SET_IP_TTL(out)->ttl = ttl; return 0; @@ -1657,14 +1690,18 @@ format_SET_IP_TTL(const struct ofpact_ip_ttl *a, struct ds *s) /* Set TCP/UDP/SCTP port actions. */ static enum ofperr -decode_OFPAT_RAW_SET_TP_SRC(ovs_be16 port, struct ofpbuf *out) +decode_OFPAT_RAW_SET_TP_SRC(ovs_be16 port, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { ofpact_put_SET_L4_SRC_PORT(out)->port = ntohs(port); return 0; } static enum ofperr -decode_OFPAT_RAW_SET_TP_DST(ovs_be16 port, struct ofpbuf *out) +decode_OFPAT_RAW_SET_TP_DST(ovs_be16 port, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { ofpact_put_SET_L4_DST_PORT(out)->port = ntohs(port); return 0; @@ -1919,6 +1956,7 @@ decode_copy_field__(ovs_be16 src_offset, ovs_be16 dst_offset, ovs_be16 n_bits, static enum ofperr decode_OFPAT_RAW15_COPY_FIELD(const struct ofp15_action_copy_field *oacf, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *ofpacts) { return decode_copy_field__(oacf->src_offset, oacf->dst_offset, @@ -1928,6 +1966,7 @@ decode_OFPAT_RAW15_COPY_FIELD(const struct ofp15_action_copy_field *oacf, static enum ofperr decode_ONFACT_RAW13_COPY_FIELD(const struct onf_action_copy_field *oacf, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *ofpacts) { return decode_copy_field__(oacf->src_offset, oacf->dst_offset, @@ -1937,6 +1976,7 @@ decode_ONFACT_RAW13_COPY_FIELD(const struct onf_action_copy_field *oacf, static enum ofperr decode_NXAST_RAW_REG_MOVE(const struct nx_action_reg_move *narm, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *ofpacts) { struct ofpact_reg_move *move; @@ -2172,6 +2212,7 @@ decode_ofpat_set_field(const struct ofp12_action_set_field *oasf, static enum ofperr decode_OFPAT_RAW12_SET_FIELD(const struct ofp12_action_set_field *oasf, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *ofpacts) { return decode_ofpat_set_field(oasf, false, ofpacts); @@ -2179,6 +2220,7 @@ decode_OFPAT_RAW12_SET_FIELD(const struct ofp12_action_set_field *oasf, static enum ofperr decode_OFPAT_RAW15_SET_FIELD(const struct ofp12_action_set_field *oasf, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *ofpacts) { return decode_ofpat_set_field(oasf, true, ofpacts); @@ -2186,6 +2228,7 @@ decode_OFPAT_RAW15_SET_FIELD(const struct ofp12_action_set_field *oasf, static enum ofperr decode_NXAST_RAW_REG_LOAD(const struct nx_action_reg_load *narl, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { struct ofpact_set_field *sf = ofpact_put_reg_load(out); @@ -2221,6 +2264,7 @@ decode_NXAST_RAW_REG_LOAD(const struct nx_action_reg_load *narl, static enum ofperr decode_NXAST_RAW_REG_LOAD2(const struct nx_action_reg_load2 *narl, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { struct ofpact_set_field *sf; @@ -2691,7 +2735,8 @@ decode_stack_action(const struct nx_action_stack *nasp, static enum ofperr decode_NXAST_RAW_STACK_PUSH(const struct nx_action_stack *nasp, - struct ofpbuf *ofpacts) + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *ofpacts) { struct ofpact_stack *push = ofpact_put_STACK_PUSH(ofpacts); enum ofperr error = decode_stack_action(nasp, push); @@ -2700,6 +2745,7 @@ decode_NXAST_RAW_STACK_PUSH(const struct nx_action_stack *nasp, static enum ofperr decode_NXAST_RAW_STACK_POP(const struct nx_action_stack *nasp, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *ofpacts) { struct ofpact_stack *pop = ofpact_put_STACK_POP(ofpacts); @@ -2807,6 +2853,7 @@ decode_OFPAT_RAW_DEC_NW_TTL(struct ofpbuf *out) static enum ofperr decode_NXAST_RAW_DEC_TTL_CNT_IDS(const struct nx_action_cnt_ids *nac_ids, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { struct ofpact_cnt_ids *ids; @@ -2929,7 +2976,9 @@ format_DEC_TTL(const struct ofpact_cnt_ids *a, struct ds *s) /* Set MPLS label actions. */ static enum ofperr -decode_OFPAT_RAW_SET_MPLS_LABEL(ovs_be32 label, struct ofpbuf *out) +decode_OFPAT_RAW_SET_MPLS_LABEL(ovs_be32 label, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { ofpact_put_SET_MPLS_LABEL(out)->label = label; return 0; @@ -2970,7 +3019,9 @@ format_SET_MPLS_LABEL(const struct ofpact_mpls_label *a, struct ds *s) /* Set MPLS TC actions. */ static enum ofperr -decode_OFPAT_RAW_SET_MPLS_TC(uint8_t tc, struct ofpbuf *out) +decode_OFPAT_RAW_SET_MPLS_TC(uint8_t tc, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { ofpact_put_SET_MPLS_TC(out)->tc = tc; return 0; @@ -3010,7 +3061,9 @@ format_SET_MPLS_TC(const struct ofpact_mpls_tc *a, struct ds *s) /* Set MPLS TTL actions. */ static enum ofperr -decode_OFPAT_RAW_SET_MPLS_TTL(uint8_t ttl, struct ofpbuf *out) +decode_OFPAT_RAW_SET_MPLS_TTL(uint8_t ttl, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { ofpact_put_SET_MPLS_TTL(out)->ttl = ttl; return 0; @@ -3081,7 +3134,9 @@ format_DEC_MPLS_TTL(const struct ofpact_null *a OVS_UNUSED, struct ds *s) /* Push MPLS label action. */ static enum ofperr -decode_OFPAT_RAW_PUSH_MPLS(ovs_be16 ethertype, struct ofpbuf *out) +decode_OFPAT_RAW_PUSH_MPLS(ovs_be16 ethertype, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { struct ofpact_push_mpls *oam; @@ -3124,7 +3179,9 @@ format_PUSH_MPLS(const struct ofpact_push_mpls *a, struct ds *s) /* Pop MPLS label action. */ static enum ofperr -decode_OFPAT_RAW_POP_MPLS(ovs_be16 ethertype, struct ofpbuf *out) +decode_OFPAT_RAW_POP_MPLS(ovs_be16 ethertype, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { ofpact_put_POP_MPLS(out)->ethertype = ethertype; return 0; @@ -3160,7 +3217,9 @@ format_POP_MPLS(const struct ofpact_pop_mpls *a, struct ds *s) /* Set tunnel ID actions. */ static enum ofperr -decode_NXAST_RAW_SET_TUNNEL(uint32_t tun_id, struct ofpbuf *out) +decode_NXAST_RAW_SET_TUNNEL(uint32_t tun_id, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { struct ofpact_tunnel *tunnel = ofpact_put_SET_TUNNEL(out); tunnel->ofpact.raw = NXAST_RAW_SET_TUNNEL; @@ -3169,7 +3228,9 @@ decode_NXAST_RAW_SET_TUNNEL(uint32_t tun_id, struct ofpbuf *out) } static enum ofperr -decode_NXAST_RAW_SET_TUNNEL64(uint64_t tun_id, struct ofpbuf *out) +decode_NXAST_RAW_SET_TUNNEL64(uint64_t tun_id, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { struct ofpact_tunnel *tunnel = ofpact_put_SET_TUNNEL(out); tunnel->ofpact.raw = NXAST_RAW_SET_TUNNEL64; @@ -3225,7 +3286,9 @@ format_SET_TUNNEL(const struct ofpact_tunnel *a, struct ds *s) /* Set queue action. */ static enum ofperr -decode_OFPAT_RAW_SET_QUEUE(uint32_t queue_id, struct ofpbuf *out) +decode_OFPAT_RAW_SET_QUEUE(uint32_t queue_id, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { ofpact_put_SET_QUEUE(out)->queue_id = queue_id; return 0; @@ -3317,6 +3380,7 @@ OFP_ASSERT(sizeof(struct nx_action_fin_timeout) == 16); static enum ofperr decode_NXAST_RAW_FIN_TIMEOUT(const struct nx_action_fin_timeout *naft, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { struct ofpact_fin_timeout *oft; @@ -3435,7 +3499,9 @@ struct nx_action_resubmit { OFP_ASSERT(sizeof(struct nx_action_resubmit) == 16); static enum ofperr -decode_NXAST_RAW_RESUBMIT(uint16_t port, struct ofpbuf *out) +decode_NXAST_RAW_RESUBMIT(uint16_t port, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { struct ofpact_resubmit *resubmit; @@ -3448,6 +3514,7 @@ decode_NXAST_RAW_RESUBMIT(uint16_t port, struct ofpbuf *out) static enum ofperr decode_NXAST_RAW_RESUBMIT_TABLE(const struct nx_action_resubmit *nar, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { struct ofpact_resubmit *resubmit; @@ -3821,6 +3888,7 @@ learn_min_len(uint16_t header) * 'ofpacts'. Returns 0 if successful, otherwise an OFPERR_*. */ static enum ofperr decode_NXAST_RAW_LEARN(const struct nx_action_learn *nal, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *ofpacts) { struct ofpact_learn *learn; @@ -4015,6 +4083,7 @@ add_conjunction(struct ofpbuf *out, static enum ofperr decode_NXAST_RAW_CONJUNCTION(const struct nx_action_conjunction *nac, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { if (nac->n_clauses < 2 || nac->n_clauses > 64 @@ -4130,6 +4199,7 @@ OFP_ASSERT(sizeof(struct nx_action_multipath) == 32); static enum ofperr decode_NXAST_RAW_MULTIPATH(const struct nx_action_multipath *nam, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { uint32_t n_links = ntohs(nam->max_link) + 1; @@ -4211,7 +4281,9 @@ struct nx_action_note { OFP_ASSERT(sizeof(struct nx_action_note) == 16); static enum ofperr -decode_NXAST_RAW_NOTE(const struct nx_action_note *nan, struct ofpbuf *out) +decode_NXAST_RAW_NOTE(const struct nx_action_note *nan, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { struct ofpact_note *note; unsigned int length; @@ -4376,7 +4448,9 @@ struct nx_action_sample { OFP_ASSERT(sizeof(struct nx_action_sample) == 24); static enum ofperr -decode_NXAST_RAW_SAMPLE(const struct nx_action_sample *nas, struct ofpbuf *out) +decode_NXAST_RAW_SAMPLE(const struct nx_action_sample *nas, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { struct ofpact_sample *sample; @@ -4622,6 +4696,7 @@ OFP_ASSERT(sizeof(struct nx_action_write_metadata) == 32); static enum ofperr decode_NXAST_RAW_WRITE_METADATA(const struct nx_action_write_metadata *nawm, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { struct ofpact_metadata *om; @@ -4760,7 +4835,7 @@ ofpacts_decode(const void *actions, size_t actions_len, error = ofpact_pull_raw(&openflow, ofp_version, &raw, &arg); if (!error) { - error = ofpact_decode(action, raw, arg, ofpacts); + error = ofpact_decode(action, raw, ofp_version, arg, ofpacts); } if (error) {