Commit 496955d9 authored by gauthier's avatar gauthier
Browse files

Removed boost::asio. Set configurations default values

parent f13a6ef0
......@@ -23,45 +23,45 @@ S-GW =
INSTANCE = @INSTANCE@; # 0 is the default
PID_DIRECTORY = "@PID_DIRECTORY@"; # /var/run is the default
ITTI_TASKS :
{
ITTI_TIMER_SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 85;
};
S11_SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 84;
};
S5S8_SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 84;
};
SX_SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 84;
};
SGW_APP_SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 84;
};
ASYNC_CMD_SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 84;
};
};
#ITTI_TASKS :
#{
#ITTI_TIMER_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 85;
#};
#S11_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#S5S8_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#SX_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#SGW_APP_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#ASYNC_CMD_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#};
INTERFACES :
{
......@@ -69,27 +69,27 @@ S-GW =
{
# S-GW binded interface for S11 communication (GTPV2-C), if none selected the ITTI message interface is used
INTERFACE_NAME = "@SGW_INTERFACE_NAME_FOR_S11@"; # STRING, interface name, YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read"; # STRING, CIDR or read to let app read interface configured IP address, YOUR NETWORK CONFIG HERE
PORT = 2123; # INTEGER, port number, PREFER NOT CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING
SCHED_PARAMS : # SCHEADULING PARAMS OF THE LOOPING RECEIVER THREAD BOUND TO THIS INTERFACE/PROTOCOL
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 95;
};
IPV4_ADDRESS = "read"; # STRING, CIDR or "read" to let app read interface configured IP address, YOUR NETWORK CONFIG HERE
#PORT = 2123; # INTEGER, port number, PREFER NOT CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING
#SCHED_PARAMS : # SCHEADULING PARAMS OF THE LOOPING RECEIVER THREAD BOUND TO THIS INTERFACE/PROTOCOL
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 95;
#};
};
S5_S8_CP :
{
# S-GW binded interface for S5 or S8 communication
INTERFACE_NAME = "@SGW_INTERFACE_NAME_FOR_S5_S8_CP@"; # STRING, interface name
IPV4_ADDRESS = "read"; # STRING, CIDR or read to let app read interface configured IP address
PORT = 2123;
SCHED_PARAMS : # SCHEADULING PARAMS OF THE LOOPING RECEIVER THREAD BOUND TO THIS INTERFACE/PROTOCOL
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 95;
};
IPV4_ADDRESS = "read"; # STRING, CIDR or "read" to let app read interface configured IP address
#PORT = 2123; # INTEGER, port number, PREFER NOT CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING
#SCHED_PARAMS : # SCHEADULING PARAMS OF THE LOOPING RECEIVER THREAD BOUND TO THIS INTERFACE/PROTOCOL
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 95;
#};
};
};
};
......@@ -99,45 +99,45 @@ P-GW =
INSTANCE = @INSTANCE@; # 0 is the default
PID_DIRECTORY = "@PID_DIRECTORY@"; # /var/run is the default
ITTI_TASKS :
{
ITTI_TIMER_SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 85;
};
S11_SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 84;
};
S5S8_SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 84;
};
SX_SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 84;
};
PGW_APP_SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 84;
};
ASYNC_CMD_SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 84;
};
};
#ITTI_TASKS :
#{
#ITTI_TIMER_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 85;
#};
#S11_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#S5S8_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#SX_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#PGW_APP_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#ASYNC_CMD_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#};
INTERFACES :
{
......@@ -145,27 +145,27 @@ P-GW =
{
# P-GW binded interface for S5 or S8 communication
INTERFACE_NAME = "@PGW_INTERFACE_NAME_FOR_S5_S8_CP@"; # STRING, interface name
IPV4_ADDRESS = "read"; # STRING, CIDR or read to let app read interface configured IP address
PORT = 2123;
SCHED_PARAMS : # SCHEADULING PARAMS OF THE LOOPING RECEIVER THREAD BOUND TO THIS INTERFACE/PROTOCOL
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 95;
};
IPV4_ADDRESS = "read"; # STRING, CIDR or "read" to let app read interface configured IP address
#PORT = 2123;
#SCHED_PARAMS : # SCHEADULING PARAMS OF THE LOOPING RECEIVER THREAD BOUND TO THIS INTERFACE/PROTOCOL
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 95;
#};
};
SX :
{
# P-GW binded interface for SX communication
INTERFACE_NAME = "@PGW_INTERFACE_NAME_FOR_SX@"; # STRING, interface name
IPV4_ADDRESS = "read"; # STRING, CIDR or read to let app read interface configured IP address
PORT = 8805;
SCHED_PARAMS : # SCHEADULING PARAMS OF THE LOOPING RECEIVER THREAD BOUND TO THIS INTERFACE/PROTOCOL
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 95;
};
IPV4_ADDRESS = "read"; # STRING, CIDR or "read" to let app read interface configured IP address
#PORT = 8805;
#SCHED_PARAMS : # SCHEADULING PARAMS OF THE LOOPING RECEIVER THREAD BOUND TO THIS INTERFACE/PROTOCOL
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 95;
#};
};
};
......
......@@ -23,33 +23,33 @@ SPGW-U =
INSTANCE = @INSTANCE@; # 0 is the default
PID_DIRECTORY = "@PID_DIRECTORY@"; # /var/run is the default
ITTI_TASKS :
{
ITTI_TIMER_SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 85;
};
S1U_SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 84;
};
SX_SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 84;
};
ASYNC_CMD_SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 84;
};
};
#ITTI_TASKS :
#{
#ITTI_TIMER_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 85;
#};
#S1U_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#SX_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#ASYNC_CMD_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#};
INTERFACES :
{
......@@ -57,39 +57,39 @@ SPGW-U =
{
# S-GW binded interface for S1-U communication (GTPV1-U) can be ethernet interface, virtual ethernet interface, we don't advise wireless interfaces
INTERFACE_NAME = "@SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP@"; # STRING, interface name, YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read"; # STRING, CIDR or read to let app read interface configured IP address
PORT = @SGW_UDP_PORT_FOR_S1U_S12_S4_UP@; # Default is 2152
SCHED_PARAMS :
{
CPU_ID = 2;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 98;
};
IPV4_ADDRESS = "read"; # STRING, CIDR or "read to let app read interface configured IP address
#PORT = 2152; # Default is 2152
#SCHED_PARAMS :
#{
#CPU_ID = 2;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 98;
#};
};
SX :
{
# S/P-GW binded interface for SX communication
INTERFACE_NAME = "@SGW_INTERFACE_NAME_FOR_SX@"; # STRING, interface name
IPV4_ADDRESS = "read"; # STRING, CIDR or read to let app read interface configured IP address
PORT = 8805; # Default is 8805
SCHED_PARAMS :
{
CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 95;
};
IPV4_ADDRESS = "read"; # STRING, CIDR or "read" to let app read interface configured IP address
#PORT = 8805; # Default is 8805
#SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 95;
#};
};
SGI :
{
# No config to set, the software will set the SGi interface to the interface used for the default route.
INTERFACE_NAME = "@SGW_INTERFACE_NAME_FOR_SGI@"; # STRING, interface name or "default_gateway"
IPV4_ADDRESS = "read"; # STRING, CIDR or read to let app read interface configured IP address
SCHED_PARAMS :
{
CPU_ID = 3;
SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_PRIORITY = 98;
};
IPV4_ADDRESS = "read"; # STRING, CIDR or "read" to let app read interface configured IP address
#SCHED_PARAMS :
#{
#CPU_ID = 3;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 98;
#};
};
};
......
......@@ -391,6 +391,16 @@ struct imsi_s {
} u1;
uint num_digits;
imsi_s() : num_digits(0)
{
memset(u1.b, 0, sizeof(u1.b));
}
imsi_s(const imsi_s& i) : num_digits(i.num_digits)
{
memcpy(u1.b, i.u1.b, sizeof(u1.b));
}
std::string toString() const
{
std::string s = {};
......@@ -431,6 +441,39 @@ struct imsi_s {
}
return imsi64;
}
imsi_s& operator++ () // prefix ++
{
int l_i = IMSI_BCD8_SIZE - 1;
uint8_t carry = 1;
while(l_i > 5) {
uint8_t b = u1.b[l_i];
uint8_t d0 = b & 0x0f;
uint8_t d1 = b & 0xf0;
if (d0 <= 9) {
d0 += carry;
if (d0 <= 9) {
u1.b[l_i] = d0 | d1;
return(*this);
} else {
d0 = 0;
u1.b[l_i] = d0 | d1;
}
}
if (d1 <= 9) {
d1 += carry;
if (d1 <= 9) {
u1.b[l_i] = d0 | d1;
return(*this);
} else {
d1 = 0;
u1.b[l_i] = d0 | d1;
}
}
l_i++;
}
return (*this);
}
} ;
typedef struct imsi_s imsi_t;
......@@ -578,7 +621,7 @@ typedef struct ip_address_s {
//-------------------------------------
// 8.10 Mobile Equipment Identity (MEI)
// The ME Identity field contains either the IMEI or the IMEISV as defined in subclause 6.2 of 3GPP TS 23.003
typedef struct mei_s {
struct mei_s {
#define MEI_MIN_LENGTH (15)
#define MEI_MAX_LENGTH (16)
union {
......@@ -603,10 +646,74 @@ typedef struct mei_s {
uint8_t b[MEI_MAX_LENGTH/2];
} u1;
uint num_digits;
} mei_t;
mei_s() : num_digits(0)
{
memset(u1.b, 0, sizeof(u1.b));
}
mei_s(const mei_s& i) : num_digits(i.num_digits)
{
memcpy(u1.b, i.u1.b, sizeof(u1.b));
}
std::string toString() const
{
std::string s = {};
int l_i = 0;
int l_j = 0;
while(l_i < MEI_MAX_LENGTH/2) {
if((u1.b[l_i] & 0xf) > 9)
break;
s.append(std::to_string(u1.b[l_i] & 0xf));
l_j++;
if(((u1.b[l_i] & 0xf0) >> 4) > 9)
break;
s.append(std::to_string((u1.b[l_i] & 0xf0) >> 4));
l_j++;
l_i++;
}
return s;
}
mei_s& operator++ () // prefix ++
{
int l_i = MEI_MAX_LENGTH/2 - 1 - 1; // depends if imei or imei_sv -1 again
uint8_t carry = 1;
while(l_i) {
uint8_t b = u1.b[l_i];
uint8_t d0 = b & 0x0f;
uint8_t d1 = b & 0xf0;
if (d0 <= 9) {
d0 += carry;
if (d0 <= 9) {
u1.b[l_i] = d0 | d1;
return(*this);
} else {
d0 = 0;
u1.b[l_i] = d0 | d1;
}
}
if (d1 <= 9) {
d1 += carry;
if (d1 <= 9) {
u1.b[l_i] = d0 | d1;
return(*this);
} else {
d1 = 0;
u1.b[l_i] = d0 | d1;
}
}
l_i++;
}
return (*this);
}
} ;
typedef struct mei_s mei_t;
//-------------------------------------
// 8.11 MSISDN
typedef struct msisdn_s {
struct msisdn_s {
#define MSISDN_MAX_LENGTH (15)
union {
struct {
......@@ -629,7 +736,73 @@ typedef struct msisdn_s {
uint8_t b[MSISDN_MAX_LENGTH/2+1];
} u1;
uint num_digits;
} msisdn_t;
msisdn_s() : num_digits(0)
{
memset(u1.b, 0, sizeof(u1.b));
}
msisdn_s(const msisdn_s& i) : num_digits(i.num_digits)
{
memcpy(u1.b, i.u1.b, sizeof(u1.b));
}
std::string toString() const
{
std::string s = {};
int l_i = 0;
int l_j = 0;
while(l_i < sizeof(u1.b)) {
if((u1.b[l_i] & 0xf) > 9)
break;
s.append(std::to_string(u1.b[l_i] & 0xf));
l_j++;
if(((u1.b[l_i] & 0xf0) >> 4) > 9)
break;
s.append(std::to_string((u1.b[l_i] & 0xf0) >> 4));
l_j++;
l_i++;
}
return s;
}
// Should be refined see spec
msisdn_s& operator++ () // prefix ++
{
int l_i = sizeof(u1.b) - 1;
uint8_t carry = 1;
while(l_i > 5) {
uint8_t b = u1.b[l_i];
uint8_t d0 = b & 0x0f;
uint8_t d1 = b & 0xf0;
if (d0 <= 9) {
d0 += carry;
if (d0 <= 9) {
u1.b[l_i] = d0 | d1;
return(*this);
} else {
d0 = 0;
u1.b[l_i] = d0 | d1;
}
}
if (d1 <= 9) {
d1 += carry;
if (d1 <= 9) {
u1.b[l_i] = d0 | d1;
return(*this);
} else {
d1 = 0;
u1.b[l_i] = d0 | d1;
}
}
l_i++;
}
return (*this);
}
};
typedef struct msisdn_s msisdn_t;
//-------------------------------------
// 8.12 Indication
typedef struct indication_s {
......@@ -833,9 +1006,31 @@ enum rat_type_e {
RAT_TYPE_E_LTE_M = 9,
RAT_TYPE_E_NR = 10,
};
typedef struct rat_type_s {
struct rat_type_s {
uint8_t rat_type;
} rat_type_t;
rat_type_s() : rat_type(RAT_TYPE_E_EUTRAN_WB_EUTRAN) {}
rat_type_s(const rat_type_e r) : rat_type(r) {}
rat_type_s(const rat_type_s& i) : rat_type(i.rat_type) {}
//------------------------------------------------------------------------------
std::string toString() const
{
switch(rat_type) {
case RAT_TYPE_E_EUTRAN_WB_EUTRAN: return std::string("EUTRAN_WB_EUTRAN");
case RAT_TYPE_E_EUTRAN_NB_IOT: return std::string("EUTRAN_NB_IOT");
case RAT_TYPE_E_LTE_M: return std::string("LTE_M");
case RAT_TYPE_E_NR: return std::string("NR");
case RAT_TYPE_E_VIRTUAL: return std::string("VIRTUAL");
case RAT_TYPE_E_RESERVED: return std::string("RESERVED");
case RAT_TYPE_E_UTRAN: return std::string("UTRAN");
case RAT_TYPE_E_GERAN: return std::string("GERAN");
case RAT_TYPE_E_WLAN: return std::string("WLAN");
case RAT_TYPE_E_GAN: return std::string("GAN");
case RAT_TYPE_E_HSPA_EVOLUTION: return std::string("HSPA_EVOLUTION");
default: return std::to_string(rat_type);
}
}
};
typedef struct rat_type_s rat_type_t;
//-------------------------------------
// 8.18 Serving Network
typedef struct serving_network_s {