Loading ccsrc/Protocols/Http/http_codec_mec.cc +6 −3 Viewed Changes for ccsrc/Protocols/Http/http_codec_mec.cc: 6 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -28,13 +28,16 @@ bool http_codec_mec::decode_body_json(const OCTETSTRING &p_data, LibHttp__JsonMe loggers::get_instance().log(">>> http_codec_mec::decode_body_json"); if (_codecs["json"].get() != nullptr) { loggers::get_instance().log("http_codec::decode_body: Call 'json_codec'"); loggers::get_instance().log("http_codec::decode_body_json: Call 'json_codec'"); if (_codecs["json"]->decode(p_data, (Record_Type&)p_json_body, p_params) == -1) { loggers::get_instance().warning("http_codec::decode_body: Failed to decode JSON message"); loggers::get_instance().warning("http_codec::decode_body_json: Failed to decode JSON message"); p_json_body.raw() = CHARSTRING(p_data.lengthof(), (char*)static_cast<const unsigned char*>(p_data)); } else { loggers::get_instance().log_msg("http_codec::decode_body: Decoded message:", p_json_body); loggers::get_instance().log_msg("http_codec::decode_body_json: Decoded message:", p_json_body); } } else { loggers::get_instance().error("http_codec::decode_body_json: Codec not found"); return false; } return true; Loading ccsrc/Protocols/Json/json_codec.cc +104 −53 Viewed Changes for ccsrc/Protocols/Json/json_codec.cc: 104 added lines, 53 removed lines. Original line number Diff line number Diff line Loading @@ -20,26 +20,26 @@ int json_codec::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTE const UEidentityAPI__TypesAndValues::UeIdentityTagInfo& ue_identity_tag_info = msg.ueIdentityTagInfo(); ue_identity_tag_info.encode(UEidentityAPI__TypesAndValues::UeIdentityTagInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_userTrackingSubscription)) { const LocationAPI__TypesAndValues::UserTrackingSubscription& user_tracking_subscription = msg.userTrackingSubscription(); user_tracking_subscription.encode(LocationAPI__TypesAndValues::UserTrackingSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"userTrackingSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_periodicNotificationSubscription)) { const LocationAPI__TypesAndValues::PeriodicNotificationSubscription& periodic_notification_subscription = msg.periodicNotificationSubscription(); periodic_notification_subscription.encode(LocationAPI__TypesAndValues::PeriodicNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"periodicNotificationSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_zonalTrafficSubscription)) { const LocationAPI__TypesAndValues::ZonalTrafficSubscription& zonal_traffic_subscription = msg.zonalTrafficSubscription(); zonal_traffic_subscription.encode(LocationAPI__TypesAndValues::ZonalTrafficSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"zonalTrafficSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_circleNotificationSubscription)) { const LocationAPI__TypesAndValues::CircleNotificationSubscription& notif = msg.circleNotificationSubscription(); notif.encode(LocationAPI__TypesAndValues::CircleNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"circleNotificationSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_distanceNotificationSubscription)) { const LocationAPI__TypesAndValues::DistanceNotificationSubscription& notif = msg.distanceNotificationSubscription(); notif.encode(LocationAPI__TypesAndValues::DistanceNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"distanceNotificationSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_userLocationEventSubscription)) { const LocationAPI__TypesAndValues::UserLocationEventSubscription& user_location_event_subscription = msg.userLocationEventSubscription(); user_location_event_subscription.encode(LocationAPI__TypesAndValues::UserLocationEventSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"userLocationEventSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_userLocationPeriodicSubscription)) { const LocationAPI__TypesAndValues::UserLocationPeriodicSubscription& user_location_periodic_subscription = msg.userLocationPeriodicSubscription(); user_location_periodic_subscription.encode(LocationAPI__TypesAndValues::UserLocationPeriodicSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"userLocationPeriodicSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_zoneLocationEventSubscription)) { const LocationAPI__TypesAndValues::ZoneLocationEventSubscription& zone_location_event_subscription = msg.zoneLocationEventSubscription(); zone_location_event_subscription.encode(LocationAPI__TypesAndValues::ZoneLocationEventSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"zoneLocationEventSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_userAreaSubscription)) { const LocationAPI__TypesAndValues::UserAreaSubscription& notif = msg.userAreaSubscription(); notif.encode(LocationAPI__TypesAndValues::UserAreaSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"userAreaSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_userDistanceSubscription)) { const LocationAPI__TypesAndValues::UserDistanceSubscription& notif = msg.userDistanceSubscription(); notif.encode(LocationAPI__TypesAndValues::UserDistanceSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"userDistanceSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_cellChangeSubscription)) { const RnisAPI__TypesAndValues::CellChangeSubscription& cell_change_subscription = msg.cellChangeSubscription(); cell_change_subscription.encode(RnisAPI__TypesAndValues::CellChangeSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); Loading @@ -52,10 +52,22 @@ int json_codec::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTE const EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceInfo& service_info = msg.serviceInfo(); service_info.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"ServiceInfo\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appInfo__regapps)) { const EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo& app_info = msg.appInfo__regapps(); app_info.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"AppInfo\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appTerminationNotificationSubscription)) { const EdgePlatformApplicationEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription& app = msg.appTerminationNotificationSubscription(); app.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"AppTerminationNotificationSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appTerminationConfirmation)) { const EdgePlatformApplicationEnablementAPI__TypesAndValues::AppTerminationConfirmation& app = msg.appTerminationConfirmation(); app.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppTerminationConfirmation_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"AppTerminationConfirmation\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appReadyConfirmation)) { const EdgePlatformApplicationEnablementAPI__TypesAndValues::AppReadyConfirmation& app = msg.appReadyConfirmation(); app.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppReadyConfirmation_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"AppTerminationConfirmation\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_dnsRule)) { const EdgePlatformApplicationEnablementAPI__TypesAndValues::DnsRule& dns_rule = msg.dnsRule(); dns_rule.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::DnsRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); Loading @@ -67,27 +79,49 @@ int json_codec::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTE } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_trafficRule)) { const EdgePlatformApplicationEnablementAPI__TypesAndValues::TrafficRule& traffic_rule = msg.trafficRule(); traffic_rule.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::TrafficRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_bwInfo)) { const TrafficManagementAPI__TypesAndValues::BwInfo& bw_info = msg.bwInfo(); bw_info.encode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_mtsSessionInfo)) { const TrafficManagementAPI__TypesAndValues::MtsSessionInfo& mts_session_info = msg.mtsSessionInfo(); mts_session_info.encode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_predictedQos)) { const V2XInformationServiceAPI__TypesAndValues::PredictedQos& predicted_qos = msg.predictedQos(); predicted_qos.encode(V2XInformationServiceAPI__TypesAndValues::PredictedQos_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_v2xMsgDistributionServerInfo)) { const V2XInformationServiceAPI__TypesAndValues::V2xMsgDistributionServerInfo& v2x_msg_distribution_server_info = msg.v2xMsgDistributionServerInfo(); v2x_msg_distribution_server_info.encode(V2XInformationServiceAPI__TypesAndValues::V2xMsgDistributionServerInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_provChgUuUniSubscription)) { const V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniSubscription& prov_chg_uu_uni_subscription = msg.provChgUuUniSubscription(); prov_chg_uu_uni_subscription.encode(V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_provChgUuMbmsSubscription)) { const V2XInformationServiceAPI__TypesAndValues::ProvChgUuMbmsSubscription& prov_chg_uu_mbms_subscription = msg.provChgUuMbmsSubscription(); prov_chg_uu_mbms_subscription.encode(V2XInformationServiceAPI__TypesAndValues::ProvChgUuMbmsSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_provChgPc5Subscription)) { const V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Subscription& prov_chg_pc5_subscription = msg.provChgPc5Subscription(); prov_chg_pc5_subscription.encode(V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Subscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_v2xMsgSubscription)) { const V2XInformationServiceAPI__TypesAndValues::V2xMsgSubscription& v2x_msg_subscription = msg.v2xMsgSubscription(); v2x_msg_subscription.encode(V2XInformationServiceAPI__TypesAndValues::V2xMsgSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_assocStaSubscription)) { const WlanInformationAPI__TypesAndValues::AssocStaSubscription& assoc_sta_subscription = msg.assocStaSubscription(); assoc_sta_subscription.encode(WlanInformationAPI__TypesAndValues::AssocStaSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_staDataRateSubscription)) { const WlanInformationAPI__TypesAndValues::StaDataRateSubscription& sta_data_rate_subscription = msg.staDataRateSubscription(); sta_data_rate_subscription.encode(WlanInformationAPI__TypesAndValues::StaDataRateSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else { loggers::get_instance().error("json_codec::encode: Not supported"); } Loading Loading @@ -146,44 +180,44 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes LocationAPI__TypesAndValues::AccessPointList access_point_list; access_point_list.decode(LocationAPI__TypesAndValues::AccessPointList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.accessPointList() = access_point_list; } else if (it->second.find("\"userTrackingSubscription\"") != std::string::npos) { } else if (it->second.find("\"userLocationEventSubscription\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); LocationAPI__TypesAndValues::UserTrackingSubscription user_tracking_subscription; user_tracking_subscription.decode(LocationAPI__TypesAndValues::UserTrackingSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userTrackingSubscription() = user_tracking_subscription; LocationAPI__TypesAndValues::UserLocationEventSubscription user_location_event_subscription; user_location_event_subscription.decode(LocationAPI__TypesAndValues::UserLocationEventSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userLocationEventSubscription() = user_location_event_subscription; } else if (it->second.find("\"periodicNotificationSubscription\"") != std::string::npos) { } else if (it->second.find("\"userLocationPeriodicSubscription\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); LocationAPI__TypesAndValues::PeriodicNotificationSubscription periodic_notification_subscription; periodic_notification_subscription.decode(LocationAPI__TypesAndValues::PeriodicNotificationSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.periodicNotificationSubscription() = periodic_notification_subscription; } else if (it->second.find("\"zonalTrafficSubscription\"") != std::string::npos) { LocationAPI__TypesAndValues::UserLocationPeriodicSubscription user_location_periodic_subscription; user_location_periodic_subscription.decode(LocationAPI__TypesAndValues::UserLocationPeriodicSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userLocationPeriodicSubscription() = user_location_periodic_subscription; } else if (it->second.find("\"zoneLocationEventSubscription\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); LocationAPI__TypesAndValues::ZonalTrafficSubscription zonal_traffic_subscription; zonal_traffic_subscription.decode(LocationAPI__TypesAndValues::ZonalTrafficSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.zonalTrafficSubscription() = zonal_traffic_subscription; } else if (it->second.find("\"periodicTrackingSubscription\"") != std::string::npos) { LocationAPI__TypesAndValues::ZoneLocationEventSubscription zone_location_event_subscription; zone_location_event_subscription.decode(LocationAPI__TypesAndValues::ZoneLocationEventSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.zoneLocationEventSubscription() = zone_location_event_subscription; } else if (it->second.find("\"userLocationPeriodicSubscription\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); LocationAPI__TypesAndValues::PeriodicTrackingSubscription periodic_tracking_subscription; periodic_tracking_subscription.decode(LocationAPI__TypesAndValues::PeriodicTrackingSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.periodicTrackingSubscription() = periodic_tracking_subscription; LocationAPI__TypesAndValues::UserLocationPeriodicSubscription periodic_tracking_subscription; periodic_tracking_subscription.decode(LocationAPI__TypesAndValues::UserLocationPeriodicSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userLocationPeriodicSubscription() = periodic_tracking_subscription; } else if (it->second.find("\"accessPointId\"") != std::string::npos) { LocationAPI__TypesAndValues::UserInfo user_info; user_info.decode(LocationAPI__TypesAndValues::UserInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); Loading @@ -201,17 +235,17 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); LocationAPI__TypesAndValues::CircleNotificationSubscription notif; notif.decode(LocationAPI__TypesAndValues::CircleNotificationSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.circleNotificationSubscription() = notif; } else if (it->second.find("\"distanceNotificationSubscription\"") != std::string::npos) { LocationAPI__TypesAndValues::UserAreaSubscription notif; notif.decode(LocationAPI__TypesAndValues::UserAreaSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userAreaSubscription() = notif; } else if (it->second.find("\"userDistanceSubscription\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); LocationAPI__TypesAndValues::DistanceNotificationSubscription notif; notif.decode(LocationAPI__TypesAndValues::DistanceNotificationSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.distanceNotificationSubscription() = notif; LocationAPI__TypesAndValues::UserDistanceSubscription notif; notif.decode(LocationAPI__TypesAndValues::UserDistanceSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userDistanceSubscription() = notif; } else if (it->second.find("\"ueIdentityTagInfo\"") != std::string::npos) { UEidentityAPI__TypesAndValues::UeIdentityTagInfo ue_identity_tag_info; ue_identity_tag_info.decode(UEidentityAPI__TypesAndValues::UeIdentityTagInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); Loading @@ -226,7 +260,11 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes std::size_t it_stop = it_start + 4; loggers::get_instance().log("json_codec::decode: id_stop=%d", it_stop); loggers::get_instance().log("json_codec::decode: segment=%s", str.substr(it_start, it_stop - it_start).c_str()); if ((str[it_start - 3] == 'n') || (str[it_start - 3] == 's')) { // fqdn or uris or addresses str = str.substr(0, it_start) + "[]" + str.substr(it_stop); } else { str = str.substr(0, it_start) + "{}" + str.substr(it_stop); } loggers::get_instance().log("json_codec::decode: After, str=%s", str.c_str()); } // End of 'while' statement decoding_buffer.clear(); Loading Loading @@ -329,19 +367,23 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes RnisAPI__TypesAndValues::RabRelSubscription rab_rel_subscription; rab_rel_subscription.decode(RnisAPI__TypesAndValues::RabRelSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.rabRelSubscription() = rab_rel_subscription; } else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions") != std::string::npos)) { // SubscriptionLinkList } else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions\"") != std::string::npos)) { // SubscriptionLinkList // FIXME Conflict with MEC-028 SubscriptionLinkList data type RnisAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; subscription_link_list.decode(RnisAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.subscriptionLinkList() = subscription_link_list; } else if (it->second.find("\"AppContext\"") != std::string::npos) { } else if (it->second.find("\"associateDevAppId\"") != std::string::npos) { UEAppInterfaceAPI__TypesAndValues::AppContext appContext; appContext.decode(UEAppInterfaceAPI__TypesAndValues::AppContext_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.appContext() = appContext; } else if (it->second.find("\"AppInfo\"") != std::string::npos) { } else if (it->second.find("\"appInfo\"") != std::string::npos) { UEAppInterfaceAPI__TypesAndValues::AppInfo appInfo; appInfo.decode(UEAppInterfaceAPI__TypesAndValues::AppInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.appInfo() = appInfo; } else if (it->second.find("\"appName\"") != std::string::npos) { EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo appInfo; appInfo.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.appInfo__regapps() = appInfo; } else if ((it->second.find("\"bwInfo\"") != std::string::npos) || (it->second.find("\"fixedBWPriority\"") != std::string::npos)) { // Need to change some enumerated string not supported by TTCN-3 language while (true) { Loading Loading @@ -413,6 +455,11 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); prov_chg_pc5_subscription.decode(V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Subscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.provChgPc5Subscription() = prov_chg_pc5_subscription; } else if (it->second.find("\"V2xMsgSubscription\"") != std::string::npos) { V2XInformationServiceAPI__TypesAndValues::V2xMsgSubscription v2x_msg_subscription; TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); v2x_msg_subscription.decode(V2XInformationServiceAPI__TypesAndValues::V2xMsgSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.v2xMsgSubscription() = v2x_msg_subscription; } else if (it->second.find("\"ProvChgUuUniNotification\"") != std::string::npos) { Loading @@ -430,7 +477,11 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); prov_chg_pc5_notification.decode(V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Notification_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.provChgPc5Notification() = prov_chg_pc5_notification; } else if (it->second.find("\"v2xMsgDistributionServer\"") != std::string::npos) { V2XInformationServiceAPI__TypesAndValues::V2xMsgDistributionServerInfo v2x_msg_distribution_server_info; TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); v2x_msg_distribution_server_info.decode(V2XInformationServiceAPI__TypesAndValues::V2xMsgDistributionServerInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.v2xMsgDistributionServerInfo() = v2x_msg_distribution_server_info; } else if (it->second.find("\"AssocStaSubscription\"") != std::string::npos) { if (it->second.find("\"subscription\"") != std::string::npos) { // SubscriptionLinkList Loading etc/AtsMec_V2XInformationService/AtsMec_V2XInformationService.cfg→etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement_Mockoon.cf_ +15 −11 Viewed Changes for etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement_Mockoon.cf_: 15 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -8,25 +8,26 @@ LibCommon_Time.PX_TAC := 30.0 LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; LibHttp_Pics.PICS_HEADER_HOST := "sandbox-mec.etsi.org" #"192.168.1.39" LibHttp_Pics.PICS_HEADER_HOST := "try-mec.etsi.org" #"192.168.1.39" LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibHttp_Pics.PICS_USE_TOKEN_HEADER := true #LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" LibMec_Pics.PICS_ROOT_API := "/sbx8tunqyy/mep1" # Need to sign in on https://sandbox-mec.etsi.org/, section 'Try-it from your MEC application' LibMec_Pics.PICS_ROOT_API := "/sbx1y8q0x9/mep1" # Need to sign in on https://try-mec.etsi.org/, section 'Try-it from your MEC application' # LibMec_Pixits LibMec_Pics.PICS_MEC_PLAT := true [LOGGING] # In this section you can specify the name of the log file and the classes of events # you want to log into the file or display on console (standard error). LogFile := "../logs/AtsMec_V2XInformationService/%e.%h-%r.%s" #FileMask := LOG_ALL | USER | DEBUG | MATCHING #ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT LogFile := "../logs/AtsMec/%e.%h-%r.%s" FileMask := LOG_ALL | USER | DEBUG | MATCHING ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING #FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE #ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE LogSourceInfo := Stack LogEntityName:= Yes LogEventTypes:= Yes Loading @@ -34,8 +35,10 @@ LogEventTypes:= Yes [TESTPORT_PARAMETERS] # In this section you can specify parameters that are passed to Test Ports. system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=sandbox-mec.etsi.org,port=443,use_ssl=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1,mutual_auth=1,mutual_tls=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" #system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.168.1.39,port=30030,use_ssl=0)" system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" #system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1)" system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=80,use_ssl=0)" [DEFINE] # In this section you can create macro definitions, Loading @@ -60,7 +63,8 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server [EXECUTE] # In this section you can specify what parts of your test suite you want to execute. AtsMec_TestControl.control #AtsMec_TestControl.control [GROUPS] # In this section you can specify groups of hosts. These groups can be used inside the Loading etc/AtsMec_IoT/AtsMec_IoT_Mockoon.cf_ 0 → 100644 +81 −0 Viewed Changes for etc/AtsMec_IoT/AtsMec_IoT_Mockoon.cf_: 81 added lines, 0 removed lines. Original line number Diff line number Diff line [MODULE_PARAMETERS] # This section shall contain the values of all parameters that are defined in your TTCN-3 modules. # IUT roles LibCommon_Time.PX_TAC := 30.0 #LibCommon_Time.PX_TWAIT := 30.0 LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; LibHttp_Pics.PICS_HEADER_HOST := "try-mec.etsi.org" #"192.168.1.39" LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibHttp_Pics.PICS_USE_TOKEN_HEADER := true #LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" LibMec_Pics.PICS_ROOT_API := "/sbx1y8q0x9/mep1" # Need to sign in on https://try-mec.etsi.org/, section 'Try-it from your MEC application' # LibMec_Pixits [LOGGING] # In this section you can specify the name of the log file and the classes of events # you want to log into the file or display on console (standard error). LogFile := "../logs/AtsMec/%e.%h-%r.%s" FileMask := LOG_ALL | USER | DEBUG | MATCHING ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING #FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE #ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE LogSourceInfo := Stack LogEntityName:= Yes LogEventTypes:= Yes #TimeStampFormat := DateTime [TESTPORT_PARAMETERS] # In this section you can specify parameters that are passed to Test Ports. #system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.168.1.39,port=30030,use_ssl=0)" system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" #system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1)" system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=80,use_ssl=0)" [DEFINE] # In this section you can create macro definitions, # that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. [INCLUDE] # To use configuration settings given in other configuration files, # the configuration files just need to be listed in this section, with their full or relative pathnames. [ORDERED_INCLUDE] # To use configuration settings given in other configuration files, # the configuration files just need to be listed in this section, with their full or relative pathnames. [EXTERNAL_COMMANDS] # This section can define external commands (shell scripts) to be executed by the ETS # whenever a control part or test case is started or terminated. #BeginTestCase := "" #EndTestCase := "" #BeginControlPart := "" #EndControlPart := "" [EXECUTE] # In this section you can specify what parts of your test suite you want to execute. #AtsMec_TestControl.control [GROUPS] # In this section you can specify groups of hosts. These groups can be used inside the # [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. [COMPONENTS] # This section consists of rules restricting the location of created PTCs. [MAIN_CONTROLLER] # The options herein control the behavior of MC. KillTimer := 10.0 LocalAddress := 127.0.0.1 TCPPort := 12000 NumHCs := 1 etc/AtsMec_Location/AtsMec_Location_Lewis.cf_ +2 −2 Viewed Changes for etc/AtsMec_Location/AtsMec_Location_Lewis.cf_: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -17,8 +17,8 @@ LibHttp_Pics.PICS_USE_TOKEN_HEADER := true LibMec_Pics.PICS_ROOT_API := "etsi-013" # LibMex_Pixits LibMec_Pixits.PX_ME_APP_Q_ZONE_ID_URI := "/location/v2/zones" LibMec_Pixits.PX_ME_APP_Q_USERS_LIST_URI := "/location/v2/users" LibMec_Pixits.PX_ME_APP_Q_ZONE_ID_URI := "/location/v3/zones" LibMec_Pixits.PX_ME_APP_Q_USERS_LIST_URI := "/location/v3/users" LibMec_Pixits.PX_RNIS_SUBSCRITIONS_URI := "/rni/v1/subscriptions" LibMec_Pixits.PX_RNIS_QUERIES_URI := "/rni/v1/queries" LibMec_Pixits.PX_MEC_SVC_MGMT_APPS_URI := "/mec_service_mgmt/v1/applications" Loading Loading
ccsrc/Protocols/Http/http_codec_mec.cc +6 −3 Viewed Changes for ccsrc/Protocols/Http/http_codec_mec.cc: 6 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -28,13 +28,16 @@ bool http_codec_mec::decode_body_json(const OCTETSTRING &p_data, LibHttp__JsonMe loggers::get_instance().log(">>> http_codec_mec::decode_body_json"); if (_codecs["json"].get() != nullptr) { loggers::get_instance().log("http_codec::decode_body: Call 'json_codec'"); loggers::get_instance().log("http_codec::decode_body_json: Call 'json_codec'"); if (_codecs["json"]->decode(p_data, (Record_Type&)p_json_body, p_params) == -1) { loggers::get_instance().warning("http_codec::decode_body: Failed to decode JSON message"); loggers::get_instance().warning("http_codec::decode_body_json: Failed to decode JSON message"); p_json_body.raw() = CHARSTRING(p_data.lengthof(), (char*)static_cast<const unsigned char*>(p_data)); } else { loggers::get_instance().log_msg("http_codec::decode_body: Decoded message:", p_json_body); loggers::get_instance().log_msg("http_codec::decode_body_json: Decoded message:", p_json_body); } } else { loggers::get_instance().error("http_codec::decode_body_json: Codec not found"); return false; } return true; Loading
ccsrc/Protocols/Json/json_codec.cc +104 −53 Viewed Changes for ccsrc/Protocols/Json/json_codec.cc: 104 added lines, 53 removed lines. Original line number Diff line number Diff line Loading @@ -20,26 +20,26 @@ int json_codec::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTE const UEidentityAPI__TypesAndValues::UeIdentityTagInfo& ue_identity_tag_info = msg.ueIdentityTagInfo(); ue_identity_tag_info.encode(UEidentityAPI__TypesAndValues::UeIdentityTagInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_userTrackingSubscription)) { const LocationAPI__TypesAndValues::UserTrackingSubscription& user_tracking_subscription = msg.userTrackingSubscription(); user_tracking_subscription.encode(LocationAPI__TypesAndValues::UserTrackingSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"userTrackingSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_periodicNotificationSubscription)) { const LocationAPI__TypesAndValues::PeriodicNotificationSubscription& periodic_notification_subscription = msg.periodicNotificationSubscription(); periodic_notification_subscription.encode(LocationAPI__TypesAndValues::PeriodicNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"periodicNotificationSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_zonalTrafficSubscription)) { const LocationAPI__TypesAndValues::ZonalTrafficSubscription& zonal_traffic_subscription = msg.zonalTrafficSubscription(); zonal_traffic_subscription.encode(LocationAPI__TypesAndValues::ZonalTrafficSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"zonalTrafficSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_circleNotificationSubscription)) { const LocationAPI__TypesAndValues::CircleNotificationSubscription& notif = msg.circleNotificationSubscription(); notif.encode(LocationAPI__TypesAndValues::CircleNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"circleNotificationSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_distanceNotificationSubscription)) { const LocationAPI__TypesAndValues::DistanceNotificationSubscription& notif = msg.distanceNotificationSubscription(); notif.encode(LocationAPI__TypesAndValues::DistanceNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"distanceNotificationSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_userLocationEventSubscription)) { const LocationAPI__TypesAndValues::UserLocationEventSubscription& user_location_event_subscription = msg.userLocationEventSubscription(); user_location_event_subscription.encode(LocationAPI__TypesAndValues::UserLocationEventSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"userLocationEventSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_userLocationPeriodicSubscription)) { const LocationAPI__TypesAndValues::UserLocationPeriodicSubscription& user_location_periodic_subscription = msg.userLocationPeriodicSubscription(); user_location_periodic_subscription.encode(LocationAPI__TypesAndValues::UserLocationPeriodicSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"userLocationPeriodicSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_zoneLocationEventSubscription)) { const LocationAPI__TypesAndValues::ZoneLocationEventSubscription& zone_location_event_subscription = msg.zoneLocationEventSubscription(); zone_location_event_subscription.encode(LocationAPI__TypesAndValues::ZoneLocationEventSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"zoneLocationEventSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_userAreaSubscription)) { const LocationAPI__TypesAndValues::UserAreaSubscription& notif = msg.userAreaSubscription(); notif.encode(LocationAPI__TypesAndValues::UserAreaSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"userAreaSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_userDistanceSubscription)) { const LocationAPI__TypesAndValues::UserDistanceSubscription& notif = msg.userDistanceSubscription(); notif.encode(LocationAPI__TypesAndValues::UserDistanceSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"userDistanceSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_cellChangeSubscription)) { const RnisAPI__TypesAndValues::CellChangeSubscription& cell_change_subscription = msg.cellChangeSubscription(); cell_change_subscription.encode(RnisAPI__TypesAndValues::CellChangeSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); Loading @@ -52,10 +52,22 @@ int json_codec::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTE const EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceInfo& service_info = msg.serviceInfo(); service_info.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"ServiceInfo\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appInfo__regapps)) { const EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo& app_info = msg.appInfo__regapps(); app_info.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"AppInfo\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appTerminationNotificationSubscription)) { const EdgePlatformApplicationEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription& app = msg.appTerminationNotificationSubscription(); app.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"AppTerminationNotificationSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appTerminationConfirmation)) { const EdgePlatformApplicationEnablementAPI__TypesAndValues::AppTerminationConfirmation& app = msg.appTerminationConfirmation(); app.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppTerminationConfirmation_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"AppTerminationConfirmation\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appReadyConfirmation)) { const EdgePlatformApplicationEnablementAPI__TypesAndValues::AppReadyConfirmation& app = msg.appReadyConfirmation(); app.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppReadyConfirmation_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"AppTerminationConfirmation\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_dnsRule)) { const EdgePlatformApplicationEnablementAPI__TypesAndValues::DnsRule& dns_rule = msg.dnsRule(); dns_rule.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::DnsRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); Loading @@ -67,27 +79,49 @@ int json_codec::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTE } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_trafficRule)) { const EdgePlatformApplicationEnablementAPI__TypesAndValues::TrafficRule& traffic_rule = msg.trafficRule(); traffic_rule.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::TrafficRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_bwInfo)) { const TrafficManagementAPI__TypesAndValues::BwInfo& bw_info = msg.bwInfo(); bw_info.encode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_mtsSessionInfo)) { const TrafficManagementAPI__TypesAndValues::MtsSessionInfo& mts_session_info = msg.mtsSessionInfo(); mts_session_info.encode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_predictedQos)) { const V2XInformationServiceAPI__TypesAndValues::PredictedQos& predicted_qos = msg.predictedQos(); predicted_qos.encode(V2XInformationServiceAPI__TypesAndValues::PredictedQos_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_v2xMsgDistributionServerInfo)) { const V2XInformationServiceAPI__TypesAndValues::V2xMsgDistributionServerInfo& v2x_msg_distribution_server_info = msg.v2xMsgDistributionServerInfo(); v2x_msg_distribution_server_info.encode(V2XInformationServiceAPI__TypesAndValues::V2xMsgDistributionServerInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_provChgUuUniSubscription)) { const V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniSubscription& prov_chg_uu_uni_subscription = msg.provChgUuUniSubscription(); prov_chg_uu_uni_subscription.encode(V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_provChgUuMbmsSubscription)) { const V2XInformationServiceAPI__TypesAndValues::ProvChgUuMbmsSubscription& prov_chg_uu_mbms_subscription = msg.provChgUuMbmsSubscription(); prov_chg_uu_mbms_subscription.encode(V2XInformationServiceAPI__TypesAndValues::ProvChgUuMbmsSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_provChgPc5Subscription)) { const V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Subscription& prov_chg_pc5_subscription = msg.provChgPc5Subscription(); prov_chg_pc5_subscription.encode(V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Subscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_v2xMsgSubscription)) { const V2XInformationServiceAPI__TypesAndValues::V2xMsgSubscription& v2x_msg_subscription = msg.v2xMsgSubscription(); v2x_msg_subscription.encode(V2XInformationServiceAPI__TypesAndValues::V2xMsgSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_assocStaSubscription)) { const WlanInformationAPI__TypesAndValues::AssocStaSubscription& assoc_sta_subscription = msg.assocStaSubscription(); assoc_sta_subscription.encode(WlanInformationAPI__TypesAndValues::AssocStaSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_staDataRateSubscription)) { const WlanInformationAPI__TypesAndValues::StaDataRateSubscription& sta_data_rate_subscription = msg.staDataRateSubscription(); sta_data_rate_subscription.encode(WlanInformationAPI__TypesAndValues::StaDataRateSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else { loggers::get_instance().error("json_codec::encode: Not supported"); } Loading Loading @@ -146,44 +180,44 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes LocationAPI__TypesAndValues::AccessPointList access_point_list; access_point_list.decode(LocationAPI__TypesAndValues::AccessPointList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.accessPointList() = access_point_list; } else if (it->second.find("\"userTrackingSubscription\"") != std::string::npos) { } else if (it->second.find("\"userLocationEventSubscription\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); LocationAPI__TypesAndValues::UserTrackingSubscription user_tracking_subscription; user_tracking_subscription.decode(LocationAPI__TypesAndValues::UserTrackingSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userTrackingSubscription() = user_tracking_subscription; LocationAPI__TypesAndValues::UserLocationEventSubscription user_location_event_subscription; user_location_event_subscription.decode(LocationAPI__TypesAndValues::UserLocationEventSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userLocationEventSubscription() = user_location_event_subscription; } else if (it->second.find("\"periodicNotificationSubscription\"") != std::string::npos) { } else if (it->second.find("\"userLocationPeriodicSubscription\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); LocationAPI__TypesAndValues::PeriodicNotificationSubscription periodic_notification_subscription; periodic_notification_subscription.decode(LocationAPI__TypesAndValues::PeriodicNotificationSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.periodicNotificationSubscription() = periodic_notification_subscription; } else if (it->second.find("\"zonalTrafficSubscription\"") != std::string::npos) { LocationAPI__TypesAndValues::UserLocationPeriodicSubscription user_location_periodic_subscription; user_location_periodic_subscription.decode(LocationAPI__TypesAndValues::UserLocationPeriodicSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userLocationPeriodicSubscription() = user_location_periodic_subscription; } else if (it->second.find("\"zoneLocationEventSubscription\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); LocationAPI__TypesAndValues::ZonalTrafficSubscription zonal_traffic_subscription; zonal_traffic_subscription.decode(LocationAPI__TypesAndValues::ZonalTrafficSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.zonalTrafficSubscription() = zonal_traffic_subscription; } else if (it->second.find("\"periodicTrackingSubscription\"") != std::string::npos) { LocationAPI__TypesAndValues::ZoneLocationEventSubscription zone_location_event_subscription; zone_location_event_subscription.decode(LocationAPI__TypesAndValues::ZoneLocationEventSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.zoneLocationEventSubscription() = zone_location_event_subscription; } else if (it->second.find("\"userLocationPeriodicSubscription\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); LocationAPI__TypesAndValues::PeriodicTrackingSubscription periodic_tracking_subscription; periodic_tracking_subscription.decode(LocationAPI__TypesAndValues::PeriodicTrackingSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.periodicTrackingSubscription() = periodic_tracking_subscription; LocationAPI__TypesAndValues::UserLocationPeriodicSubscription periodic_tracking_subscription; periodic_tracking_subscription.decode(LocationAPI__TypesAndValues::UserLocationPeriodicSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userLocationPeriodicSubscription() = periodic_tracking_subscription; } else if (it->second.find("\"accessPointId\"") != std::string::npos) { LocationAPI__TypesAndValues::UserInfo user_info; user_info.decode(LocationAPI__TypesAndValues::UserInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); Loading @@ -201,17 +235,17 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); LocationAPI__TypesAndValues::CircleNotificationSubscription notif; notif.decode(LocationAPI__TypesAndValues::CircleNotificationSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.circleNotificationSubscription() = notif; } else if (it->second.find("\"distanceNotificationSubscription\"") != std::string::npos) { LocationAPI__TypesAndValues::UserAreaSubscription notif; notif.decode(LocationAPI__TypesAndValues::UserAreaSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userAreaSubscription() = notif; } else if (it->second.find("\"userDistanceSubscription\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); LocationAPI__TypesAndValues::DistanceNotificationSubscription notif; notif.decode(LocationAPI__TypesAndValues::DistanceNotificationSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.distanceNotificationSubscription() = notif; LocationAPI__TypesAndValues::UserDistanceSubscription notif; notif.decode(LocationAPI__TypesAndValues::UserDistanceSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userDistanceSubscription() = notif; } else if (it->second.find("\"ueIdentityTagInfo\"") != std::string::npos) { UEidentityAPI__TypesAndValues::UeIdentityTagInfo ue_identity_tag_info; ue_identity_tag_info.decode(UEidentityAPI__TypesAndValues::UeIdentityTagInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); Loading @@ -226,7 +260,11 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes std::size_t it_stop = it_start + 4; loggers::get_instance().log("json_codec::decode: id_stop=%d", it_stop); loggers::get_instance().log("json_codec::decode: segment=%s", str.substr(it_start, it_stop - it_start).c_str()); if ((str[it_start - 3] == 'n') || (str[it_start - 3] == 's')) { // fqdn or uris or addresses str = str.substr(0, it_start) + "[]" + str.substr(it_stop); } else { str = str.substr(0, it_start) + "{}" + str.substr(it_stop); } loggers::get_instance().log("json_codec::decode: After, str=%s", str.c_str()); } // End of 'while' statement decoding_buffer.clear(); Loading Loading @@ -329,19 +367,23 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes RnisAPI__TypesAndValues::RabRelSubscription rab_rel_subscription; rab_rel_subscription.decode(RnisAPI__TypesAndValues::RabRelSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.rabRelSubscription() = rab_rel_subscription; } else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions") != std::string::npos)) { // SubscriptionLinkList } else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions\"") != std::string::npos)) { // SubscriptionLinkList // FIXME Conflict with MEC-028 SubscriptionLinkList data type RnisAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; subscription_link_list.decode(RnisAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.subscriptionLinkList() = subscription_link_list; } else if (it->second.find("\"AppContext\"") != std::string::npos) { } else if (it->second.find("\"associateDevAppId\"") != std::string::npos) { UEAppInterfaceAPI__TypesAndValues::AppContext appContext; appContext.decode(UEAppInterfaceAPI__TypesAndValues::AppContext_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.appContext() = appContext; } else if (it->second.find("\"AppInfo\"") != std::string::npos) { } else if (it->second.find("\"appInfo\"") != std::string::npos) { UEAppInterfaceAPI__TypesAndValues::AppInfo appInfo; appInfo.decode(UEAppInterfaceAPI__TypesAndValues::AppInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.appInfo() = appInfo; } else if (it->second.find("\"appName\"") != std::string::npos) { EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo appInfo; appInfo.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.appInfo__regapps() = appInfo; } else if ((it->second.find("\"bwInfo\"") != std::string::npos) || (it->second.find("\"fixedBWPriority\"") != std::string::npos)) { // Need to change some enumerated string not supported by TTCN-3 language while (true) { Loading Loading @@ -413,6 +455,11 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); prov_chg_pc5_subscription.decode(V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Subscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.provChgPc5Subscription() = prov_chg_pc5_subscription; } else if (it->second.find("\"V2xMsgSubscription\"") != std::string::npos) { V2XInformationServiceAPI__TypesAndValues::V2xMsgSubscription v2x_msg_subscription; TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); v2x_msg_subscription.decode(V2XInformationServiceAPI__TypesAndValues::V2xMsgSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.v2xMsgSubscription() = v2x_msg_subscription; } else if (it->second.find("\"ProvChgUuUniNotification\"") != std::string::npos) { Loading @@ -430,7 +477,11 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); prov_chg_pc5_notification.decode(V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Notification_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.provChgPc5Notification() = prov_chg_pc5_notification; } else if (it->second.find("\"v2xMsgDistributionServer\"") != std::string::npos) { V2XInformationServiceAPI__TypesAndValues::V2xMsgDistributionServerInfo v2x_msg_distribution_server_info; TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); v2x_msg_distribution_server_info.decode(V2XInformationServiceAPI__TypesAndValues::V2xMsgDistributionServerInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.v2xMsgDistributionServerInfo() = v2x_msg_distribution_server_info; } else if (it->second.find("\"AssocStaSubscription\"") != std::string::npos) { if (it->second.find("\"subscription\"") != std::string::npos) { // SubscriptionLinkList Loading
etc/AtsMec_V2XInformationService/AtsMec_V2XInformationService.cfg→etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement_Mockoon.cf_ +15 −11 Viewed Changes for etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement_Mockoon.cf_: 15 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -8,25 +8,26 @@ LibCommon_Time.PX_TAC := 30.0 LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; LibHttp_Pics.PICS_HEADER_HOST := "sandbox-mec.etsi.org" #"192.168.1.39" LibHttp_Pics.PICS_HEADER_HOST := "try-mec.etsi.org" #"192.168.1.39" LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibHttp_Pics.PICS_USE_TOKEN_HEADER := true #LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" LibMec_Pics.PICS_ROOT_API := "/sbx8tunqyy/mep1" # Need to sign in on https://sandbox-mec.etsi.org/, section 'Try-it from your MEC application' LibMec_Pics.PICS_ROOT_API := "/sbx1y8q0x9/mep1" # Need to sign in on https://try-mec.etsi.org/, section 'Try-it from your MEC application' # LibMec_Pixits LibMec_Pics.PICS_MEC_PLAT := true [LOGGING] # In this section you can specify the name of the log file and the classes of events # you want to log into the file or display on console (standard error). LogFile := "../logs/AtsMec_V2XInformationService/%e.%h-%r.%s" #FileMask := LOG_ALL | USER | DEBUG | MATCHING #ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT LogFile := "../logs/AtsMec/%e.%h-%r.%s" FileMask := LOG_ALL | USER | DEBUG | MATCHING ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING #FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE #ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE LogSourceInfo := Stack LogEntityName:= Yes LogEventTypes:= Yes Loading @@ -34,8 +35,10 @@ LogEventTypes:= Yes [TESTPORT_PARAMETERS] # In this section you can specify parameters that are passed to Test Ports. system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=sandbox-mec.etsi.org,port=443,use_ssl=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1,mutual_auth=1,mutual_tls=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" #system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.168.1.39,port=30030,use_ssl=0)" system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" #system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1)" system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=80,use_ssl=0)" [DEFINE] # In this section you can create macro definitions, Loading @@ -60,7 +63,8 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server [EXECUTE] # In this section you can specify what parts of your test suite you want to execute. AtsMec_TestControl.control #AtsMec_TestControl.control [GROUPS] # In this section you can specify groups of hosts. These groups can be used inside the Loading
etc/AtsMec_IoT/AtsMec_IoT_Mockoon.cf_ 0 → 100644 +81 −0 Viewed Changes for etc/AtsMec_IoT/AtsMec_IoT_Mockoon.cf_: 81 added lines, 0 removed lines. Original line number Diff line number Diff line [MODULE_PARAMETERS] # This section shall contain the values of all parameters that are defined in your TTCN-3 modules. # IUT roles LibCommon_Time.PX_TAC := 30.0 #LibCommon_Time.PX_TWAIT := 30.0 LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; LibHttp_Pics.PICS_HEADER_HOST := "try-mec.etsi.org" #"192.168.1.39" LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibHttp_Pics.PICS_USE_TOKEN_HEADER := true #LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" LibMec_Pics.PICS_ROOT_API := "/sbx1y8q0x9/mep1" # Need to sign in on https://try-mec.etsi.org/, section 'Try-it from your MEC application' # LibMec_Pixits [LOGGING] # In this section you can specify the name of the log file and the classes of events # you want to log into the file or display on console (standard error). LogFile := "../logs/AtsMec/%e.%h-%r.%s" FileMask := LOG_ALL | USER | DEBUG | MATCHING ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING #FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE #ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE LogSourceInfo := Stack LogEntityName:= Yes LogEventTypes:= Yes #TimeStampFormat := DateTime [TESTPORT_PARAMETERS] # In this section you can specify parameters that are passed to Test Ports. #system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.168.1.39,port=30030,use_ssl=0)" system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" #system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1)" system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=80,use_ssl=0)" [DEFINE] # In this section you can create macro definitions, # that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. [INCLUDE] # To use configuration settings given in other configuration files, # the configuration files just need to be listed in this section, with their full or relative pathnames. [ORDERED_INCLUDE] # To use configuration settings given in other configuration files, # the configuration files just need to be listed in this section, with their full or relative pathnames. [EXTERNAL_COMMANDS] # This section can define external commands (shell scripts) to be executed by the ETS # whenever a control part or test case is started or terminated. #BeginTestCase := "" #EndTestCase := "" #BeginControlPart := "" #EndControlPart := "" [EXECUTE] # In this section you can specify what parts of your test suite you want to execute. #AtsMec_TestControl.control [GROUPS] # In this section you can specify groups of hosts. These groups can be used inside the # [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. [COMPONENTS] # This section consists of rules restricting the location of created PTCs. [MAIN_CONTROLLER] # The options herein control the behavior of MC. KillTimer := 10.0 LocalAddress := 127.0.0.1 TCPPort := 12000 NumHCs := 1
etc/AtsMec_Location/AtsMec_Location_Lewis.cf_ +2 −2 Viewed Changes for etc/AtsMec_Location/AtsMec_Location_Lewis.cf_: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -17,8 +17,8 @@ LibHttp_Pics.PICS_USE_TOKEN_HEADER := true LibMec_Pics.PICS_ROOT_API := "etsi-013" # LibMex_Pixits LibMec_Pixits.PX_ME_APP_Q_ZONE_ID_URI := "/location/v2/zones" LibMec_Pixits.PX_ME_APP_Q_USERS_LIST_URI := "/location/v2/users" LibMec_Pixits.PX_ME_APP_Q_ZONE_ID_URI := "/location/v3/zones" LibMec_Pixits.PX_ME_APP_Q_USERS_LIST_URI := "/location/v3/users" LibMec_Pixits.PX_RNIS_SUBSCRITIONS_URI := "/rni/v1/subscriptions" LibMec_Pixits.PX_RNIS_QUERIES_URI := "/rni/v1/queries" LibMec_Pixits.PX_MEC_SVC_MGMT_APPS_URI := "/mec_service_mgmt/v1/applications" Loading