Commit a82bfecd authored by sagar arora's avatar sagar arora

Merge branch 'ie_fix' into 'develop'

IE USER_PLANE_IP_RESOURCE_INFORMATION fix

See merge request oai/cn5g/oai-cn5g-smf!133
parents 1117d8da b3e54093
...@@ -1566,7 +1566,7 @@ typedef struct user_plane_ip_resource_information_s { ...@@ -1566,7 +1566,7 @@ typedef struct user_plane_ip_resource_information_s {
uint8_t teid_range; uint8_t teid_range;
struct in_addr ipv4_address; struct in_addr ipv4_address;
struct in6_addr ipv6_address; struct in6_addr ipv6_address;
uint16_t network_instance; std::string network_instance;
uint8_t source_interface; uint8_t source_interface;
} user_plane_ip_resource_information_t; } user_plane_ip_resource_information_t;
......
...@@ -2552,9 +2552,11 @@ class pfcp_up_function_features_ie : public pfcp_ie { ...@@ -2552,9 +2552,11 @@ class pfcp_up_function_features_ie : public pfcp_ie {
is.read(reinterpret_cast<char*>(&u2.b), sizeof(u2.b)); is.read(reinterpret_cast<char*>(&u2.b), sizeof(u2.b));
is.read(reinterpret_cast<char*>(&u3.b), sizeof(u3.b)); is.read(reinterpret_cast<char*>(&u3.b), sizeof(u3.b));
is.read(reinterpret_cast<char*>(&u4.b), sizeof(u4.b)); is.read(reinterpret_cast<char*>(&u4.b), sizeof(u4.b));
if (tlv.get_length() > 4) {
is.read(reinterpret_cast<char*>(&u5.b), sizeof(u5.b)); is.read(reinterpret_cast<char*>(&u5.b), sizeof(u5.b));
is.read(reinterpret_cast<char*>(&u6.b), sizeof(u6.b)); is.read(reinterpret_cast<char*>(&u6.b), sizeof(u6.b));
} }
}
//-------- //--------
void to_core_type(pfcp_ies_container& s) { void to_core_type(pfcp_ies_container& s) {
pfcp::up_function_features_s v = {}; pfcp::up_function_features_s v = {};
...@@ -6700,7 +6702,7 @@ class pfcp_user_plane_ip_resource_information_ie : public pfcp_ie { ...@@ -6700,7 +6702,7 @@ class pfcp_user_plane_ip_resource_information_ie : public pfcp_ie {
uint8_t teid_range; uint8_t teid_range;
struct in_addr ipv4_address; struct in_addr ipv4_address;
struct in6_addr ipv6_address; struct in6_addr ipv6_address;
uint16_t network_instance; std::string network_instance;
union { union {
struct { struct {
uint8_t source_interface : 4; uint8_t source_interface : 4;
...@@ -6717,7 +6719,7 @@ class pfcp_user_plane_ip_resource_information_ie : public pfcp_ie { ...@@ -6717,7 +6719,7 @@ class pfcp_user_plane_ip_resource_information_ie : public pfcp_ie {
teid_range = 0; teid_range = 0;
ipv4_address.s_addr = INADDR_ANY; ipv4_address.s_addr = INADDR_ANY;
ipv6_address = in6addr_any; ipv6_address = in6addr_any;
network_instance = 0; network_instance = {};
tlv.set_length(1); tlv.set_length(1);
u1.bf.v4 = b.v4; u1.bf.v4 = b.v4;
...@@ -6736,7 +6738,7 @@ class pfcp_user_plane_ip_resource_information_ie : public pfcp_ie { ...@@ -6736,7 +6738,7 @@ class pfcp_user_plane_ip_resource_information_ie : public pfcp_ie {
} }
if (u1.bf.assoni) { if (u1.bf.assoni) {
network_instance = b.network_instance; network_instance = b.network_instance;
tlv.add_length(2); tlv.add_length(network_instance.size());
} }
if (u1.bf.assosi) { if (u1.bf.assosi) {
u2.bf.source_interface = b.source_interface; u2.bf.source_interface = b.source_interface;
...@@ -6751,7 +6753,7 @@ class pfcp_user_plane_ip_resource_information_ie : public pfcp_ie { ...@@ -6751,7 +6753,7 @@ class pfcp_user_plane_ip_resource_information_ie : public pfcp_ie {
teid_range = 0; teid_range = 0;
ipv4_address.s_addr = INADDR_ANY; ipv4_address.s_addr = INADDR_ANY;
ipv6_address = in6addr_any; ipv6_address = in6addr_any;
network_instance = 0; network_instance = {};
tlv.set_length(1); tlv.set_length(1);
} }
//-------- //--------
...@@ -6762,7 +6764,7 @@ class pfcp_user_plane_ip_resource_information_ie : public pfcp_ie { ...@@ -6762,7 +6764,7 @@ class pfcp_user_plane_ip_resource_information_ie : public pfcp_ie {
teid_range = 0; teid_range = 0;
ipv4_address.s_addr = INADDR_ANY; ipv4_address.s_addr = INADDR_ANY;
ipv6_address = in6addr_any; ipv6_address = in6addr_any;
network_instance = 0; network_instance = {};
}; };
//-------- //--------
void to_core_type(pfcp::user_plane_ip_resource_information_t& b) { void to_core_type(pfcp::user_plane_ip_resource_information_t& b) {
...@@ -6800,10 +6802,7 @@ class pfcp_user_plane_ip_resource_information_ie : public pfcp_ie { ...@@ -6800,10 +6802,7 @@ class pfcp_user_plane_ip_resource_information_ie : public pfcp_ie {
ipv6_address_dump_to(os, ipv6_address); ipv6_address_dump_to(os, ipv6_address);
} }
if (u1.bf.assoni) { if (u1.bf.assoni) {
auto be_network_instance = htobe32(network_instance); os << network_instance;
os.write(
reinterpret_cast<const char*>(&be_network_instance),
sizeof(be_network_instance));
} }
if (u1.bf.assosi) { if (u1.bf.assosi) {
os.write(reinterpret_cast<const char*>(&u2.b), sizeof(u2.b)); os.write(reinterpret_cast<const char*>(&u2.b), sizeof(u2.b));
...@@ -6826,9 +6825,9 @@ class pfcp_user_plane_ip_resource_information_ie : public pfcp_ie { ...@@ -6826,9 +6825,9 @@ class pfcp_user_plane_ip_resource_information_ie : public pfcp_ie {
ipv6_address_load_from(is, ipv6_address); ipv6_address_load_from(is, ipv6_address);
} }
if (u1.bf.assoni) { if (u1.bf.assoni) {
is.read( char e[tlv.get_length()];
reinterpret_cast<char*>(&network_instance), sizeof(network_instance)); is.read(e, tlv.get_length());
network_instance = be16toh(network_instance); network_instance.assign(e, tlv.get_length());
} }
if (u1.bf.assosi) { if (u1.bf.assosi) {
is.read(reinterpret_cast<char*>(&u2.b), sizeof(u2.b)); is.read(reinterpret_cast<char*>(&u2.b), sizeof(u2.b));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment