Compare commits
2 Commits
1a064fa6ae
...
25ace76f98
Author | SHA1 | Date |
---|---|---|
Pau Espin | 25ace76f98 | |
Pau Espin | 1391d074f6 |
|
@ -8,6 +8,20 @@
|
|||
-ifndef(GSUP_PROTOCOL).
|
||||
-define(GSUP_PROTOCOL, true).
|
||||
|
||||
% TS 24.008 10.5.5.14, GMM Cause used in GSUP:
|
||||
-define(GSUP_CAUSE_IMSI_UNKNOWN, 16#02).
|
||||
-define(GSUP_CAUSE_ILLEGAL_MS, 16#03).
|
||||
-define(GSUP_CAUSE_GPRS_NOTALLOWED, 16#07).
|
||||
-define(GSUP_CAUSE_PLMN_NOTALLOWED, 16#0b).
|
||||
-define(GSUP_CAUSE_LA_NOTALLOWED, 16#0c).
|
||||
-define(GSUP_CAUSE_ROAMING_NOTALLOWED, 16#0d).
|
||||
-define(GSUP_CAUSE_NO_SUIT_CELL_IN_LA, 16#0f).
|
||||
-define(GSUP_CAUSE_NET_FAIL, 16#11).
|
||||
-define(GSUP_CAUSE_CONGESTION, 16#16).
|
||||
-define(GSUP_CAUSE_GSM_AUTH_UNACCEPT, 16#17).
|
||||
-define(GSUP_CAUSE_INV_MAND_INFO, 16#60).
|
||||
-define(GSUP_CAUSE_PROTO_ERR_UNSPEC, 16#6f).
|
||||
|
||||
-type 'GSUPMessageType'() :: location_upd_req
|
||||
| location_upd_err
|
||||
| location_upd_res
|
||||
|
@ -99,6 +113,7 @@
|
|||
hlr_number => binary(),
|
||||
pdp_context_id => [integer()],
|
||||
pdp_charging => integer(),
|
||||
pco => binary(),
|
||||
rand => binary(),
|
||||
auts => binary(),
|
||||
cn_domain => integer(),
|
||||
|
@ -145,6 +160,7 @@
|
|||
-define(ACCESS_POINT_NAME, 16#12).
|
||||
-define(QUALITY_OF_SERVICE, 16#13).
|
||||
-define(PDP_CHARGING, 16#14).
|
||||
-define(PCO, 16#15).
|
||||
-define(RAND, 16#20).
|
||||
-define(SRES, 16#21).
|
||||
-define(KC, 16#22).
|
||||
|
@ -229,9 +245,9 @@
|
|||
16#47 => #{message_type => e_close, mandatory => [message_class, source_name, destination_name, session_id, session_state]},
|
||||
16#4b => #{message_type => e_abort, mandatory => [message_class, session_id, session_state, bssap_cause]},
|
||||
16#4e => #{message_type => e_routing_err, mandatory => [message_class, source_name, destination_name], optional => [session_id, session_state]},
|
||||
16#50 => #{message_type => epdg_tunnel_request, mandatory => [message_class], optional => []},
|
||||
16#50 => #{message_type => epdg_tunnel_request, mandatory => [message_class], optional => [pco]},
|
||||
16#51 => #{message_type => epdg_tunnel_error, mandatory => [message_class, cause], optional => []},
|
||||
16#52 => #{message_type => epdg_tunnel_result, mandatory => [message_class, pdp_info_complete, pdp_info_list], optional => []}
|
||||
16#52 => #{message_type => epdg_tunnel_result, mandatory => [message_class, pdp_info_complete, pdp_info_list], optional => [pco]}
|
||||
}).
|
||||
|
||||
-define(AUTH_TUPLE_MANDATORY, []).
|
||||
|
|
|
@ -100,6 +100,10 @@ decode_ie(<<?RAND, Len, Rand:Len/binary, Tail/binary>>, Map) ->
|
|||
?CHECK_LEN(rand, Len, 16, 16),
|
||||
decode_ie(Tail, Map#{rand => Rand});
|
||||
|
||||
decode_ie(<<?PCO, Len, PCO:Len/binary, Tail/binary>>, Map) ->
|
||||
?CHECK_LEN(pco, Len, 1, 251),
|
||||
decode_ie(Tail, Map#{pco => PCO});
|
||||
|
||||
decode_ie(<<?AUTS, Len, AUTS:Len/binary, Tail/binary>>, Map) ->
|
||||
?CHECK_LEN(auts, Len, 14, 14),
|
||||
decode_ie(Tail, Map#{auts => AUTS});
|
||||
|
@ -408,6 +412,11 @@ encode_ie(#{pdp_charging := Value} = GSUPMessage, Head) ->
|
|||
?CHECK_SIZE(pdp_charging, Len, Value),
|
||||
encode_ie(maps:without([pdp_charging], GSUPMessage), <<Head/binary, ?PDP_CHARGING, Len, Value:Len/unit:8>>);
|
||||
|
||||
encode_ie(#{pco := Value} = GSUPMessage, Head) ->
|
||||
Len = size(Value),
|
||||
?CHECK_LEN(pco, Len, 1, 251),
|
||||
encode_ie(maps:without([pco], GSUPMessage), <<Head/binary, ?PCO, Len, Value/binary>>);
|
||||
|
||||
encode_ie(#{auts := Value} = GSUPMessage, Head) ->
|
||||
Len = 14,
|
||||
?CHECK_LEN(auts, size(Value), Len, Len),
|
||||
|
|
Loading…
Reference in New Issue