ambr, mbr, gbr downlink/uplink DB attribute changed from 32bit to 64bit

This commit is contained in:
Sukchan Lee 2017-08-24 19:51:16 +09:00
parent 52fe187df3
commit 6b9ec5c5d7
7 changed files with 58 additions and 54 deletions

View File

@ -489,16 +489,16 @@ status_t hss_db_subscription_data(
{
const char *child1_key = bson_iter_key(&child1_iter);
if (!strcmp(child1_key, "uplink") &&
BSON_ITER_HOLDS_INT32(&child1_iter))
BSON_ITER_HOLDS_INT64(&child1_iter))
{
subscription_data->ambr.uplink =
bson_iter_int32(&child1_iter) * 1024;
bson_iter_int64(&child1_iter) * 1024;
}
else if (!strcmp(child1_key, "downlink") &&
BSON_ITER_HOLDS_INT32(&child1_iter))
BSON_ITER_HOLDS_INT64(&child1_iter))
{
subscription_data->ambr.downlink =
bson_iter_int32(&child1_iter) * 1024;
bson_iter_int64(&child1_iter) * 1024;
}
}
}
@ -591,16 +591,16 @@ status_t hss_db_subscription_data(
const char *child3_key =
bson_iter_key(&child3_iter);
if (!strcmp(child3_key, "uplink") &&
BSON_ITER_HOLDS_INT32(&child3_iter))
BSON_ITER_HOLDS_INT64(&child3_iter))
{
pdn->ambr.uplink =
bson_iter_int32(&child3_iter) * 1024;
bson_iter_int64(&child3_iter) * 1024;
}
else if (!strcmp(child3_key, "downlink") &&
BSON_ITER_HOLDS_INT32(&child3_iter))
BSON_ITER_HOLDS_INT64(&child3_iter))
{
pdn->ambr.downlink =
bson_iter_int32(&child3_iter) * 1024;
bson_iter_int64(&child3_iter) * 1024;
}
}
}

View File

