Commit b2eb0f74 authored by Robert Schmidt's avatar Robert Schmidt

Remove unused code in openair3/UTILS: not used anywhere

parent 83656309
SUBDIRS = . HASHTABLE
AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/SGW-LITE \
-I$(top_srcdir)/INTERTASK_INTERFACE
AM_YFLAGS = -d
noinst_LTLIBRARIES = libutils.la
libutils_la_LDFLAGS = -all-static
libutils_la_SOURCES = \
conversions.h conversions.c \
enum_string.h enum_string.c \
log.c log.h \
mme_config.c mme_config.h \
mcc_mnc_itu.c mcc_mnc_itu.h \
mme_default_values.h \
queue.h tree.h
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef __UTILS_MME_CONFIG__H__
#define __UTILS_MME_CONFIG__H__
#include <pthread.h>
#include <stdint.h>
#include "mme_default_values.h"
#define MME_CONFIG_STRING_MME_CONFIG "MME"
#define MME_CONFIG_STRING_REALM "REALM"
#define MME_CONFIG_STRING_MAXENB "MAXENB"
#define MME_CONFIG_STRING_MAXUE "MAXUE"
#define MME_CONFIG_STRING_RELATIVE_CAPACITY "RELATIVE_CAPACITY"
#define MME_CONFIG_STRING_STATISTIC_TIMER "MME_STATISTIC_TIMER"
#define MME_CONFIG_STRING_EMERGENCY_ATTACH_SUPPORTED "EMERGENCY_ATTACH_SUPPORTED"
#define MME_CONFIG_STRING_UNAUTHENTICATED_IMSI_SUPPORTED "UNAUTHENTICATED_IMSI_SUPPORTED"
#define MME_CONFIG_STRING_INTERTASK_INTERFACE_CONFIG "INTERTASK_INTERFACE"
#define MME_CONFIG_STRING_INTERTASK_INTERFACE_QUEUE_SIZE "ITTI_QUEUE_SIZE"
#define MME_CONFIG_STRING_SCTP_CONFIG "SCTP"
#define MME_CONFIG_STRING_SCTP_INSTREAMS "SCTP_INSTREAMS"
#define MME_CONFIG_STRING_SCTP_OUTSTREAMS "SCTP_OUTSTREAMS"
#define MME_CONFIG_STRING_S1AP_CONFIG "S1AP"
#define MME_CONFIG_STRING_S1AP_OUTCOME_TIMER "S1AP_OUTCOME_TIMER"
#define MME_CONFIG_STRING_S1AP_PORT "S1AP_PORT"
#define MME_CONFIG_STRING_GUMMEI_CONFIG "GUMMEI"
#define MME_CONFIG_STRING_MME_CODE "MME_CODE"
#define MME_CONFIG_STRING_MME_GID "MME_GID"
#define MME_CONFIG_STRING_TAI_LIST "TAI_LIST"
#define MME_CONFIG_STRING_MCC "MCC"
#define MME_CONFIG_STRING_MNC "MNC"
#define MME_CONFIG_STRING_TAC "TAC"
#define MME_CONFIG_STRING_NETWORK_INTERFACES_CONFIG "NETWORK_INTERFACES"
#define MME_CONFIG_STRING_INTERFACE_NAME_FOR_S1_MME "MME_INTERFACE_NAME_FOR_S1_MME"
#define MME_CONFIG_STRING_IPV4_ADDRESS_FOR_S1_MME "MME_IPV4_ADDRESS_FOR_S1_MME"
#define MME_CONFIG_STRING_INTERFACE_NAME_FOR_S11_MME "MME_INTERFACE_NAME_FOR_S11_MME"
#define MME_CONFIG_STRING_IPV4_ADDRESS_FOR_S11_MME "MME_IPV4_ADDRESS_FOR_S11_MME"
#define MME_CONFIG_STRING_ASN1_VERBOSITY "VERBOSITY"
#define MME_CONFIG_STRING_ASN1_VERBOSITY_NONE "none"
#define MME_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING "annoying"
#define MME_CONFIG_STRING_ASN1_VERBOSITY_INFO "info"
#define MME_CONFIG_STRING_NAS_CONFIG "NAS"
#define MME_CONFIG_STRING_NAS_SUPPORTED_INTEGRITY_ALGORITHM_LIST "ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST"
#define MME_CONFIG_STRING_NAS_SUPPORTED_CIPHERING_ALGORITHM_LIST "ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST"
#define NAS_CONFIG_SECURITY_ALGORITHMS_EEA0 0b000
#define NAS_CONFIG_SECURITY_ALGORITHMS_EEA1 0b001
#define NAS_CONFIG_SECURITY_ALGORITHMS_EEA2 0b010
#define NAS_CONFIG_SECURITY_ALGORITHMS_EEA3 0b011
#define NAS_CONFIG_SECURITY_ALGORITHMS_EEA4 0b100
#define NAS_CONFIG_SECURITY_ALGORITHMS_EEA5 0b101
#define NAS_CONFIG_SECURITY_ALGORITHMS_EEA6 0b110
#define NAS_CONFIG_SECURITY_ALGORITHMS_EEA7 0b111
#define NAS_CONFIG_SECURITY_ALGORITHMS_EIA0 0b000
#define NAS_CONFIG_SECURITY_ALGORITHMS_EIA1 0b001
#define NAS_CONFIG_SECURITY_ALGORITHMS_EIA2 0b010
#define NAS_CONFIG_SECURITY_ALGORITHMS_EIA3 0b011
#define NAS_CONFIG_SECURITY_ALGORITHMS_EIA4 0b100
#define NAS_CONFIG_SECURITY_ALGORITHMS_EIA5 0b101
#define NAS_CONFIG_SECURITY_ALGORITHMS_EIA6 0b110
#define NAS_CONFIG_SECURITY_ALGORITHMS_EIA7 0b111
typedef struct mme_config_s {
/* Reader/writer lock for this configuration */
pthread_rwlock_t rw_lock;
uint8_t verbosity_level;
char *config_file;
char *realm;
int realm_length;
uint32_t max_eNBs;
uint32_t max_ues;
uint8_t relative_capacity;
uint32_t mme_statistic_timer;
uint8_t emergency_attach_supported;
uint8_t unauthenticated_imsi_supported;
struct {
uint16_t nb_mme_gid;
uint16_t *mme_gid;
uint16_t nb_mmec;
uint8_t *mmec;
uint8_t nb_plmns;
uint16_t *plmn_mcc;
uint16_t *plmn_mnc;
uint16_t *plmn_mnc_len;
uint16_t *plmn_tac;
} gummei;
struct {
uint16_t in_streams;
uint16_t out_streams;
} sctp_config;
struct {
uint16_t port_number;
} gtpv1u_config;
struct {
uint16_t port_number;
uint8_t outcome_drop_timer_sec;
} s1ap_config;
struct {
uint32_t sgw_ip_address_for_S1u_S12_S4_up;
char *mme_interface_name_for_S1_MME;
uint32_t mme_ip_address_for_S1_MME;
char *mme_interface_name_for_S11;
uint32_t mme_ip_address_for_S11;
uint32_t sgw_ip_address_for_S11;
} ipv4;
struct {
uint32_t queue_size;
char *log_file;
} itti_config;
struct {
uint8_t prefered_integrity_algorithm[8];
uint8_t prefered_ciphering_algorithm[8];
} nas_config;
} mme_config_t;
extern mme_config_t mme_config;
int mme_config_find_mnc_length(const char mcc_digit1P,
const char mcc_digit2P,
const char mcc_digit3P,
const char mnc_digit1P,
const char mnc_digit2P,
const char mnc_digit3P);
int config_parse_opt_line(int argc, char *argv[], mme_config_t *mme_config);
#define config_read_lock(mMEcONFIG) pthread_rwlock_rdlock(&(mMEcONFIG)->rw_lock)
#define config_write_lock(mMEcONFIG) pthread_rwlock_wrlock(&(mMEcONFIG)->rw_lock)
#define config_unlock(mMEcONFIG) pthread_rwlock_unlock(&(mMEcONFIG)->rw_lock)
//int yyparse(struct mme_config_s *mme_config_p);
#endif /* __UTILS_MME_CONFIG__H__ */
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef MME_DEFAULT_VALUES_H_
#define MME_DEFAULT_VALUES_H_
/*******************************************************************************
* Timer Constants
******************************************************************************/
#define MME_STATISTIC_TIMER_S (60)
/*******************************************************************************
* GTPV1 User Plane Constants
******************************************************************************/
#define GTPV1_U_PORT_NUMBER (2152)
/*******************************************************************************
* S1AP Constants
******************************************************************************/
#define S1AP_PORT_NUMBER (36412) ///< S1AP SCTP IANA ASSIGNED Port Number
#define S1AP_SCTP_PPID (18) ///< S1AP SCTP Payload Protocol Identifier (PPID)
#define S1AP_OUTCOME_TIMER_DEFAULT (5) ///< S1AP Outcome drop timer (s)
/*******************************************************************************
* SCTP Constants
******************************************************************************/
/*
#define SCTP_RECV_BUFFER_SIZE (1 << 16)
#define SCTP_OUT_STREAMS (32)
#define SCTP_IN_STREAMS (32)
#define SCTP_MAX_ATTEMPTS (5)
*/
/*******************************************************************************
* MME global definitions
******************************************************************************/
#define MAX_NUMBER_OF_ENB (2)
#define MAX_NUMBER_OF_UE (64)
#define MMEC (0)
#define MMEGID (0)
#define PLMN_MCC (208)
#define PLMN_MNC (34)
#define PLMN_MNC_LEN (2)
#define PLMN_TAC (0)
#define RELATIVE_CAPACITY (15)
/*******************************************************************************
* IPv4 Constants
******************************************************************************/
/* Default network card to use for IPV4 packets forwarding.
* up stands for user-plane.
* cp stands for control-plane
*
* +-----------+ +------+ +-----------+
* | eNB +------+ | ovs | VLAN 1+------+ MME |
* | |cpenb0+------------------+cpmme0| |
* | +------+ |bridge| +------+ |
* | |upenb0+-------+ | | |
* +-----------+------+ | | | +-+------+--+
* +---|--+ |s11mme|
* | +---+--+
* | VLAN3 | (optional)
* | +---+--+
* | |s11sgw|
* | +-+------+--+
* | | S+P-GW |
* | VLAN2 +------+ +--------+
* +----------+upsgw0| |pgwsgi0 +
* +------+ +--------+
* | |
* +-----------+
*/
#define DEFAULT_SGW_INTERFACE_NAME_FOR_S11 ("s11sgw")
#define DEFAULT_SGW_IP_ADDRESS_FOR_S11 ("192.168.10.1")
#define DEFAULT_SGW_IP_NETMASK_FOR_S11 24
#define DEFAULT_SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP ("upsgw0")
#define DEFAULT_SGW_IP_ADDRESS_FOR_S1U_S12_S4_UP ("192.168.1.1")
#define DEFAULT_SGW_IP_NETMASK_FOR_S1U_S12_S4_UP 24
#define DEFAULT_SGW_INTERFACE_NAME_FOR_S5_S8_UP ("upsgw1")
#define DEFAULT_SGW_IP_ADDRESS_FOR_S5_S8_UP ("192.168.5.2")
#define DEFAULT_SGW_IP_NETMASK_FOR_S5_S8_UP 24
#define DEFAULT_PGW_INTERFACE_NAME_FOR_S5_S8 ("uppgw0")
#define DEFAULT_PGW_IP_ADDRESS_FOR_S5_S8 ("192.168.5.1")
#define DEFAULT_PGW_IP_NETMASK_FOR_S5_S8 24
#define DEFAULT_PGW_INTERFACE_NAME_FOR_SGI ("eth0")
#define DEFAULT_PGW_IP_ADDR_FOR_SGI ("192.168.14.17")
#define DEFAULT_PGW_IP_NETMASK_FOR_SGI 24
#define DEFAULT_MME_INTERFACE_NAME_FOR_S11 ("s11mme") ///< MME control plane interface
#define DEFAULT_MME_IP_ADDRESS_FOR_S11 ("192.168.10.2") ///< MME control plane IP address
#define DEFAULT_MME_IP_NETMASK_FOR_S11 24;
#define DEFAULT_MME_INTERFACE_NAME_FOR_S1_MME ("cpmme0") ///< MME control plane interface
#define DEFAULT_MME_IP_ADDRESS_FOR_S1_MME ("192.168.11.1") ///< MME control plane IP address
#define DEFAULT_MME_IP_NETMASK_FOR_S1_MME 24;
#endif /* MME_DEFAULT_VALUES_H_ */
/* Lex configuration parser.
*
* This file defines the token for parsing the configuration file
*
* Note : This module is NOT thread-safe. All processing must be done from one thread only.
*/
%{
#include <stdio.h>
#include "mme_config.h"
/* Include yacc tokens definitions */
#include "mme_parser.h"
/* Update the column information */
#ifdef DEBUG_LEX
#define YY_USER_ACTION { \
yylloc->first_column = yylloc->last_column + 1; \
yylloc->last_column = yylloc->first_column + yyleng - 1; \
TRACE_DEBUG(FULL, \
"(%d:%d-%d:%d) matched rule %d, length=%d, txt='%s'\n", \
yylloc->first_line, yylloc->first_column, \
yylloc->last_line, yylloc->last_column, \
yy_act, yyleng, yytext); \
}
#else /* DEBUG_LEX */
#define YY_USER_ACTION { \
yylloc->first_column = yylloc->last_column + 1; \
yylloc->last_column = yylloc->first_column + yyleng - 1; \
}
#endif
#define YY_NO_INPUT
%}
%option bison-bridge bison-locations
%option noyywrap
%option nounput
/* Quoted string. Multilines do not match. */
qstring \"[^\"\n]*\"
%%
/* List of patterns and actions */
<*>\n {
/* Update the line count */
yylloc->first_line++;
yylloc->last_line++;
yylloc->last_column=0;
}
<*>([[:space:]]{-}[\n])+ ; /* Eat all spaces, not new lines */
<*>#.*$ ; /* Eat all comments */
{qstring} {
/* First copy the string without the quotes for use in the yacc parser */
if ((yylval->string = strdup(yytext+1)) == NULL) { /* This allocates one useless tail char but... it's easier :D */
return LEX_ERROR;/* on error, trig an error in yacc parser */
}
yylval->string[yyleng-2] = '\0';
/* the yacc parser will check the string is valid */
return QSTRING;
}
[[:digit:]]+ {
/* Convert this to an integer value */
int ret = sscanf(yytext, "%i", &yylval->integer);
if (ret != 1) {
/* No matching: an error occurred */
fprintf(stderr, "Unable to convert the value '%s' to a valid number: %s\n",
yytext, strerror(errno));
return LEX_ERROR; /* trig an error in yacc parser */
/* Maybe we could REJECT instead of failing here? */
}
return INTEGER;
}
/* Full words tokens (keywords) */
(?i:"EMERGENCY_ATTACH_SUPPORTED") { return EMERGENCY_ATTACH_SUPPORTED; }
(?i:"UNAUTHENTICATED_IMSI_SUPPORTED") { return UNAUTHENTICATED_IMSI_SUPPORTED; }
(?i:"MAXENB") { return MAX_ENB; }
(?i:"MAXUE") { return MAX_UE; }
(?i:"S6A_CONF") { return S6A_CONF; }
(?i:"ITTI_QUEUE_SIZE") { return ITTI_QUEUE_SIZE; }
(?i:"SCTP_INSTREAMS") { return SCTP_INSTREAMS; }
(?i:"SCTP_OUTSTREAMS") { return SCTP_OUTSTREAMS; }
(?i:"MME_CODE") { return MME_CODE; }
(?i:"MME_GID") { return MME_GID; }
(?i:"REALM") { return REALM; }
(?i:"PLMN") { return PLMN_Y; }
(?i:"RELATIVE_CAPACITY") { return RELATIVE_CAP; }
(?i:"S1AP_OUTCOME_TIMER") { return S1AP_OUTCOME_TIMER; }
(?i:"MME_STATISTIC_TIMER") { return MME_STATISTIC_TIMER; }
(?i:"SGW_INTERFACE_NAME_FOR_S11") { return SGW_INTERFACE_NAME_FOR_S11; }
(?i:"SGW_IP_ADDRESS_FOR_S11") { return SGW_IP_ADDRESS_FOR_S11; }
(?i:"SGW_IP_NETMASK_FOR_S11") { return SGW_IP_NETMASK_FOR_S11; }
(?i:"SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP") { return SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP; }
(?i:"SGW_IP_ADDRESS_FOR_S1U_S12_S4_UP") { return SGW_IP_ADDRESS_FOR_S1U_S12_S4_UP; }
(?i:"SGW_IP_NETMASK_FOR_S1U_S12_S4_UP") { return SGW_IP_NETMASK_FOR_S1U_S12_S4_UP; }
(?i:"SGW_INTERFACE_NAME_FOR_S5_S8_UP") { return SGW_INTERFACE_NAME_FOR_S5_S8_UP; }
(?i:"SGW_IP_ADDRESS_FOR_S5_S8_UP") { return SGW_IP_ADDRESS_FOR_S5_S8_UP; }
(?i:"SGW_IP_NETMASK_FOR_S5_S8_UP") { return SGW_IP_NETMASK_FOR_S5_S8_UP; }
(?i:"PGW_INTERFACE_NAME_FOR_S5_S8") { return PGW_INTERFACE_NAME_FOR_S5_S8; }
(?i:"PGW_IP_ADDRESS_FOR_S5_S8") { return PGW_IP_ADDRESS_FOR_S5_S8; }
(?i:"PGW_IP_NETMASK_FOR_S5_S8") { return PGW_IP_NETMASK_FOR_S5_S8; }
(?i:"PGW_INTERFACE_NAME_FOR_SGI") { return PGW_INTERFACE_NAME_FOR_SGI; }
(?i:"PGW_IP_ADDR_FOR_SGI") { return PGW_IP_ADDR_FOR_SGI; }
(?i:"PGW_IP_NETMASK_FOR_SGI") { return PGW_IP_NETMASK_FOR_SGI; }
(?i:"MME_INTERFACE_NAME_FOR_S1_MME") { return MME_INTERFACE_NAME_FOR_S1_MME; }
(?i:"MME_IP_ADDRESS_FOR_S1_MME") { return MME_IP_ADDRESS_FOR_S1_MME; }
(?i:"MME_IP_NETMASK_FOR_S1_MME") { return MME_IP_NETMASK_FOR_S1_MME; }
(?i:"MME_INTERFACE_NAME_FOR_S11_MME") { return MME_INTERFACE_NAME_FOR_S11_MME; }
(?i:"MME_IP_ADDRESS_FOR_S11_MME") { return MME_IP_ADDRESS_FOR_S11_MME; }
(?i:"MME_IP_NETMASK_FOR_S11_MME") { return MME_IP_NETMASK_FOR_S11_MME; }
/* Valid single characters for yyparse */
<*>[.=,:;{}] { return yytext[0]; }
<*>[[:alnum:]]+ | /* This rule is only useful to print a complete token in error messages */
/* Unrecognized character */
<*>. {
fprintf(stderr, "Unrecognized text on line %d col %d: '%s'.\n",
yylloc->first_line, yylloc->first_column, yytext);
return LEX_ERROR;
}
%%
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment