diff --git a/include/gtp_packet.hrl b/include/gtp_packet.hrl index e99df41..0ad7173 100644 --- a/include/gtp_packet.hrl +++ b/include/gtp_packet.hrl @@ -747,7 +747,9 @@ }). -record(private_extension, { - instance = 0 + instance = 0, + enterprise_id = 0, + value = <<>> }). %% -include("gtp_packet_v2_gen.hrl"). diff --git a/priv/ie_gen_v1.erl b/priv/ie_gen_v1.erl index 4b089de..9ed38e2 100755 --- a/priv/ie_gen_v1.erl +++ b/priv/ie_gen_v1.erl @@ -433,7 +433,8 @@ ies() -> {254, "Address of Recommended Node", '_', [{"Address", 0, binary}]}, {255, "Private Extension", '_', - []} + [{"Enterprise Id", 16, integer}, + {"Value", 0, binary}]} ]. msgs() -> diff --git a/src/gtp_packet.erl b/src/gtp_packet.erl index 8ffd12f..9d6d93b 100644 --- a/src/gtp_packet.erl +++ b/src/gtp_packet.erl @@ -1897,8 +1897,11 @@ decode_v1_element(<>, 254, Instance) -> #address_of_recommended_node{instance = Instance, address = M_address}; -decode_v1_element(<<>>, 255, Instance) -> - #private_extension{instance = Instance}; +decode_v1_element(<>, 255, Instance) -> + #private_extension{instance = Instance, + enterprise_id = M_enterprise_id, + value = M_value}; decode_v1_element(Value, Tag, Instance) -> {Tag, Instance, Value}. @@ -2723,8 +2726,11 @@ encode_v1_element(#address_of_recommended_node{ encode_v1_element(254, Instance, <>); encode_v1_element(#private_extension{ - instance = Instance}) -> - encode_v1_element(255, Instance, <<>>); + instance = Instance, + enterprise_id = M_enterprise_id, + value = M_value}) -> + encode_v1_element(255, Instance, <>); encode_v1_element({Tag, Instance, Value}) when is_integer(Tag), is_integer(Instance), is_binary(Value) -> encode_v1_element(Tag, Instance, Value). diff --git a/test/property_test/gtplib_prop.erl b/test/property_test/gtplib_prop.erl index 6579c97..e8598de 100644 --- a/test/property_test/gtplib_prop.erl +++ b/test/property_test/gtplib_prop.erl @@ -1612,7 +1612,8 @@ gen_address_of_recommended_node() -> gen_private_extension() -> #private_extension{ - instance = instance() + instance = instance(), + value = binary() }. %% v2 generator ==========================================================================