update it
This commit is contained in:
parent
6a613d2544
commit
96518fa271
|
@ -21,7 +21,7 @@ AM_CPPFLAGS = \
|
|||
-I$(top_srcdir)/lib/core/include
|
||||
|
||||
AM_CFLAGS = \
|
||||
-Wall -Werror -Wno-unused
|
||||
-Wall -Werror -Wno-unused -DSYSCONFDIR=\"$(sysconfdir)/\"
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
MOSTLYCLEANFILES = *.stackdump
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
static struct s6a_fd_config_t g_conf;
|
||||
struct s6a_fd_config_t *s6a_fd_config;
|
||||
|
||||
static char *s6a_fd_hss_conffile = SYSCONFDIR "hss_fd.conf";
|
||||
static char *s6a_fd_mme_conffile = SYSCONFDIR "mme_fd.conf";
|
||||
|
||||
static int s6a_conf_parse()
|
||||
{
|
||||
struct peer_info fddpi;
|
||||
|
@ -57,7 +60,7 @@ static int s6a_conf_parse()
|
|||
return 0;
|
||||
}
|
||||
|
||||
status_t s6a_default_fd_config()
|
||||
status_t s6a_fd_config_apply()
|
||||
{
|
||||
char * buf = NULL, *b;
|
||||
size_t len = 0;
|
||||
|
@ -86,7 +89,7 @@ void s6a_fd_config_init()
|
|||
s6a_fd_config = &g_conf;
|
||||
}
|
||||
|
||||
void s6a_fd_hss_config()
|
||||
char *s6a_fd_hss_config()
|
||||
{
|
||||
s6a_fd_config_init();
|
||||
|
||||
|
@ -96,9 +99,11 @@ void s6a_fd_hss_config()
|
|||
s6a_fd_config->cnf_port_tls = 30869;
|
||||
s6a_fd_config->pi_diamid = "peer1.localdomain";
|
||||
s6a_fd_config->pic_port = (c_uint16_t)3868;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void s6a_fd_mme_config()
|
||||
char *s6a_fd_mme_config()
|
||||
{
|
||||
s6a_fd_config_init();
|
||||
|
||||
|
@ -106,4 +111,6 @@ void s6a_fd_mme_config()
|
|||
s6a_fd_config->cnf_diamrlm = "localdomain";
|
||||
s6a_fd_config->pi_diamid = "peer2.localdomain";
|
||||
s6a_fd_config->pic_port = (c_uint16_t)30868;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
static void s6a_gnutls_log_func(int level, const char *str);
|
||||
static void s6a_fd_logger(int printlevel, const char *format, va_list ap);
|
||||
|
||||
status_t s6a_fd_init()
|
||||
status_t s6a_fd_init(const char *conffile)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
@ -36,26 +36,20 @@ status_t s6a_fd_init()
|
|||
return CORE_ERROR;
|
||||
}
|
||||
|
||||
ret = s6a_default_fd_config();
|
||||
if (ret != 0)
|
||||
/* Parse the configuration file */
|
||||
if (conffile)
|
||||
{
|
||||
d_error("s6a_config_init() failed");
|
||||
return CORE_ERROR;
|
||||
}
|
||||
CHECK_FCT_DO( fd_core_parseconf(conffile), goto error );
|
||||
}
|
||||
else
|
||||
{
|
||||
CHECK_FCT_DO( s6a_fd_config_apply(), goto error );
|
||||
}
|
||||
|
||||
ret = fd_core_start();
|
||||
if (ret != 0)
|
||||
{
|
||||
d_error("fd_core_start() failed");
|
||||
return CORE_ERROR;
|
||||
}
|
||||
/* Start the servers */
|
||||
CHECK_FCT_DO( fd_core_start(), goto error );
|
||||
|
||||
ret = fd_core_waitstartcomplete();
|
||||
if (ret != 0)
|
||||
{
|
||||
d_error("fd_core_waitstartcomplete() failed");
|
||||
return CORE_ERROR;
|
||||
}
|
||||
CHECK_FCT_DO( fd_core_waitstartcomplete(), goto error );
|
||||
|
||||
ret = s6a_app_init();
|
||||
if (ret != 0)
|
||||
|
@ -65,6 +59,11 @@ status_t s6a_fd_init()
|
|||
}
|
||||
|
||||
return CORE_OK;
|
||||
error:
|
||||
CHECK_FCT_DO( fd_core_shutdown(), );
|
||||
CHECK_FCT( fd_core_wait_shutdown_complete() );
|
||||
|
||||
return CORE_ERROR;
|
||||
}
|
||||
|
||||
status_t s6a_fd_hss_init()
|
||||
|
@ -72,8 +71,7 @@ status_t s6a_fd_hss_init()
|
|||
status_t rv;
|
||||
int ret;
|
||||
|
||||
s6a_fd_hss_config();
|
||||
rv = s6a_fd_init();
|
||||
rv = s6a_fd_init(s6a_fd_hss_config());
|
||||
if (rv != CORE_OK)
|
||||
{
|
||||
d_error("s6a_fd_init() failed");
|
||||
|
@ -92,9 +90,8 @@ status_t s6a_fd_hss_init()
|
|||
status_t s6a_fd_mme_init()
|
||||
{
|
||||
status_t rv;
|
||||
s6a_fd_mme_config();
|
||||
|
||||
rv = s6a_fd_init();
|
||||
rv = s6a_fd_init(s6a_fd_mme_config());
|
||||
if (rv != CORE_OK)
|
||||
{
|
||||
d_error("s6a_fd_init() failed");
|
||||
|
|
|
@ -34,10 +34,10 @@ CORE_DECLARE(status_t) s6a_fd_hss_init();
|
|||
CORE_DECLARE(status_t) s6a_fd_mme_init();
|
||||
CORE_DECLARE(void) s6a_fd_final();
|
||||
|
||||
CORE_DECLARE(status_t) s6a_default_fd_config();
|
||||
CORE_DECLARE(status_t) s6a_fd_config_apply();
|
||||
CORE_DECLARE(void) s6a_fd_config_init();
|
||||
CORE_DECLARE(void) s6a_fd_hss_config();
|
||||
CORE_DECLARE(void) s6a_fd_mme_config();
|
||||
CORE_DECLARE(char *) s6a_fd_hss_config();
|
||||
CORE_DECLARE(char *) s6a_fd_mme_config();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue