From ce801ee218906218f44c918497f2706f5c8ac6c1 Mon Sep 17 00:00:00 2001 From: Sukchan Lee Date: Sat, 9 Dec 2017 23:07:19 +0900 Subject: [PATCH] `dev` is added in the configuration --- .../include/arch/unix/core_arch_network.h | 4 + lib/core/include/core.h.in | 4 - lib/core/include/core_network.h | 2 +- lib/core/src/unix/socket.c | 14 +- lib/core/test/testsock.c | 6 +- src/mme/mme_context.c | 87 ++++-- src/pgw/pgw_context.c | 82 +++-- src/sgw/sgw_context.c | 82 +++-- support/config/hss.conf.in | 31 +- support/config/mme.conf.in | 129 +++----- support/config/nextepc.conf.in | 6 +- support/config/nextepc.yaml | 281 ------------------ support/config/pcrf.conf.in | 32 +- support/config/pgw.conf.in | 71 ++--- support/config/sgw.conf.in | 43 ++- 15 files changed, 321 insertions(+), 553 deletions(-) delete mode 100644 support/config/nextepc.yaml diff --git a/lib/core/include/arch/unix/core_arch_network.h b/lib/core/include/arch/unix/core_arch_network.h index 4910a131c..58d625b41 100644 --- a/lib/core/include/arch/unix/core_arch_network.h +++ b/lib/core/include/arch/unix/core_arch_network.h @@ -8,6 +8,10 @@ #include #endif +#if HAVE_NETDB_H +#include +#endif + #if HAVE_SYS_SOCKET_H #include #endif diff --git a/lib/core/include/core.h.in b/lib/core/include/core.h.in index 35703dc76..674fe391e 100644 --- a/lib/core/include/core.h.in +++ b/lib/core/include/core.h.in @@ -144,10 +144,6 @@ #include #endif -#if HAVE_NETDB_H -#include -#endif - #if HAVE_SYS_IOCTL_H #include #endif diff --git a/lib/core/include/core_network.h b/lib/core/include/core_network.h index bfca8ba12..5c0225362 100644 --- a/lib/core/include/core_network.h +++ b/lib/core/include/core_network.h @@ -128,7 +128,7 @@ CORE_DECLARE(status_t) sock_remove_node(list_t *list, sock_node_t *node); CORE_DECLARE(status_t) sock_remove_all_nodes(list_t *list); CORE_DECLARE(status_t) sock_probe_node( - list_t *list, list_t *list6, c_uint16_t port); + list_t *list, list_t *list6, const char *dev, c_uint16_t port); CORE_DECLARE(status_t) sock_fill_scope_id_in_local(c_sockaddr_t *sa_list); CORE_DECLARE(status_t) core_getaddrinfo(c_sockaddr_t **sa_list, diff --git a/lib/core/src/unix/socket.c b/lib/core/src/unix/socket.c index 554956200..228080024 100644 --- a/lib/core/src/unix/socket.c +++ b/lib/core/src/unix/socket.c @@ -375,7 +375,8 @@ status_t sock_remove_all_nodes(list_t *list) return CORE_OK; } -status_t sock_probe_node(list_t *list, list_t *list6, c_uint16_t port) +status_t sock_probe_node( + list_t *list, list_t *list6, const char *dev, c_uint16_t port) { sock_node_t *node = NULL; struct ifaddrs *iflist, *cur; @@ -401,6 +402,9 @@ status_t sock_probe_node(list_t *list, list_t *list6, c_uint16_t port) if (cur->ifa_addr == NULL) /* may happen with ppp interfaces */ continue; + if (dev && strcmp(dev, cur->ifa_name) != 0) + continue; + addr = (c_sockaddr_t *)cur->ifa_addr; if (cur->ifa_addr->sa_family == AF_INET) { @@ -574,15 +578,11 @@ status_t core_addaddrinfo(c_sockaddr_t **sa_list, prev = *sa_list; while(prev->next) prev = prev->next; } - ai = ai_list; - while(ai) + for (ai = ai_list; ai; ai = ai->ai_next) { c_sockaddr_t *new; if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) - { - ai = ai->ai_next; continue; - } new = core_calloc(1, sizeof(c_sockaddr_t)); memcpy(&new->sa, ai->ai_addr, ai->ai_addrlen); @@ -595,8 +595,8 @@ status_t core_addaddrinfo(c_sockaddr_t **sa_list, prev->next = new; prev = new; - ai = ai->ai_next; } + freeaddrinfo(ai_list); if (prev == NULL) diff --git a/lib/core/test/testsock.c b/lib/core/test/testsock.c index 7fb6f7fed..804a54641 100644 --- a/lib/core/test/testsock.c +++ b/lib/core/test/testsock.c @@ -11,6 +11,10 @@ #define PORT 7777 #define PORT2 7778 +#ifndef AI_PASSIVE +#define AI_PASSIVE 1 +#endif + static void sock_test1(abts_case *tc, void *data) { sock_id udp; @@ -406,7 +410,7 @@ static void sock_test7(abts_case *tc, void *data) sock_remove_all_nodes(&list); - rv = sock_probe_node(&list, &list6, PORT); + rv = sock_probe_node(&list, &list6, NULL, PORT); ABTS_INT_EQUAL(tc, CORE_OK, rv); sock_remove_all_nodes(&list); diff --git a/src/mme/mme_context.c b/src/mme/mme_context.c index 0dca7381a..1773f6797 100644 --- a/src/mme/mme_context.c +++ b/src/mme/mme_context.c @@ -268,6 +268,7 @@ status_t mme_context_parse_config() int i, num = 0; const char *hostname[MAX_NUM_OF_HOSTNAME]; c_uint16_t port = self.s1ap_port; + const char *dev = NULL; c_sockaddr_t *list = NULL; sock_node_t *node = NULL; @@ -344,6 +345,10 @@ status_t mme_context_parse_config() self.s1ap_port = port; } } + else if (!strcmp(s1ap_key, "dev")) + { + dev = yaml_iter_value(&s1ap_iter); + } else d_warn("unknown key `%s`", s1ap_key); } @@ -352,26 +357,40 @@ status_t mme_context_parse_config() for (i = 0; i < num; i++) { rv = core_addaddrinfo(&list, - family, hostname[i], port, AI_PASSIVE); + family, hostname[i], port, 0); d_assert(rv == CORE_OK, return CORE_ERROR,); } - if (context_self()->parameter.no_ipv4 == 0) + if (list) { - rv = sock_add_node(&self.s1ap_list, - &node, list, AF_INET); - d_assert(rv == CORE_OK, return CORE_ERROR,); + if (context_self()->parameter.no_ipv4 == 0) + { + rv = sock_add_node(&self.s1ap_list, + &node, list, AF_INET); + d_assert(rv == CORE_OK, return CORE_ERROR,); + } + + if (context_self()->parameter.no_ipv6 == 0) + { + rv = sock_add_node(&self.s1ap_list6, + &node, list, AF_INET6); + d_assert(rv == CORE_OK, return CORE_ERROR,); + } + + core_freeaddrinfo(list); } - if (context_self()->parameter.no_ipv6 == 0) + if (dev) { - rv = sock_add_node(&self.s1ap_list6, - &node, list, AF_INET6); + rv = sock_probe_node( + context_self()->parameter.no_ipv4 ? + NULL : &self.s1ap_list, + context_self()->parameter.no_ipv6 ? + NULL : &self.s1ap_list6, + dev, self.s1ap_port); d_assert(rv == CORE_OK, return CORE_ERROR,); } - core_freeaddrinfo(list); - } while(yaml_iter_type(&s1ap_array) == YAML_SEQUENCE_NODE); if (list_first(&self.s1ap_list) == NULL && @@ -382,7 +401,7 @@ status_t mme_context_parse_config() NULL : &self.s1ap_list, context_self()->parameter.no_ipv6 ? NULL : &self.s1ap_list6, - self.s1ap_port); + NULL, self.s1ap_port); d_assert(rv == CORE_OK, return CORE_ERROR,); } } @@ -396,6 +415,7 @@ status_t mme_context_parse_config() int i, num = 0; const char *hostname[MAX_NUM_OF_HOSTNAME]; c_uint16_t port = self.gtpc_port; + const char *dev = NULL; c_sockaddr_t *list = NULL; sock_node_t *node = NULL; @@ -472,6 +492,10 @@ status_t mme_context_parse_config() self.gtpc_port = port; } } + else if (!strcmp(gtpc_key, "dev")) + { + dev = yaml_iter_value(>pc_iter); + } else d_warn("unknown key `%s`", gtpc_key); } @@ -480,26 +504,39 @@ status_t mme_context_parse_config() for (i = 0; i < num; i++) { rv = core_addaddrinfo(&list, - family, hostname[i], port, AI_PASSIVE); + family, hostname[i], port, 0); d_assert(rv == CORE_OK, return CORE_ERROR,); } - if (context_self()->parameter.no_ipv4 == 0) + if (list) { - rv = sock_add_node(&self.gtpc_list, - &node, list, AF_INET); - d_assert(rv == CORE_OK, return CORE_ERROR,); + if (context_self()->parameter.no_ipv4 == 0) + { + rv = sock_add_node(&self.gtpc_list, + &node, list, AF_INET); + d_assert(rv == CORE_OK, return CORE_ERROR,); + } + + if (context_self()->parameter.no_ipv6 == 0) + { + rv = sock_add_node(&self.gtpc_list6, + &node, list, AF_INET6); + d_assert(rv == CORE_OK, return CORE_ERROR,); + } + + core_freeaddrinfo(list); } - if (context_self()->parameter.no_ipv6 == 0) + if (dev) { - rv = sock_add_node(&self.gtpc_list6, - &node, list, AF_INET6); + rv = sock_probe_node( + context_self()->parameter.no_ipv4 ? + NULL : &self.gtpc_list, + context_self()->parameter.no_ipv6 ? + NULL : &self.gtpc_list6, + dev, self.gtpc_port); d_assert(rv == CORE_OK, return CORE_ERROR,); } - - core_freeaddrinfo(list); - } while(yaml_iter_type(>pc_array) == YAML_SEQUENCE_NODE); if (list_first(&self.gtpc_list) == NULL && @@ -510,7 +547,7 @@ status_t mme_context_parse_config() NULL : &self.gtpc_list, context_self()->parameter.no_ipv6 ? NULL : &self.gtpc_list6, - self.gtpc_port); + NULL, self.gtpc_port); d_assert(rv == CORE_OK, return CORE_ERROR,); } } @@ -1022,7 +1059,7 @@ status_t mme_context_parse_config() for (i = 0; i < num; i++) { rv = core_addaddrinfo(&list, - family, hostname[i], port, AI_PASSIVE); + family, hostname[i], port, 0); d_assert(rv == CORE_OK, return CORE_ERROR,); } @@ -1139,7 +1176,7 @@ status_t mme_context_parse_config() for (i = 0; i < num; i++) { rv = core_addaddrinfo(&list, - family, hostname[i], port, AI_PASSIVE); + family, hostname[i], port, 0); d_assert(rv == CORE_OK, return CORE_ERROR,); } diff --git a/src/pgw/pgw_context.c b/src/pgw/pgw_context.c index e03ca39a8..201e2b0e1 100644 --- a/src/pgw/pgw_context.c +++ b/src/pgw/pgw_context.c @@ -197,6 +197,7 @@ status_t pgw_context_parse_config() int i, num = 0; const char *hostname[MAX_NUM_OF_HOSTNAME]; c_uint16_t port = self.gtpc_port; + const char *dev = NULL; c_sockaddr_t *list = NULL; sock_node_t *node = NULL; @@ -273,6 +274,10 @@ status_t pgw_context_parse_config() self.gtpc_port = port; } } + else if (!strcmp(gtpc_key, "dev")) + { + dev = yaml_iter_value(>pc_iter); + } else d_warn("unknown key `%s`", gtpc_key); } @@ -281,26 +286,40 @@ status_t pgw_context_parse_config() for (i = 0; i < num; i++) { rv = core_addaddrinfo(&list, - family, hostname[i], port, AI_PASSIVE); + family, hostname[i], port, 0); d_assert(rv == CORE_OK, return CORE_ERROR,); } - if (context_self()->parameter.no_ipv4 == 0) + if (list) { - rv = sock_add_node(&self.gtpc_list, - &node, list, AF_INET); - d_assert(rv == CORE_OK, return CORE_ERROR,); + if (context_self()->parameter.no_ipv4 == 0) + { + rv = sock_add_node(&self.gtpc_list, + &node, list, AF_INET); + d_assert(rv == CORE_OK, return CORE_ERROR,); + } + + if (context_self()->parameter.no_ipv6 == 0) + { + rv = sock_add_node(&self.gtpc_list6, + &node, list, AF_INET6); + d_assert(rv == CORE_OK, return CORE_ERROR,); + } + + core_freeaddrinfo(list); } - if (context_self()->parameter.no_ipv6 == 0) + if (dev) { - rv = sock_add_node(&self.gtpc_list6, - &node, list, AF_INET6); + rv = sock_probe_node( + context_self()->parameter.no_ipv4 ? + NULL : &self.gtpc_list, + context_self()->parameter.no_ipv6 ? + NULL : &self.gtpc_list6, + dev, self.gtpc_port); d_assert(rv == CORE_OK, return CORE_ERROR,); } - core_freeaddrinfo(list); - } while(yaml_iter_type(>pc_array) == YAML_SEQUENCE_NODE); if (list_first(&self.gtpc_list) == NULL && @@ -311,7 +330,7 @@ status_t pgw_context_parse_config() NULL : &self.gtpc_list, context_self()->parameter.no_ipv6 ? NULL : &self.gtpc_list6, - self.gtpc_port); + NULL, self.gtpc_port); d_assert(rv == CORE_OK, return CORE_ERROR,); } } @@ -325,6 +344,7 @@ status_t pgw_context_parse_config() int i, num = 0; const char *hostname[MAX_NUM_OF_HOSTNAME]; c_uint16_t port = self.gtpu_port; + const char *dev = NULL; c_sockaddr_t *list = NULL; sock_node_t *node = NULL; @@ -401,6 +421,10 @@ status_t pgw_context_parse_config() self.gtpu_port = port; } } + else if (!strcmp(gtpu_key, "dev")) + { + dev = yaml_iter_value(>pu_iter); + } else d_warn("unknown key `%s`", gtpu_key); } @@ -409,26 +433,40 @@ status_t pgw_context_parse_config() for (i = 0; i < num; i++) { rv = core_addaddrinfo(&list, - family, hostname[i], port, AI_PASSIVE); + family, hostname[i], port, 0); d_assert(rv == CORE_OK, return CORE_ERROR,); } - if (context_self()->parameter.no_ipv4 == 0) + if (list) { - rv = sock_add_node(&self.gtpu_list, - &node, list, AF_INET); - d_assert(rv == CORE_OK, return CORE_ERROR,); + if (context_self()->parameter.no_ipv4 == 0) + { + rv = sock_add_node(&self.gtpu_list, + &node, list, AF_INET); + d_assert(rv == CORE_OK, return CORE_ERROR,); + } + + if (context_self()->parameter.no_ipv6 == 0) + { + rv = sock_add_node(&self.gtpu_list6, + &node, list, AF_INET6); + d_assert(rv == CORE_OK, return CORE_ERROR,); + } + + core_freeaddrinfo(list); } - if (context_self()->parameter.no_ipv6 == 0) + if (dev) { - rv = sock_add_node(&self.gtpu_list6, - &node, list, AF_INET6); + rv = sock_probe_node( + context_self()->parameter.no_ipv4 ? + NULL : &self.gtpu_list, + context_self()->parameter.no_ipv6 ? + NULL : &self.gtpu_list6, + dev, self.gtpu_port); d_assert(rv == CORE_OK, return CORE_ERROR,); } - core_freeaddrinfo(list); - } while(yaml_iter_type(>pu_array) == YAML_SEQUENCE_NODE); if (list_first(&self.gtpu_list) == NULL && @@ -439,7 +477,7 @@ status_t pgw_context_parse_config() NULL : &self.gtpu_list, context_self()->parameter.no_ipv6 ? NULL : &self.gtpu_list6, - self.gtpu_port); + NULL, self.gtpu_port); d_assert(rv == CORE_OK, return CORE_ERROR,); } } diff --git a/src/sgw/sgw_context.c b/src/sgw/sgw_context.c index fc79dc6ce..94c94b943 100644 --- a/src/sgw/sgw_context.c +++ b/src/sgw/sgw_context.c @@ -157,6 +157,7 @@ status_t sgw_context_parse_config() int i, num = 0; const char *hostname[MAX_NUM_OF_HOSTNAME]; c_uint16_t port = self.gtpc_port; + const char *dev = NULL; c_sockaddr_t *list = NULL; sock_node_t *node = NULL; @@ -233,6 +234,10 @@ status_t sgw_context_parse_config() self.gtpc_port = port; } } + else if (!strcmp(gtpc_key, "dev")) + { + dev = yaml_iter_value(>pc_iter); + } else d_warn("unknown key `%s`", gtpc_key); } @@ -241,26 +246,40 @@ status_t sgw_context_parse_config() for (i = 0; i < num; i++) { rv = core_addaddrinfo(&list, - family, hostname[i], port, AI_PASSIVE); + family, hostname[i], port, 0); d_assert(rv == CORE_OK, return CORE_ERROR,); } - if (context_self()->parameter.no_ipv4 == 0) + if (list) { - rv = sock_add_node(&self.gtpc_list, - &node, list, AF_INET); - d_assert(rv == CORE_OK, return CORE_ERROR,); + if (context_self()->parameter.no_ipv4 == 0) + { + rv = sock_add_node(&self.gtpc_list, + &node, list, AF_INET); + d_assert(rv == CORE_OK, return CORE_ERROR,); + } + + if (context_self()->parameter.no_ipv6 == 0) + { + rv = sock_add_node(&self.gtpc_list6, + &node, list, AF_INET6); + d_assert(rv == CORE_OK, return CORE_ERROR,); + } + + core_freeaddrinfo(list); } - if (context_self()->parameter.no_ipv6 == 0) + if (dev) { - rv = sock_add_node(&self.gtpc_list6, - &node, list, AF_INET6); + rv = sock_probe_node( + context_self()->parameter.no_ipv4 ? + NULL : &self.gtpc_list, + context_self()->parameter.no_ipv6 ? + NULL : &self.gtpc_list6, + dev, self.gtpc_port); d_assert(rv == CORE_OK, return CORE_ERROR,); } - core_freeaddrinfo(list); - } while(yaml_iter_type(>pc_array) == YAML_SEQUENCE_NODE); if (list_first(&self.gtpc_list) == NULL && @@ -271,7 +290,7 @@ status_t sgw_context_parse_config() NULL : &self.gtpc_list, context_self()->parameter.no_ipv6 ? NULL : &self.gtpc_list6, - self.gtpc_port); + NULL, self.gtpc_port); d_assert(rv == CORE_OK, return CORE_ERROR,); } } @@ -285,6 +304,7 @@ status_t sgw_context_parse_config() int i, num = 0; const char *hostname[MAX_NUM_OF_HOSTNAME]; c_uint16_t port = self.gtpu_port; + const char *dev = NULL; c_sockaddr_t *list = NULL; sock_node_t *node = NULL; @@ -361,6 +381,10 @@ status_t sgw_context_parse_config() self.gtpu_port = port; } } + else if (!strcmp(gtpu_key, "dev")) + { + dev = yaml_iter_value(>pu_iter); + } else d_warn("unknown key `%s`", gtpu_key); } @@ -369,26 +393,40 @@ status_t sgw_context_parse_config() for (i = 0; i < num; i++) { rv = core_addaddrinfo(&list, - family, hostname[i], port, AI_PASSIVE); + family, hostname[i], port, 0); d_assert(rv == CORE_OK, return CORE_ERROR,); } - if (context_self()->parameter.no_ipv4 == 0) + if (list) { - rv = sock_add_node(&self.gtpu_list, - &node, list, AF_INET); - d_assert(rv == CORE_OK, return CORE_ERROR,); + if (context_self()->parameter.no_ipv4 == 0) + { + rv = sock_add_node(&self.gtpu_list, + &node, list, AF_INET); + d_assert(rv == CORE_OK, return CORE_ERROR,); + } + + if (context_self()->parameter.no_ipv6 == 0) + { + rv = sock_add_node(&self.gtpu_list6, + &node, list, AF_INET6); + d_assert(rv == CORE_OK, return CORE_ERROR,); + } + + core_freeaddrinfo(list); } - if (context_self()->parameter.no_ipv6 == 0) + if (dev) { - rv = sock_add_node(&self.gtpu_list6, - &node, list, AF_INET6); + rv = sock_probe_node( + context_self()->parameter.no_ipv4 ? + NULL : &self.gtpu_list, + context_self()->parameter.no_ipv6 ? + NULL : &self.gtpu_list6, + dev, self.gtpu_port); d_assert(rv == CORE_OK, return CORE_ERROR,); } - core_freeaddrinfo(list); - } while(yaml_iter_type(>pu_array) == YAML_SEQUENCE_NODE); if (list_first(&self.gtpu_list) == NULL && @@ -399,7 +437,7 @@ status_t sgw_context_parse_config() NULL : &self.gtpu_list, context_self()->parameter.no_ipv6 ? NULL : &self.gtpu_list6, - self.gtpu_port); + NULL, self.gtpu_port); d_assert(rv == CORE_OK, return CORE_ERROR,); } } diff --git a/support/config/hss.conf.in b/support/config/hss.conf.in index aedc40cd9..19d0c24a7 100644 --- a/support/config/hss.conf.in +++ b/support/config/hss.conf.in @@ -1,23 +1,12 @@ -{ - "DB_URI" : "mongodb://localhost/nextepc", - "LOG" : - { - "FILE" : "@LOCALSTATE_DIR@/log/nextepc/hss.log", - "SOCKET" : - { - "UNIX_DOMAIN" : "/tmp/nextepc-hssd.sock", - "FILE" : 0 - } - }, - "TRACE" : - { - "FD": 1, - "OTHERS": 1 - }, +### For reference, see `nextepc.conf` - "HSS" : - { - "FD_CONF_PATH" : "hss.conf" - } +db_uri: mongodb://localhost/nextepc -} +logger: + file: @LOCALSTATE_DIR@/log/nextepc/hss.log + trace: + diameter: 1 + others: 1 + +hss: + freeDiameter: hss.conf diff --git a/support/config/mme.conf.in b/support/config/mme.conf.in index 4d39aac05..8ee70e56b 100644 --- a/support/config/mme.conf.in +++ b/support/config/mme.conf.in @@ -1,87 +1,50 @@ -{ - "LOG" : - { - "FILE" : "@LOCALSTATE_DIR@/log/nextepc/mme.log", - "SOCKET" : - { - "UNIX_DOMAIN" : "/tmp/nextepc-mmed.sock", - "FILE" : 0 - } - }, - "TRACE" : - { - "S1AP": 1, - "NAS": 1, - "FD": 1, - "GTP": 1, - "OTHERS": 1 - }, +### For reference, see `nextepc.conf` - "MME" : - { - "FD_CONF_PATH" : "mme.conf", - "DEFAULT_PAGING_DRX" : "v64", - "S1AP" : - [ - { - "HOSTNAME" : "127.0.0.1" - }, - { - "HOSTNAME" : "::1" - } - ], - "NETWORK" : - { - "GTPC_IPV4" : "127.0.0.1" - }, - "GUMMEI" : - [ - { - "PLMN_ID" : - { - "MCC" : "001", - "MNC" : "01" - }, - "MME_GID" : 2, - "MME_CODE" : 1 - } - ], - "TAI": - [ - { - "PLMN_ID" : - { - "MCC": "001", - "MNC": "01" - }, - "TAC": 12345 - } - ], - "SECURITY" : - { - "INTEGRITY_ORDER" : [ "EIA1", "EIA2", "EIA0" ], - "CIPHERING_ORDER" : [ "EEA0", "EEA1", "EEA2" ] - } - }, +db_uri: mongodb://localhost/nextepc - "SGW" : - { - "NETWORK" : - [ - { - "GTPC_IPV4" : "127.0.0.2", - "GTPU_IPV4" : "127.0.0.2" - } - ] - }, +logger: + file: @LOCALSTATE_DIR@/log/nextepc/mme.log + trace: + s1ap: 1 + nas: 1 + diameter: 1 + gtp: 1 + others: 1 - "PGW" : - { - "NETWORK" : - { - "GTPC_IPV4" : "127.0.0.3", - "GTPU_IPV4" : "127.0.0.3" - } - } +parameter: +# no_ipv4: true +# no_ipv6: true +# prefer_ipv4: true -} +mme: + freeDiameter: mme.conf + s1ap: + gtpc: + - addr: 127.0.0.1 + - addr: ::1 + gummei: + plmn_id: + mcc: 001 + mnc: 01 + mme_gid: 2 + mme_code: 1 + tai: + plmn_id: + mcc: 001 + mnc: 01 + tac: 12345 + security: + integrity_order : [ EIA1, EIA2, EIA0 ] + ciphering_order : [ EEA0, EEA1, EEA2 ] + +sgw: + gtpc: + addr: + - 127.0.0.2 + - fe80::2%@LO_DEV@ + +pgw: + gtpc: + addr: + - 127.0.0.3 + - fe80::3%@LO_DEV@ diff --git a/support/config/nextepc.conf.in b/support/config/nextepc.conf.in index 6d937ba47..5db884231 100644 --- a/support/config/nextepc.conf.in +++ b/support/config/nextepc.conf.in @@ -78,9 +78,13 @@ mme: # o S1AP Server(all address avaiable) # s1ap: # +# o S1AP Server(address avaiable in `eth0` interface) +# s1ap: +# dev: eth0 +# # o S1AP Server(0.0.0.0:36412) # s1ap: -# addr: +# addr: 0.0.0.0 # # o S1AP Server(127.0.0.1:36412, [::1]:36413) # s1ap: diff --git a/support/config/nextepc.yaml b/support/config/nextepc.yaml deleted file mode 100644 index ee61aa770..000000000 --- a/support/config/nextepc.yaml +++ /dev/null @@ -1,281 +0,0 @@ -db_uri: mongodb://localhost/nextepc - -logger: - file: @LOCALSTATE_DIR@/log/nextepc/nextepc.log - trace: - s1ap: 1 - nas: 1 - diameter: 1 - gtp: 1 - others: 1 - -# -# -# -# o Disable use of IPv4 addresses (only IPv6) -# Type : BOOLEAN -# -# o IPv4 enabled -# parameter: -# -# o IPv4 disabled -# parameter: -# no_ipv4: true -# -# -# -# -# o Disable use of IPv6 addresses (only IPv4) -# Type : BOOLEAN -# -# o IPv6 enabled -# parameter: -# -# o IPv6 disabled -# parameter: -# no_ipv6: true -# -# -# -# -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# Type : BOOLEAN -# Default : IPv6 is attempted first. -# -# o IPv6 preferred -# parameter: -# -# o IPv4 preferred -# parameter: -# prefer_ipv4: true -# -# -# -# -# o Disable EPC elements (Only applicable `nextepc-epcd`) -# Type : BOOLEAN -# -# o Enable HSS/SGW/PGW/PCRF -# parameter: -# -# o Disable HSS/SGW/PGW/PCRF -# parameter: -# no_hss: true -# no_sgw: true -# no_pgw: true -# no_pcrf: true -# -parameter: - -mme: - freeDiameter: mme.conf - -# -# > -# -# o Specify local addresses the S1AP server must bind to -# -# o S1AP Server(all address avaiable) -# s1ap: -# -# o Single S1AP Server(0.0.0.0:36412) -# s1ap: -# addr: -# -# o Multiple S1AP Server(127.0.0.1:36412, [::1]:36413) -# s1ap: -# name: localhost -# - s1ap: - -# -# > -# -# o Specify local addresses the GTP-C server must bind to -# -# o Multiple GTP-C Server(127.0.0.1:2123, [::1]:2123) -# gtpc: -# - addr: 127.0.0.1 -# - addr: ::1 -# - gtpc: - - addr: 127.0.0.1 - - addr: ::1 - -# -# -# -# o Multiple GUMMEI -# gummei: -# - plmn_id: -# mcc: 001 -# mnc: 01 -# mme_gid: 2 -# mme_code: 1 -# - plmn_id: -# - mcc: 002 -# mnc: 02 -# - mcc: 003 -# mnc: 03 -# mme_gid: [3, 4] -# mme_code: -# - 2 -# - 3 -# - gummei: - plmn_id: - mcc: 001 - mnc: 01 - mme_gid: 2 - mme_code: 1 - -# -# -# -# o Multiple TAI -# tai: -# - plmn_id: -# mcc: 001 -# mnc: 01 -# tac: 12345 -# - plmn_id: -# mcc: 002 -# mnc: 02 -# tac: 12346 -# - tai: - plmn_id: - mcc: 001 - mnc: 01 - tac: 12345 - - security: - integrity_order : [ EIA1, EIA2, EIA0 ] - ciphering_order : [ EEA0, EEA1, EEA2 ] - -hss: - freeDiameter: hss.conf - -sgw: -# -# ------------------------ MME -------------------------- -# -# o Specify SGW addresses the GTP-C must connect to -# -# o Single GTP-C Client(127.0.0.2:2123) -# gtpc: -# addr: 127.0.0.2 -# -# o MME selects SGW with round-robin manner per UE-basis -# gtpc: -# - name: sgw1.nextepc.org -# - addr: 192.168.0.1 -# - name: sgw2.nextepc.org -# -# ------------------------ SGW -------------------------- -# -# o Specify local addresses the GTP-C server must bind to -# -# o Single GTP-C Server(127.0.0.2:2123) -# gtpc: -# addr: 127.0.0.2 -# - gtpc: - addr: 127.0.0.2 - -# -# > -# -# o Specify local addresses the GTP-U server must bind to -# -# o GTP-U Server(all address avaiable) -# gtpu: -# - gtpu: - -pgw: - freeDiameter: pgw.conf - -# -# ------------------------ MME -------------------------- -# -# o Specify PGW addresses the GTP-C must connect to -# -# o Only first address is attempted. Others are ignored. -# o if HSS provide PGW addresss(per-UE), it overwrites configuration. -# -# o 127.0.0.3:2123 is attempted. [::3]:2123 is ignored. -# gtpc: -# - addr: 127.0.0.3 -# - addr: ::3 -# -# ------------------------ PGW -------------------------- -# -# o Specify local addresses the GTP-C server must bind to -# -# o Single GTP-C Server(127.0.0.3:2123) -# gtpc: -# addr: 127.0.0.3 -# - gtpc: - addr: 127.0.0.3 - -# -# > -# -# o Specify local addresses the GTP-U server must bind to -# -# o Multiple GTP-U Server(127.0.0.3:2152, [::3]:2152) -# gtpu: -# - addr: 127.0.0.3 -# - addr: ::3 - gtpu: - - addr: 127.0.0.3 - - addr: ::3 - -# -# -# -# o IPv4/IPv6 with `pgwtun` device -# ue_network: -# addr: -# - 45.45.0.1/16 -# - 2001:200:903::1/96 -# -# o Multiple Device -# ue_network: -# - addr: 45.45.0.1/16 -# dev: pgwtun1 -# - addr: -# - 46.46.0.1/16 -# - 2001:200:903::1/96 -# dev: pgwtun2 -# -# o Per-APN -# ue_network: -# - addr: 45.45.0.1/16 -# dev: pgwtun1 -# apn : internet -# - addr: -# - 46.46.0.1/16 -# - 2001:200:903::1/96 -# dev: pgwtun2 -# apn : volte -# - ue_network: - addr: 45.45.0.1/16 - -# -# -# -# o primary/secondary can be configured. Others is ignored -# - dns: - - 8.8.8.8 - - 8.8.4.4 - dns6: - - 2001:4860:4860::8888 - - 2001:4860:4860::8844 - -pcrf: - freeDiameter: "pcrf.conf" diff --git a/support/config/pcrf.conf.in b/support/config/pcrf.conf.in index 9e3738496..1590b94f1 100644 --- a/support/config/pcrf.conf.in +++ b/support/config/pcrf.conf.in @@ -1,22 +1,12 @@ -{ - "DB_URI" : "mongodb://localhost/nextepc", - "LOG" : - { - "FILE" : "@LOCALSTATE_DIR@/log/nextepc/pcrf.log", - "SOCKET" : - { - "UNIX_DOMAIN" : "/tmp/nextepc-pcrfd.sock", - "FILE" : 0 - } - }, - "TRACE" : - { - "FD": 1, - "OTHERS": 1 - }, - "PCRF" : - { - "FD_CONF_PATH" : "pcrf.conf" - } +### For reference, see `nextepc.conf` -} +db_uri: mongodb://localhost/nextepc + +logger: + file: @LOCALSTATE_DIR@/log/nextepc/pcrf.log + trace: + diameter: 1 + others: 1 + +pcrf: + freeDiameter: pcrf.conf diff --git a/support/config/pgw.conf.in b/support/config/pgw.conf.in index 90c0b914d..1ac23131b 100644 --- a/support/config/pgw.conf.in +++ b/support/config/pgw.conf.in @@ -1,40 +1,35 @@ -{ - "LOG" : - { - "FILE" : "@LOCALSTATE_DIR@/log/nextepc/pgw.log", - "SOCKET" : - { - "UNIX_DOMAIN" : "/tmp/nextepc-pgwd.sock", - "FILE" : 0 - } - }, - "TRACE" : - { - "FD": 1, - "GTP": 1, - "OTHERS": 1 - }, +### For reference, see `nextepc.conf` - "PGW" : - { - "FD_CONF_PATH" : "pgw.conf", - "NETWORK" : - { - "GTPC_IPV4" : "127.0.0.3", - "GTPU_IPV4" : "127.0.0.3" - }, - "UE_NETWORK": - [ - { - "IF_NAME" : "pgwtun", - "IPV4_POOL" : "45.45.0.1/16" - } - ], - "DNS" : - { - "PRIMARY_IPV4" : "8.8.8.8", - "SECONDARY_IPV4" : "4.4.4.4" - } - } +db_uri: mongodb://localhost/nextepc + +logger: + file: @LOCALSTATE_DIR@/log/nextepc/pgw.log + trace: + diameter: 1 + gtp: 1 + others: 1 + +parameter: +# no_ipv4: true +# no_ipv6: true +# prefer_ipv4: true + +pgw: + freeDiameter: pgw.conf + gtpc: + addr: + - 127.0.0.3 + - fe80::3%@LO_DEV@ + gtpu: + - addr: 127.0.0.3 + - addr: fe80::3%@LO_DEV@ + ue_network: + addr: 45.45.0.1/16 + dev: pgwtun + dns: + - 8.8.8.8 + - 8.8.4.4 + dns6: + - 2001:4860:4860::8888 + - 2001:4860:4860::8844 -} diff --git a/support/config/sgw.conf.in b/support/config/sgw.conf.in index 1a4975fbb..928b8e91c 100644 --- a/support/config/sgw.conf.in +++ b/support/config/sgw.conf.in @@ -1,28 +1,19 @@ -{ - "LOG" : - { - "FILE" : "@LOCALSTATE_DIR@/log/nextepc/sgw.log", - "SOCKET" : - { - "UNIX_DOMAIN" : "/tmp/nextepc-sgwd.sock", - "FILE" : 0 - } - }, - "TRACE" : - { - "GTP": 1, - "OTHERS": 1 - }, +### For reference, see `nextepc.conf` - "SGW" : - { - "NETWORK" : - [ - { - "GTPC_IPV4" : "127.0.0.2", - "GTPU_IPV4" : "127.0.0.2" - } - ] - } +logger: + file: @LOCALSTATE_DIR@/log/nextepc/sgw.log + trace: + gtp: 1 + others: 1 -} +parameter: +# no_ipv4: true +# no_ipv6: true +# prefer_ipv4: true + +sgw: + gtpc: + addr: + - 127.0.0.2 + - fe80::2%@LO_DEV@ + gtpu: