Reviewed-by: Petri Savolainen <petri.savolai...@linaro.org> > -----Original Message----- > From: lng-odp-boun...@lists.linaro.org [mailto:lng-odp- > boun...@lists.linaro.org] On Behalf Of ext Maxim Uvarov > Sent: Tuesday, December 09, 2014 12:51 PM > To: lng-odp@lists.linaro.org > Subject: Re: [lng-odp] [PATCH v6 1/3] helper: odph_tcp header description > > Ciprian, Anders, Viktor, you commented on that patch. Do you like to add > your sign-offs? > > Maxim. > > On 12/08/2014 03:02 PM, Balasubramanian Manoharan wrote: > > Adds TCP header description struct odph_tcphdr_t in helper directory. > > This structure is used for accessing TCP header information from the > packet > > > > Signed-off-by: Balasubramanian Manoharan <bala.manoha...@linaro.org> > > --- > > V6: Incoporates review comments from Bill > > helper/include/odph_tcp.h | 81 > ++++++++++++++++++++++ > > platform/linux-generic/include/api/odp_byteorder.h | 7 ++ > > 2 files changed, 88 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..3992ecf > > --- /dev/null > > +++ b/helper/include/odph_tcp.h > > @@ -0,0 +1,81 @@ > > +/* 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 <odp_align.h> > > +#include <odp_debug.h> > > +#include <odp_byteorder.h> > > + > > +/** TCP header */ > > +typedef struct ODP_PACKED { > > + uint16be_t src_port; /**< Source port */ > > + uint16be_t dst_port; /**< Destination port */ > > + uint32be_t seq_no; /**< Sequence number */ > > + uint32be_t ack_no; /**< Acknowledgment number */ > > + union { > > + uint16be_t doffset_flags; > > +#if defined(ODP_BIG_ENDIAN_BITFIELD) > > + struct { > > + uint16be_t rsvd1:8; > > + uint16be_t flags:8; /**< TCP flags as a byte */ > > + }; > > + struct { > > + uint16be_t hl:4; /**< Hdr len, in words */ > > + uint16be_t rsvd3:4; /**< Reserved */ > > + uint16be_t cwr:1; > > + uint16be_t ece:1; > > + uint16be_t urg:1; > > + uint16be_t ack:1; > > + uint16be_t psh:1; > > + uint16be_t rst:1; > > + uint16be_t syn:1; > > + uint16be_t fin:1; > > + }; > > +#elif defined(ODP_LITTLE_ENDIAN_BITFIELD) > > + struct { > > + uint16be_t flags:8; > > + uint16be_t rsvd1:8; /**< TCP flags as a byte */ > > + }; > > + struct { > > + uint16be_t rsvd3:4; /**< Reserved */ > > + uint16be_t hl:4; /**< Hdr len, in words */ > > + uint16be_t fin:1; > > + uint16be_t syn:1; > > + uint16be_t rst:1; > > + uint16be_t psh:1; > > + uint16be_t ack:1; > > + uint16be_t urg:1; > > + uint16be_t ece:1; > > + uint16be_t cwr:1; > > + }; > > + > > +#else > > +#error "Endian BitField order not defined!" > > +#endif > > + }; > > + uint16be_t window; /**< Window size */ > > + uint16be_t cksm; /**< Checksum */ > > + uint16be_t urgptr; /**< Urgent pointer */ > > +} odph_tcphdr_t; > > + > > +#ifdef __cplusplus > > +} > > +#endif > > + > > +#endif > > diff --git a/platform/linux-generic/include/api/odp_byteorder.h > b/platform/linux-generic/include/api/odp_byteorder.h > > index 79ddd75..5d7cceb 100644 > > --- a/platform/linux-generic/include/api/odp_byteorder.h > > +++ b/platform/linux-generic/include/api/odp_byteorder.h > > @@ -19,6 +19,7 @@ extern "C" { > > #endif > > > > #include <endian.h> > > +#include <asm/byteorder.h> > > #include <odp_std_types.h> > > #include <odp_compiler.h> > > > > @@ -45,6 +46,12 @@ extern "C" { > > /** Little endian byte order */ > > #define ODP_LITTLE_ENDIAN __LITTLE_ENDIAN > > > > +/** Big endian bit field */ > > +#define ODP_BIG_ENDIAN_BITFIELD __BIG_ENDIAN_BITFIELD > > + > > +/** Little endian bit field */ > > +#define ODP_LITTLE_ENDIAN_BITFIELD __LITTLE_ENDIAN_BITFIELD > > + > > /** Selected byte order */ > > #if __BYTE_ORDER == __LITTLE_ENDIAN > > #define ODP_BYTE_ORDER ODP_LITTLE_ENDIAN > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp
_______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org http://lists.linaro.org/mailman/listinfo/lng-odp