Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zzha zzha
OpenXG-RAN
Commits
c36a1ef4
Commit
c36a1ef4
authored
Oct 20, 2022
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/rm_CN_UTILS' into integration_2022_wk42b
parents
b3d4321d
d671d8ad
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
0 additions
and
2103 deletions
+0
-2103
CMakeLists.txt
CMakeLists.txt
+0
-6
openair3/UTILS/conversions.c
openair3/UTILS/conversions.c
+0
-96
openair3/UTILS/conversions.h
openair3/UTILS/conversions.h
+0
-4
openair3/UTILS/enum_string.c
openair3/UTILS/enum_string.c
+0
-84
openair3/UTILS/enum_string.h
openair3/UTILS/enum_string.h
+0
-42
openair3/UTILS/mcc_mnc_itu.c
openair3/UTILS/mcc_mnc_itu.c
+0
-1817
openair3/UTILS/mcc_mnc_itu.h
openair3/UTILS/mcc_mnc_itu.h
+0
-54
No files found.
CMakeLists.txt
View file @
c36a1ef4
...
...
@@ -2124,12 +2124,6 @@ include_directories("${OPENAIR1_DIR}/SCHED_NR_UE")
# CN libs
##########################
add_library
(
CN_UTILS
${
OPENAIR3_DIR
}
/UTILS/conversions.c
${
OPENAIR3_DIR
}
/UTILS/enum_string.c
${
OPENAIR3_DIR
}
/UTILS/mcc_mnc_itu.c
)
add_library
(
GTPV1U
${
NR_RRC_DIR
}
/rrc_gNB_GTPV1U.c
${
RRC_DIR
}
/rrc_eNB_GTPV1U.c
...
...
openair3/UTILS/conversions.c
deleted
100644 → 0
View file @
b3d4321d
/*
* 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
*/
#include <stdlib.h>
#include <stdint.h>
#include <ctype.h>
#include "conversions.h"
static
const
char
hex_to_ascii_table
[
16
]
=
{
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
,
};
static
const
signed
char
ascii_to_hex_table
[
0x100
]
=
{
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
10
,
11
,
12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
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
};
void
hexa_to_ascii
(
uint8_t
*
from
,
char
*
to
,
size_t
length
)
{
int
i
;
for
(
i
=
0
;
i
<
length
;
i
++
)
{
uint8_t
upper
=
(
from
[
i
]
&
0xf0
)
>>
4
;
uint8_t
lower
=
from
[
i
]
&
0x0f
;
to
[
2
*
i
]
=
hex_to_ascii_table
[
upper
];
to
[
2
*
i
+
1
]
=
hex_to_ascii_table
[
lower
];
}
}
int
ascii_to_hex
(
uint8_t
*
dst
,
const
char
*
h
)
{
const
unsigned
char
*
hex
=
(
const
unsigned
char
*
)
h
;
unsigned
i
=
0
;
for
(;;)
{
int
high
,
low
;
while
(
*
hex
&&
isspace
(
*
hex
))
hex
++
;
if
(
!*
hex
)
return
1
;
high
=
ascii_to_hex_table
[
*
hex
++
];
if
(
high
<
0
)
return
0
;
while
(
*
hex
&&
isspace
(
*
hex
))
hex
++
;
if
(
!*
hex
)
return
0
;
low
=
ascii_to_hex_table
[
*
hex
++
];
if
(
low
<
0
)
return
0
;
dst
[
i
++
]
=
(
high
<<
4
)
|
low
;
}
}
openair3/UTILS/conversions.h
View file @
c36a1ef4
...
...
@@ -560,8 +560,4 @@ do { \
#define GTP_TEID_TO_ASN1 INT32_TO_OCTET_STRING
#define OCTET_STRING_TO_TAC OCTET_STRING_TO_INT16
void
hexa_to_ascii
(
uint8_t
*
from
,
char
*
to
,
size_t
length
);
int
ascii_to_hex
(
uint8_t
*
dst
,
const
char
*
h
);
#endif
/* CONVERSIONS_H_ */
openair3/UTILS/enum_string.c
deleted
100644 → 0
View file @
b3d4321d
/*
* 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
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "common_types.h"
#include "enum_string.h"
enum_to_string_t
rat_to_string
[
NUMBER_OF_RAT_TYPE
]
=
{
{
RAT_WLAN
,
"WLAN"
},
{
RAT_VIRTUAL
,
"VIRUTAL"
},
{
RAT_UTRAN
,
"UTRAN"
},
{
RAT_GERAN
,
"GERAN"
},
{
RAT_GAN
,
"GAN"
},
{
RAT_HSPA_EVOLUTION
,
"HSPA_EVOLUTION"
},
{
RAT_EUTRAN
,
"E-UTRAN"
},
{
RAT_CDMA2000_1X
,
"CDMA2000_1X"
},
{
RAT_HRPD
,
"HRPD"
},
{
RAT_UMB
,
"UMB"
},
{
RAT_EHRPD
,
"EHRPD"
},
};
enum_to_string_t
network_access_mode_to_string
[
NAM_MAX
]
=
{
{
NAM_PACKET_AND_CIRCUIT
,
"PACKET AND CIRCUIT"
},
{
NAM_RESERVED
,
"RESERVED"
},
{
NAM_ONLY_PACKET
,
"ONLY PACKET"
},
};
enum_to_string_t
all_apn_conf_ind_to_string
[
ALL_APN_MAX
]
=
{
{
ALL_APN_CONFIGURATIONS_INCLUDED
,
"ALL APN CONFIGURATIONS INCLUDED"
},
{
MODIFIED_ADDED_APN_CONFIGURATIONS_INCLUDED
,
"MODIFIED ADDED APN CONFIGURATIONS INCLUDED"
},
};
enum_to_string_t
pdn_type_to_string
[
IP_MAX
]
=
{
{
IPv4
,
"IPv4"
},
{
IPv6
,
"IPv6"
},
{
IPv4_AND_v6
,
"IPv4 and IPv6"
},
{
IPv4_OR_v6
,
"IPv4 or IPv6"
},
};
static
int
compare_values
(
const
void
*
m1
,
const
void
*
m2
)
{
enum_to_string_t
*
mi1
=
(
enum_to_string_t
*
)
m1
;
enum_to_string_t
*
mi2
=
(
enum_to_string_t
*
)
m2
;
return
(
mi1
->
enum_value
-
mi2
->
enum_value
);
}
char
*
enum_to_string
(
int
enum_val
,
enum_to_string_t
*
string_table
,
int
nb_element
)
{
enum_to_string_t
*
res
;
enum_to_string_t
temp
;
temp
.
enum_value
=
enum_val
;
res
=
bsearch
(
&
temp
,
string_table
,
nb_element
,
sizeof
(
enum_to_string_t
),
compare_values
);
if
(
res
==
NULL
)
{
return
"UNKNOWN"
;
}
return
res
->
enum_value_name
;
}
openair3/UTILS/enum_string.h
deleted
100644 → 0
View file @
b3d4321d
/*
* 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 ENUM_STRING_H_
#define ENUM_STRING_H_
typedef
struct
{
int
enum_value
;
char
*
enum_value_name
;
}
enum_to_string_t
;
extern
enum_to_string_t
network_access_mode_to_string
[
NAM_MAX
];
extern
enum_to_string_t
rat_to_string
[
NUMBER_OF_RAT_TYPE
];
extern
enum_to_string_t
pdn_type_to_string
[
IP_MAX
];
char
*
enum_to_string
(
int
enum_val
,
enum_to_string_t
*
string_table
,
int
nb_element
);
#define ACCESS_MODE_TO_STRING(vAL) \
enum_to_string((int)vAL, network_access_mode_to_string, \
sizeof(network_access_mode_to_string) / sizeof(enum_to_string_t))
#define PDN_TYPE_TO_STRING(vAL) \
enum_to_string((int)vAL, pdn_type_to_string, \
sizeof(pdn_type_to_string) / sizeof(enum_to_string_t))
#endif
/* ENUM_STRING_H_ */
openair3/UTILS/mcc_mnc_itu.c
deleted
100644 → 0
View file @
b3d4321d
This diff is collapsed.
Click to expand it.
openair3/UTILS/mcc_mnc_itu.h
deleted
100644 → 0
View file @
b3d4321d
/*
* 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
*/
/*****************************************************************************
Source mcc_mnc.h
Version 0.1
Date {2014/10/02
Product
Subsystem
Author Lionel GAUTHIER
Description Defines the MCC/MNC list delivered by the ITU
*****************************************************************************/
#ifndef __MCC_MNC_H__
#define __MCC_MNC_H__
typedef
struct
mcc_mnc_list_s
{
uint16_t
mcc
;
char
mnc
[
4
];
}
mcc_mnc_list_t
;
int
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
);
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment