libs6a -> libfd for adding other interface such as Gx
This commit is contained in:
parent
ec3391f531
commit
63d29714e2
|
@ -311,8 +311,8 @@ AC_CONFIG_FILES([lib/base/Makefile])
|
|||
AC_CONFIG_FILES([lib/s1ap/asn1c/Makefile])
|
||||
AC_CONFIG_FILES([lib/s1ap/Makefile])
|
||||
AC_CONFIG_FILES([lib/nas/Makefile])
|
||||
AC_CONFIG_FILES([lib/s6a/freeDiameter/Makefile])
|
||||
AC_CONFIG_FILES([lib/s6a/Makefile])
|
||||
AC_CONFIG_FILES([lib/fd/s6a/Makefile])
|
||||
AC_CONFIG_FILES([lib/fd/Makefile])
|
||||
AC_CONFIG_FILES([lib/gtp/Makefile])
|
||||
AC_CONFIG_FILES([lib/Makefile])
|
||||
AC_CONFIG_FILES([src/mme/Makefile])
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
SUBDIRS = core logger base s1ap nas s6a gtp
|
||||
SUBDIRS = core logger base s1ap nas fd gtp
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
MOSTLYCLEANFILES = *.stackdump
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
SUBDIRS = s6a
|
||||
|
||||
noinst_LTLIBRARIES = libfd.la
|
||||
|
||||
libfd_la_SOURCES = \
|
||||
fd_context.h fd_logger.h fd_init.h
|
||||
|
||||
nodist_libfd_la_SOURCES = \
|
||||
libapp_sip.c fd_context.c fd_logger.c fd_init.c
|
||||
|
||||
libfd_la_DEPENDENCIES = \
|
||||
$(top_srcdir)/lib/base/libbase.la \
|
||||
$(top_srcdir)/lib/fd/s6a/libfds6a.la
|
||||
|
||||
libfd_la_LIBADD = \
|
||||
$(top_srcdir)/lib/base/libbase.la \
|
||||
$(top_srcdir)/lib/fd/s6a/libfds6a.la
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/lib/core/include \
|
||||
-I$(top_srcdir)/lib/fd/s6a
|
||||
|
||||
AM_CFLAGS = \
|
||||
-Wall -Werror
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
MOSTLYCLEANFILES = *.stackdump
|
||||
|
||||
EXTRA_DIST = .libs $(noinst_LTLIBRARIES)
|
|
@ -1,15 +1,32 @@
|
|||
#define TRACE_MODULE _s6a_config
|
||||
#define TRACE_MODULE _fd_context
|
||||
|
||||
#include "core_debug.h"
|
||||
#include "core_lib.h"
|
||||
#include "core_file.h"
|
||||
|
||||
#include "s6a_lib.h"
|
||||
#include "fd_context.h"
|
||||
|
||||
static struct s6a_config_t g_conf;
|
||||
struct s6a_config_t *s6a_config;
|
||||
static struct fd_context_t self;
|
||||
|
||||
static int s6a_config_apply_internal()
|
||||
int fd_context_init(int mode)
|
||||
{
|
||||
memset(&self, 0, sizeof(struct fd_context_t));
|
||||
|
||||
self.mode = mode;
|
||||
|
||||
/* Set the default values */
|
||||
self.vendor_id = 10415; /* 3GPP Vendor ID */
|
||||
self.duration = 10; /* 10 seconds */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct fd_context_t* fd_self()
|
||||
{
|
||||
return &self;
|
||||
}
|
||||
|
||||
static int fd_default_context()
|
||||
{
|
||||
struct peer_info fddpi;
|
||||
struct addrinfo hints, *ai;
|
||||
|
@ -19,20 +36,20 @@ static int s6a_config_apply_internal()
|
|||
/* disable SCTP */
|
||||
fd_g_config->cnf_flags.no_sctp = 1;
|
||||
|
||||
fd_g_config->cnf_diamid = s6a_config->cnf_diamid;
|
||||
fd_g_config->cnf_diamid = self.cnf_diamid;
|
||||
fd_os_validate_DiameterIdentity(
|
||||
&fd_g_config->cnf_diamid, &fd_g_config->cnf_diamid_len, 1);
|
||||
fd_g_config->cnf_diamrlm = s6a_config->cnf_diamrlm;
|
||||
fd_g_config->cnf_diamrlm = self.cnf_diamrlm;
|
||||
fd_os_validate_DiameterIdentity(
|
||||
&fd_g_config->cnf_diamrlm, &fd_g_config->cnf_diamrlm_len, 1);
|
||||
if (s6a_config->cnf_addr == NULL)
|
||||
if (self.cnf_addr == NULL)
|
||||
return CORE_ERROR;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
|
||||
if (s6a_config->cnf_addr == NULL)
|
||||
if (self.cnf_addr == NULL)
|
||||
return CORE_ERROR;
|
||||
ret = getaddrinfo(s6a_config->cnf_addr, NULL, &hints, &ai);
|
||||
ret = getaddrinfo(self.cnf_addr, NULL, &hints, &ai);
|
||||
if (ret)
|
||||
return CORE_ERROR;
|
||||
|
||||
|
@ -40,10 +57,10 @@ static int s6a_config_apply_internal()
|
|||
ai->ai_addr, ai->ai_addrlen, EP_FL_CONF),
|
||||
freeaddrinfo(ai);
|
||||
|
||||
if (s6a_config->cnf_port)
|
||||
fd_g_config->cnf_port = s6a_config->cnf_port;
|
||||
if (s6a_config->cnf_port_tls)
|
||||
fd_g_config->cnf_port_tls = s6a_config->cnf_port_tls;
|
||||
if (self.cnf_port)
|
||||
fd_g_config->cnf_port = self.cnf_port;
|
||||
if (self.cnf_port_tls)
|
||||
fd_g_config->cnf_port_tls = self.cnf_port_tls;
|
||||
|
||||
memset(&fddpi, 0, sizeof(fddpi));
|
||||
fddpi.config.pic_flags.persist = PI_PRST_ALWAYS;
|
||||
|
@ -52,16 +69,16 @@ static int s6a_config_apply_internal()
|
|||
fddpi.config.pic_flags.alg = PI_ALGPREF_TCP;
|
||||
fddpi.config.pic_flags.sec |= PI_SEC_NONE;
|
||||
|
||||
fddpi.config.pic_port = s6a_config->pic_port;
|
||||
fddpi.pi_diamid = s6a_config->pi_diamid;
|
||||
fddpi.config.pic_port = self.pic_port;
|
||||
fddpi.pi_diamid = self.pi_diamid;
|
||||
|
||||
fd_list_init( &fddpi.pi_endpoints, NULL );
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICHOST;
|
||||
if (s6a_config->pi_addr == NULL)
|
||||
if (self.pi_addr == NULL)
|
||||
return CORE_ERROR;
|
||||
ret = getaddrinfo(s6a_config->pi_addr, NULL, &hints, &ai);
|
||||
ret = getaddrinfo(self.pi_addr, NULL, &hints, &ai);
|
||||
if (ret)
|
||||
return CORE_ERROR;
|
||||
|
||||
|
@ -74,12 +91,12 @@ static int s6a_config_apply_internal()
|
|||
return 0;
|
||||
}
|
||||
|
||||
status_t s6a_config_apply()
|
||||
status_t fd_set_default_context()
|
||||
{
|
||||
char * buf = NULL, *b;
|
||||
size_t len = 0;
|
||||
|
||||
CHECK_FCT( s6a_config_apply_internal() );
|
||||
CHECK_FCT( fd_default_context() );
|
||||
|
||||
/* The following module use data from the configuration */
|
||||
int fd_rtdisp_init(void);
|
||||
|
@ -97,16 +114,3 @@ status_t s6a_config_apply()
|
|||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
||||
int s6a_config_init(void)
|
||||
{
|
||||
memset(&g_conf, 0, sizeof(struct s6a_config_t));
|
||||
s6a_config = &g_conf;
|
||||
|
||||
/* Set the default values */
|
||||
s6a_config->vendor_id = 10415; /* 3GPP Vendor ID */
|
||||
s6a_config->appli_id = 16777251; /* 3GPP S6A Application ID */
|
||||
s6a_config->duration = 10; /* 10 seconds */
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
#ifndef __FD_CONTEXT_H__
|
||||
#define __FD_CONTEXT_H__
|
||||
|
||||
#include "core_errno.h"
|
||||
|
||||
#include "freeDiameter/freeDiameter-host.h"
|
||||
#include "freeDiameter/libfdcore.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* This is default diameter configuration if there is no config file
|
||||
* The Configuration : No TLS, Only TCP */
|
||||
struct fd_context_t {
|
||||
/* Diameter Identity of the local peer (FQDN -- ASCII) */
|
||||
char *cnf_diamid;
|
||||
/* Diameter realm of the local peer, default to realm part of cnf_diamid */
|
||||
char *cnf_diamrlm;
|
||||
/* IP address of the local peer */
|
||||
char *cnf_addr;
|
||||
|
||||
/* the local port for legacy Diameter (default: 3868) in host byte order */
|
||||
c_uint16_t cnf_port;
|
||||
/* the local port for Diameter/TLS (default: 5658) in host byte order */
|
||||
c_uint16_t cnf_port_tls;
|
||||
|
||||
/* (supposedly) UTF-8, \0 terminated.
|
||||
* The Diameter Identity of the remote peer. */
|
||||
char *pi_diamid;
|
||||
char *pi_addr; /* IP address of the remote peer */
|
||||
c_uint16_t pic_port; /* port to connect to. 0: default. */
|
||||
|
||||
#define FD_MODE_SERVER 0x1
|
||||
#define FD_MODE_CLIENT 0x2
|
||||
int mode; /* default FD_MODE_SERVER | FD_MODE_CLIENT */
|
||||
c_uint32_t vendor_id; /* default 10415 */
|
||||
|
||||
int duration; /* default 10 */
|
||||
struct fd_stats {
|
||||
unsigned long long nb_echoed; /* server */
|
||||
unsigned long long nb_sent; /* client */
|
||||
unsigned long long nb_recv; /* client */
|
||||
unsigned long long nb_errs; /* client */
|
||||
unsigned long shortest; /* fastest answer, in microseconds */
|
||||
unsigned long longest; /* slowest answer, in microseconds */
|
||||
unsigned long avg; /* average answer time, in microseconds */
|
||||
} stats;
|
||||
|
||||
pthread_mutex_t stats_lock;
|
||||
};
|
||||
|
||||
CORE_DECLARE(int) fd_context_init(int mode);
|
||||
CORE_DECLARE(struct fd_context_t*) fd_self();
|
||||
|
||||
CORE_DECLARE(status_t) fd_set_default_context(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* ! __FD_CONTEXT_H__ */
|
|
@ -1,4 +1,4 @@
|
|||
#define TRACE_MODULE _s6a_fd
|
||||
#define TRACE_MODULE _fd_init
|
||||
|
||||
#include "core_debug.h"
|
||||
#include "core_param.h"
|
||||
|
@ -7,19 +7,21 @@
|
|||
|
||||
#include "s6a_lib.h"
|
||||
|
||||
static void s6a_gnutls_log_func(int level, const char *str);
|
||||
static void s6a_fd_logger(int printlevel, const char *format, va_list ap);
|
||||
#include "fd_context.h"
|
||||
#include "fd_logger.h"
|
||||
#include "fd_lib.h"
|
||||
|
||||
extern status_t s6a_config_apply();
|
||||
static void fd_gnutls_log_func(int level, const char *str);
|
||||
static void fd_log_func(int printlevel, const char *format, va_list ap);
|
||||
|
||||
int s6a_fd_init(const char *conffile)
|
||||
int fd_init(const char *conffile)
|
||||
{
|
||||
int ret;
|
||||
|
||||
gnutls_global_set_log_function(s6a_gnutls_log_func);
|
||||
gnutls_global_set_log_function(fd_gnutls_log_func);
|
||||
gnutls_global_set_log_level(TRACE_MODULE);
|
||||
|
||||
ret = fd_log_handler_register(s6a_fd_logger);
|
||||
ret = fd_log_handler_register(fd_log_func);
|
||||
if (ret != 0)
|
||||
{
|
||||
d_error("fd_log_handler_register() failed");
|
||||
|
@ -40,17 +42,19 @@ int s6a_fd_init(const char *conffile)
|
|||
}
|
||||
else
|
||||
{
|
||||
CHECK_FCT_DO( s6a_config_apply(), goto error );
|
||||
CHECK_FCT_DO( fd_set_default_context(), goto error );
|
||||
}
|
||||
|
||||
/* register debug hook */
|
||||
CHECK_FCT_DO( s6a_hook_init(), goto error );
|
||||
/* Initialize FD logger */
|
||||
CHECK_FCT_DO( fd_logger_init(), goto error );
|
||||
|
||||
/* Start the servers */
|
||||
CHECK_FCT_DO( fd_core_start(), goto error );
|
||||
|
||||
CHECK_FCT_DO( fd_core_waitstartcomplete(), goto error );
|
||||
|
||||
CHECK_FCT( fd_logger_stats_start() );
|
||||
|
||||
return 0;
|
||||
error:
|
||||
CHECK_FCT_DO( fd_core_shutdown(), );
|
||||
|
@ -59,21 +63,21 @@ error:
|
|||
return -1;
|
||||
}
|
||||
|
||||
void s6a_fd_final()
|
||||
void fd_final()
|
||||
{
|
||||
s6a_hook_final();
|
||||
fd_logger_final();
|
||||
|
||||
CHECK_FCT_DO( fd_core_shutdown(), d_error("fd_core_shutdown() failed") );
|
||||
CHECK_FCT_DO( fd_core_wait_shutdown_complete(),
|
||||
d_error("fd_core_wait_shutdown_complete() failed"));
|
||||
}
|
||||
|
||||
static void s6a_gnutls_log_func(int level, const char *str)
|
||||
static void fd_gnutls_log_func(int level, const char *str)
|
||||
{
|
||||
d_trace(level, "gnutls[%d]: %s", level, str);
|
||||
}
|
||||
|
||||
static void s6a_fd_logger(int printlevel, const char *format, va_list ap)
|
||||
static void fd_log_func(int printlevel, const char *format, va_list ap)
|
||||
{
|
||||
char buffer[HUGE_STRING_LEN];
|
||||
int ret = 0;
|
|
@ -0,0 +1,34 @@
|
|||
#ifndef __FD_LIB_H__
|
||||
#define __FD_LIB_H__
|
||||
|
||||
#include "core_errno.h"
|
||||
|
||||
#include "freeDiameter/freeDiameter-host.h"
|
||||
#include "freeDiameter/libfdcore.h"
|
||||
|
||||
#include "fd_context.h"
|
||||
#include "fd_logger.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define FD_REALM "localdomain" /* Default Relam */
|
||||
#define MME_IDENTITY "mme.localdomain" /* Default MME Identity */
|
||||
#define HSS_IDENTITY "hss.localdomain" /* Default HSS Identity */
|
||||
|
||||
#define AVP_CODE_CONTEXT_IDENTIFIER (1423)
|
||||
#define AVP_CODE_ALL_APN_CONFIG_INC_IND (1428)
|
||||
#define AVP_CODE_APN_CONFIGURATION (1430)
|
||||
|
||||
CORE_DECLARE(int) fd_init(const char *conffile);
|
||||
CORE_DECLARE(void) fd_final(void);
|
||||
|
||||
int fd_avp_search_avp ( struct avp * groupedavp,
|
||||
struct dict_object * what, struct avp ** avp );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* ! __FD_LIB_H__ */
|
|
@ -1,18 +1,77 @@
|
|||
#define TRACE_MODULE _s6a_hook
|
||||
#define TRACE_MODULE _fd_logger
|
||||
|
||||
#include "core_debug.h"
|
||||
|
||||
#include "s6a_lib.h"
|
||||
#include "fd_context.h"
|
||||
#include "fd_logger.h"
|
||||
|
||||
static struct fd_hook_hdl *s6a_hook_hdl = NULL;
|
||||
static struct fd_hook_hdl *logger_hdl = NULL;
|
||||
static char * buf = NULL;
|
||||
static size_t len;
|
||||
static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
|
||||
static pthread_t fd_stats_th = (pthread_t)NULL;
|
||||
|
||||
static s6a_hook_user_handler s6a_hook_user_handler_instance = NULL;
|
||||
static fd_logger_user_handler user_handler = NULL;
|
||||
|
||||
static void fd_logger_cb_tree(enum fd_hook_type type, struct msg * msg,
|
||||
struct peer_hdr * peer, void * other, struct fd_hook_permsgdata *pmd,
|
||||
void * regdata);
|
||||
static void * fd_stats_worker(void * arg);
|
||||
|
||||
int fd_logger_init()
|
||||
{
|
||||
uint32_t mask_errors, mask_sndrcv, mask_routing, mask_peers;
|
||||
uint32_t mask_tree;
|
||||
|
||||
mask_errors = HOOK_MASK( HOOK_MESSAGE_FAILOVER, HOOK_MESSAGE_PARSING_ERROR,
|
||||
HOOK_MESSAGE_ROUTING_ERROR, HOOK_MESSAGE_DROPPED );
|
||||
mask_sndrcv = HOOK_MASK( HOOK_MESSAGE_RECEIVED, HOOK_MESSAGE_SENT );
|
||||
mask_routing= HOOK_MASK( HOOK_MESSAGE_LOCAL,
|
||||
HOOK_MESSAGE_ROUTING_FORWARD, HOOK_MESSAGE_ROUTING_LOCAL );
|
||||
mask_peers = HOOK_MASK( HOOK_PEER_CONNECT_FAILED,
|
||||
HOOK_PEER_CONNECT_SUCCESS );
|
||||
|
||||
mask_tree = mask_errors;
|
||||
mask_tree |= mask_sndrcv;
|
||||
mask_tree |= mask_routing;
|
||||
mask_tree |= mask_peers;
|
||||
|
||||
CHECK_FCT( fd_hook_register(
|
||||
mask_tree, fd_logger_cb_tree, NULL, NULL, &logger_hdl) );
|
||||
|
||||
CHECK_POSIX( pthread_mutex_init(&fd_self()->stats_lock, NULL) );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void fd_logger_final()
|
||||
{
|
||||
CHECK_FCT_DO( fd_thr_term(&fd_stats_th), );
|
||||
CHECK_POSIX_DO( pthread_mutex_destroy(&fd_self()->stats_lock), );
|
||||
|
||||
if (logger_hdl) { CHECK_FCT_DO( fd_hook_unregister( logger_hdl ), ); }
|
||||
}
|
||||
|
||||
int fd_logger_stats_start()
|
||||
{
|
||||
/* Start the statistics thread */
|
||||
CHECK_POSIX( pthread_create(&fd_stats_th, NULL, fd_stats_worker, NULL) );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void fd_logger_register(fd_logger_user_handler instance)
|
||||
{
|
||||
user_handler = instance;
|
||||
}
|
||||
|
||||
void fd_logger_unregister(void)
|
||||
{
|
||||
user_handler = NULL;
|
||||
}
|
||||
|
||||
/* The callback called when messages are received and sent */
|
||||
static void s6a_hook_cb_tree(enum fd_hook_type type, struct msg * msg,
|
||||
static void fd_logger_cb_tree(enum fd_hook_type type, struct msg * msg,
|
||||
struct peer_hdr * peer, void * other, struct fd_hook_permsgdata *pmd,
|
||||
void * regdata)
|
||||
{
|
||||
|
@ -20,8 +79,8 @@ static void s6a_hook_cb_tree(enum fd_hook_type type, struct msg * msg,
|
|||
|
||||
CHECK_POSIX_DO( pthread_mutex_lock(&mtx), );
|
||||
|
||||
if (s6a_hook_user_handler_instance)
|
||||
s6a_hook_user_handler_instance(type, msg, peer, other, pmd, regdata);
|
||||
if (user_handler)
|
||||
user_handler(type, msg, peer, other, pmd, regdata);
|
||||
|
||||
if (msg) {
|
||||
CHECK_MALLOC_DO( fd_msg_dump_treeview(&buf, &len, NULL, msg, fd_g_config->cnf_dict, (type == HOOK_MESSAGE_PARSING_ERROR) ? 0 : 1, 1),
|
||||
|
@ -109,41 +168,62 @@ static void s6a_hook_cb_tree(enum fd_hook_type type, struct msg * msg,
|
|||
CHECK_POSIX_DO( pthread_mutex_unlock(&mtx), );
|
||||
}
|
||||
|
||||
int s6a_hook_init()
|
||||
/* Function to display statistics periodically */
|
||||
static void * fd_stats_worker(void * arg)
|
||||
{
|
||||
uint32_t mask_errors, mask_sndrcv, mask_routing, mask_peers;
|
||||
uint32_t mask_tree;
|
||||
struct timespec start, now;
|
||||
struct fd_stats copy;
|
||||
|
||||
mask_errors = HOOK_MASK( HOOK_MESSAGE_FAILOVER, HOOK_MESSAGE_PARSING_ERROR,
|
||||
HOOK_MESSAGE_ROUTING_ERROR, HOOK_MESSAGE_DROPPED );
|
||||
mask_sndrcv = HOOK_MASK( HOOK_MESSAGE_RECEIVED, HOOK_MESSAGE_SENT );
|
||||
mask_routing= HOOK_MASK( HOOK_MESSAGE_LOCAL,
|
||||
HOOK_MESSAGE_ROUTING_FORWARD, HOOK_MESSAGE_ROUTING_LOCAL );
|
||||
mask_peers = HOOK_MASK( HOOK_PEER_CONNECT_FAILED,
|
||||
HOOK_PEER_CONNECT_SUCCESS );
|
||||
/* Get the start time */
|
||||
CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &start), );
|
||||
|
||||
mask_tree = mask_errors;
|
||||
mask_tree |= mask_sndrcv;
|
||||
mask_tree |= mask_routing;
|
||||
mask_tree |= mask_peers;
|
||||
/* Now, loop until canceled */
|
||||
while (1) {
|
||||
/* Display statistics every XX seconds */
|
||||
sleep(fd_self()->duration);
|
||||
|
||||
/* Now, get the current stats */
|
||||
CHECK_POSIX_DO( pthread_mutex_lock(&fd_self()->stats_lock), );
|
||||
memcpy(©, &fd_self()->stats, sizeof(struct fd_stats));
|
||||
CHECK_POSIX_DO( pthread_mutex_unlock(&fd_self()->stats_lock), );
|
||||
|
||||
/* Get the current execution time */
|
||||
CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &now), );
|
||||
|
||||
/* Now, display everything */
|
||||
d_trace(3, "------- fd statistics ---------\n");
|
||||
if (now.tv_nsec >= start.tv_nsec)
|
||||
{
|
||||
d_trace(3, " Executing for: %d.%06ld sec\n",
|
||||
(int)(now.tv_sec - start.tv_sec),
|
||||
(long)(now.tv_nsec - start.tv_nsec) / 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
d_trace(3, " Executing for: %d.%06ld sec\n",
|
||||
(int)(now.tv_sec - 1 - start.tv_sec),
|
||||
(long)(now.tv_nsec + 1000000000 - start.tv_nsec) / 1000);
|
||||
}
|
||||
|
||||
if (fd_self()->mode & FD_MODE_SERVER) {
|
||||
d_trace(3, " Server: %llu message(s) echoed\n",
|
||||
copy.nb_echoed);
|
||||
}
|
||||
if (fd_self()->mode & FD_MODE_CLIENT) {
|
||||
d_trace(3, " Client:\n");
|
||||
d_trace(3, " %llu message(s) sent\n", copy.nb_sent);
|
||||
d_trace(3, " %llu error(s) received\n", copy.nb_errs);
|
||||
d_trace(3, " %llu answer(s) received\n", copy.nb_recv);
|
||||
d_trace(3, " fastest: %ld.%06ld sec.\n",
|
||||
copy.shortest / 1000000, copy.shortest % 1000000);
|
||||
d_trace(3, " slowest: %ld.%06ld sec.\n",
|
||||
copy.longest / 1000000, copy.longest % 1000000);
|
||||
d_trace(3, " Average: %ld.%06ld sec.\n",
|
||||
copy.avg / 1000000, copy.avg % 1000000);
|
||||
}
|
||||
d_trace(3, "-------------------------------------\n");
|
||||
}
|
||||
|
||||
CHECK_FCT( fd_hook_register(
|
||||
mask_tree, s6a_hook_cb_tree, NULL, NULL, &s6a_hook_hdl) );
|
||||
|
||||
return 0;
|
||||
return NULL; /* never called */
|
||||
}
|
||||
|
||||
void s6a_hook_final()
|
||||
{
|
||||
if (s6a_hook_hdl) { CHECK_FCT_DO( fd_hook_unregister( s6a_hook_hdl ), ); }
|
||||
}
|
||||
|
||||
void s6a_hook_register(s6a_hook_user_handler instance)
|
||||
{
|
||||
s6a_hook_user_handler_instance = instance;
|
||||
}
|
||||
|
||||
void s6a_hook_unregister(void)
|
||||
{
|
||||
s6a_hook_user_handler_instance = NULL;
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
#ifndef __FD_LOGGER_H__
|
||||
#define __FD_LOGGER_H__
|
||||
|
||||
#include "core_errno.h"
|
||||
|
||||
#include "freeDiameter/freeDiameter-host.h"
|
||||
#include "freeDiameter/libfdcore.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
CORE_DECLARE(int) fd_logger_init();
|
||||
CORE_DECLARE(void) fd_logger_final();
|
||||
|
||||
CORE_DECLARE(int) fd_logger_stats_start();
|
||||
|
||||
typedef void (*fd_logger_user_handler)(
|
||||
enum fd_hook_type type, struct msg *msg, struct peer_hdr *peer,
|
||||
void *other, struct fd_hook_permsgdata *pmd, void *regdata);
|
||||
|
||||
CORE_DECLARE(void) fd_logger_register(fd_logger_user_handler instance);
|
||||
CORE_DECLARE(void) fd_logger_unregister();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* ! __FD_LOGGER_H__ */
|
|
@ -65,8 +65,6 @@ int fd_ext_ ## _function(int major, int minor, char * conffile) { \
|
|||
return (_function)(conffile); \
|
||||
}
|
||||
|
||||
int fd_avp_search_avp ( struct avp * groupedavp, struct dict_object * what, struct avp ** avp );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -1,15 +1,16 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
noinst_LTLIBRARIES = libs6afreeDiameter.la
|
||||
noinst_LTLIBRARIES = libfds6a.la
|
||||
|
||||
libs6afreeDiameter_la_SOURCES = \
|
||||
libfds6a_la_SOURCES = \
|
||||
extension.h
|
||||
|
||||
nodist_libs6afreeDiameter_la_SOURCES = \
|
||||
dict_nas_mipv6.c dict_s6a.c libapp_sip.c
|
||||
nodist_libfds6a_la_SOURCES = \
|
||||
dict_nas_mipv6.c dict_s6a.c s6a_init.c
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/lib/s6a
|
||||
-I$(top_srcdir)/lib/fd/s6a \
|
||||
-I$(top_srcdir)/lib/fd
|
||||
|
||||
AM_CFLAGS = \
|
||||
-Wall -Werror
|
|
@ -1,9 +1,10 @@
|
|||
#define TRACE_MODULE _s6a_dict
|
||||
|
||||
#include "core_debug.h"
|
||||
#define TRACE_MODULE _s6a_init
|
||||
|
||||
#include "s6a_lib.h"
|
||||
|
||||
#define S6A_VENDOR_ID 10415; /* 3GPP Vendor ID */
|
||||
#define S6A_APPLI_ID 16777251; /* 3GPP S6A Application ID */
|
||||
|
||||
struct dict_object *s6a_vendor = NULL;
|
||||
struct dict_object *s6a_appli = NULL;
|
||||
|
||||
|
@ -76,38 +77,29 @@ struct dict_object *s6a_served_party_ip_addr = NULL;
|
|||
|
||||
int s6a_ext_load()
|
||||
{
|
||||
int ret;
|
||||
|
||||
int fd_ext_dict_nas_mipv6_init(int major, int minor, char *conffile);
|
||||
int fd_ext_dict_s6a_init(int major, int minor, char *conffile);
|
||||
|
||||
ret = fd_ext_dict_nas_mipv6_init(
|
||||
FD_PROJECT_VERSION_MAJOR, FD_PROJECT_VERSION_MINOR, NULL);
|
||||
if (ret != 0)
|
||||
{
|
||||
d_error("fd_ext_init_nas_mipv6() failed");
|
||||
return ret;
|
||||
}
|
||||
ret = fd_ext_dict_s6a_init(
|
||||
FD_PROJECT_VERSION_MAJOR, FD_PROJECT_VERSION_MINOR, NULL);
|
||||
if (ret != 0)
|
||||
{
|
||||
d_error("fd_ext_init_dict_s6a() failed");
|
||||
return ret;
|
||||
}
|
||||
CHECK_FCT(fd_ext_dict_nas_mipv6_init(
|
||||
FD_PROJECT_VERSION_MAJOR, FD_PROJECT_VERSION_MINOR, NULL));
|
||||
CHECK_FCT(fd_ext_dict_s6a_init(
|
||||
FD_PROJECT_VERSION_MAJOR, FD_PROJECT_VERSION_MINOR, NULL));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int s6a_dict_init(void)
|
||||
int s6a_init(void)
|
||||
{
|
||||
uint32_t vendor_id = S6A_VENDOR_ID;
|
||||
uint32_t appli_id = S6A_APPLI_ID;
|
||||
|
||||
CHECK_FCT(s6a_ext_load());
|
||||
|
||||
CHECK_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_VENDOR,
|
||||
VENDOR_BY_ID, (void *)&s6a_config->vendor_id, &s6a_vendor, ENOENT));
|
||||
VENDOR_BY_ID, (void *)&vendor_id, &s6a_vendor, ENOENT));
|
||||
|
||||
CHECK_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_APPLICATION,
|
||||
APPLICATION_BY_ID, (void *)&s6a_config->appli_id, &s6a_appli, ENOENT));
|
||||
APPLICATION_BY_ID, (void *)&appli_id, &s6a_appli, ENOENT));
|
||||
|
||||
CHECK_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_COMMAND, CMD_BY_NAME,
|
||||
"Authentication-Information-Request", &s6a_cmd_air, ENOENT));
|
|
@ -1,8 +1,6 @@
|
|||
#ifndef __S6A_LIB_H__
|
||||
#define __S6A_LIB_H__
|
||||
|
||||
#include "core_errno.h"
|
||||
|
||||
#include "freeDiameter/freeDiameter-host.h"
|
||||
#include "freeDiameter/libfdcore.h"
|
||||
#include "freeDiameter/extension.h"
|
||||
|
@ -11,10 +9,6 @@
|
|||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define S6A_REALM "localdomain" /* Default Relam */
|
||||
#define MME_IDENTITY "mme.localdomain" /* Default MME Identity */
|
||||
#define HSS_IDENTITY "hss.localdomain" /* Default HSS Identity */
|
||||
|
||||
#define S6A_RAT_TYPE_WLAN 0
|
||||
#define S6A_RAT_TYPE_VIRTUAL 1
|
||||
#define S6A_RAT_TYPE_UTRAN 1000
|
||||
|
@ -42,51 +36,6 @@ extern "C" {
|
|||
#define S6A_UE_SRVCC_NOT_SUPPORTED (0)
|
||||
#define S6A_UE_SRVCC_SUPPORTED (1)
|
||||
|
||||
#define AVP_CODE_CONTEXT_IDENTIFIER (1423)
|
||||
#define AVP_CODE_ALL_APN_CONFIG_INC_IND (1428)
|
||||
#define AVP_CODE_APN_CONFIGURATION (1430)
|
||||
|
||||
/* This is default diameter configuration if there is no config file
|
||||
* The Configuration : No TLS, Only TCP */
|
||||
struct s6a_config_t {
|
||||
/* Diameter Identity of the local peer (FQDN -- ASCII) */
|
||||
char *cnf_diamid;
|
||||
/* Diameter realm of the local peer, default to realm part of cnf_diamid */
|
||||
char *cnf_diamrlm;
|
||||
/* IP address of the local peer */
|
||||
char *cnf_addr;
|
||||
|
||||
/* the local port for legacy Diameter (default: 3868) in host byte order */
|
||||
c_uint16_t cnf_port;
|
||||
/* the local port for Diameter/TLS (default: 5658) in host byte order */
|
||||
c_uint16_t cnf_port_tls;
|
||||
|
||||
/* (supposedly) UTF-8, \0 terminated.
|
||||
* The Diameter Identity of the remote peer. */
|
||||
char *pi_diamid;
|
||||
char *pi_addr; /* IP address of the remote peer */
|
||||
c_uint16_t pic_port; /* port to connect to. 0: default. */
|
||||
|
||||
int mode; /* default MODE_MME | MODE_HSS */
|
||||
c_uint32_t vendor_id; /* default 10415 */
|
||||
c_uint32_t appli_id; /* default 16777251 */
|
||||
|
||||
int duration; /* default 10 */
|
||||
struct s6a_stats {
|
||||
unsigned long long nb_echoed; /* server */
|
||||
unsigned long long nb_sent; /* client */
|
||||
unsigned long long nb_recv; /* client */
|
||||
unsigned long long nb_errs; /* client */
|
||||
unsigned long shortest; /* fastest answer, in microseconds */
|
||||
unsigned long longest; /* slowest answer, in microseconds */
|
||||
unsigned long avg; /* average answer time, in microseconds */
|
||||
} stats;
|
||||
|
||||
pthread_mutex_t stats_lock;
|
||||
};
|
||||
|
||||
extern struct s6a_config_t *s6a_config;
|
||||
|
||||
/* Some global variables for dictionary */
|
||||
extern struct dict_object *s6a_vendor;
|
||||
extern struct dict_object *s6a_appli;
|
||||
|
@ -159,20 +108,7 @@ extern struct dict_object *s6a_pre_emption_capability;
|
|||
extern struct dict_object *s6a_pre_emption_vulnerability;
|
||||
extern struct dict_object *s6a_served_party_ip_addr;
|
||||
|
||||
CORE_DECLARE(int) s6a_init(const char *conffile);
|
||||
CORE_DECLARE(void) s6a_final(void);
|
||||
|
||||
CORE_DECLARE(int) s6a_config_init(void);
|
||||
|
||||
CORE_DECLARE(int) s6a_hook_init();
|
||||
CORE_DECLARE(void) s6a_hook_final();
|
||||
|
||||
typedef void (*s6a_hook_user_handler)(
|
||||
enum fd_hook_type type, struct msg *msg, struct peer_hdr *peer,
|
||||
void *other, struct fd_hook_permsgdata *pmd, void *regdata);
|
||||
|
||||
CORE_DECLARE(void) s6a_hook_register(s6a_hook_user_handler instance);
|
||||
CORE_DECLARE(void) s6a_hook_unregister();
|
||||
int s6a_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
SUBDIRS = freeDiameter
|
||||
|
||||
noinst_LTLIBRARIES = libs6a.la
|
||||
|
||||
libs6a_la_SOURCES = \
|
||||
s6a_lib.h
|
||||
|
||||
nodist_libs6a_la_SOURCES = \
|
||||
s6a_init.c s6a_fd.c s6a_config.c s6a_hook.c s6a_dict.c
|
||||
|
||||
libs6a_la_DEPENDENCIES = \
|
||||
$(top_srcdir)/lib/base/libbase.la \
|
||||
$(top_srcdir)/lib/s6a/freeDiameter/libs6afreeDiameter.la
|
||||
|
||||
libs6a_la_LIBADD = \
|
||||
$(top_srcdir)/lib/base/libbase.la \
|
||||
$(top_srcdir)/lib/s6a/freeDiameter/libs6afreeDiameter.la
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/lib/core/include
|
||||
|
||||
AM_CFLAGS = \
|
||||
-Wall -Werror
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
MOSTLYCLEANFILES = *.stackdump
|
||||
|
||||
EXTRA_DIST = .libs $(noinst_LTLIBRARIES)
|
|
@ -1,108 +0,0 @@
|
|||
#define TRACE_MODULE _s6a_init
|
||||
|
||||
#include "core_debug.h"
|
||||
|
||||
#include "s6a_lib.h"
|
||||
|
||||
static pthread_t s6a_stats_th = (pthread_t)NULL;
|
||||
|
||||
int s6a_fd_init(const char *conffile);
|
||||
void s6a_fd_final();
|
||||
|
||||
int s6a_dict_init(void);
|
||||
|
||||
static void s6a_config_dump(void)
|
||||
{
|
||||
d_trace(3, "------- s6a configuration dump: ---------\n");
|
||||
d_trace(3, " Vendor Id .......... : %u\n", s6a_config->vendor_id);
|
||||
d_trace(3, " Application Id ..... : %u\n", s6a_config->appli_id);
|
||||
d_trace(3, " Duration ........... : %d(sec)\n", s6a_config->duration);
|
||||
d_trace(3, "------- /s6a configuration dump ---------\n");
|
||||
}
|
||||
|
||||
/* Function to display statistics periodically */
|
||||
static void * s6a_stats(void * arg)
|
||||
{
|
||||
struct timespec start, now;
|
||||
struct s6a_stats copy;
|
||||
|
||||
/* Get the start time */
|
||||
CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &start), );
|
||||
|
||||
/* Now, loop until canceled */
|
||||
while (1) {
|
||||
/* Display statistics every XX seconds */
|
||||
sleep(s6a_config->duration);
|
||||
|
||||
/* Now, get the current stats */
|
||||
CHECK_POSIX_DO( pthread_mutex_lock(&s6a_config->stats_lock), );
|
||||
memcpy(©, &s6a_config->stats, sizeof(struct s6a_stats));
|
||||
CHECK_POSIX_DO( pthread_mutex_unlock(&s6a_config->stats_lock), );
|
||||
|
||||
/* Get the current execution time */
|
||||
CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &now), );
|
||||
|
||||
/* Now, display everything */
|
||||
d_trace(3, "------- s6a statistics ---------\n");
|
||||
if (now.tv_nsec >= start.tv_nsec)
|
||||
{
|
||||
d_trace(3, " Executing for: %d.%06ld sec\n",
|
||||
(int)(now.tv_sec - start.tv_sec),
|
||||
(long)(now.tv_nsec - start.tv_nsec) / 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
d_trace(3, " Executing for: %d.%06ld sec\n",
|
||||
(int)(now.tv_sec - 1 - start.tv_sec),
|
||||
(long)(now.tv_nsec + 1000000000 - start.tv_nsec) / 1000);
|
||||
}
|
||||
|
||||
d_trace(3, " Local: %llu message(s) echoed\n",
|
||||
copy.nb_echoed);
|
||||
d_trace(3, " Remote:\n");
|
||||
d_trace(3, " %llu message(s) sent\n", copy.nb_sent);
|
||||
d_trace(3, " %llu error(s) received\n", copy.nb_errs);
|
||||
d_trace(3, " %llu answer(s) received\n", copy.nb_recv);
|
||||
d_trace(3, " fastest: %ld.%06ld sec.\n",
|
||||
copy.shortest / 1000000, copy.shortest % 1000000);
|
||||
d_trace(3, " slowest: %ld.%06ld sec.\n",
|
||||
copy.longest / 1000000, copy.longest % 1000000);
|
||||
d_trace(3, " Average: %ld.%06ld sec.\n",
|
||||
copy.avg / 1000000, copy.avg % 1000000);
|
||||
d_trace(3, "-------------------------------------\n");
|
||||
}
|
||||
|
||||
return NULL; /* never called */
|
||||
}
|
||||
|
||||
/* entry point */
|
||||
int s6a_init(const char *conffile)
|
||||
{
|
||||
/* Configure Application Mode(MME, HSS) */
|
||||
CHECK_FCT( s6a_fd_init(conffile) );
|
||||
|
||||
/* Initialize the mutex */
|
||||
CHECK_POSIX( pthread_mutex_init(&s6a_config->stats_lock, NULL) );
|
||||
|
||||
s6a_config_dump();
|
||||
|
||||
/* Install objects definitions for this test application */
|
||||
CHECK_FCT( s6a_dict_init() );
|
||||
|
||||
/* Advertise the support for the test application in the peer */
|
||||
CHECK_FCT( fd_disp_app_support ( s6a_appli, s6a_vendor, 1, 0 ) );
|
||||
|
||||
/* Start the statistics thread */
|
||||
CHECK_POSIX( pthread_create(&s6a_stats_th, NULL, s6a_stats, NULL) );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Unload */
|
||||
void s6a_final(void)
|
||||
{
|
||||
CHECK_FCT_DO( fd_thr_term(&s6a_stats_th), );
|
||||
CHECK_POSIX_DO( pthread_mutex_destroy(&s6a_config->stats_lock), );
|
||||
|
||||
s6a_fd_final();
|
||||
}
|
|
@ -10,16 +10,17 @@ nodist_libhss_la_SOURCES = \
|
|||
|
||||
libhss_la_DEPENDENCIES = \
|
||||
$(top_srcdir)/lib/core/src/libcore.la \
|
||||
$(top_srcdir)/lib/s6a/libs6a.la
|
||||
$(top_srcdir)/lib/fd/libfd.la
|
||||
|
||||
libhss_la_LIBADD = \
|
||||
$(top_srcdir)/lib/core/src/libcore.la \
|
||||
$(top_srcdir)/lib/s6a/libs6a.la
|
||||
$(top_srcdir)/lib/fd/libfd.la
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/lib/core/include \
|
||||
-I$(top_srcdir)/lib/base \
|
||||
-I$(top_srcdir)/lib/s6a \
|
||||
-I$(top_srcdir)/lib/fd/s6a \
|
||||
-I$(top_srcdir)/lib/fd \
|
||||
@MONGOC_CFLAGS@
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include <mongoc.h>
|
||||
|
||||
#include "s6a_lib.h"
|
||||
#include "fd_lib.h"
|
||||
|
||||
#include "context.h"
|
||||
#include "hss_context.h"
|
||||
|
@ -294,12 +294,12 @@ status_t hss_context_setup_trace_module()
|
|||
|
||||
extern int _hss_s6a_handler;
|
||||
d_trace_level(&_hss_s6a_handler, s6a);
|
||||
extern int _s6a_fd;
|
||||
d_trace_level(&_s6a_fd, s6a);
|
||||
extern int _s6a_init;
|
||||
d_trace_level(&_s6a_init, s6a);
|
||||
extern int _s6a_hook;
|
||||
d_trace_level(&_s6a_hook, s6a);
|
||||
extern int _fd_init;
|
||||
d_trace_level(&_fd_init, s6a);
|
||||
extern int _fd_context;
|
||||
d_trace_level(&_fd_context, s6a);
|
||||
extern int _fd_logger;
|
||||
d_trace_level(&_fd_logger, s6a);
|
||||
}
|
||||
|
||||
if (others)
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "core_lib.h"
|
||||
#include "core_sha2.h"
|
||||
|
||||
#include "fd_lib.h"
|
||||
#include "s6a_lib.h"
|
||||
|
||||
#include "hss_context.h"
|
||||
|
@ -167,9 +168,9 @@ static int hss_air_cb( struct msg **msg, struct avp *avp,
|
|||
fd_msg_send(msg, NULL, NULL);
|
||||
|
||||
/* Add this value to the stats */
|
||||
pthread_mutex_lock(&s6a_config->stats_lock);
|
||||
s6a_config->stats.nb_echoed++;
|
||||
pthread_mutex_unlock(&s6a_config->stats_lock);
|
||||
pthread_mutex_lock(&fd_self()->stats_lock);
|
||||
fd_self()->stats.nb_echoed++;
|
||||
pthread_mutex_unlock(&fd_self()->stats_lock);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -470,9 +471,9 @@ static int hss_ulr_cb( struct msg **msg, struct avp *avp,
|
|||
fd_msg_send(msg, NULL, NULL);
|
||||
|
||||
/* Add this value to the stats */
|
||||
pthread_mutex_lock(&s6a_config->stats_lock);
|
||||
s6a_config->stats.nb_echoed++;
|
||||
pthread_mutex_unlock(&s6a_config->stats_lock);
|
||||
pthread_mutex_lock(&fd_self()->stats_lock);
|
||||
fd_self()->stats.nb_echoed++;
|
||||
pthread_mutex_unlock(&fd_self()->stats_lock);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -488,27 +489,30 @@ status_t hss_s6a_init(void)
|
|||
struct disp_when data;
|
||||
int ret;
|
||||
|
||||
s6a_config_init();
|
||||
fd_context_init(FD_MODE_SERVER);
|
||||
|
||||
if (hss_self()->s6a_config_path == NULL)
|
||||
{
|
||||
/* This is default diameter configuration if there is no config file
|
||||
* The Configuration : No TLS, Only TCP */
|
||||
|
||||
s6a_config->cnf_diamid = HSS_IDENTITY;
|
||||
s6a_config->cnf_diamrlm = S6A_REALM;
|
||||
s6a_config->cnf_addr = hss_self()->hss_s6a_addr;
|
||||
s6a_config->cnf_port = hss_self()->hss_s6a_port;
|
||||
s6a_config->cnf_port_tls = hss_self()->hss_s6a_tls_port;
|
||||
fd_self()->cnf_diamid = HSS_IDENTITY;
|
||||
fd_self()->cnf_diamrlm = FD_REALM;
|
||||
fd_self()->cnf_addr = hss_self()->hss_s6a_addr;
|
||||
fd_self()->cnf_port = hss_self()->hss_s6a_port;
|
||||
fd_self()->cnf_port_tls = hss_self()->hss_s6a_tls_port;
|
||||
|
||||
s6a_config->pi_diamid = MME_IDENTITY;
|
||||
s6a_config->pi_addr = hss_self()->mme_s6a_addr;
|
||||
s6a_config->pic_port = hss_self()->mme_s6a_port;
|
||||
fd_self()->pi_diamid = MME_IDENTITY;
|
||||
fd_self()->pi_addr = hss_self()->mme_s6a_addr;
|
||||
fd_self()->pic_port = hss_self()->mme_s6a_port;
|
||||
}
|
||||
|
||||
ret = s6a_init(hss_self()->s6a_config_path);
|
||||
ret = fd_init(hss_self()->s6a_config_path);
|
||||
if (ret != 0) return CORE_ERROR;
|
||||
|
||||
/* Install objects definitions for this application */
|
||||
CHECK_FCT( s6a_init() );
|
||||
|
||||
memset(&data, 0, sizeof(data));
|
||||
data.app = s6a_appli;
|
||||
|
||||
|
@ -526,6 +530,9 @@ status_t hss_s6a_init(void)
|
|||
d_assert(fd_disp_register(hss_ulr_cb, DISP_HOW_CC, &data, NULL,
|
||||
&hdl_ulr) == 0, return CORE_ERROR,);
|
||||
|
||||
/* Advertise the support for the application in the peer */
|
||||
CHECK_FCT( fd_disp_app_support ( s6a_appli, s6a_vendor, 1, 0 ) );
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
||||
|
@ -541,5 +548,5 @@ void hss_s6a_final(void)
|
|||
(void) fd_disp_unregister(&hdl_ulr, NULL);
|
||||
}
|
||||
|
||||
s6a_final();
|
||||
fd_final();
|
||||
}
|
||||
|
|
|
@ -27,14 +27,14 @@ libmme_la_DEPENDENCIES = \
|
|||
$(top_srcdir)/lib/core/src/libcore.la \
|
||||
$(top_srcdir)/lib/s1ap/libs1ap.la \
|
||||
$(top_srcdir)/lib/nas/libnas.la \
|
||||
$(top_srcdir)/lib/s6a/libs6a.la \
|
||||
$(top_srcdir)/lib/fd/libfd.la \
|
||||
$(top_srcdir)/lib/gtp/libgtp.la
|
||||
|
||||
libmme_la_LIBADD = \
|
||||
$(top_srcdir)/lib/core/src/libcore.la \
|
||||
$(top_srcdir)/lib/s1ap/libs1ap.la \
|
||||
$(top_srcdir)/lib/nas/libnas.la \
|
||||
$(top_srcdir)/lib/s6a/libs6a.la \
|
||||
$(top_srcdir)/lib/fd/libfd.la \
|
||||
$(top_srcdir)/lib/gtp/libgtp.la
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
|
@ -43,7 +43,8 @@ AM_CPPFLAGS = \
|
|||
-I$(top_srcdir)/lib/s1ap/asn1c \
|
||||
-I$(top_srcdir)/lib/s1ap \
|
||||
-I$(top_srcdir)/lib/nas \
|
||||
-I$(top_srcdir)/lib/s6a \
|
||||
-I$(top_srcdir)/lib/fd/s6a \
|
||||
-I$(top_srcdir)/lib/fd \
|
||||
-I$(top_srcdir)/lib/gtp
|
||||
|
||||
AM_CFLAGS = \
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "gtp_path.h"
|
||||
#include "s1ap_message.h"
|
||||
#include "s6a_lib.h"
|
||||
#include "fd_lib.h"
|
||||
|
||||
#include "context.h"
|
||||
#include "nas_conv.h"
|
||||
|
@ -833,12 +833,12 @@ status_t mme_context_setup_trace_module()
|
|||
|
||||
extern int _mme_s6a_handler;
|
||||
d_trace_level(&_mme_s6a_handler, s6a);
|
||||
extern int _s6a_fd;
|
||||
d_trace_level(&_s6a_fd, s6a);
|
||||
extern int _s6a_init;
|
||||
d_trace_level(&_s6a_init, s6a);
|
||||
extern int _s6a_hook;
|
||||
d_trace_level(&_s6a_hook, s6a);
|
||||
extern int _fd_init;
|
||||
d_trace_level(&_fd_init, s6a);
|
||||
extern int _fd_context;
|
||||
d_trace_level(&_fd_context, s6a);
|
||||
extern int _fd_logger;
|
||||
d_trace_level(&_fd_logger, s6a);
|
||||
}
|
||||
|
||||
if (gtp)
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "core_debug.h"
|
||||
#include "core_pool.h"
|
||||
|
||||
#include "fd_lib.h"
|
||||
#include "s6a_lib.h"
|
||||
|
||||
#include "mme_event.h"
|
||||
|
@ -98,31 +99,31 @@ static void mme_s6a_aia_cb(void *data, struct msg **msg)
|
|||
|
||||
out:
|
||||
/* Free the message */
|
||||
d_assert(pthread_mutex_lock(&s6a_config->stats_lock) == 0,,);
|
||||
d_assert(pthread_mutex_lock(&fd_self()->stats_lock) == 0,,);
|
||||
dur = ((ts.tv_sec - mi->ts.tv_sec) * 1000000) +
|
||||
((ts.tv_nsec - mi->ts.tv_nsec) / 1000);
|
||||
if (s6a_config->stats.nb_recv)
|
||||
if (fd_self()->stats.nb_recv)
|
||||
{
|
||||
/* Ponderate in the avg */
|
||||
s6a_config->stats.avg = (s6a_config->stats.avg *
|
||||
s6a_config->stats.nb_recv + dur) / (s6a_config->stats.nb_recv + 1);
|
||||
fd_self()->stats.avg = (fd_self()->stats.avg *
|
||||
fd_self()->stats.nb_recv + dur) / (fd_self()->stats.nb_recv + 1);
|
||||
/* Min, max */
|
||||
if (dur < s6a_config->stats.shortest)
|
||||
s6a_config->stats.shortest = dur;
|
||||
if (dur > s6a_config->stats.longest)
|
||||
s6a_config->stats.longest = dur;
|
||||
if (dur < fd_self()->stats.shortest)
|
||||
fd_self()->stats.shortest = dur;
|
||||
if (dur > fd_self()->stats.longest)
|
||||
fd_self()->stats.longest = dur;
|
||||
}
|
||||
else
|
||||
{
|
||||
s6a_config->stats.shortest = dur;
|
||||
s6a_config->stats.longest = dur;
|
||||
s6a_config->stats.avg = dur;
|
||||
fd_self()->stats.shortest = dur;
|
||||
fd_self()->stats.longest = dur;
|
||||
fd_self()->stats.avg = dur;
|
||||
}
|
||||
if (error)
|
||||
s6a_config->stats.nb_errs++;
|
||||
fd_self()->stats.nb_errs++;
|
||||
else
|
||||
s6a_config->stats.nb_recv++;
|
||||
d_assert(pthread_mutex_unlock(&s6a_config->stats_lock) == 0,,);
|
||||
fd_self()->stats.nb_recv++;
|
||||
d_assert(pthread_mutex_unlock(&fd_self()->stats_lock) == 0,,);
|
||||
|
||||
/* Display how long it took */
|
||||
if (ts.tv_nsec > mi->ts.tv_nsec)
|
||||
|
@ -233,9 +234,9 @@ int mme_s6a_send_air(mme_ue_t *mme_ue)
|
|||
d_assert(fd_msg_send(&req, mme_s6a_aia_cb, svg) == 0, goto out,);
|
||||
|
||||
/* Increment the counter */
|
||||
d_assert(pthread_mutex_lock(&s6a_config->stats_lock) == 0,,);
|
||||
s6a_config->stats.nb_sent++;
|
||||
d_assert(pthread_mutex_unlock(&s6a_config->stats_lock) == 0,, );
|
||||
d_assert(pthread_mutex_lock(&fd_self()->stats_lock) == 0,,);
|
||||
fd_self()->stats.nb_sent++;
|
||||
d_assert(pthread_mutex_unlock(&fd_self()->stats_lock) == 0,, );
|
||||
|
||||
d_trace(3, "[S6A] Authentication-Information-Request : UE[%s] --> HSS\n",
|
||||
mme_ue->imsi_bcd);
|
||||
|
@ -423,31 +424,31 @@ static void mme_s6a_ula_cb(void *data, struct msg **msg)
|
|||
mme_event_send(&e);
|
||||
out:
|
||||
/* Free the message */
|
||||
d_assert(pthread_mutex_lock(&s6a_config->stats_lock) == 0,,);
|
||||
d_assert(pthread_mutex_lock(&fd_self()->stats_lock) == 0,,);
|
||||
dur = ((ts.tv_sec - mi->ts.tv_sec) * 1000000) +
|
||||
((ts.tv_nsec - mi->ts.tv_nsec) / 1000);
|
||||
if (s6a_config->stats.nb_recv)
|
||||
if (fd_self()->stats.nb_recv)
|
||||
{
|
||||
/* Ponderate in the avg */
|
||||
s6a_config->stats.avg = (s6a_config->stats.avg *
|
||||
s6a_config->stats.nb_recv + dur) / (s6a_config->stats.nb_recv + 1);
|
||||
fd_self()->stats.avg = (fd_self()->stats.avg *
|
||||
fd_self()->stats.nb_recv + dur) / (fd_self()->stats.nb_recv + 1);
|
||||
/* Min, max */
|
||||
if (dur < s6a_config->stats.shortest)
|
||||
s6a_config->stats.shortest = dur;
|
||||
if (dur > s6a_config->stats.longest)
|
||||
s6a_config->stats.longest = dur;
|
||||
if (dur < fd_self()->stats.shortest)
|
||||
fd_self()->stats.shortest = dur;
|
||||
if (dur > fd_self()->stats.longest)
|
||||
fd_self()->stats.longest = dur;
|
||||
}
|
||||
else
|
||||
{
|
||||
s6a_config->stats.shortest = dur;
|
||||
s6a_config->stats.longest = dur;
|
||||
s6a_config->stats.avg = dur;
|
||||
fd_self()->stats.shortest = dur;
|
||||
fd_self()->stats.longest = dur;
|
||||
fd_self()->stats.avg = dur;
|
||||
}
|
||||
if (error)
|
||||
s6a_config->stats.nb_errs++;
|
||||
fd_self()->stats.nb_errs++;
|
||||
else
|
||||
s6a_config->stats.nb_recv++;
|
||||
d_assert(pthread_mutex_unlock(&s6a_config->stats_lock) == 0,,);
|
||||
fd_self()->stats.nb_recv++;
|
||||
d_assert(pthread_mutex_unlock(&fd_self()->stats_lock) == 0,,);
|
||||
|
||||
/* Display how long it took */
|
||||
if (ts.tv_nsec > mi->ts.tv_nsec)
|
||||
|
@ -553,9 +554,9 @@ int mme_s6a_send_ulr(mme_ue_t *mme_ue)
|
|||
d_assert(fd_msg_send(&req, mme_s6a_ula_cb, svg) == 0, goto out,);
|
||||
|
||||
/* Increment the counter */
|
||||
d_assert(pthread_mutex_lock(&s6a_config->stats_lock) == 0,,);
|
||||
s6a_config->stats.nb_sent++;
|
||||
d_assert(pthread_mutex_unlock(&s6a_config->stats_lock) == 0,, );
|
||||
d_assert(pthread_mutex_lock(&fd_self()->stats_lock) == 0,,);
|
||||
fd_self()->stats.nb_sent++;
|
||||
d_assert(pthread_mutex_unlock(&fd_self()->stats_lock) == 0,, );
|
||||
|
||||
d_trace(3, "[S6A] Update-Location-Request : UE[%s] --> HSS\n",
|
||||
mme_ue->imsi_bcd);
|
||||
|
@ -573,31 +574,37 @@ status_t mme_s6a_init(void)
|
|||
{
|
||||
status_t rv;
|
||||
|
||||
s6a_config_init();
|
||||
fd_context_init(FD_MODE_CLIENT);
|
||||
|
||||
if (mme_self()->s6a_config_path == NULL)
|
||||
{
|
||||
/* This is default diameter configuration if there is no config file
|
||||
* The Configuration : No TLS, Only TCP */
|
||||
|
||||
s6a_config->cnf_diamid = MME_IDENTITY;
|
||||
s6a_config->cnf_diamrlm = S6A_REALM;
|
||||
s6a_config->cnf_addr = mme_self()->mme_s6a_addr;
|
||||
s6a_config->cnf_port = mme_self()->mme_s6a_port;
|
||||
s6a_config->cnf_port_tls = mme_self()->mme_s6a_tls_port;
|
||||
fd_self()->cnf_diamid = MME_IDENTITY;
|
||||
fd_self()->cnf_diamrlm = FD_REALM;
|
||||
fd_self()->cnf_addr = mme_self()->mme_s6a_addr;
|
||||
fd_self()->cnf_port = mme_self()->mme_s6a_port;
|
||||
fd_self()->cnf_port_tls = mme_self()->mme_s6a_tls_port;
|
||||
|
||||
s6a_config->pi_diamid = HSS_IDENTITY;
|
||||
s6a_config->pi_addr = mme_self()->hss_s6a_addr;
|
||||
s6a_config->pic_port = mme_self()->hss_s6a_port;
|
||||
fd_self()->pi_diamid = HSS_IDENTITY;
|
||||
fd_self()->pi_addr = mme_self()->hss_s6a_addr;
|
||||
fd_self()->pic_port = mme_self()->hss_s6a_port;
|
||||
}
|
||||
|
||||
rv = s6a_init(mme_self()->s6a_config_path);
|
||||
rv = fd_init(mme_self()->s6a_config_path);
|
||||
if (rv != CORE_OK) return rv;
|
||||
|
||||
/* Install objects definitions for this application */
|
||||
CHECK_FCT( s6a_init() );
|
||||
|
||||
pool_init(&sess_state_pool, MAX_NUM_SESSION_STATE);
|
||||
|
||||
d_assert(fd_sess_handler_create(&mme_s6a_reg,
|
||||
(void *)free, NULL, NULL) == 0, return -1,);
|
||||
|
||||
/* Advertise the support for the application in the peer */
|
||||
CHECK_FCT( fd_disp_app_support ( s6a_appli, s6a_vendor, 1, 0 ) );
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
@ -617,5 +624,5 @@ void mme_s6a_final(void)
|
|||
|
||||
pool_final(&sess_state_pool);
|
||||
|
||||
s6a_final();
|
||||
fd_final();
|
||||
}
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -24,11 +24,11 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -39,11 +39,11 @@
|
|||
fun:strdup
|
||||
fun:fd_log_threadname
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -55,11 +55,11 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -72,11 +72,11 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -90,11 +90,11 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
|
@ -109,9 +109,9 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
|
@ -126,9 +126,9 @@
|
|||
obj:/usr/lib/i386-linux-gnu/libgnutls.so.26.22.6
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
|
@ -145,7 +145,7 @@
|
|||
obj:/usr/lib/i386-linux-gnu/libgnutls.so.26.22.6
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:fd_init
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
|
@ -161,8 +161,8 @@
|
|||
obj:/usr/lib/i386-linux-gnu/libgnutls.so.26.22.6
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
|
@ -174,11 +174,11 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -193,10 +193,10 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
|
@ -226,11 +226,11 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
|
@ -249,6 +249,23 @@
|
|||
obj:/usr/lib/i386-linux-gnu/libgnutls.so.26.22.6
|
||||
fun:gnutls_global_init
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: reachable
|
||||
fun:malloc
|
||||
fun:fd_dump_extend
|
||||
obj:/usr/lib/libfdproto.so.1.2.0
|
||||
obj:/usr/lib/libfdproto.so.1.2.0
|
||||
fun:fd_logger_cb_tree
|
||||
fun:fd_hook_call
|
||||
obj:/usr/lib/libfdcore.so.1.2.0
|
||||
fun:fd_out_send
|
||||
fun:fd_p_ce_handle_newcnx
|
||||
obj:/usr/lib/libfdcore.so.1.2.0
|
||||
fun:start_thread
|
||||
fun:clone
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
|
@ -259,11 +276,11 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -275,11 +292,11 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -290,11 +307,11 @@
|
|||
fun:strdup
|
||||
fun:fd_log_threadname
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -306,11 +323,11 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -323,11 +340,11 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -341,11 +358,11 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
|
@ -360,9 +377,9 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
|
@ -377,8 +394,25 @@
|
|||
obj:/usr/lib/i386-linux-gnu/libgnutls.so.26.22.6
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: reachable
|
||||
fun:malloc
|
||||
obj:/usr/lib/i386-linux-gnu/libgnutls.so.26.22.6
|
||||
obj:/lib/i386-linux-gnu/libgcrypt.so.11.8.2
|
||||
obj:/lib/i386-linux-gnu/libgcrypt.so.11.8.2
|
||||
obj:/lib/i386-linux-gnu/libgcrypt.so.11.8.2
|
||||
obj:/lib/i386-linux-gnu/libgcrypt.so.11.8.2
|
||||
fun:gcry_control
|
||||
obj:/usr/lib/i386-linux-gnu/libgnutls.so.26.22.6
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
}
|
||||
{
|
||||
|
@ -391,11 +425,11 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -410,10 +444,24 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
fun:app_initialize
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: reachable
|
||||
fun:malloc
|
||||
fun:fd_dump_extend
|
||||
obj:/usr/lib/libfdproto.so.1.2.0
|
||||
obj:/usr/lib/libfdproto.so.1.2.0
|
||||
fun:fd_logger_cb_tree
|
||||
fun:fd_hook_call
|
||||
obj:/usr/lib/libfdcore.so.1.2.0
|
||||
fun:start_thread
|
||||
fun:clone
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
|
@ -441,12 +489,11 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
|
@ -457,12 +504,10 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -473,12 +518,10 @@
|
|||
fun:strdup
|
||||
fun:fd_log_threadname
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -490,12 +533,10 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -508,12 +549,28 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: reachable
|
||||
fun:calloc
|
||||
obj:/usr/lib/i386-linux-gnu/libp11-kit.so.0.0.0
|
||||
obj:/usr/lib/i386-linux-gnu/libp11-kit.so.0.0.0
|
||||
fun:p11_kit_pin_register_callback
|
||||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
|
@ -525,12 +582,28 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: reachable
|
||||
fun:calloc
|
||||
obj:/usr/lib/i386-linux-gnu/libp11-kit.so.0.0.0
|
||||
obj:/usr/lib/i386-linux-gnu/libp11-kit.so.0.0.0
|
||||
fun:p11_kit_initialize_registered
|
||||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:fd_init
|
||||
fun:hss_s6a_init
|
||||
fun:hss_initialize
|
||||
fun:app_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
|
@ -542,12 +615,11 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
|
@ -558,12 +630,10 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -574,12 +644,10 @@
|
|||
fun:strdup
|
||||
fun:fd_log_threadname
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -591,12 +659,10 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
|
@ -609,12 +675,28 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: reachable
|
||||
fun:calloc
|
||||
obj:/usr/lib/i386-linux-gnu/libp11-kit.so.0.0.0
|
||||
obj:/usr/lib/i386-linux-gnu/libp11-kit.so.0.0.0
|
||||
fun:p11_kit_pin_register_callback
|
||||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
fun:app_initialize
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
|
@ -626,41 +708,9 @@
|
|||
fun:gnutls_pkcs11_init
|
||||
fun:gnutls_global_init
|
||||
fun:fd_core_initialize
|
||||
fun:s6a_fd_init
|
||||
fun:s6a_init
|
||||
fun:fd_init
|
||||
fun:mme_s6a_init
|
||||
fun:mme_initialize
|
||||
fun:app_initialize
|
||||
fun:test_initialize
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: reachable
|
||||
fun:malloc
|
||||
fun:fd_dump_extend
|
||||
obj:/usr/lib/libfdproto.so.1.2.0
|
||||
obj:/usr/lib/libfdproto.so.1.2.0
|
||||
fun:s6a_hook_cb_tree
|
||||
fun:fd_hook_call
|
||||
obj:/usr/lib/libfdcore.so.1.2.0
|
||||
fun:fd_out_send
|
||||
fun:fd_p_ce_handle_newcnx
|
||||
obj:/usr/lib/libfdcore.so.1.2.0
|
||||
fun:start_thread
|
||||
fun:clone
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: reachable
|
||||
fun:malloc
|
||||
fun:fd_dump_extend
|
||||
obj:/usr/lib/libfdproto.so.1.2.0
|
||||
obj:/usr/lib/libfdproto.so.1.2.0
|
||||
fun:s6a_hook_cb_tree
|
||||
fun:fd_hook_call
|
||||
obj:/usr/lib/libfdcore.so.1.2.0
|
||||
fun:start_thread
|
||||
fun:clone
|
||||
fun:main
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ AM_CPPFLAGS = \
|
|||
-I$(top_srcdir)/lib/s1ap/asn1c \
|
||||
-I$(top_srcdir)/lib/s1ap \
|
||||
-I$(top_srcdir)/lib/nas \
|
||||
-I$(top_srcdir)/lib/s6a \
|
||||
-I$(top_srcdir)/lib/fd \
|
||||
-I$(top_srcdir)/lib/gtp \
|
||||
-I$(top_srcdir)/src/mme \
|
||||
-I$(top_srcdir)/src/hss \
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "core_general.h"
|
||||
#include "core_debug.h"
|
||||
#include "core_semaphore.h"
|
||||
#include "s6a_lib.h"
|
||||
#include "fd_lib.h"
|
||||
|
||||
#include "app.h"
|
||||
#include "context.h"
|
||||
|
@ -26,7 +26,7 @@
|
|||
#include "testutil.h"
|
||||
|
||||
static int connected_count = 0;
|
||||
static void test_s6a_hook_handler(enum fd_hook_type type, struct msg * msg,
|
||||
static void test_fd_logger_handler(enum fd_hook_type type, struct msg * msg,
|
||||
struct peer_hdr * peer, void * other, struct fd_hook_permsgdata *pmd,
|
||||
void * regdata)
|
||||
{
|
||||
|
@ -48,7 +48,7 @@ status_t test_initialize(void)
|
|||
{
|
||||
status_t rv;
|
||||
|
||||
s6a_hook_register(test_s6a_hook_handler);
|
||||
fd_logger_register(test_fd_logger_handler);
|
||||
|
||||
atexit(test_terminate);
|
||||
|
||||
|
|
Loading…
Reference in New Issue