From 31d4176efde046ba837e74f990e3454bf98f73de Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 18 Jan 2016 20:42:15 +0100 Subject: initial check-in of OCTSDR-2G headers Version is OCTSDR_GSM-02.03.00-B560 (2015/08/07) --- octpkt/octpkt_hdr.h | 108 +++++++++++++++++++++++++++++++++++++++++++++ octpkt/octpkt_hdr_swap.h | 78 ++++++++++++++++++++++++++++++++ octpkt/octpkt_hdrxl.h | 95 +++++++++++++++++++++++++++++++++++++++ octpkt/octpkt_hdrxl_swap.h | 69 +++++++++++++++++++++++++++++ 4 files changed, 350 insertions(+) create mode 100644 octpkt/octpkt_hdr.h create mode 100644 octpkt/octpkt_hdr_swap.h create mode 100644 octpkt/octpkt_hdrxl.h create mode 100644 octpkt/octpkt_hdrxl_swap.h (limited to 'octpkt') diff --git a/octpkt/octpkt_hdr.h b/octpkt/octpkt_hdr.h new file mode 100644 index 0000000..e33025e --- /dev/null +++ b/octpkt/octpkt_hdr.h @@ -0,0 +1,108 @@ +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +File: OCTPKT_HDR.h + +Copyright (c) 2015 Octasic Inc. All rights reserved. + +Description: + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + + +Release: OCTSDR Software Development Kit OCTSDR_GSM-02.03.00-B560 (2015/08/07) + +$Revision: $ + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ + +#ifndef __OCTPKT_HDR_H__ +#define __OCTPKT_HDR_H__ + + +/***************************** INCLUDE FILES *******************************/ +#include "../octdev_types.h" + + +/************************ COMMON DEFINITIONS *******************************/ + +#define cOCTPKT_HDR_ETHERTYPE 0x5200 + +/*------------------------------------------------------------------------------------- + OctPkt-Packet Format Values +-------------------------------------------------------------------------------------*/ + +/*------------------------------------------------------------------------------------- + tOCTPKT_HDR_FORMAT_PROTO_TYPE_LEN_MASK : +-------------------------------------------------------------------------------------*/ +#define tOCTPKT_HDR_FORMAT_PROTO_TYPE_LEN_MASK tOCT_UINT32 + +#define cOCTPKT_HDR_FORMAT_PROTO_TYPE_LEN_MASK_FORMAT_BIT_MASK 0x000000FF +#define cOCTPKT_HDR_FORMAT_PROTO_TYPE_LEN_MASK_FORMAT_BIT_OFFSET 24 +#define cOCTPKT_HDR_FORMAT_PROTO_TYPE_LEN_MASK_FORMAT ((tOCT_UINT32)(cOCTPKT_HDR_FORMAT_PROTO_TYPE_LEN_MASK_FORMAT_BIT_MASK<. + + +Release: OCTSDR Software Development Kit OCTSDR_GSM-02.03.00-B560 (2015/08/07) + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ +#ifndef __OCTPKT_HDR_SWAP_H__ +#define __OCTPKT_HDR_SWAP_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/***************************** INCLUDE FILES *******************************/ +#include "../octvc1/octvc1_swap_hdrs.h" +#include "octpkt_hdr.h" + +/********************************* MACROS **********************************/ + + +#if defined( _OCT_ENDIAN_TYPE_LE_ ) +#define mOCTPKT_HDR_FORMAT_PROTO_TYPE_LEN_MASK_SWAP( pType ){ \ + *((tOCT_UINT32 *)pType) = mOCT_SWAP32_IF_LE( *((tOCT_UINT32 *)pType) ); } +#else + +#define mOCTPKT_HDR_FORMAT_PROTO_TYPE_LEN_MASK_SWAP( pType ) + +#endif /* _OCT_ENDIAN_TYPE_LE_ */ + +#if defined( _OCT_ENDIAN_TYPE_LE_ ) +#define mOCTPKT_HDR_CONTROL_PROTOCOL_TYPE_ENUM_SWAP( pType ){ \ + *((tOCT_UINT32 *)pType) = mOCT_SWAP32_IF_LE( *((tOCT_UINT32 *)pType) ); } +#else + +#define mOCTPKT_HDR_CONTROL_PROTOCOL_TYPE_ENUM_SWAP( pType ) + +#endif /* _OCT_ENDIAN_TYPE_LE_ */ + +#if defined( _OCT_ENDIAN_TYPE_LE_ ) +#define mOCTPKT_HDR_SWAP( _f_pParms ){ tOCTPKT_HDR * pOCTPKT_HDR = (_f_pParms); SWAP_UNUSED(pOCTPKT_HDR)\ + { mOCTPKT_HDR_FORMAT_PROTO_TYPE_LEN_MASK_SWAP( &((tOCTPKT_HDR *)pOCTPKT_HDR)->ul_Format_Trace_Length ); } \ +} +#else +#define mOCTPKT_HDR_SWAP( pOCTPKT_HDR ) +#endif /* _OCT_ENDIAN_TYPE_LE_ */ + +#if defined( _OCT_ENDIAN_TYPE_LE_ ) +#define mOCTPKT_HDR_TYPE_ENUM_SWAP( pType ){ \ + *((tOCT_UINT32 *)pType) = mOCT_SWAP32_IF_LE( *((tOCT_UINT32 *)pType) ); } +#else + +#define mOCTPKT_HDR_TYPE_ENUM_SWAP( pType ) + +#endif /* _OCT_ENDIAN_TYPE_LE_ */ + +#ifdef __cplusplus +} + +#endif + +#endif /* __OCTPKT_HDR_SWAP_H__ */ diff --git a/octpkt/octpkt_hdrxl.h b/octpkt/octpkt_hdrxl.h new file mode 100644 index 0000000..113cdec --- /dev/null +++ b/octpkt/octpkt_hdrxl.h @@ -0,0 +1,95 @@ +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +File: OCTPKT_HDRXL.h + +Copyright (c) 2015 Octasic Inc. All rights reserved. + +Description: + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + + +Release: OCTSDR Software Development Kit OCTSDR_GSM-02.03.00-B560 (2015/08/07) + +$Revision: $ + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ + +#ifndef __OCTPKT_HDRXL_H__ +#define __OCTPKT_HDRXL_H__ + + +/***************************** INCLUDE FILES *******************************/ +#include "../octdev_types.h" +#include "octpkt_hdr.h" + + +/************************ COMMON DEFINITIONS *******************************/ + +#define cOCTPKT_HDRXL_ETHERTYPE 0x5201 + +/*------------------------------------------------------------------------------------- + OctPkt-Packet Format Values +-------------------------------------------------------------------------------------*/ + +/*------------------------------------------------------------------------------------- + tOCTPKT_HDRXL_FORMAT_PROTO_TYPE_LEN_MASK : +-------------------------------------------------------------------------------------*/ +#define tOCTPKT_HDRXL_FORMAT_PROTO_TYPE_LEN_MASK tOCT_UINT32 + +#define cOCTPKT_HDRXL_FORMAT_PROTO_TYPE_LEN_MASK_FORMAT_BIT_MASK 0x000000FF +#define cOCTPKT_HDRXL_FORMAT_PROTO_TYPE_LEN_MASK_FORMAT_BIT_OFFSET 16 +#define cOCTPKT_HDRXL_FORMAT_PROTO_TYPE_LEN_MASK_FORMAT ((tOCT_UINT32)(cOCTPKT_HDRXL_FORMAT_PROTO_TYPE_LEN_MASK_FORMAT_BIT_MASK<. + + +Release: OCTSDR Software Development Kit OCTSDR_GSM-02.03.00-B560 (2015/08/07) + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ +#ifndef __OCTPKT_HDRXL_SWAP_H__ +#define __OCTPKT_HDRXL_SWAP_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/***************************** INCLUDE FILES *******************************/ +#include "../octvc1/octvc1_swap_hdrs.h" +#include "octpkt_hdrxl.h" + +/********************************* MACROS **********************************/ + + +#if defined( _OCT_ENDIAN_TYPE_LE_ ) +#define mOCTPKT_HDRXL_FORMAT_PROTO_TYPE_LEN_MASK_SWAP( pType ){ \ + *((tOCT_UINT32 *)pType) = mOCT_SWAP32_IF_LE( *((tOCT_UINT32 *)pType) ); } +#else + +#define mOCTPKT_HDRXL_FORMAT_PROTO_TYPE_LEN_MASK_SWAP( pType ) + +#endif /* _OCT_ENDIAN_TYPE_LE_ */ + +#if defined( _OCT_ENDIAN_TYPE_LE_ ) +#define mOCTPKT_HDRXL_SWAP( _f_pParms ){ tOCTPKT_HDRXL * pOCTPKT_HDRXL = (_f_pParms); SWAP_UNUSED(pOCTPKT_HDRXL)\ + { mOCTPKT_HDRXL_FORMAT_PROTO_TYPE_LEN_MASK_SWAP( &((tOCTPKT_HDRXL *)pOCTPKT_HDRXL)->ul_Proto_Format_Length ); } \ +} +#else +#define mOCTPKT_HDRXL_SWAP( pOCTPKT_HDRXL ) +#endif /* _OCT_ENDIAN_TYPE_LE_ */ + +#if defined( _OCT_ENDIAN_TYPE_LE_ ) +#define mOCTPKT_HDRXL_ETH_SWAP( _f_pParms ){ tOCTPKT_HDRXL_ETH * pOCTPKT_HDRXL_ETH = (_f_pParms); SWAP_UNUSED(pOCTPKT_HDRXL_ETH)\ + ((tOCTPKT_HDRXL_ETH *)pOCTPKT_HDRXL_ETH)->usReserved = \ + mOCT_SWAP16_IF_LE(((tOCTPKT_HDRXL_ETH *)pOCTPKT_HDRXL_ETH)->usReserved); \ +} +#else +#define mOCTPKT_HDRXL_ETH_SWAP( pOCTPKT_HDRXL_ETH ) +#endif /* _OCT_ENDIAN_TYPE_LE_ */ + +#ifdef __cplusplus +} + +#endif + +#endif /* __OCTPKT_HDRXL_SWAP_H__ */ -- cgit v1.2.3