diff options
author | Anders Svensson <[email protected]> | 2011-11-11 14:42:45 +0100 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2011-11-11 14:42:45 +0100 |
commit | 4ed347dcaeeb8e8844be532414a11817da3920f5 (patch) | |
tree | 595eea3450bd1dcda3708c5b01af4c1fe28ee4ac /lib/diameter/src/base/diameter_capx.erl | |
parent | 74c2fa9b2d34ae8d40cc6ea9c2dc4aee2b0cb083 (diff) | |
parent | 7721c6ab406aaf29cf1b2d782c5baf65d2b0e2da (diff) | |
download | otp-4ed347dcaeeb8e8844be532414a11817da3920f5.tar.gz otp-4ed347dcaeeb8e8844be532414a11817da3920f5.tar.bz2 otp-4ed347dcaeeb8e8844be532414a11817da3920f5.zip |
Merge branch 'anders/diameter/capabilities_cb/OTP-9654'
* anders/diameter/capabilities_cb/OTP-9654:
Update documentation
Add capx suite
Accept any 2xxx result code in CEA
Rename some functions plus comment tweak
Send events for connection establishment failure
Use trivial capabilities callback in traffic suite
Add capabilities_cb transport option
Minor tls_ack simplification
diameter_dbg:log -> diameter_lib:log
Diffstat (limited to 'lib/diameter/src/base/diameter_capx.erl')
-rw-r--r-- | lib/diameter/src/base/diameter_capx.erl | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/lib/diameter/src/base/diameter_capx.erl b/lib/diameter/src/base/diameter_capx.erl index 138e76411e..842a9e6103 100644 --- a/lib/diameter/src/base/diameter_capx.erl +++ b/lib/diameter/src/base/diameter_capx.erl @@ -57,9 +57,9 @@ -include("diameter_types.hrl"). -include("diameter_gen_base_rfc3588.hrl"). --define(SUCCESS, ?'DIAMETER_BASE_RESULT-CODE_DIAMETER_SUCCESS'). --define(NOAPP, ?'DIAMETER_BASE_RESULT-CODE_DIAMETER_NO_COMMON_APPLICATION'). --define(NOSECURITY, ?'DIAMETER_BASE_RESULT-CODE_DIAMETER_NO_COMMON_SECURITY'). +-define(SUCCESS, 2001). %% DIAMETER_SUCCESS +-define(NOAPP, 5010). %% DIAMETER_NO_COMMON_APPLICATION +-define(NOSECURITY, 5017). %% DIAMETER_NO_COMMON_SECURITY -define(NO_INBAND_SECURITY, 0). -define(TLS, 1). @@ -96,7 +96,7 @@ try_it([Fun | Args]) -> try apply(Fun, Args) of T -> {ok, T} catch - throw: ?FAILURE(Reason) -> {error, {Reason, Args}} + throw: ?FAILURE(Reason) -> {error, Reason} end. %% mk_caps/2 @@ -224,10 +224,6 @@ rCER(CER, #diameter_service{capabilities = LCaps} = Svc) -> RCaps, CEA#diameter_base_CEA{'Result-Code' = ?SUCCESS})}. -%% TODO: 5.3 of RFC 3588 says we MUST return DIAMETER_NO_COMMON_APPLICATION -%% in the CEA and SHOULD disconnect the transport. However, we have -%% no way to guarantee the send before disconnecting. - build_CEA([], _, _, CEA) -> CEA#diameter_base_CEA{'Result-Code' = ?NOAPP}; @@ -292,25 +288,12 @@ to_cea(CER, Field, CEA) -> %% rCEA/2 -rCEA(#diameter_base_CEA{'Result-Code' = RC} - = CEA, - #diameter_service{capabilities = LCaps} - = Svc) -> - RC == ?SUCCESS orelse ?THROW({'Result-Code', RC}), - +rCEA(CEA, #diameter_service{capabilities = LCaps} = Svc) -> RCaps = capx_to_caps(CEA), SApps = common_applications(LCaps, RCaps, Svc), - - [] == SApps andalso ?THROW(no_common_applications), - IS = common_security(LCaps, RCaps), - [] == IS andalso ?THROW(no_common_security), - - {SApps, IS, RCaps}; - -rCEA(CEA, _Svc) -> - ?THROW({invalid, CEA}). + {SApps, IS, RCaps}. %% capx_to_caps/1 |