@ -213,14 +213,18 @@ status_t pcrf_db_init()
{
if (context_self()->db_client && context_self()->db_name)
{
gx_pdn_data_t pdn_data;
self.subscriberCollection = mongoc_client_get_collection(
context_self()->db_client,
context_self()->db_name, "subscribers");
d_assert(self.subscriberCollection, return CORE_ERROR,
"Couldn't find Subscriber Collection in '%s'",
context_self()->db_name);
#if 0
{
gx_pdn_data_t pdn_data;
pcrf_db_pdn_data("123", "internet", &pdn_data);
}
#endif
}
return CORE_OK;
@ -384,16 +388,16 @@ status_t pcrf_db_pdn_data(
const char *child3_key =
bson_iter_key(&child3_iter);
if (!strcmp(child3_key, "uplink") &&
BSON_ITER_HOLDS_INT32(&child3_iter))
BSON_ITER_HOLDS_INT64(&child3_iter))
{
pdn->ambr.uplink =
bson_iter_int32(&child3_iter) * 1024;
bson_iter_int64(&child3_iter) * 1024;
}
else if (!strcmp(child3_key, "downlink") &&
BSON_ITER_HOLDS_INT32(&child3_iter))
BSON_ITER_HOLDS_INT64(&child3_iter))
{
pdn->ambr.downlink =
bson_iter_int32(&child3_iter) * 1024;
bson_iter_int64(&child3_iter) * 1024;
}
}
}
@ -492,20 +496,20 @@ status_t pcrf_db_pdn_data(
bson_iter_key(&child6_iter);
if (!strcmp(child6_key,
"downlink") &&
BSON_ITER_HOLDS_INT32(
BSON_ITER_HOLDS_INT64(
&child6_iter))
{
pcc_rule->qos.mbr.downlink =
bson_iter_int32(
bson_iter_int64(
&child6_iter);
}
else if (!strcmp(child6_key,
"uplink") &&
BSON_ITER_HOLDS_INT32(
BSON_ITER_HOLDS_INT64(
&child6_iter))
{
pcc_rule->qos.mbr.uplink =
bson_iter_int32(
bson_iter_int64(
&child6_iter);
}
}
@ -522,20 +526,20 @@ status_t pcrf_db_pdn_data(
bson_iter_key(&child6_iter);
if (!strcmp(child6_key,
"downlink") &&
BSON_ITER_HOLDS_INT32(
BSON_ITER_HOLDS_INT64(
&child6_iter))
{
pcc_rule->qos.gbr.downlink =
bson_iter_int32(
bson_iter_int64(
&child6_iter);
}
else if (!strcmp(child6_key,
"uplink") &&
BSON_ITER_HOLDS_INT32(
BSON_ITER_HOLDS_INT64(
&child6_iter))
{
pcc_rule->qos.gbr.uplink =
bson_iter_int32(
bson_iter_int64(
&child6_iter);
}
}

View File

@ -62,8 +62,8 @@ static void attach_test1(abts_case *tc, void *data)
"\"apn\" : \"internet\", "
"\"_id\" : { \"$oid\" : \"597223158b8861d7605378c7\" }, "
"\"ambr\" : {"
"\"uplink\" : 1024000, "
"\"downlink\" : 1024000 "
"\"uplink\" : { \"$numberLong\" : \"1024000\" }, "
"\"downlink\" : { \"$numberLong\" : \"1024000\" } "
"},"
"\"qos\" : { "
"\"qci\" : 9, "
@ -77,8 +77,8 @@ static void attach_test1(abts_case *tc, void *data)
"}"
"],"
"\"ambr\" : { "
"\"uplink\" : 1024000, "
"\"downlink\" : 1024000 "
"\"uplink\" : { \"$numberLong\" : \"1024000\" }, "
"\"downlink\" : { \"$numberLong\" : \"1024000\" } "
"},"
"\"subscribed_rau_tau_timer\" : 12,"
"\"network_access_mode\" : 2, "
@ -102,8 +102,8 @@ static void attach_test1(abts_case *tc, void *data)
"\"apn\" : \"internet\", "
"\"_id\" : { \"$oid\" : \"697223158b8861d7605378c7\" }, "
"\"ambr\" : {"
"\"uplink\" : 1024000, "
"\"downlink\" : 1024000 "
"\"uplink\" : { \"$numberLong\" : \"1024000\" }, "
"\"downlink\" : { \"$numberLong\" : \"1024000\" } "
"},"
"\"qos\" : { "
"\"qci\" : 9, "
@ -117,8 +117,8 @@ static void attach_test1(abts_case *tc, void *data)
"}"
"],"
"\"ambr\" : { "
"\"uplink\" : 1024000, "
"\"downlink\" : 1024000 "
"\"uplink\" : { \"$numberLong\" : \"1024000\" }, "
"\"downlink\" : { \"$numberLong\" : \"1024000\" } "
"},"
"\"subscribed_rau_tau_timer\" : 12,"
"\"network_access_mode\" : 2, "
@ -408,8 +408,8 @@ static void attach_test2(abts_case *tc, void *data)
"\"apn\" : \"internet\", "
"\"_id\" : { \"$oid\" : \"597223158b8861d7605378c7\" }, "
"\"ambr\" : {"
"\"uplink\" : 1024000, "
"\"downlink\" : 1024000 "
"\"uplink\" : { \"$numberLong\" : \"1024000\" }, "
"\"downlink\" : { \"$numberLong\" : \"1024000\" } "
"},"
"\"qos\" : { "
"\"qci\" : 9, "
@ -423,8 +423,8 @@ static void attach_test2(abts_case *tc, void *data)
"}"
"],"
"\"ambr\" : { "
"\"uplink\" : 1024000, "
"\"downlink\" : 1024000 "
"\"uplink\" : { \"$numberLong\" : \"1024000\" }, "
"\"downlink\" : { \"$numberLong\" : \"1024000\" } "
"},"
"\"subscribed_rau_tau_timer\" : 12,"
"\"network_access_mode\" : 2, "
@ -659,8 +659,8 @@ static void attach_test3(abts_case *tc, void *data)
"\"apn\" : \"internet\", "
"\"_id\" : { \"$oid\" : \"597223158b8861d7605378c7\" }, "
"\"ambr\" : {"
"\"uplink\" : 1024000, "
"\"downlink\" : 1024000 "
"\"uplink\" : { \"$numberLong\" : \"1024000\" }, "
"\"downlink\" : { \"$numberLong\" : \"1024000\" } "
"},"
"\"qos\" : { "
"\"qci\" : 9, "
@ -674,8 +674,8 @@ static void attach_test3(abts_case *tc, void *data)
"}"
"],"
"\"ambr\" : { "
"\"uplink\" : 1024000, "
"\"downlink\" : 1024000 "
"\"uplink\" : { \"$numberLong\" : \"1024000\" }, "
"\"downlink\" : { \"$numberLong\" : \"1024000\" } "
"},"
"\"subscribed_rau_tau_timer\" : 12,"
"\"network_access_mode\" : 2, "

View File

@ -38,10 +38,6 @@ static void volte_test1(abts_case *tc, void *data)
"{"
"\"apn\" : \"internet\", "
"\"_id\" : { \"$oid\" : \"597223158b8861d7605378c7\" }, "
"\"ambr\" : {"
"\"uplink\" : 1024000, "
"\"downlink\" : 1024000 "
"},"
"\"qos\" : { "
"\"qci\" : 9, "
"\"arp\" : { "
@ -54,8 +50,8 @@ static void volte_test1(abts_case *tc, void *data)
"}"
"],"
"\"ambr\" : { "
"\"uplink\" : 1024000, "
"\"downlink\" : 1024000 "
"\"uplink\" : { \"$numberLong\" : \"1024000\" }, "
"\"downlink\" : { \"$numberLong\" : \"1024000\" } "
"},"
"\"subscribed_rau_tau_timer\" : 12,"
"\"network_access_mode\" : 2, "
@ -71,9 +67,7 @@ static void volte_test1(abts_case *tc, void *data)
"\"__v\" : 0 "
"}";
#if 1
d_log_set_level(D_MSG_TO_STDOUT, D_LOG_LEVEL_ERROR);
#endif
/* eNB connects to MME */
sock = tests1ap_enb_connect();

View File

@ -20,6 +20,7 @@
"lusca": "^1.4.1",
"method-override": "^2.3.9",
"mongoose": "^4.10.5",
"mongoose-long": "^0.1.1",
"morgan": "^1.8.2",
"next": "^2.3.1",
"next-redux-wrapper": "^1.1.2",

View File

@ -1,5 +1,6 @@
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
require('mongoose-long')(mongoose);
const Subscriber = new Schema({
imsi: { $type: String, unique: true, required: true },
@ -9,7 +10,7 @@ const Subscriber = new Schema({
op: String,
amf: String,
rand: String,
sqn: Number
sqn: Schema.Types.Long
},
access_restriction_data: {
@ -31,8 +32,8 @@ const Subscriber = new Schema({
},
ambr: {
downlink: Number,
uplink: Number
downlink: Schema.Types.Long,
uplink: Schema.Types.Long
},
pdn: [{
@ -53,8 +54,8 @@ const Subscriber = new Schema({
}
},
ambr: {
downlink: Number,
uplink: Number
downlink: Schema.Types.Long,
uplink: Schema.Types.Long
},
pcc_rule: [{
flow: [{
@ -73,12 +74,12 @@ const Subscriber = new Schema({
}
},
mbr: {
downlink: Number,
uplink: Number
downlink: Schema.Types.Long,
uplink: Schema.Types.Long
},
gbr: {
downlink: Number,
uplink: Number
downlink: Schema.Types.Long,
uplink: Schema.Types.Long
},
},
}]

View File

@ -2448,6 +2448,10 @@ mongoose-detective@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/mongoose-detective/-/mongoose-detective-0.1.1.tgz#853b05e2fc100c1cfae6d52171f62626de681fce"
mongoose-long@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/mongoose-long/-/mongoose-long-0.1.1.tgz#cc32e05b0cf50c85e25a19359d43a936fe9505a3"
mongoose@^4.10.5:
version "4.10.6"
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-4.10.6.tgz#cc57dad8c8b9145cbd2ca5696a5081a959e8fcd8"