change variable name to align database attribute name

This commit is contained in:
Sukchan Lee 2017-08-22 14:07:37 +09:00
parent 40fdcd82fa
commit 17dc308aa2
9 changed files with 55 additions and 51 deletions

View File

@ -97,13 +97,15 @@ ED2(c_uint8_t spare:5;,
c_uint32_t ipv4_addr2;
} __attribute__ ((packed)) paa_t;
typedef struct _bitrate_t {
c_uint64_t downlink; /* bits per seconds */
c_uint64_t uplink; /* bits per seconds */
} bitrate_t;
/**********************************
* QoS Structure */
typedef struct _qos_t {
lnode_t node; /**< A node of list_t */
c_uint32_t max_bandwidth_ul; /* bits per second */
c_uint32_t max_bandwidth_dl; /* bits per second */
lnode_t node; /* A node of list_t */
#define PDN_QCI_1 1
#define PDN_QCI_2 2
@ -120,19 +122,23 @@ typedef struct _qos_t {
#define PDN_QCI_70 70
c_uint8_t qci;
/* Values 1 to 8 should only be assigned for services that are authorized
* to receive prioritized treatment within an operator domain.
struct {
/* Values 1 to 8 should only be assigned for services that are
* authorized to receive prioritized treatment within an operator domain.
* Values 9 to 15 may be assigned to resources that are authorized
* by the home network and thus applicable when a UE is roaming. */
c_uint8_t priority_level;
c_uint8_t priority_level;
#define PDN_PRE_EMPTION_CAPABILITY_ENABLED 0
#define PDN_PRE_EMPTION_CAPABILITY_DISABLED 1
c_uint8_t pre_emption_capability;
c_uint8_t pre_emption_capability;
#define PDN_PRE_EMPTION_VULNERABILITY_ENABLED 0
#define PDN_PRE_EMPTION_VULNERABILITY_DISABLED 1
c_uint8_t pre_emption_vulnerability;
c_uint8_t pre_emption_vulnerability;
} arp;
bitrate_t mbr; /* Maxmimum Bit Rate (MBR) */
bitrate_t gbr; /* Guaranteed Bit Rate (GBR) */
} qos_t;
/**********************************
@ -148,6 +154,7 @@ typedef struct _pdn_t {
paa_t paa;
qos_t qos;
bitrate_t ambr; /* APN-AMBR */
} pdn_t;
CORE_DECLARE(c_int16_t) apn_build(c_int8_t *dst, c_int8_t *src, c_int16_t len);

View File

@ -483,13 +483,13 @@ status_t hss_db_subscription_data(
if (!strcmp(child1_key, "uplink") &&
BSON_ITER_HOLDS_INT32(&child1_iter))
{
subscription_data->max_bandwidth_ul =
subscription_data->ambr.uplink =
bson_iter_int32(&child1_iter) * 1024;
}
else if (!strcmp(child1_key, "downlink") &&
BSON_ITER_HOLDS_INT32(&child1_iter))
{
subscription_data->max_bandwidth_dl =
subscription_data->ambr.downlink =
bson_iter_int32(&child1_iter) * 1024;
}
}
@ -553,21 +553,21 @@ status_t hss_db_subscription_data(
if (!strcmp(child4_key, "priority_level") &&
BSON_ITER_HOLDS_INT32(&child4_iter))
{
pdn->qos.priority_level =
pdn->qos.arp.priority_level =
bson_iter_int32(&child4_iter);
}
else if (!strcmp(child4_key,
"pre_emption_capability") &&
BSON_ITER_HOLDS_INT32(&child4_iter))
{
pdn->qos.pre_emption_capability =
pdn->qos.arp.pre_emption_capability =
bson_iter_int32(&child4_iter);
}
else if (!strcmp(child4_key,
"pre_emption_vulnerability") &&
BSON_ITER_HOLDS_INT32(&child4_iter))
{
pdn->qos.pre_emption_vulnerability =
pdn->qos.arp.pre_emption_vulnerability =
bson_iter_int32(&child4_iter);
}
}
@ -585,13 +585,13 @@ status_t hss_db_subscription_data(
if (!strcmp(child3_key, "uplink") &&
BSON_ITER_HOLDS_INT32(&child3_iter))
{
pdn->qos.max_bandwidth_ul =
pdn->ambr.uplink =
bson_iter_int32(&child3_iter) * 1024;
}
else if (!strcmp(child3_key, "downlink") &&
BSON_ITER_HOLDS_INT32(&child3_iter))
{
pdn->qos.max_bandwidth_dl =
pdn->ambr.downlink =
bson_iter_int32(&child3_iter) * 1024;
}
}

