Commit 6cc793e0 authored by gauthier's avatar gauthier

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6389 818b1a75-f10b-46b9-bf7c-635c3b92a50f

parent 9a17b228
This diff is collapsed.
v0.1:
- Build system
- SCTP layer v0.1
- S1AP layer v0.1
v0.2:
- Updated S1AP messages to RELEASE9 v9.8
This diff is collapsed.
if HAVE_DOXYGEN
directory = $(top_srcdir)/DOCS/Documentation
doc_DATA = $(directory)
if HAVE_PDFLATEX
doc_DATA += oaisim_mme.pdf
endif
$(directory): doxyfile.stamp
doxyfile.stamp:
$(DOXYGEN) Doxyfile
echo Timestamp > doxyfile.stamp
CLEANFILES = doxyfile.stamp
all-local: doxyfile.stamp
clean-local:
rm -f doxyfile.stamp
rm -rf $(top_srcdir)/DOCS/Documentation/html
rm -rf $(top_srcdir)/DOCS/Documentation/latex
endif
This diff is collapsed.
SUBDIRS = DOXYGEN
\ No newline at end of file
This diff is collapsed.
AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/include \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/shared \
-I$(top_srcdir)/UTILS \
-I$(top_srcdir)/UTILS/TIMER
noinst_LTLIBRARIES = libgtpv1u.la
libgtpv1u_la_LDFLAGS = -all-static
libgtpv1u_la_SOURCES = \
gtpv1_u_task.c gtpv1_u.h \
nw-gtpv1u/shared/NwTypes.h \
nw-gtpv1u/shared/NwUtils.h \
nw-gtpv1u/shared/NwGtpv1uError.h \
nw-gtpv1u/shared/NwLog.h \
nw-gtpv1u/shared/NwGtpv1uIe.h \
nw-gtpv1u/shared/NwGtpv1uMsg.h \
nw-gtpv1u/shared/NwGtpv1u.h \
nw-gtpv1u/include/NwGtpv1uPrivate.h \
nw-gtpv1u/include/NwGtpv1uLog.h \
nw-gtpv1u/include/NwGtpv1uTrxn.h \
nw-gtpv1u/include/NwGtpv1uTunnelEndPoint.h \
nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c \
nw-gtpv1u/src/NwGtpv1uTrxn.c \
nw-gtpv1u/src/NwGtpv1uMsg.c \
nw-gtpv1u/src/NwGtpv1u.c
\ No newline at end of file
This diff is collapsed.
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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 General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes
06410 Biot FRANCE
*******************************************************************************/
#ifndef GTPV1_U_H_
#define GTPV1_U_H_
int gtpv1_u_init(const mme_config_t *mme_config);
#endif /* GTPV1_U_H_ */
This diff is collapsed.
Copyright (c) 2010-2011 Amit Chawre <http://www.amitchawre.net/contact.html>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*----------------------------------------------------------------------------*
* *
* n w - g t p v 2 u *
* G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k *
* *
* *
* Copyright (c) 2010-2011 Amit Chawre *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the following disclaimer. *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* 3. The name of the author may not be used to endorse or promote products *
* derived from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR *
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES *
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. *
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, *
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT *
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF *
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
*----------------------------------------------------------------------------*/
#ifndef __NW_GTPV1U_LOG_H__
#define __NW_GTPV1U_LOG_H__
#include <stdio.h>
#include "NwLog.h"
/**
* @file NwGtpv1uLog.h
* @brief This header contains logging related definitions.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*---------------------------------------------------------------------------
* Log Macro Definition
*--------------------------------------------------------------------------*/
#define NW_LOG(_gtpv1uHandle, _logLevel, ...) \
do { \
if(((NwGtpv1uStackT*)(_gtpv1uHandle))->logLevel >= _logLevel) \
{ \
char _logBuf[1024]; \
snprintf(_logBuf, 1024, __VA_ARGS__); \
((NwGtpv1uStackT*)(_gtpv1uHandle))->logMgr.logReqCallback(((NwGtpv1uStackT*)_gtpv1uHandle)->logMgr.logMgrHandle, _logLevel, __FILE__, __LINE__, _logBuf);\
} \
} while(0)
#define NW_ENTER(_gtpv1uHandle) \
do { \
NW_LOG(_gtpv1uHandle, NW_LOG_LEVEL_DEBG, "Entering '%s'", __func__);\
} while(0)
#define NW_LEAVE(_gtpv1uHandle) \
do { \
NW_LOG(_gtpv1uHandle, NW_LOG_LEVEL_DEBG, "Leaving '%s'", __func__);\
} while(0)
#ifdef __cplusplus
}
#endif
#endif /* __NW_TYPES_H__ */
/*--------------------------------------------------------------------------*
* E N D O F F I L E *
*--------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*
* *
* n w - g t p v 2 u *
* n w - g t p v 2 u *
* G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k *
* *
* *
* Copyright (c) 2010-2011 Amit Chawre *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the following disclaimer. *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* 3. The name of the author may not be used to endorse or promote products *
* derived from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR *
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES *
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. *
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, *
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT *
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF *
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
*----------------------------------------------------------------------------*/
#ifndef __NW_GTPV1U_PRIVATE_H__
#define __NW_GTPV1U_PRIVATE_H__
#include "tree.h"
#include "queue.h"
#include "NwTypes.h"
#include "NwGtpv1uError.h"
#include "NwGtpv1u.h"
#include "NwGtpv1uMsg.h"
/**
* @file NwGtpv1uPrivate.h
* @brief This header file contains nw-gtpv1u private definitions not to be
* exposed to user application.
*/
#ifdef __cplusplus
extern "C" {
#endif
#define NW_GTPV1U_MALLOC(_stack, _size, _mem, _type) \
do { \
if(((NwGtpv1uStackT*)(_stack))->memMgr.memAlloc && ((NwGtpv1uStackT*)(_stack))->memMgr.memFree )\
{ \
_mem = (_type) ((NwGtpv1uStackT*) (_stack))->memMgr.memAlloc(((NwGtpv1uStackT*) (_stack))->memMgr.hMemMgr, _size, __FILE__, __LINE__);\
} \
else \
{ \
_mem = (_type) malloc (_size); \
} \
} while (0)
/*--------------------------------------------------------------------------*
* G T P U S T A C K O B J E C T T Y P E D E F I N I T I O N *
*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*
* GRPS Tunneling Protocol Stack Class Definition
*--------------------------------------------------------------------------*/
/**
* gtpv1u stack class definition
*/
typedef struct NwGtpv1uStack
{
NwU32T id;
NwU32T seq;
NwGtpv1uUlpEntityT ulp;
NwGtpv1uUdpEntityT udp;
NwGtpv1uMemMgrEntityT memMgr;
NwGtpv1uTimerMgrEntityT tmrMgr;
NwGtpv1uLogMgrEntityT logMgr;
NwU32T logLevel;
RB_HEAD( NwGtpv1uOutstandingTxSeqNumTrxnMap, NwGtpv1uTrxn) outstandingTxSeqNumMap;
RB_HEAD( NwGtpv1uOutstandingRxSeqNumTrxnMap, NwGtpv1uTrxn) outstandingRxSeqNumMap;
RB_HEAD(NwGtpv1uTunnelEndPointTMap, NwGtpv1uTunnelEndPoint) sessionMap;
RB_HEAD(NwGtpv1uTunnelEndPointIdentifierMap, NwGtpv1uTunnelEndPoint) teidMap;
} NwGtpv1uStackT;
/**
* GTP Tunnel End Point class definition
*/
typedef struct NwGtpv1uTunnelEndPoint
{
NwU32T teid; /**< Gtpu Tunnel End Point Identifier */
NwU32T peerAddr; /**< Peer IP address for the session */
NwGtpv1uStackT* pStack; /**< Pointer to the parent stack */
NwGtpv1uUlpSessionHandleT hUlpSession; /**< ULP session handle for the session */
RB_ENTRY (NwGtpv1uTunnelEndPoint) sessionMapRbtNode; /**< RB Tree Data Structure Node */
struct NwGtpv1uTunnelEndPoint *next;
} NwGtpv1uTunnelEndPointT;
/*--------------------------------------------------------------------------*
* Timeout Info Type Definition
*--------------------------------------------------------------------------*/
/**
* gtpv1u timeout info
*/
typedef struct NwGtpv1uTimeoutInfo
{
NwGtpv1uStackHandleT hStack;
void* timeoutArg;
NwGtpv1uRcT (*timeoutCallbackFunc)(void*);
} NwGtpv1uTimeoutInfoT;
/**
* Start a transaction response timer
*
* @param[in] thiz Pointer to stack instance
* @param[in] timeoutArg Arg to timeout function.
* @param[out] phTmr Pointer to timer handle.
* @return NW_GTPV1U_OK on success.
*/
NwGtpv1uRcT
nwGtpStartTrxnPeerRspTimer(NwGtpv1uStackT* thiz, NwGtpv1uTimeoutInfoT* timeoutInfo, NwGtpv1uTimerHandleT* phTmr);
/**
* Stop a transaction response timer
*
* @param[in] thiz Pointer to stack instance
* @param[out] phTmr Pointer to timer handle.
* @return NW_GTPV1U_OK on success.
*/
NwGtpv1uRcT
nwGtpStopTrxnPeerRspTimer(NwGtpv1uStackT* thiz, NwGtpv1uTimerHandleT* phTmr);
#define NW_GTPV1U_MAX_MSG_LEN (4096) /**< Maximum supported gtpv1u packet length including header */
/**
* NwGtpv1uMsgT holds gtpv1u messages to/from the peer.
*/
typedef struct NwGtpv1uMsg
{
NwU8T version;
NwU8T protocolType;
NwU8T extHdrFlag;
NwU8T seqNumFlag;
NwU16T npduNumFlag;
NwU32T msgType;
NwU16T msgLen;
NwU32T teid;
NwU16T seqNum;
NwU8T npduNum;
NwU8T nextExtHdrType;
NwU8T msgBuf[NW_GTPV1U_MAX_MSG_LEN];
struct NwGtpv1uMsg* next;
} NwGtpv1uMsgT;
/*--------------------------------------------------------------------------*
* R6/R4 Transaction Context Type Definition
*--------------------------------------------------------------------------*/
/**
* Transaction structure
*/
typedef struct NwGtpv1uTrxn
{
NwU32T seqNum;
NwU32T peerIp;
NwU32T peerPort;
NwU8T maxRetries;
NwU8T t3Timer;
NwGtpv1uTimerHandleT hRspTmr;
NwGtpv1uTimeoutInfoT peerRspTimeoutInfo;
NwGtpv1uStackT* pStack;
NwGtpv1uTunnelEndPointT* pSession;
NwU32T hUlpTrxn;
NwGtpv1uMsgT* pMsg;
RB_ENTRY (NwGtpv1uTrxn) outstandingTxSeqNumMapRbtNode; /**< RB Tree Data Structure Node */
RB_ENTRY (NwGtpv1uTrxn) outstandingRxSeqNumMapRbtNode; /**< RB Tree Data Structure Node */
struct NwGtpv1uTrxn* next;
} NwGtpv1uTrxnT;
/**
* GTPv2 message header structure
*/
#pragma pack(1)
typedef struct NwGtpv1uMsgHeader
{
NwU8T PN:1;
NwU8T S:1;
NwU8T E:1;
NwU8T spare:1;
NwU8T PT:1;
NwU8T version:3;
NwU8T msgType;
NwU16T msgLength;
NwU32T teid;
} NwGtpv1uMsgHeaderT;
#pragma pack()
#ifdef __cplusplus
}
#endif
#endif /* __NW_GTPV1U_PRIVATE_H__ */
/*--------------------------------------------------------------------------*
* E N D O F F I L E *
*--------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*
* *
* n w - g t p v 2 u *
* G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k *
* *
* *
* Copyright (c) 2010-2011 Amit Chawre *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the following disclaimer. *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* 3. The name of the author may not be used to endorse or promote products *
* derived from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR *
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES *
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. *
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, *
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT *
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF *
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
*----------------------------------------------------------------------------*/
/**
* @file NwGtpv1uTrxn.h
* @author Amit Chawre
* @brief
*
* This header file contains required definitions and functions
* prototypes used by gtpv1u transactions.
*
**/
#ifndef __NW_GTPV1U_TRXN_H__
#define __NW_GTPV1U_TRXN_H__
#ifdef __cplusplus
extern "C" {
#endif
NwGtpv1uRcT
nwGtpv1uTrxnNew( NW_IN NwGtpv1uStackT* thiz,
NW_OUT NwGtpv1uTrxnT **ppTrxn);
NwGtpv1uRcT
nwGtpv1uTrxnWithSeqNew( NW_IN NwGtpv1uStackT* thiz,
NW_IN NwU32T seqNum,
NW_OUT NwGtpv1uTrxnT **ppTrxn);
NwGtpv1uRcT
nwGtpv1uTrxnDelete( NW_INOUT NwGtpv1uTrxnT **ppTrxn);
NwGtpv1uRcT
nwGtpv1uTrxnNew( NW_IN NwGtpv1uStackT* thiz,
NW_OUT NwGtpv1uTrxnT **ppTrxn);
NwGtpv1uRcT
nwGtpv1uTrxnDelete( NW_INOUT NwGtpv1uTrxnT **pthiz);
NwGtpv1uRcT
nwGtpv1uTrxnCreateAndSendMsg( NW_IN NwGtpv1uStackT* thiz,
NW_IN NwGtpv1uTrxnT *pTrxn,
NW_IN NwU32T peerIp,
NW_IN NwU32T peerPort,
NW_IN NwGtpv1uMsgT *pMsg);
#ifdef __cplusplus
}
#endif
#endif /* __NW_GTPV1U_TRXN_H__ */
/*--------------------------------------------------------------------------*
* E N D O F F I L E *
*--------------------------------------------------------------------------*/
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# this is example-file: Makefile.am
# the subdirectories of the project to go into
SUBDIRS = \
nw-helloworld
bin_PROGRAMS = helloworld
AM_CFLAGS = -D__WITH_LIBEVENT__ -I../../shared -I../../include -I../../test-app/nw-udp -I../../test-app/nw-log @AM_CFLAGS@
helloworld_SOURCES = \
NwEvt.h\
NwMiniLogMgrEntity.h\
NwMiniTmrMgrEntity.h\
NwMiniUlpEntity.h\
NwMiniUdpEntity.h\
NwMiniLogMgrEntity.c\
NwMiniTmrMgrEntity.c\
NwMiniUlpEntity.c\
NwMiniUdpEntity.c\
helloworld.c
helloworld_LDADD = ../../src/libNwGtpv1u.a -levent $(AM_LDFLAGS)
This diff is collapsed.
AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/UTILS
noinst_LTLIBRARIES = libitti.la
libitti_la_LDFLAGS = -all-static
libitti_la_SOURCES = \
gtpv1_u_messages_def.h gtpv1_u_messages_types.h \
timer_messages_def.h timer_messages_types.h \
s1ap_messages_def.h s1ap_messages_types.h \
s6a_messages_def.h s6a_messages_types.h \
sgw_lite_def.h sgw_lite_messages_types.h \
sctp_messages_def.h sctp_messages_types.h \
udp_message_def.h udp_messages_types.h \
intertask_interface.c intertask_interface.h \
intertask_interface_dump.c intertask_interface_dump.h
\ No newline at end of file
This diff is collapsed.
MESSAGE_DEF(GTPV1U_DATA_REQ, TASK_PRIORITY_MED, Gtpv1uDataReq gtpv1uDataReq)
MESSAGE_DEF(S1U_CREATE_TUNNEL, TASK_PRIORITY_MED_LEAST, S1UCreateTunnel s1uCreateTunnel)
\ No newline at end of file