From f1ffd33240b982ec2ed80231a3a10f14cf5e3fc9 Mon Sep 17 00:00:00 2001
From: Anders Svensson
+
+
+
+&man_main;,
+&man_dict;
+
+
+&man_main;,
+&man_dict;
An address list is available to the start function of a
-
The
Note that a single
The representation of a Diameter message as passed to
-&mod_call;.
-The record representation is as outlined in
-
-A third representation allows a message to be specified as a list
-whose head is a
A container for incoming and outgoing Diameter messages that's passed
@@ -505,8 +486,7 @@ The application in which the callback takes place (that is, the
callback module as configured with &mod_start_service;)
is determined by the Application Identifier in the header of the
incoming request message, the selected module being the one
-whose corresponding
The
-
+Calls to this module are made by diameter itself as a consequence of +configuration passed to &mod_start_service;. +The encode/decode functions may also be useful for other purposes (eg. +test) but the diameter user does not need to call them explicitly when +sending and receiving messages using &mod_call; and the callback +interface documented in &man_app;.
++The &header; and &packet; records below +are defined in diameter.hrl, which can be included as follows.
+ ++-include_lib("diameter/include/diameter.hrl"). ++ +
+Application-specific records are definied in the hrl +files resulting from dictionary file compilation.
++8-bit, 24-bit and 32-bit integers occurring in Diameter and AVP +headers.
++The application-neutral representation of an AVP. +Primarily intended for use by relay applications that need to handle +arbitrary Diameter applications. +A service implementing a specific Diameter application +(for which it configures a dictionary) can manipulate values of type +&message; instead.
+ ++Fields have the following types.
+ +
+Values in the AVP header, corresponding to AVP Code, the M flag, P
+flags and Vendor-ID respectivelty.
+A Vendor-ID other than
+The data bytes of the AVP.
+
+The name of the AVP as defined in the dictionary file in question, or
+
+The decoded value of an AVP.
+Will be
+The type of the AVP as specified in the dictionary file in question
+(or one it inherits).
+Possible types are
+The name of a generated dictionary module as generated by &man_compile; +or &make_codec;. +The interface provided by a dictionary module is an +implementation detail that may change.
+
+The record representation of the Diameter header.
+Values in a &packet; returned by &decode; are as extracted from the
+incoming message.
+Values set in an &packet; passed to &encode; are preserved in the
+encoded binary(), with the exception of
+It is not necessary to set header fields explicitly in outgoing +messages as diameter itself will set appropriate values. +Setting inappropriate values can be useful for test purposes.
++Fields have the following types.
+ ++Values of the Version, Message Length, Command-Code, Application-ID, +Hop-by-Hop Identifier and End-to-End Identifier fields of the Diameter +header.
++Values correspoding to the R(equest), P(roxiable), E(rror) +and T(Potentially re-transmitted message) flags of the Diameter +header.
+
+The representation of a Diameter message as passed to
+&mod_call; or returned from a &app_handle_request; callback.
+The record representation is as outlined in &records;:
+a message as defined in a dictionary file is encoded as a record with
+one field for each component AVP.
+Equivalently, a message can also be encoded as a list whose head is
+the atom-valued message name (as specified in the relevant dictionary
+file) and whose tail is a list of
+Another list-valued representation allows a message to be specified +as a list whose head is a &header; and whose tail is an &avp; list. +This representation is used by diameter itself when relaying requests +as directed by the return value of a &app_handle_request; callback. +It differs from the other other two in that it bypasses the checks for +messages that do not agree with their definitions in the dictionary in +question: messages are sent exactly as specified.
+ ++A container for incoming and outgoing Diameter messages. +Fields have the following types.
+ +-
+Decode a Diameter message.+Encode a Diameter message.
-&man_main;, -&man_dict;
+&man_compile;, &man_app;, &man_dict;, &man_make; diff --git a/lib/diameter/doc/src/diameter_compile.xml b/lib/diameter/doc/src/diameter_compile.xml index eb6de80c11..0bd7ad1789 100644 --- a/lib/diameter/doc/src/diameter_compile.xml +++ b/lib/diameter/doc/src/diameter_compile.xml @@ -1,5 +1,7 @@ dictionary file'> %also; @@ -36,12 +38,14 @@ supplied.
-The diameterc utility is used to compile diameter
-
+The module &man_make; provides an alternate compilation interface.
+-Compiles a single dictionary file. Valid options are as follows.
- - - --Specifies the directory into which the generated source should be written. -Defaults to the current working directory.
-
-Specifies a directory to add to the code path.
+Prepend the specified directory to the code path.
Use to point at beam files compiled from inherited dictionaries,
-
Multiple
+Write generated source to the specified directory. +Defaults to the current working directory.
+-Supresses erl and hrl generation, respectively.
+Supress erl and hrl generation, respectively.
-Set
-Append an
Multiple
-&man_dict;
+&man_make;, &man_dict;
-A diameter service as configured with &mod_start_service;
+A diameter service, as configured with &mod_start_service;,
specifies one or more supported Diameter applications.
Each Diameter application specifies a dictionary module that knows how
to encode and decode its messages and AVPs.
The dictionary module is in turn generated from a file that defines
these messages and AVPs.
-The format of such a file is defined in
-
-The codec generation also results in a hrl file that defines records
-for the messages and grouped AVPs defined for the application, these
-records being what a user of the diameter application sends and receives.
-(Modulo other available formats as discussed in &man_app;.)
+Dictionary module generation also results in a hrl file that defines
+records for the messages and Grouped AVPs defined by the
+dictionary, these records being what a user of the diameter
+application sends and receives, modulo other possible formats as
+discussed in &man_app;.
These records and the underlying Erlang data types corresponding to
-Diameter data formats are discussed in
@@ -111,6 +116,8 @@ The order in which sections are specified is unimportant.
@@ -134,6 +141,8 @@ Example:
@@ -155,6 +164,8 @@ Example:
@@ -178,6 +189,8 @@ Example:
@@ -198,6 +211,8 @@ Example:
@@ -218,6 +233,8 @@ Region-Set
@@ -253,6 +270,8 @@ Example:
@@ -263,7 +282,7 @@ The section consists of definitions of the form
where Code is the integer AVP code, Type identifies an AVP Data Format
-as defined in
@@ -308,6 +329,8 @@ Framed-IP-Address
@@ -325,6 +348,8 @@ Framed-IP-Address
@@ -370,6 +395,8 @@ RTA ::= < Diameter Header: 287, PXY >
@@ -395,6 +422,8 @@ Specifying a Vendor-Id in the definition of a grouped AVP is
equivalent to specifying it with
@@ -421,6 +450,8 @@ REMOVE_SIP_SERVER 3
@@ -447,8 +478,8 @@ The hrl generated from a dictionary specification defines records for the
messages and grouped AVPs defined in
-&man_compile;, &man_main;, &man_app;
+&man_compile;, &man_main;, &man_app;, &man_codec;, &man_make; diff --git a/lib/diameter/doc/src/diameter_make.xml b/lib/diameter/doc/src/diameter_make.xml index aee98d62d2..da6124310e 100644 --- a/lib/diameter/doc/src/diameter_make.xml +++ b/lib/diameter/doc/src/diameter_make.xml @@ -1,5 +1,9 @@ file:name()'> + dictionary file'> %also; @@ -43,7 +47,14 @@ under the License.-
+The function &codec; is used to compile a diameter +&dictionary; into Erlang source. +The resulting source implements the interface diameter required +to encode and decode the dictionary's messages and AVP's. + ++The utility &man_compile; provides an alternate compilation +interface.
-
+Compile a single dictionary file to Erlang source. +
+Prepend the specified directory to the code path.
+Use to point at beam files compiled from inherited dictionaries,
+
+Multiple
+Write generated source to the specified directory. +Defaults to the current working directory.
+
+Set
+Append &dict_inherits; of the specified module.
+Specifying
+Multiple
+All options are string-valued. +In particular, it is not currently possible to +an &dict_inherits; module as an atom() or a path as a &filename;
+ +-&man_main;, -&man_dict;
+&man_compile;, &man_dict;
-This module implements diameter transport over SCTP using
An insufficiently large receive buffer may result in a peer having to
-resend incoming messages: set the
An insufficiently large send buffer may result in outgoing messages
-being discarded: set the
-&man_main;,
-&man_transport;,
-
-This module implements diameter transport over TCP using
-&man_main;,
-&man_transport;,
-
+A Diameter message as passed over the transport interface.
+ +
+For an inbound message from a transport process, a &codec_packet; must
+contain the received message in its
+For an outbound message to a transport process, a &codec_packet; has a
+value other than
The start function should use the
-A transport process can expect the following messages from -diameter.
+A transport process can expect messages of the following types from +its parent.
-An outbound Diameter message.
-
-A transport process should send the following messages +A transport process should send messages of the following types to its parent.
-An inbound Diameter message.
-
-The function &service_info;
+The function diameter:service_info/2
can be used to retrieve information about a started service
(statistics, information about connected peers, etc) but
this is not yet documented and both the input and output may change
diff --git a/lib/diameter/doc/src/seealso.ent b/lib/diameter/doc/src/seealso.ent
index 6f67630220..435dfda326 100644
--- a/lib/diameter/doc/src/seealso.ent
+++ b/lib/diameter/doc/src/seealso.ent
@@ -77,12 +77,21 @@ significant.
prepare_request/3'>
diameter_app:capabilities()'>
-diameter_app:message()'>
-diameter_app:packet()'>
diameter_app:peer()'>
diameter_app:peer_ref()'>
diameter_app:state()'>
+
+
+diameter_codec:encode/2'>
+diameter_codec:decode/2'>
+
+diameter_codec:avp()'>
+diameter_codec:header()'>
+diameter_codec:dictionary()'>
+diameter_codec:message()'>
+diameter_codec:packet()'>
+
diameter_dict(4)'>
@@ -95,6 +104,14 @@ significant.
UTF8String()'>
Unsigned32()'>
+@name'>
+@prefix'>
+@inherits'>
+
+
+
+diameter_make:codec/2'>
+
diameterc(1)'>
diameter(3)'>
diameter_app(3)'>
+diameter_codec(3)'>
diameter_dict(4)'>
-diameter_transport(3)'>
+diameter_make(3)'>
+diameter_transport(3)'>
diameter_sctp(3)'>
diameter_tcp(3)'>
--
cgit v1.2.3
From 2810e848c24d93b2292a08f2df0293166cf32ee6 Mon Sep 17 00:00:00 2001
From: Anders Svensson
This module provides the interface with which a user can
implement a Diameter node that sends and receives messages using the
-Diameter protocol as defined in RFC 3588.
Basic usage consists of creating a representation of a @@ -73,7 +73,7 @@ Beware the difference between diameter (not capitalised) and Diameter (capitalised). The former refers to the Erlang application named diameter whose main api is defined here, the latter to Diameter protocol in the sense of -RFC 3588.
+&the_rfc;.The diameter application must be started before calling most functions @@ -97,7 +97,7 @@ in this module.
-Types corresponding to RFC 3588 AVP Data Formats. +Types corresponding to &the_rfc; AVP Data Formats. Defined in &dict_data_types;.
-Note that RFC 3588 requires that End-to-End identifiers remain unique
+Note that &the_rfc; requires that End-to-End identifiers remain unique
for a period of at least 4 minutes and that this and the call rate
places a lower bound on the appropriate values of
-For a connecting transport, the RFC 3588 Tc timer, in milliseconds. +For a connecting transport, the &the_rfc; Tc timer, in milliseconds. Note that this timer determines the frequency with which a transport will attempt to establish a connection with its peer only before an initial connection is established: once there is an initial @@ -1622,7 +1622,7 @@ Return the list of started services.
Return a value for a Session-Id AVP.-The value has the form required by section 8.8 of RFC 3588. +The value has the form required by section 8.8 of &the_rfc;. Ident should be the Origin-Host of the peer from which the message containing the returned value will be sent.
diff --git a/lib/diameter/doc/src/diameter_app.xml b/lib/diameter/doc/src/diameter_app.xml index d1fbb9ba31..f4db625c71 100644 --- a/lib/diameter/doc/src/diameter_app.xml +++ b/lib/diameter/doc/src/diameter_app.xml @@ -558,7 +558,7 @@ where
-Note that RFC 3588 mandates that only answers with a 3xxx series
+Note that &the_rfc; mandates that only answers with a 3xxx series
Result-Code (protocol errors) may set the E bit.
Returning a non-3xxx value in a
The diameter application includes three dictionary modules
-corresponding to applications defined in section 2.4 of RFC 3588:
+corresponding to applications defined in section 2.4 of &the_rfc;:
-All dictionaries should typically inherit RFC3588 AVPs from
+All dictionaries should typically inherit &the_rfc; AVPs from
@@ -299,9 +299,7 @@ Requested-Information 353 Enumerated V
-The P flag has been deprecated by the Diameter Maintenance
-and Extensions Working Group of the IETF and should be omitted
-to conform to the current draft standard.
Defines the messages of the application. The section content consists of definitions of the form specified in -section 3.2 of RFC 3588, "Command Code ABNF specification".
+section 3.2 of &the_rfc;, "Command Code Format Specification".@@ -403,7 +401,7 @@ RTA ::= < Diameter Header: 287, PXY > Defines the contents of the AVPs of the application having type Grouped. The section content consists of definitions of the form specified in -section 4.4 of RFC 3588, "Grouped AVP Values". +section 4.4 of &the_rfc;, "Grouped AVP Values".Example:
@@ -507,7 +505,7 @@ type and number of times the AVP can occur. In particular, an AVP which is specified as occurring exactly once is encoded as a value of the AVP's type while an AVP with any other specification is encoded as a list of values of the AVP's type. -The AVP's type is as specified in the AVP definition, the RFC 3588 +The AVP's type is as specified in the AVP definition, the &the_rfc; types being described below.@@ -520,7 +518,7 @@ types being described below. The data formats defined in sections 4.2 ("Basic AVP Data -Formats") and 4.3 ("Derived AVP Data Formats") of RFC 3588 are encoded +Formats") and 4.3 ("Derived AVP Data Formats") of &the_rfc; are encoded as values of the types defined here. Values are passed to &mod_call; in a request record when sending a request, returned in a resulting @@ -595,8 +593,8 @@ where
Additionally, values that can be encoded are -limited by way of their encoding as four octets as required by RFC -3588 with the required extension from RFC 2030. +limited by way of their encoding as four octets as required by +&the_rfc; with the required extension from RFC 2030. In particular, only values between
@@ -640,7 +638,7 @@ where On encode, fields port, transport and protocol default to 3868, sctp and diameter respectively. The grammar of an OctetString-valued DiameterURI() is as specified in -section 4.3 of RFC 3588. +section 4.3 of &the_rfc;. The record representation is used on decode.{{1968,1,20},{3,14,8}} and{{2104,2,26},{9,42,23}} (both inclusive) can be encoded.diff --git a/lib/diameter/doc/src/diameter_intro.xml b/lib/diameter/doc/src/diameter_intro.xml index bc2afbd453..fd578ccf45 100644 --- a/lib/diameter/doc/src/diameter_intro.xml +++ b/lib/diameter/doc/src/diameter_intro.xml @@ -1,5 +1,8 @@ - + + %also; +]> @@ -35,7 +38,7 @@ under the License. The diameter application is an implementation of the Diameter protocol -as defined by RFC 3588. +as defined by &the_rfc;. It supports arbitrary Diameter applications by way of a dictionary interface that allows messages and AVP's to be defined and input into diameter as configuration. @@ -86,9 +89,9 @@ dictionary module that provide encode/decode functionality for outgoing/incoming Diameter messages belonging to the application. A dictionary module is generated from a
diff --git a/lib/diameter/doc/src/diameter_soc.xml b/lib/diameter/doc/src/diameter_soc.xml index 6b9ef9f756..16f6b9d5bb 100644 --- a/lib/diameter/doc/src/diameter_soc.xml +++ b/lib/diameter/doc/src/diameter_soc.xml @@ -1,11 +1,15 @@ - + + %also; +]>specification file using thedictionary file using thediameterc utility. -Dictionaries for the RFC 3588 Diameter Common Messages, Base +Dictionaries for the &the_rfc; Diameter Common Messages, Base Accounting and Relay applications are provided with the diameter application.@@ -41,38 +45,20 @@ Known points of questionable or non-compliance. 2011 +2012 Ericsson AB. All Rights Reserved. - RFC 3588 +&the_rfc;
- - -
-The End-to-End Security framework (section 2.9) isn't implemented -since it is largely unspecified. -The document that was to describe it -(reference [AAACMS]) was abandoned in an uncompleted state several -years ago and the current draft RFC deprecates the framework, -including the P Flag in the AVP header.
-- -
-There is no TLS support over SCTP. -RFC 3588 requires that a Diameter server support TLS but in -practise this seems to mean TLS over SCTP since there are limitations -with running over SCTP: see RFC 6083 (DTLS over SCTP), which is a -response to RFC 3436 (TLS over SCTP). -The current RFC 3588 draft acknowledges this by equating -TLS with TLS/TCP and DTLS/SCTP but we do not yet support DTLS.
+There is no support for DTLS over SCTP.There is no explicit support for peer discovery (section 5.2). It can possibly be implemented on top of diameter as is but this is -probably something that diameter should do. -The current draft deprecates portions of the original RFC's mechanisms -however.
+probably something that diameter should do.- diff --git a/lib/diameter/doc/src/diameter_tcp.xml b/lib/diameter/doc/src/diameter_tcp.xml index 901fce32c3..e3b8c733b7 100644 --- a/lib/diameter/doc/src/diameter_tcp.xml +++ b/lib/diameter/doc/src/diameter_tcp.xml @@ -66,7 +66,7 @@ It can be specified as the value of a
transport_module option to and implements the behaviour documented in &man_transport;. TLS security is supported, both as an upgrade following -capabilities exchange as specified by RFC 3588 and +capabilities exchange as specified by &the_rfc; and at connection establishment as in the current draft standard.diff --git a/lib/diameter/doc/src/seealso.ent b/lib/diameter/doc/src/seealso.ent index 435dfda326..4647c42f85 100644 --- a/lib/diameter/doc/src/seealso.ent +++ b/lib/diameter/doc/src/seealso.ent @@ -32,6 +32,8 @@ significant. --> + + diameter:add_transport/2'> -- cgit v1.2.3 From 3b8adac9179ea32c2f78860c621289cb4b2bb57e Mon Sep 17 00:00:00 2001 From: Anders Svensson
Date: Fri, 23 Nov 2012 14:58:39 +0100 Subject: Add missing diameter_codec(3) content --- lib/diameter/doc/src/diameter_codec.xml | 54 ++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 5 deletions(-) (limited to 'lib/diameter/doc/src') diff --git a/lib/diameter/doc/src/diameter_codec.xml b/lib/diameter/doc/src/diameter_codec.xml index fb245936cf..4a77d5435b 100644 --- a/lib/diameter/doc/src/diameter_codec.xml +++ b/lib/diameter/doc/src/diameter_codec.xml @@ -266,24 +266,66 @@ Fields have the following types. - @@ -299,11 +341,12 @@ Fields have the following types.+ header = &header; header = &header; | undefined - +
-+The Diameter header of the message. +Can be (and typically should be)
undefined for an outgoing +message in a non-relay application, in which case diameter provides +appropriate values.+ msg = &message; avps = [&avp;] | undefined - +
+ ++The AVPs of the message. +Ignored for an outgoing message if the
+msg field is set to a +value other thanundefined .+ msg = &message; | undefined - +
+The incoming/outgoing message. +For an incoming message, a record if the message can be +decoded in a non-relay application,
+ +undefined otherwise. +For an outgoing message, setting a[&header; | &avp;] list is +equivalent to setting theheader andavps fields to the +corresponding values.+ ++A record-valued
+msg field does not imply an absence of +decode errors. +Theerrors field should also be examined.bin = binary() - +
-+The incoming message prior to encode or the outgoing message after +encode.
+ errors = [&dict_Unsigned32; | {&dict_Unsigned32;, avp()}] errors = [5000..5999 | {5000..5999, avp()}] - +
+Errors detected at decode of an incoming message, as identified by +a corresponding 5xxx series Result-Code (Permanent Failures). +For an incoming request, these should be used to formulate an +appropriate answer as documented for the &app_handle_request; +callback in &man_app;. +For an incoming answer, the &mod_application_opt; +
answer_errors determines the behaviour.transport_data = term() - +
+An arbitrary term of meaning only to the transport process in +question, as documented in &man_transport;.
- decode(Mod, Bin) -> &packet; +decode(Mod, Bin) -> Pkt Decode a Diameter message. Mod = &dictionary; Bin = binary() +Pkt = &packet; @@ -314,11 +357,12 @@ Decode a Diameter message. - encode(Mod, Msg) -> binary() +encode(Mod, Msg) -> Pkt Encode a Diameter message. Mod = &dictionary; Msg = &message; | &packet; +Pkt = &packet; -- cgit v1.2.3 From d5de2e1ffd6403f5d7ec62e6ce8da508e1cb1239 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 26 Nov 2012 15:48:29 +0100 Subject: Prepare release --- lib/diameter/doc/src/notes.xml | 157 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) (limited to 'lib/diameter/doc/src') diff --git a/lib/diameter/doc/src/notes.xml b/lib/diameter/doc/src/notes.xml index 7f3cdab075..d448b01eba 100644 --- a/lib/diameter/doc/src/notes.xml +++ b/lib/diameter/doc/src/notes.xml @@ -42,6 +42,163 @@ first. + + Diameter 1.3 + ++ + + Fixed Bugs and Malfunctions ++
+- +
++ Fix faulty handling of Origin-State-Id and faulty config + values.
++ The former was expected in a list despite the + documentation requiring (correctly) an integer. A bare + value for a list-valued capability was not handled.
++ Own Id: OTP-10440
+- +
++ Fix timing of up/down events.
++ Previously, a call to diameter:call/4 following a peer_up + callback might incorrectly return {error, no_connection}, + depending on timing. Both events now follow the + corresponding callbacks.
++ Own Id: OTP-10459
+- +
++ Make diameter:service_info/2 usable in peer_up, peer_down + and pick_peer callbacks.
++ Except for in pick_peer when {call_mutates_state, false}, + it would previously hang indefinitely.
++ Own Id: OTP-10460
+- +
++ Verify that End-to-End and Hop-by-Hop Identifiers in an + incoming CEA/DPA match those sent in the corresponding + CER/DPR.
++ The values were previously ignored. Answers whose + identifiers do not match are handled as unexpected.
++ Own Id: OTP-10565
+- +
++ Fix formatting problems in PDF documentation.
++ In particular, text corresponding to links in HTML was + omitted in preformatted blocks. There are still issues + with indentation but this is not diameter-specific.
++ Own Id: OTP-10583
++ + Improvements and New Features ++
+- +
++ Let prepare_request, prepare_retransmit and + handle_request callbacks return a function to be invoked + on outgoing messages after encode.
++ This allows encoded messages to be logged for example.
++ Own Id: OTP-10441
+- +
++ Add service_opt() 'restrict_connections' to allow + multiple transport connections with the same peer.
++ Own Id: OTP-10443
+- +
++ Add service_opt() 'sequence' to allow the masking of a + constant onto the topmost bits of End-to-End and + Hop-by-Hop identifiers.
++ This allows the same service on different nodes to use + distinct values in outgoing request messages.
++ Own Id: OTP-10445
+- +
++ Add diameter:service_info(PeerRef) to return the + transport_ref() and transport_opt() list of the + corresponding transport.
++ This allows easy access to these from diameter_app + callbacks that only get peer_ref() as an argument.
++ Own Id: OTP-10470
+- +
++ Add reference pages diameter_codec(3) and + diameter_make(3).
++ Own Id: OTP-10471
+- +
++ Add events for service start and stop.
++ Own Id: OTP-10492
+- +
++ Add transport_opt() 'disconnect_cb' to make the sending + of DPR configurable.
++ Whether or not DPR should be sent at application stop, + service stop or transport removal is determined by the + value returned by the callback, as is the + Disconnect-Cause and timeout if DPA is not received.
++ Own Id: OTP-10493
+- +
++ Add transport_opt() 'capx_timeout' for the timeout + associated with non-reception of CER/CEA.
++ Own Id: OTP-10554
+- +
++ Allow a handle_request callback to return a + #diameter_packet{}.
++ This allows an answer to set transport_data and header + fields.
++ Own Id: OTP-10566
+- +
++ Update documentation for RFC 6733.
++ RFC 3588 is now obsolete.
++ Own Id: OTP-10568
+Diameter 1.2 Fixed Bugs and Malfunctions -- cgit v1.2.3