View File

@ -37,10 +37,8 @@ typedef struct _hss_db_subscription_data_t {
#define HSS_NETWORK_ACCESS_MODE_ONLY_PACKET 2
c_uint32_t network_access_mode;
c_uint32_t max_bandwidth_ul; /* bits per second */
c_uint32_t max_bandwidth_dl; /* bits per second */
c_uint32_t subscribed_rau_tau_timer; /* minutes */
bitrate_t ambr; /* UE-AMBR */
c_uint32_t subscribed_rau_tau_timer; /* unit : minutes */
pdn_t pdn[MAX_NUM_OF_PDN];
int num_of_pdn;

View File

@ -273,13 +273,13 @@ static int hss_ulr_cb( struct msg **msg, struct avp *avp,
CHECK_FCT( fd_msg_avp_new(s6a_ambr, 0, &avp_ambr) );
CHECK_FCT( fd_msg_avp_new(s6a_max_bandwidth_ul, 0,
&avp_max_bandwidth_ul) );
val.u32 = subscription_data.max_bandwidth_ul;
val.u32 = subscription_data.ambr.uplink;
CHECK_FCT( fd_msg_avp_setvalue(avp_max_bandwidth_ul, &val) );
CHECK_FCT( fd_msg_avp_add(avp_ambr, MSG_BRW_LAST_CHILD,
avp_max_bandwidth_ul) );
CHECK_FCT( fd_msg_avp_new(s6a_max_bandwidth_dl, 0,
&avp_max_bandwidth_dl) );
val.u32 = subscription_data.max_bandwidth_dl;
val.u32 = subscription_data.ambr.downlink;
CHECK_FCT( fd_msg_avp_setvalue(avp_max_bandwidth_dl, &val) );
CHECK_FCT( fd_msg_avp_add(avp_ambr, MSG_BRW_LAST_CHILD,
avp_max_bandwidth_dl) );
@ -365,21 +365,21 @@ static int hss_ulr_cb( struct msg **msg, struct avp *avp,
CHECK_FCT( fd_msg_avp_new(s6a_priority_level, 0,
&priority_level) );
val.u32 = pdn->qos.priority_level;
val.u32 = pdn->qos.arp.priority_level;
CHECK_FCT( fd_msg_avp_setvalue(priority_level, &val) );
CHECK_FCT( fd_msg_avp_add(allocation_retention_priority,
MSG_BRW_LAST_CHILD, priority_level) );
CHECK_FCT( fd_msg_avp_new(s6a_pre_emption_capability, 0,
&pre_emption_capability) );
val.u32 = pdn->qos.pre_emption_capability;
val.u32 = pdn->qos.arp.pre_emption_capability;
CHECK_FCT( fd_msg_avp_setvalue(pre_emption_capability, &val) );
CHECK_FCT( fd_msg_avp_add(allocation_retention_priority,
MSG_BRW_LAST_CHILD, pre_emption_capability) );
CHECK_FCT( fd_msg_avp_new(s6a_pre_emption_vulnerability, 0,
&pre_emption_vulnerability) );
val.u32 = pdn->qos.pre_emption_vulnerability;
val.u32 = pdn->qos.arp.pre_emption_vulnerability;
CHECK_FCT(
fd_msg_avp_setvalue(pre_emption_vulnerability, &val) );
CHECK_FCT( fd_msg_avp_add(allocation_retention_priority,
@ -395,13 +395,13 @@ static int hss_ulr_cb( struct msg **msg, struct avp *avp,
CHECK_FCT( fd_msg_avp_new(s6a_ambr, 0, &avp_ambr) );
CHECK_FCT( fd_msg_avp_new(s6a_max_bandwidth_ul, 0,
&avp_max_bandwidth_ul) );
val.u32 = pdn->qos.max_bandwidth_ul;
val.u32 = pdn->ambr.uplink;
CHECK_FCT( fd_msg_avp_setvalue(avp_max_bandwidth_ul, &val) );
CHECK_FCT( fd_msg_avp_add(avp_ambr, MSG_BRW_LAST_CHILD,
avp_max_bandwidth_ul) );
CHECK_FCT( fd_msg_avp_new(s6a_max_bandwidth_dl, 0,
&avp_max_bandwidth_dl) );
val.u32 = pdn->qos.max_bandwidth_dl;
val.u32 = pdn->ambr.downlink;
CHECK_FCT( fd_msg_avp_setvalue(avp_max_bandwidth_dl, &val) );
CHECK_FCT( fd_msg_avp_add(avp_ambr, MSG_BRW_LAST_CHILD,
avp_max_bandwidth_dl) );

View File

@ -109,12 +109,11 @@ status_t esm_build_activate_default_bearer_context(
pdn_address->length = PAA_IPV4_LEN;
memcpy(&pdn_address->paa, &pdn->paa, pdn_address->length);
if (pdn->qos.max_bandwidth_dl || pdn->qos.max_bandwidth_ul)
if (pdn->ambr.downlink || pdn->ambr.uplink)
{
activate_default_eps_bearer_context_request->presencemask |=
NAS_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_APN_AMBR_PRESENT;
apn_ambr_build(apn_ambr,
pdn->qos.max_bandwidth_dl, pdn->qos.max_bandwidth_ul);
apn_ambr_build(apn_ambr, pdn->ambr.downlink, pdn->ambr.uplink);
}
if (bearer->pgw_pco_len)

View File

@ -205,10 +205,9 @@ struct _mme_ue_t {
/* HSS Info */
c_uint32_t ula_flags;
c_uint32_t max_bandwidth_ul; /* bits per seconds */
c_uint32_t max_bandwidth_dl; /* bits per seconds */
c_uint32_t subscribed_rau_tau_timer; /* seconds */
pdn_t pdn[MAX_NUM_OF_PDN]; /* APN Profile */
bitrate_t ambr; /* UE-AMBR */
c_uint32_t subscribed_rau_tau_timer; /* unit: seconds */
pdn_t pdn[MAX_NUM_OF_PDN]; /* APN Configruration */
int num_of_pdn;
/* ESM Info */

View File

@ -106,8 +106,8 @@ status_t mme_s11_build_create_session_request(pkbuf_t **pkbuf, mme_sess_t *sess)
req->maximum_apn_restriction.u8 = GTP_APN_NO_RESTRICTION;
memset(&ambr, 0, sizeof(gtp_ambr_t));
ambr.uplink = htonl(pdn->qos.max_bandwidth_ul);
ambr.downlink = htonl(pdn->qos.max_bandwidth_dl);
ambr.uplink = htonl(pdn->ambr.uplink);
ambr.downlink = htonl(pdn->ambr.downlink);
req->aggregate_maximum_bit_rate.presence = 1;
req->aggregate_maximum_bit_rate.data = &ambr;
req->aggregate_maximum_bit_rate.len = sizeof(ambr);
@ -124,10 +124,11 @@ status_t mme_s11_build_create_session_request(pkbuf_t **pkbuf, mme_sess_t *sess)
req->bearer_contexts_to_be_created.eps_bearer_id.u8 = bearer->ebi;
memset(&bearer_qos, 0, sizeof(bearer_qos));
bearer_qos.pre_emption_vulnerability = pdn->qos.pre_emption_vulnerability;
bearer_qos.pre_emption_capability = pdn->qos.pre_emption_capability;
bearer_qos.qci = pdn->qos.qci;
bearer_qos.priority_level = pdn->qos.priority_level;
bearer_qos.priority_level = pdn->qos.arp.priority_level;
bearer_qos.pre_emption_capability = pdn->qos.arp.pre_emption_capability;
bearer_qos.pre_emption_vulnerability =
pdn->qos.arp.pre_emption_vulnerability;
req->bearer_contexts_to_be_created.bearer_level_qos.presence = 1;
gtp_build_bearer_qos(&req->bearer_contexts_to_be_created.bearer_level_qos,
&bearer_qos, bearer_qos_buf, GTP_BEARER_QOS_LEN);

View File

@ -552,7 +552,7 @@ static void mme_s6a_ula_cb(void *data, struct msg **msg)
if (avpch2)
{
CHECK_FCT_DO( fd_msg_avp_hdr(avpch2, &hdr), return );
mme_ue->max_bandwidth_ul = hdr->avp_value->u32;
mme_ue->ambr.uplink = hdr->avp_value->u32;
}
else
error++;
@ -562,7 +562,7 @@ static void mme_s6a_ula_cb(void *data, struct msg **msg)
if (avpch2)
{
CHECK_FCT_DO( fd_msg_avp_hdr(avpch2, &hdr), return );
mme_ue->max_bandwidth_dl = hdr->avp_value->u32;
mme_ue->ambr.downlink = hdr->avp_value->u32;
}
else
error++;
@ -656,7 +656,7 @@ static void mme_s6a_ula_cb(void *data, struct msg **msg)
{
CHECK_FCT_DO( fd_msg_avp_hdr(avpch5, &hdr),
return );
pdn->qos.priority_level =
pdn->qos.arp.priority_level =
hdr->avp_value->i32;
}
@ -670,7 +670,7 @@ static void mme_s6a_ula_cb(void *data, struct msg **msg)
{
CHECK_FCT_DO( fd_msg_avp_hdr(avpch5, &hdr),
return );
pdn->qos.pre_emption_capability =
pdn->qos.arp.pre_emption_capability =
hdr->avp_value->i32;
}
else
@ -683,7 +683,7 @@ static void mme_s6a_ula_cb(void *data, struct msg **msg)
{
CHECK_FCT_DO( fd_msg_avp_hdr(avpch5, &hdr),
return );
pdn->qos.pre_emption_vulnerability =
pdn->qos.arp.pre_emption_vulnerability =
hdr->avp_value->i32;
}
else
@ -706,7 +706,7 @@ static void mme_s6a_ula_cb(void *data, struct msg **msg)
{
CHECK_FCT_DO(
fd_msg_avp_hdr(avpch4, &hdr), return );
pdn->qos.max_bandwidth_ul = hdr->avp_value->u32;
pdn->ambr.uplink = hdr->avp_value->u32;
}
else
error++;
@ -717,7 +717,7 @@ static void mme_s6a_ula_cb(void *data, struct msg **msg)
{
CHECK_FCT_DO(
fd_msg_avp_hdr(avpch4, &hdr), return );
pdn->qos.max_bandwidth_dl = hdr->avp_value->u32;
pdn->ambr.downlink = hdr->avp_value->u32;
}
else
error++;

View File

@ -182,10 +182,10 @@ status_t s1ap_build_initial_context_setup_request(
asn_uint642INTEGER(
&ies->uEaggregateMaximumBitrate.uEaggregateMaximumBitRateUL,
mme_ue->max_bandwidth_ul);
mme_ue->ambr.uplink);
asn_uint642INTEGER(
&ies->uEaggregateMaximumBitrate.uEaggregateMaximumBitRateDL,
mme_ue->max_bandwidth_dl);
mme_ue->ambr.downlink);
e_rab = (S1ap_E_RABToBeSetupItemCtxtSUReq_t *)
core_calloc(1, sizeof(S1ap_E_RABToBeSetupItemCtxtSUReq_t));
@ -193,11 +193,11 @@ status_t s1ap_build_initial_context_setup_request(
e_rab->e_RABlevelQoSParameters.qCI = pdn->qos.qci;
e_rab->e_RABlevelQoSParameters.allocationRetentionPriority.
priorityLevel = pdn->qos.priority_level;
priorityLevel = pdn->qos.arp.priority_level;
e_rab->e_RABlevelQoSParameters.allocationRetentionPriority.
pre_emptionCapability = !(pdn->qos.pre_emption_capability);
pre_emptionCapability = !(pdn->qos.arp.pre_emption_capability);
e_rab->e_RABlevelQoSParameters.allocationRetentionPriority.
pre_emptionVulnerability = !(pdn->qos.pre_emption_vulnerability);
pre_emptionVulnerability = !(pdn->qos.arp.pre_emption_vulnerability);
#if 0 /* Not needed in default bearer */
gbrQosInformation = core_calloc(1, sizeof(struct S1ap_GBR_QosInformation));