From patchwork Fri Nov 21 08:53:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 41286 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 159A8244B0 for ; Fri, 21 Nov 2014 08:54:21 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id d49sf2731696eek.8 for ; Fri, 21 Nov 2014 00:54:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=MGTsHptzH+pKhRa+dirkJhFaqi39xWckdtAe8MzmYgA=; b=OFvtGC30cJPK3po8fYpw6WPznbfBrmJRfvhOUR9lpEaH3u6uxCKVokRYctpCjyoZY8 W+naC2CgxA7RZ8HWU6yiigVl2d3EkGydFHoPdX0dyqnwnMfb4itTujkg2ClSYW4lmp/t 1UTk3nDQfcW2nbZEa7NMVTls4jsFC5oPaGuuoPnKFwh4O6D7ii1cvOxBeUozD4t2KyRS Mj4j2ewAn1C52FA3/NkJM256usQJNqef06XGX79Ub3GTcc/AW19T8glgzflJ+BkiuTfD NVq9uFFeUIREHn1mzI3qqmOEakkG+WF2ZsmxLl3aq17qDLUPcFZayXiEJkZvlbQzzBs7 1tGw== X-Gm-Message-State: ALoCoQny2EaJMxxgBPjsFFoS+UetjhYVJUFo82fzB/e+qKvdI49EJpU1szxqd9m5L/GPMTI2zzK7 X-Received: by 10.112.138.234 with SMTP id qt10mr1141319lbb.4.1416560060082; Fri, 21 Nov 2014 00:54:20 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.2.200 with SMTP id 8ls156716law.102.gmail; Fri, 21 Nov 2014 00:54:19 -0800 (PST) X-Received: by 10.112.93.231 with SMTP id cx7mr1733186lbb.89.1416560059509; Fri, 21 Nov 2014 00:54:19 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id la7si4347499lab.98.2014.11.21.00.54.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 00:54:19 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id w7so3687536lbi.15 for ; Fri, 21 Nov 2014 00:54:19 -0800 (PST) X-Received: by 10.112.62.166 with SMTP id z6mr2824834lbr.74.1416560059391; Fri, 21 Nov 2014 00:54:19 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp47001lbc; Fri, 21 Nov 2014 00:54:18 -0800 (PST) X-Received: by 10.224.98.148 with SMTP id q20mr4880314qan.18.1416560057997; Fri, 21 Nov 2014 00:54:17 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id 2si5889643qgx.106.2014.11.21.00.54.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Nov 2014 00:54:17 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xrjyo-0002HI-A4; Fri, 21 Nov 2014 08:54:14 +0000 Received: from mail-yk0-f173.google.com ([209.85.160.173]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xrjyi-0002Gy-EW for lng-odp@lists.linaro.org; Fri, 21 Nov 2014 08:54:08 +0000 Received: by mail-yk0-f173.google.com with SMTP id 19so2077725ykq.18 for ; Fri, 21 Nov 2014 00:54:03 -0800 (PST) X-Received: by 10.236.29.242 with SMTP id i78mr1493468yha.54.1416560043231; Fri, 21 Nov 2014 00:54:03 -0800 (PST) Received: from bala-PowerEdge-T110-II.caveonetworks.com ([111.93.218.67]) by mx.google.com with ESMTPSA id y67sm2345495yhc.11.2014.11.21.00.54.01 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 00:54:02 -0800 (PST) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Fri, 21 Nov 2014 14:23:40 +0530 Message-Id: <1416560024-20661-1-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Topics: patch Subject: [lng-odp] [PATCH v1 1/5] helper: odph_tcp header description X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bala.manoharan@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 This patch adds TCP header description structure odph_tcphdr. This structure is used for accessing TCP header information from the packet Signed-off-by: Balasubramanian Manoharan Reviewed-by: Maxim Uvarov --- helper/include/odph_tcp.h | 61 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 helper/include/odph_tcp.h diff --git a/helper/include/odph_tcp.h b/helper/include/odph_tcp.h new file mode 100644 index 0000000..4c5912b --- /dev/null +++ b/helper/include/odph_tcp.h @@ -0,0 +1,61 @@ +/* Copyright (c) 2014, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * + * ODP TCP header + */ + +#ifndef ODPH_TCP_H_ +#define ODPH_TCP_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +/** UDP header length */ +#define ODPH_TCPHDR_LEN 8 + +/** TCP header */ +typedef struct ODP_PACKED { + uint16be_t src_port; /**< Source port */ + uint16be_t dst_port; /**< Destinatino port */ + uint32be_t seq_no; /**< Sequence number */ + uint32be_t ack_no; /**< Acknowledgment number */ + union { + uint32be_t flags_and_window; + struct { + uint32be_t rsvd1:8; + uint32be_t flags:8; /**< TCP flags as a byte */ + uint32be_t rsvd2:16; + }; + struct { + uint32be_t hl:4; /**< Hdr len, in words */ + uint32be_t rsvd3:6; /**< Reserved */ + uint32be_t urg:1; /**< ACK */ + uint32be_t ack:1; + uint32be_t psh:1; + uint32be_t rst:1; + uint32be_t syn:1; + uint32be_t fin:1; + uint32be_t window:16; /**< Window size */ + }; + }; + uint16be_t cksm; /**< Checksum */ + uint16be_t urgptr; /**< Urgent pointer */ +} odph_tcphdr_t; + +#ifdef __cplusplus +} +#endif + +#endif