From b34d8b931ea7c908e190dc1546a23ca111369086 Mon Sep 17 00:00:00 2001 From: Sukchan Lee Date: Fri, 24 Nov 2017 16:08:26 +0000 Subject: [PATCH] configuration is updated --- src/mme/s1ap_path.c | 37 ++++++++++++++++++++++++++++++++++ src/mme/s1ap_sctp.c | 26 +----------------------- src/mme/s1ap_usrsctp.c | 33 ------------------------------ support/config/mme.conf.in | 3 --- support/config/nextepc.conf.in | 5 +---- 5 files changed, 39 insertions(+), 65 deletions(-) diff --git a/src/mme/s1ap_path.c b/src/mme/s1ap_path.c index 8c1d4ddd67..1f01d3147d 100644 --- a/src/mme/s1ap_path.c +++ b/src/mme/s1ap_path.c @@ -12,6 +12,43 @@ #include "s1ap_build.h" #include "s1ap_path.h" +status_t s1ap_open(void) +{ + status_t rv; +#if USE_USRSCTP != 1 + int type = SOCK_STREAM; +#else + int type = SOCK_SEQPACKET; +#endif + mme_s1ap_t *s1ap = NULL; + + for (s1ap = mme_s1ap_first(); s1ap; s1ap = mme_s1ap_next(s1ap)) + { + rv = s1ap_server(&s1ap->sock, s1ap->domain, type, + s1ap->hostname, s1ap->port); + if (rv != CORE_OK) + { + d_error("s1ap_server(%d:%d:[%s]:%d) failed", + s1ap->domain, type, s1ap->hostname, s1ap->port); + return CORE_ERROR; + } + } + + return CORE_OK; +} + +status_t s1ap_close() +{ + mme_s1ap_t *s1ap = NULL; + + for (s1ap = mme_s1ap_first(); s1ap; s1ap = mme_s1ap_next(s1ap)) + { + s1ap_delete(s1ap->sock); + } + + return CORE_OK; +} + status_t s1ap_send_to_enb(mme_enb_t *enb, pkbuf_t *pkbuf) { status_t rv = CORE_ERROR; diff --git a/src/mme/s1ap_sctp.c b/src/mme/s1ap_sctp.c index dd211db435..125e117f19 100644 --- a/src/mme/s1ap_sctp.c +++ b/src/mme/s1ap_sctp.c @@ -19,30 +19,6 @@ status_t s1ap_final() return CORE_OK; } -status_t s1ap_open(void) -{ - status_t rv; - int family = AF_INET; - int type = SOCK_STREAM; - const char *hostname = NULL; - c_uint16_t port = S1AP_SCTP_PORT; - - rv = s1ap_server(&mme_self()->s1ap_sock, family, type, hostname, port); - if (rv != CORE_OK) - { - d_error("s1ap_server %d:%d:[%s]:%d failed", - family, type, hostname, port); - return CORE_ERROR; - } - - return CORE_OK; -} - -status_t s1ap_close() -{ - return s1ap_delete(mme_self()->s1ap_sock); -} - status_t s1ap_server(sock_id *new, int family, int type, const char *hostname, c_uint16_t port) { @@ -53,7 +29,7 @@ status_t s1ap_server(sock_id *new, rv = sctp_server(new, family, type, hostname, port); d_assert(rv == CORE_OK, return CORE_ERROR,); - rv = sock_register(mme_self()->s1ap_sock, s1ap_accept_handler, NULL); + rv = sock_register(*new, s1ap_accept_handler, NULL); d_assert(rv == CORE_OK, return CORE_ERROR,); addr = sock_local_addr_get(*new); diff --git a/src/mme/s1ap_usrsctp.c b/src/mme/s1ap_usrsctp.c index f5bd0c7fca..47c1f5b646 100644 --- a/src/mme/s1ap_usrsctp.c +++ b/src/mme/s1ap_usrsctp.c @@ -59,39 +59,6 @@ status_t s1ap_final() return CORE_OK; } -status_t s1ap_open(void) -{ - status_t rv; - int type = SOCK_SEQPACKET; - mme_s1ap_t *s1ap = NULL; - - for (s1ap = mme_s1ap_first(); s1ap; s1ap = mme_s1ap_next(s1ap)) - { - rv = s1ap_server(&s1ap->sock, s1ap->domain, type, - s1ap->hostname, s1ap->port); - if (rv != CORE_OK) - { - d_error("s1ap_server(%d:%d:[%s]:%d) failed", - s1ap->domain, type, s1ap->hostname, s1ap->port); - return CORE_ERROR; - } - } - - return CORE_OK; -} - -status_t s1ap_close() -{ - mme_s1ap_t *s1ap = NULL; - - for (s1ap = mme_s1ap_first(); s1ap; s1ap = mme_s1ap_next(s1ap)) - { - s1ap_delete(s1ap->sock); - } - - return CORE_OK; -} - status_t s1ap_delete(sock_id sock) { d_assert(sock, return CORE_ERROR,); diff --git a/support/config/mme.conf.in b/support/config/mme.conf.in index 9297283ad3..c17ece37dd 100644 --- a/support/config/mme.conf.in +++ b/support/config/mme.conf.in @@ -25,9 +25,6 @@ [ { "DOMAIN" : "AF_INET" - }, - { - "DOMAIN" : "AF_INET6" } ], "NETWORK" : diff --git a/support/config/nextepc.conf.in b/support/config/nextepc.conf.in index 9c032a74d7..643cfeb94a 100644 --- a/support/config/nextepc.conf.in +++ b/support/config/nextepc.conf.in @@ -32,10 +32,7 @@ "S1AP" : [ { - "HOSTNAME" : "127.0.0.1" - }, - { - "HOSTNAME" : "::1" + "DOMAIN" : "AF_INET" } ], "NETWORK" :