From patchwork Fri Sep 7 17:03:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 967431 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 426P091kWwz9s3Z for ; Sat, 8 Sep 2018 03:03:21 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id AF3D6BA2; Fri, 7 Sep 2018 17:03:19 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id DBA0DAE7 for ; Fri, 7 Sep 2018 17:03:17 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9BA227A8 for ; Fri, 7 Sep 2018 17:03:16 +0000 (UTC) X-Originating-IP: 208.91.3.26 Received: from sigabrt.benpfaff.org (unknown [208.91.3.26]) (Authenticated sender: blp@ovn.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 89D0F6000F; Fri, 7 Sep 2018 17:03:13 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Fri, 7 Sep 2018 10:03:08 -0700 Message-Id: <20180907170308.1318-1-blp@ovn.org> X-Mailer: git-send-email 2.16.1 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Bhargava Shastry , Ben Pfaff Subject: [ovs-dev] [PATCH] flow: Document parse_tcp_flags() assumptions and semantics. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Reported-by: Bhargava Shastry Signed-off-by: Ben Pfaff Reviewed-by: Yifeng Sun --- lib/flow.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/flow.c b/lib/flow.c index 77ed3d9dfd2f..128f64083ac7 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -1019,6 +1019,11 @@ parse_dl_type(const struct eth_header *data_, size_t size) return parse_ethertype(&data, &size); } +/* Parses and return the TCP flags in 'packet', converted to host byte order. + * If 'packet' is not an Ethernet packet embedding TCP, returns 0. + * + * The caller must ensure that 'packet' is at least ETH_HEADER_LEN bytes + * long.'*/ uint16_t parse_tcp_flags(struct dp_packet *packet) {