From 5a5b1d91c8cc913c6d049e113ceedc4746d2ba8e Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Wed, 11 Jul 2012 02:29:45 +0200 Subject: Clarify documentation on application state --- lib/diameter/doc/src/diameter_app.xml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/diameter/doc/src/diameter_app.xml b/lib/diameter/doc/src/diameter_app.xml index a9ae0ebbec..a786443fa1 100644 --- a/lib/diameter/doc/src/diameter_app.xml +++ b/lib/diameter/doc/src/diameter_app.xml @@ -257,12 +257,8 @@ call to peer_up/3.

Invoked as a consequence of a call to diameter:call/4 to select a destination -peer for an outgoing request, the return value indicating the selected peer. -A new application state can also be returned but only if the Diameter -application in question was -configured with the option call_mutates_state set to -true, as documented for diameter:start_service/2.

+peer for an outgoing request, the return value indicating the selected +peer.

The candidate peers list will only include those @@ -301,6 +297,19 @@ marker="#pick_peer">pick_peer/4 will be, since a retransmission to an alternate peer is abandoned if an answer is received from a previously selected peer.

+ +

+{Peer, NewState} and its equivalents can only be returned if +the Diameter application in question was +configured with the option {call_mutates_state, true}, +as documented for diameter:start_service/2. +Otherwise, the State argument is always +the intial value as configured on the application, not any subsequent +value returned by a peer_up/3 +or peer_down/3 callback.

+
+ -- cgit v1.2.3 From 654d3f45431e57512597792376524b56805a1829 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Tue, 28 Aug 2012 10:44:01 +0200 Subject: Terminology and other clarifications, more references Diameter node/peer having been the most vicious terminology blunder. --- lib/diameter/doc/src/diameter.xml | 206 ++++++++++++++++------------ lib/diameter/doc/src/diameter_app.xml | 111 ++++++++------- lib/diameter/doc/src/diameter_sctp.xml | 6 +- lib/diameter/doc/src/diameter_tcp.xml | 8 +- lib/diameter/doc/src/diameter_transport.xml | 4 +- 5 files changed, 189 insertions(+), 146 deletions(-) (limited to 'lib') diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml index 10139b90c7..6abd1515c9 100644 --- a/lib/diameter/doc/src/diameter.xml +++ b/lib/diameter/doc/src/diameter.xml @@ -49,7 +49,7 @@ Diameter protocol as defined in RFC 3588.

Basic usage consists of creating a representation of a -locally implemented Diameter peer and its capabilities with start_service/2, adding transport capability using add_transport/2 and sending Diameter @@ -84,13 +84,14 @@ this module.

Address() DiameterIdentity() +Grouped() +OctetString() Time() Unsigned32() -UTF8String()

Types corresponding to RFC 3588 AVP Data Formats. -Defined in diameter_dict(4).

+Defined in diameter_dict(4).

@@ -148,7 +149,7 @@ Options defining a Diameter application as configured in an -{alias, application_alias()} +{alias, application_alias()}

An unique identifier for the application in the scope of the @@ -166,7 +167,7 @@ documented in diameter_dict(4).

-{module, application_module()} +{module, application_module()}

A callback module with which messages of the Diameter application are @@ -253,7 +254,7 @@ itself. Multiple options append to the argument list.

-{filter, peer_filter()} +{filter, peer_filter()}

A filter to apply to the list of available peers before passing them to @@ -264,7 +265,7 @@ corresponding list of filters. Defaults to none.

-{timeout, Unsigned32()} +{timeout, Unsigned32()}

The number of milliseconds after which the request should @@ -304,19 +305,19 @@ precedence over the former.

-{'Origin-Host', DiameterIdentity()} +{'Origin-Host', DiameterIdentity()}

Value of the Origin-Host AVP in outgoing messages.

-{'Origin-Realm', DiameterIdentity()} +{'Origin-Realm', DiameterIdentity()}

Value of the Origin-Realm AVP in outgoing messages.

-{'Host-IP-Address', [Address()]} +{'Host-IP-Address', [Address()]}

Values of Host-IP-Address AVPs. @@ -325,26 +326,25 @@ Optional.

The list of addresses is available to the start function of a transport module, which either uses them as is or returns a new list -(typically as configured as transport_config() on the -transport module in question) in order for the correct list of -addresses to be sent in capabilities exchange messages.

+in order for the correct list of addresses to be sent in capabilities +exchange messages.

-{'Vendor-Id', Unsigned32()} +{'Vendor-Id', Unsigned32()}

Value of the Vendor-Id AVP sent in an outgoing capabilities exchange message.

-{'Product-Name', UTF8String()} +{'Product-Name', UTF8String()}

Value of the Product-Name AVP sent in an outgoing capabilities exchange message.

-{'Origin-State-Id', Unsigned32()} +{'Origin-State-Id', Unsigned32()}

Value of Origin-State-Id to be included in outgoing messages sent by @@ -361,7 +361,7 @@ can be used as to retrieve a value that is set when the diameter application is started.

-{'Supported-Vendor-Id', [Unsigned32()]} +{'Supported-Vendor-Id', [Unsigned32()]}

Values of Supported-Vendor-Id AVPs sent in an outgoing @@ -369,7 +369,7 @@ capabilities exchange message. Optional, defaults to the empty list.

-{'Auth-Application-Id', [Unsigned32()]} +{'Auth-Application-Id', [Unsigned32()]}

Values of Auth-Application-Id AVPs sent in an outgoing @@ -377,7 +377,7 @@ capabilities exchange message. Optional, defaults to the empty list.

-{'Inband-Security-Id', [Unsigned32()]} +{'Inband-Security-Id', [Unsigned32()]}

Values of Inband-Security-Id AVPs sent in an outgoing @@ -390,7 +390,7 @@ If 1 (= TLS) is specified then TLS is selected if the CER/CEA received from the peer offers it.

-{'Acct-Application-Id', [Unsigned32()]} +{'Acct-Application-Id', [Unsigned32()]}

Values of Acct-Application-Id AVPs sent in an outgoing @@ -398,7 +398,7 @@ capabilities exchange message. Optional, defaults to the empty list.

-{'Vendor-Specific-Application-Id', [Grouped()]} +{'Vendor-Specific-Application-Id', [Grouped()]}

Values of Vendor-Specific-Application-Id AVPs sent in @@ -406,7 +406,7 @@ an outgoing capabilities exchange message. Optional, defaults to the empty list.

-{'Firmware-Revision', Unsigned32()} +{'Firmware-Revision', Unsigned32()}

Value of the Firmware-Revision AVP sent in an outgoing capabilities @@ -490,41 +490,42 @@ or any peer if the request does not contain a Destination-Realm AVP.

-{host, any|DiameterIdentity()} +{host, any|DiameterIdentity()}

Matches only those peers whose Origin-Host has the specified value, or all peers if the atom any.

-{realm, any|DiameterIdentity() +{realm, any|DiameterIdentity()

Matches only those peers whose Origin-Realm has the value, or all peers if the atom any.

-{eval, evaluable()} +{eval, evaluable()}

-Matches only those peers for which the specified evaluable() returns +Matches only those peers for which the specified #evaluable() returns true on the connection's diameter_caps record. Any other return value or exception is equivalent to false.

-{neg, peer_filter()} +{neg, peer_filter()}

Matches only those peers not matched by the specified filter.

-{all, [peer_filter()]} +{all, [peer_filter()]}

Matches only those peers matched by each filter of the specified list.

-{any, [peer_filter()]} +{any, [peer_filter()]}

Matches only those peers matched by at least one filter of the @@ -536,10 +537,11 @@ specified list.

Note that the host and realm filters examine the outgoing request as passed to call/4, -assuming that this is a record- or list-valued message() as documented -in diameter_app(3), and that +assuming that this is a record- or list-valued diameter_app:message(), and that the message contains at most one of each AVP. -If this is not the case then the {host|realm, DiameterIdentity()} +If this is not the case then the {host|realm, DiameterIdentity()} filters must be used to achieve the desired result. Note also that an empty host/realm (which should not be typical) is equivalent to an unspecified one for the purposes of filtering.

@@ -568,9 +570,9 @@ following.

{down, Ref, Peer, Config} -Ref = transport_ref() -Peer = diameter_app:peer() -Config = {connect|listen, [transport_opt()]} +Ref = transport_ref() +Peer = diameter_app:peer() +Config = {connect|listen, [transport_opt()]} Pkt = #diameter_packet{} @@ -587,8 +589,8 @@ connectivity.

Note that a single up/down event for a given peer corresponds to as many peer_up/peer_down -callbacks as there are Diameter applications shared by the peer, -as determined during capablilities exchange. +callbacks as there are Diameter applications that have been negotiated +during capablilities exchange. That is, the event communicates connectivity with the peer as a whole while the callbacks communicate connectivity with respect to individual Diameter applications.

@@ -597,8 +599,8 @@ respect to individual Diameter applications.

{reconnect, Ref, Opts} -Ref = transport_ref() -Opts = [transport_opt()] +Ref = transport_ref() +Opts = [transport_opt()]

@@ -610,8 +612,8 @@ transport connection with a peer following reconnect_timer or {closed, Ref, Reason, Config} -Ref = transport_ref() -Config = {connect|listen, [transport_opt()]} +Ref = transport_ref() +Config = {connect|listen, [transport_opt()]}

@@ -627,7 +629,7 @@ Result = ResultCode | {capabilities_cb, CB, ResultCode|discard} Caps = #diameter_caps{} Pkt = #diameter_packet{} ResultCode = integer() -CB = evaluable() +CB = evaluable()

@@ -732,12 +734,12 @@ that is somewhat unique.

Options accepted by start_service/2. -Can be any capability() tuple as +Can be any capability() tuple as well as the following.

-{application, [application_opt()]} +{application, [application_opt()]}

Defines a Diameter application supported by the service.

@@ -746,7 +748,8 @@ Defines a Diameter application supported by the service.

A service must define one application for each Diameter application it intends to support. For an outgoing Diameter request, the application is specified by -passing the desired application's application_alias() to +passing the desired application's application_alias() to call/4, while for an incoming request the application identifier in the message header determines the application (and callback module), the @@ -791,7 +794,7 @@ corresponding timeout (see transport_config below) or all fail.

{transport_config, term()} -{transport_config, term(), Unsigned32()} +{transport_config, term(), Unsigned32()}

A term passed as the third argument to the -{applications, [application_alias()]} +{applications, [application_alias()]}

The list of Diameter applications to which usage of the transport should be restricted. Defaults to all applications configured on the service -in question.

+in question. +Must only specify applications defined on the service to which +the transport is added.

-{capabilities, [capability()]} +{capabilities, [capability()]}

AVP's used to construct outgoing CER/CEA messages. @@ -843,7 +848,7 @@ not over SCTP as implemented by diameter_sctp(3).

-{capabilities_cb, evaluable()} +{capabilities_cb, evaluable()}

A callback invoked upon reception of CER/CEA during capabilities @@ -871,7 +876,7 @@ case the corresponding callbacks are applied until either all return {watchdog_timer, TwInit} -TwInit = Unsigned32() +TwInit = Unsigned32() | {M,F,A} @@ -892,7 +897,7 @@ Defaults to 30000 if unspecified.

{reconnect_timer, Tc} -Tc = Unsigned32() +Tc = Unsigned32()

@@ -911,11 +916,12 @@ causing the RFC 3539 state machine to pass to state OPEN rather than REOPEN. Note that these semantics are not goverened by the RFC and that a listening transport's reconnect_timer should be greater than its -peers's Tc plus jitter.

+peer's Tc plus jitter.

Defaults to 30000 for a connecting transport and 60000 for a listening transport.

+
@@ -927,6 +933,15 @@ marker="#service_info">service_info/2 and can be referred to in predicate functions passed to remove_transport/2.

+ +
+ +transport_ref() = reference() + +

+An reference returned by add_transport/2 that +identifies the configuration.

@@ -943,9 +958,9 @@ marker="#remove_transport">remove_transport/2.

-> {ok, Ref} | {error, Reason} Add transport capability to a service. -SvcName = service_name() -Options = [transport_opt()] -Ref = ref() +SvcName = service_name() +Options = [transport_opt()] +Ref = transport_ref() Reason = term() @@ -953,8 +968,8 @@ marker="#remove_transport">remove_transport/2.

Add transport capability to a service.

-The service will start a transport process(es) in order to establish a -connection with the peer, either by connecting to the peer +The service will start transport processes as required in order to +establish a connection with the peer, either by connecting to the peer (connect) or by accepting incoming connection requests (listen). A connecting transport establishes transport connections with at most @@ -990,11 +1005,11 @@ transports.

call(SvcName, App, Request, Options) -> ok | Answer | {error, Reason} Send a Diameter request message. -SvcName = service_name() -App = application_alias() -Request = diameter_app:message() | term() +SvcName = service_name() +App = application_alias() +Request = diameter_app:message() Answer = term() -Options = [call_opt()] +Options = [call_opt()]

@@ -1112,7 +1127,7 @@ transport.

-origin_state_id() -> Unsigned32() +origin_state_id() -> Unsigned32() Returns a reasonable Origin-State-Id.

@@ -1121,7 +1136,7 @@ outgoing messages.

The value returned is the number of seconds since 19680120T031408Z, -the first value that can be encoded as a Diameter Time(), +the first value that can be encoded as a Diameter Time(), at the time the diameter application was started.

@@ -1134,11 +1149,11 @@ at the time the diameter application was started.

remove_transport(SvcName, Pred) -> ok Remove previously added transports. -SvcName = service_name() -Pred = Fun | MFA | ref() | list() | true | false +SvcName = service_name() +Pred = Fun | MFA | transport_ref() | list() | true | false -Fun = fun((reference(), connect|listen, list()) -> boolean()) -    | fun((reference(), list()) -> boolean()) +Fun = fun((transport_ref(), connect|listen, list()) -> boolean()) +    | fun((transport_ref(), list()) -> boolean())     | fun((list()) -> boolean()) MFA = {atom(), atom(), list()} @@ -1156,12 +1171,12 @@ as returned by the corresponding call. The remaining forms are equivalent to an arity-3 fun as follows.

-Pred = fun(reference(), list()): fun(Ref, _, Opts) -> Pred(Ref, Opts) end -Pred = fun(list()): fun(_, _, Opts) -> Pred(Opts) end -Pred = reference(): fun(Ref, _, _) -> Pred == Ref end -Pred = list(): fun(_, _, Opts) -> [] == Pred -- Opts end -Pred = true: fun(_, _, _) -> true end -Pred = false: fun(_, _, _) -> false end +Pred = fun(transport_ref(), list()): fun(Ref, _, Opts) -> Pred(Ref, Opts) end +Pred = fun(list()): fun(_, _, Opts) -> Pred(Opts) end +Pred = transport_ref(): fun(Ref, _, _) -> Pred == Ref end +Pred = list(): fun(_, _, Opts) -> [] == Pred -- Opts end +Pred = true: fun(_, _, _) -> true end +Pred = false: fun(_, _, _) -> false end Pred = {M,F,A}: fun(Ref, Type, Opts) -> apply(M, F, [Ref, Type, Opts | A]) end @@ -1186,7 +1201,7 @@ DPA or timeout.

service_info(SvcName, Item) -> Value Return specific information about a started service. -SvcName = service_name() +SvcName = service_name() Value = term() @@ -1203,7 +1218,7 @@ Return information about a started service.

services() -> [SvcName] Return the list of started services. -SvcName = service_name() +SvcName = service_name()

@@ -1216,10 +1231,10 @@ Return the list of started services.

-session_id(Ident) -> OctetString() +session_id(Ident) -> OctetString() Return a value for a Session-Id AVP. -Ident = DiameterIdentity() +Ident = DiameterIdentity()

@@ -1244,7 +1259,7 @@ Start the diameter application.

The diameter application must be started before starting a service. -In a production system this will typically be accomplished by a boot +In a production system this is typically accomplished by a boot file, not by calling start/0 explicitly.

@@ -1256,8 +1271,8 @@ file, not by calling start/0 explicitly.

start_service(SvcName, Options) -> ok | {error, Reason} Start a Diameter service. -SvcName = service_name() -Options = [service_opt()] +SvcName = service_name() +Options = [service_opt()] Reason = term() @@ -1265,11 +1280,20 @@ file, not by calling start/0 explicitly.

Start a diameter service.

-A service defines a locally-implemented Diameter peer, specifying the -capabilities of the peer to be used during capabilities exchange and +A service defines a locally-implemented Diameter node, specifying the +capabilities of the node to be used during capabilities exchange and the Diameter applications that it supports. Transports are added to a service using add_transport/2.

+marker="#add_transport">add_transport/2. +

+ + +

+A transport can both override its service's +capabilities and restrict its supported Diameter applications so +"service = Diameter node as identified by Origin-Host" is not +necessarily the case.

+
@@ -1295,7 +1319,7 @@ Stop the diameter application.

stop_service(SvcName) -> ok | {error, Reason} Stop a Diameter service. -SvcName = service_name() +SvcName = service_name() Reason = term() @@ -1312,15 +1336,19 @@ Stop a diameter service.

subscribe(SvcName) -> true Subscribe to event messages. -SvcName = service_name() +SvcName = service_name()

-Subscribe to service_event() messages from a service.

+Subscribe to service_event() messages from +a service.

It is not an error to subscribe to events from a service -that does not yet exist.

+that does not yet exist. +Doing so before adding transports is required to guarantee the +reception of all related events.

@@ -1332,7 +1360,7 @@ that does not yet exist.

unsubscribe(SvcName) -> true Unsubscribe to event messages. -SvcName = service_name() +SvcName = service_name()

diff --git a/lib/diameter/doc/src/diameter_app.xml b/lib/diameter/doc/src/diameter_app.xml index a786443fa1..6e5c957eec 100644 --- a/lib/diameter/doc/src/diameter_app.xml +++ b/lib/diameter/doc/src/diameter_app.xml @@ -45,8 +45,8 @@ A diameter service as started by diameter:start_service/2 configures one of more Diameter applications, each of whose configuration specifies a callback that handles messages specific to -its application. -The messages and AVPs of the Diameter application are defined in a +the application. +The messages and AVPs of the application are defined in a dictionary file whose format is documented in diameter_dict(4) while the callback module is documented here. @@ -106,11 +106,13 @@ and, for the call-specific callbacks, any extra arguments passed to + + capabilities() = #diameter_caps{}

A record containing the identities of -the local and remote Diameter peers having an established transport +the local Diameter node and the remote Diameter peer having an established transport connection, as well as the capabilities as determined by capabilities exchange. Each field of the record is a 2-tuple consisting of @@ -119,6 +121,8 @@ Optional or possibly multiple values are encoded as lists of values, mandatory values as the bare value.

+ + message() = record() | list()

@@ -149,6 +153,8 @@ are sent exactly as specified.

+ + packet() = #diameter_packet{}

@@ -158,6 +164,8 @@ Fields of a packet() record should not be set in return values except as documented.

+ + peer_ref() = term()

@@ -165,12 +173,16 @@ A term identifying a transport connection with a Diameter peer. Should be treated opaquely.

-peer() = {peer_ref(), capabilities()} + + +peer() = {peer_ref(), capabilities()}

A tuple representing a Diameter peer connection.

+ + service_name() = term()

@@ -180,6 +192,8 @@ marker="diameter#start_service">diameter:start_service/2 when starting the service.

+ + state() = term()

@@ -211,9 +225,9 @@ process.

Mod:peer_up(SvcName, Peer, State) -> NewState Invoked when a transport connection has been established -SvcName = service_name() -Peer = peer() -State = NewState = state() +SvcName = #service_name() +Peer = peer() +State = NewState = state()

@@ -230,9 +244,9 @@ the callback module in question has been configured.

Mod:peer_down(SvcName, Peer, State) -> NewState Invoked when a transport connection has been lost. -SvcName = service_name() -Peer = peer() -State = NewState = state() +SvcName = service_name() +Peer = peer() +State = NewState = state()

@@ -248,10 +262,10 @@ call to peer_up/3.

-> {ok, Peer} | {Peer, NewState} | false Select a target peer for an outgoing request. -Candidates = [peer()] -Peer = peer() | false -SvcName = service_name() -State = NewState = state() +Candidates = [peer()] +Peer = peer() | false +SvcName = service_name() +State = NewState = state()

@@ -278,7 +292,8 @@ equivalent when callback state is mutable, as are {ok, Peer} and {Peer, State}. Returning a peer as false causes {error, no_connection} to be returned from diameter:call/4. -Returning a peer() from an initial pick_peer/4 callback will result in a +Returning a peer() from an initial +pick_peer/4 callback will result in a prepare_request/3 callback followed by either handle_answer/4 @@ -301,9 +316,9 @@ received from a previously selected peer.

{Peer, NewState} and its equivalents can only be returned if the Diameter application in question was -configured with the option {call_mutates_state, true}, -as documented for diameter:start_service/2. +configured with the diameter:application_opt() +{call_mutates_state, true}. Otherwise, the State argument is always the intial value as configured on the application, not any subsequent value returned by a peer_up/3 @@ -319,10 +334,10 @@ or peer_down/3 callback.

Mod:prepare_request(Packet, SvcName, Peer) -> Action Return a request for encoding and transport. -Packet = packet() -SvcName = service_name() -Peer = peer() -Action = {send, packet() | message()} | {discard, Reason} | discard +Packet = packet() +SvcName = service_name() +Peer = peer() +Action = {send, packet() | message()} | {discard, Reason} | discard

@@ -334,13 +349,13 @@ callback need not be limited to this usage. Many implementations may simply want to return {send, Packet}

-A returned packet() should set the request to be encoded in its +A returned packet() should set the request to be encoded in its msg field and can set the transport_data field in order to pass information to the transport module. Extra arguments passed to diameter:call/4 can be used to communicate transport data to the callback. -A returned packet() can also set the header field to a +A returned packet() can also set the header field to a diameter_header record in order to specify values that should be preserved in the outgoing request, although this should typically not be necessary and allows the callback to set header values @@ -364,10 +379,10 @@ discarded}.

Mod:prepare_retransmit(Packet, SvcName, Peer) -> Result Return a request for encoding and retransmission. -Packet = packet() -SvcName = service_name() -Peer = peer() -Result = {send, packet() | message()} | {discard, Reason} | discard +Packet = packet() +SvcName = service_name() +Peer = peer() +Result = {send, packet() | message()} | {discard, Reason} | discard

@@ -375,7 +390,7 @@ Invoked to return a request for encoding and retransmission. Has the same role as prepare_request/3 in the case that a peer connection is lost an an alternate peer selected but the -argument packet() is as returned by the initial +argument packet() is as returned by the initial prepare_request/3.

@@ -394,10 +409,10 @@ discarded}.

Mod:handle_answer(Packet, Request, SvcName, Peer) -> Result Receive an answer message from a peer. -Packet = packet() -Request = message() -SvcName = service_name() -Peer = peer() +Packet = packet() +Request = message() +SvcName = service_name() +Peer = peer() Result = term() @@ -410,7 +425,7 @@ specified.

The decoded answer record is in the msg field of the argument -packet(), +packet(), the undecoded binary in the packet field. Request is the outgoing request message as was returned from prepare_request/3 or @@ -447,9 +462,9 @@ marker="diameter#start_service">diameter:start_service/2.

Return an error from a outgoing request. Reason = timeout | failover | term() -Request = message() -SvcName = service_name() -Peer = peer() +Request = message() +SvcName = service_name() +Peer = peer() Result = term() @@ -478,14 +493,14 @@ callback returned false.

Mod:handle_request(Packet, SvcName, Peer) -> Action Receive an incoming request. -Packet = packet() +Packet = packet() SvcName = term() -Peer = peer() +Peer = peer() Action = Reply | {relay, Opts} | discard | {eval, Action, PostF} -Reply = {reply, message()} +Reply = {reply, message()} | {protocol_error, 3000..3999} -Opts = diameter:call_opts() -PostF = diameter:evaluable() +Opts = diameter:call_opts() +PostF = diameter:evaluable()

@@ -501,13 +516,13 @@ itself as defining either the application in question or the Relay application.

-The argument packet() has the following signature.

+The argument packet() has the following signature.

#diameter_packet{header = #diameter_header{}, avps = [#diameter_avp{}], msg = record() | undefined, - errors = ['Unsigned32'() | {'Unsigned32'(), #diameter_avp{}}], + errors = [Unsigned32() | {Unsigned32(), #diameter_avp{}}], bin = binary(), transport_data = term()} @@ -524,8 +539,8 @@ The errors field specifies any Result-Code's identifying errors that were encountered in decoding the request. In this case diameter will set both Result-Code and Failed-AVP AVP's in a returned -answer message() before sending it to the peer: -the returned message() need only set any other required AVP's. +answer message() before sending it to the peer: +the returned message() need only set any other required AVP's. Note that the errors detected by diameter are all of the 5xxx series (Permanent Failures). The errors list is empty if the request has been received in @@ -535,7 +550,7 @@ the relay application.

The transport_data field contains an arbitrary term passed into diameter from the transport module in question, or the atom undefined if the transport specified no data. -The term is preserved in the packet() containing any answer message +The term is preserved in the packet() containing any answer message sent back to the transport process unless another value is explicitly specified.

@@ -544,7 +559,7 @@ The semantics of each of the possible return values are as follows.

-{reply, message()} +{reply, message()}

Send the specified answer message to the peer.

diff --git a/lib/diameter/doc/src/diameter_sctp.xml b/lib/diameter/doc/src/diameter_sctp.xml index c1e839b8e1..03e2f1f6be 100644 --- a/lib/diameter/doc/src/diameter_sctp.xml +++ b/lib/diameter/doc/src/diameter_sctp.xml @@ -58,11 +58,11 @@ and implements the behaviour documented in Start a transport process. Type = connect | accept -Ref = reference() +Ref = diameter:transport_ref() Svc = #diameter_service{} -Opt = {raddr, ip_address()} | {rport, integer()} | term() +Opt = {raddr, inet:ip_address()} | {rport, integer()} | term() Pid = pid() -LAddr = ip_address() +LAddr = inet:ip_address() Reason = term() diff --git a/lib/diameter/doc/src/diameter_tcp.xml b/lib/diameter/doc/src/diameter_tcp.xml index e6b53383c0..6ad98c8640 100644 --- a/lib/diameter/doc/src/diameter_tcp.xml +++ b/lib/diameter/doc/src/diameter_tcp.xml @@ -65,13 +65,13 @@ before configuring TLS capability on diameter transports.

Start a transport process. Type = connect | accept -Ref = reference() +Ref = diameter:transport_ref() Svc = #diameter_service{} Opt = OwnOpt | SslOpt | OtherOpt Pid = pid() -LAddr = ip_address() +LAddr = inet:ip_address() Reason = term() -OwnOpt = {raddr, ip_address()} +OwnOpt = {raddr, inet:ip_address()} | {rport, integer()} | {port, integer()} SslOpt = {ssl_options, true | list()} @@ -123,7 +123,7 @@ watchdog to take down the connection.

If the service specifies more than one Host-IP-Address and -option ip is unspecified then then the +option ip is unspecified then the first of the service's addresses is used as the local address.

diff --git a/lib/diameter/doc/src/diameter_transport.xml b/lib/diameter/doc/src/diameter_transport.xml index 087a90b099..4ed02e3881 100644 --- a/lib/diameter/doc/src/diameter_transport.xml +++ b/lib/diameter/doc/src/diameter_transport.xml @@ -59,11 +59,11 @@ parent).

Start a transport process. Type = connect | accept -Ref = reference() +Ref = diameter:transport_ref() Svc = #diameter_service{} Opts = term() Pid = pid() -LAddrs = [ip_address()] +LAddrs = [inet:ip_address()] Reason = term() -- cgit v1.2.3 From bec7d6a34b795a8e5725c86bd6465bedd8deb0b5 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Tue, 28 Aug 2012 17:36:51 +0200 Subject: Document watchdog events --- lib/diameter/doc/src/diameter.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml index 6abd1515c9..34203f737b 100644 --- a/lib/diameter/doc/src/diameter.xml +++ b/lib/diameter/doc/src/diameter.xml @@ -5,7 +5,7 @@
-2011 +20112012 Ericsson AB. All Rights Reserved. @@ -697,8 +697,8 @@ The packet record contains the CEA in question.

{watchdog, Ref, PeerRef, {From, To}, Config} -Ref = transport_ref() -PeerRef = diameter_app:peer_ref() +Ref = transport_ref() +PeerRef = diameter_app:peer_ref() From, To = initial | okay | suspect | down | reopen Config = {connect|listen, [transport_opt()]} -- cgit v1.2.3 From e72579c29bd86bb104f1855d6eebcf8677038f2f Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Tue, 28 Aug 2012 17:59:57 +0200 Subject: Document service info --- lib/diameter/doc/src/diameter.xml | 281 +++++++++++++++++++++++++++++++++++++- 1 file changed, 277 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml index 34203f737b..2abfbff209 100644 --- a/lib/diameter/doc/src/diameter.xml +++ b/lib/diameter/doc/src/diameter.xml @@ -1198,15 +1198,288 @@ DPA or timeout.

-service_info(SvcName, Item) -> Value -Return specific information about a started service. +service_info(SvcName, Item) -> term() +Return information about a started service. SvcName = service_name() -Value = term()

-Return information about a started service.

+Return information about a started service. +Item can be one of the following.

+ + + +'Origin-Host' +'Origin-Realm' +'Vendor-Id' +'Product-Name' +'Origin-State-Id' +'Host-IP-Address' +'Supported-Vendor' +'Auth-Application-Id' +'Inband-Security-Id' +'Acct-Application-Id' +'Vendor-Specific-Application-Id' +'Firmware-Revision' + +

+Return a capability value as configured on the service at start_service/2. +Note that all capabilities are returned in a tagged list with the +capabilities item.

+
+ +applications + +

+Return the list of applications configured on the service at start_service/2. +

+
+ +capabilities + +

+Return a tagged list of all capabilities values configured on the service +at start_service/2.

+
+ +transport + +

+Return a list containing one entry for every transport configured on +the service with add_transport/2. +Each entry is a tagged list containing both configuration and +information about established peer connections. +An example return value with for a client service with Origin-Host +"client.example.com" configured with a single transport connected to "server.example.com" +might look as follows.

+ + +[[{ref,#Ref<0.0.0.93>}, + {type,connect}, + {options,[{transport_module,diameter_tcp}, + {transport_config,[{ip,{127,0,0,1}}, + {raddr,{127,0,0,1}}, + {rport,3868}, + {reuseaddr,true}]}]}, + {watchdog,{<0.66.0>,{1346,171491,996448},okay}}, + {peer,{<0.67.0>,{1346,171491,999906}}}, + {apps,[{0,common}]}, + {caps,[{origin_host,{"client.example.com","server.example.com"}}, + {origin_realm,{"example.com","example.com"}}, + {host_ip_address,{[{127,0,0,1}],[{127,0,0,1}]}}, + {vendor_id,{0,193}}, + {product_name,{"Client","Server"}}, + {origin_state_id,{[],[]}}, + {supported_vendor_id,{[],[]}}, + {auth_application_id,{[0],[0]}}, + {inband_security_id,{[],[0]}}, + {acct_application_id,{[],[]}}, + {vendor_specific_application_id,{[],[]}}, + {firmware_revision,{[],[]}}, + {avp,{[],[]}}]}, + {port,[{owner,<0.69.0>}, + {module,diameter_tcp}, + {socket,{{127,0,0,1},48758}}, + {peer,{{127,0,0,1},3868}}, + {statistics,[{recv_oct,656}, + {recv_cnt,6}, + {recv_max,148}, + {recv_avg,109}, + {recv_dvi,19}, + {send_oct,836}, + {send_cnt,6}, + {send_max,184}, + {send_avg,139}, + {send_pend,0}]}]}, + {statistics,[{{{0,258,0},recv},3}, + {{{0,258,1},send},3}, + {{{0,257,0},recv},1}, + {{{0,257,1},send},1}, + {{{0,258,0},recv,{'Result-Code',2001}},3}, + {{{0,280,1},recv},2}, + {{{0,280,0},send},2}]}]] + + +

+Here ref is the transport_ref() of the service's +transport and options are as were passed to add_transport/2. +The watchdog entry shows the state of a connection's RFC 3539 watchdog +state machine. +The peer entry identifies the diameter_app:peer_ref() for +which there will have been a peer_up callback for the +Diameter applications negotiated during capabilities exchange, which +are identified by the apps entry, common in this case +being the application_alias() of this +application with Application Id 0. +The caps entry identifies the capabilities sent by the local +node and received from the peer during capabilities exchange. +The port entry displays socket-level information about the +transport connection. +The statistics entry presents Diameter-level counters, +an entry like {{{0,280,1},recv},2} saying that the client has +received 2 DWR messages: {0,280,1} = {Application_Id, Command_Code, +R_Flag}.

+ +

+Note that watchdog, peer, apps, caps +and port entries depend on connectivity +with the peer and may not be present. +Note also that the statistics entry presents values acuumulated +during the lifetime of the transport configuration.

+ +

+A listening transport presents its information slightly differently +since there may be multiple accepted connections for the same transport_ref(). +The transport info returned by a server with a single client +connection might look as follows.

+ + +[[{ref,#Ref<0.0.0.61>}, + {type,listen}, + {options,[{transport_module,diameter_tcp}, + {transport_config,[{reuseaddr,true}, + {ip,{127,0,0,1}}, + {port,3868}]}]}, + {accept,[[{watchdog,{<0.56.0>,{1346,171481,226895},okay}}, + {peer,{<0.58.0>,{1346,171491,999511}}}, + {apps,[{0,server}]}, + {caps,[{origin_host,{"server.example.com","client.example.com"}}, + {origin_realm,{"example.com","example.com"}}, + {host_ip_address,{[{127,0,0,1}],[{127,0,0,1}]}}, + {vendor_id,{193,0}}, + {product_name,{"Server","Client"}}, + {origin_state_id,{[],[]}}, + {supported_vendor_id,{[],[]}}, + {auth_application_id,{[0],[0]}}, + {inband_security_id,{[],[]}}, + {acct_application_id,{[],[]}}, + {vendor_specific_application_id,{[],[]}}, + {firmware_revision,{[],[]}}, + {avp,{[],[]}}]}, + {port,[{owner,<0.62.0>}, + {module,diameter_tcp}, + {socket,{{127,0,0,1},3868}}, + {peer,{{127,0,0,1},48758}}, + {statistics,[{recv_oct,1576}, + {recv_cnt,16}, + {recv_max,184}, + {recv_avg,98}, + {recv_dvi,26}, + {send_oct,1396}, + {send_cnt,16}, + {send_max,148}, + {send_avg,87}, + {send_pend,0}]}]}], + [{watchdog,{<0.72.0>,{1346,171491,998404},initial}}]]}, + {statistics,[{{{0,280,0},recv},7}, + {{{0,280,1},send},7}, + {{{0,258,0},send,{'Result-Code',2001}},3}, + {{{0,258,1},recv},3}, + {{{0,258,0},send},3}, + {{{0,280,1},recv},5}, + {{{0,280,0},send},5}, + {{{0,257,1},recv},1}, + {{{0,257,0},send},1}]}]] + + +

+The information presented here is as in the connect case except +that the client connections are grouped under an accept tuple.

+ +
+ +connections + +

+Return a list containing one entry for every established transport +connection whose watchdog state machine is not in the down +state. +This is a flat view of transport info which lists only active +connections and for which Diameter-level statistics are accumulated +only for the lifetime of the transport connection. +A return value for the server above might look as follows.

+ + +[[{ref,#Ref<0.0.0.61>}, + {type,accept}, + {options,[{transport_module,diameter_tcp}, + {transport_config,[{reuseaddr,true}, + {ip,{127,0,0,1}}, + {port,3868}]}]}, + {watchdog,{<0.56.0>,{1346,171481,226895},okay}}, + {peer,{<0.58.0>,{1346,171491,999511}}}, + {apps,[{0,server}]}, + {caps,[{origin_host,{"server.example.com","client.example.com"}}, + {origin_realm,{"example.com","example.com"}}, + {host_ip_address,{[{127,0,0,1}],[{127,0,0,1}]}}, + {vendor_id,{193,0}}, + {product_name,{"Server","Client"}}, + {origin_state_id,{[],[]}}, + {supported_vendor_id,{[],[]}}, + {auth_application_id,{[0],[0]}}, + {inband_security_id,{[],[]}}, + {acct_application_id,{[],[]}}, + {vendor_specific_application_id,{[],[]}}, + {firmware_revision,{[],[]}}, + {avp,{[],[]}}]}, + {port,[{owner,<0.62.0>}, + {module,diameter_tcp}, + {socket,{{127,0,0,1},3868}}, + {peer,{{127,0,0,1},48758}}, + {statistics,[{recv_oct,10124}, + {recv_cnt,132}, + {recv_max,184}, + {recv_avg,76}, + {recv_dvi,9}, + {send_oct,10016}, + {send_cnt,132}, + {send_max,148}, + {send_avg,75}, + {send_pend,0}]}]}, + {statistics,[{{{0,280,0},recv},62}, + {{{0,280,1},send},62}, + {{{0,258,0},send,{'Result-Code',2001}},3}, + {{{0,258,1},recv},3}, + {{{0,258,0},send},3}, + {{{0,280,1},recv},66}, + {{{0,280,0},send},66}, + {{{0,257,1},recv},1}, + {{{0,257,0},send},1}]}]] + + +

+Note that there may be multiple entries with the same ref, in +contrast to transport info.

+
+ +statistics + +

+Return a {{Counter, Ref}, non_neg_integer()} list of counter values. +Ref can be either a transport_ref() +or a diameter_app:peer_ref(). +Entries for the latter are folded into corresponding entries for the +former as peer connections go down. +Entries for both are removed at remove_transport/2. +The Diameter-level statistics returned by transport and +connections info are based upon these entries.

+
+ +
-- cgit v1.2.3 From e70a331569b2d161d976950d209989a5dc06a2bc Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Wed, 29 Aug 2012 02:23:28 +0200 Subject: Assorted doc improvements --- lib/diameter/doc/src/diameter.xml | 457 ++++++++++++---------------- lib/diameter/doc/src/diameter_app.xml | 13 +- lib/diameter/doc/src/diameter_transport.xml | 62 ++-- 3 files changed, 241 insertions(+), 291 deletions(-) (limited to 'lib') diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml index 2abfbff209..fdd18929df 100644 --- a/lib/diameter/doc/src/diameter.xml +++ b/lib/diameter/doc/src/diameter.xml @@ -43,8 +43,8 @@ under the License.

-This module provides the interface with which a user -creates a service that sends and receives messages using the +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.

@@ -61,17 +61,15 @@ marker="diameter_app">diameter_app(3) callback modules as specified in the service configuration.

-Beware the difference between diameter application and -Diameter application. +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 an application of the Diameter -protocol in the sense of RFC 3588. -More generally, capitalized Diameter refers to the RFC -and diameter to this implementation.

+api is defined here, the latter to Diameter protocol in the sense of +RFC 3588.

-The diameter application must be started before calling functions in -this module.

+The diameter application must be started before calling most functions +in this module.

@@ -100,10 +98,9 @@ Defined in diameter_dict(4)

A name identifying a Diameter application in -service configuration passed to start_service/2 and passed to -call/4 when sending requests -belonging to the application.

+service configuration. +Passed to call/4 when sending requests +defined by the application.

@@ -121,19 +118,14 @@ ExtraArgs = list() A module implementing the callback interface defined in diameter_app(3), along with any extra arguments to be appended to those documented for the interface. -Any extra arguments are appended to the documented list of arguments for -each function. -Note that additional arguments specific to an outgoing request be +Note that extra arguments specific to an outgoing request can be specified to call/4, in which case -the call-specific arguments are appended to any specified with the -callback module.

+those are are appended to any module-specific extra arguments.

Specifying a #diameter_callback{} record allows individual functions to be configured in place of the usual diameter_app(3) callbacks, with -default implementations provided by module diameter_callback -unless otherwise specified. +marker="diameter_app">diameter_app(3) callbacks. See that module for details.

@@ -143,9 +135,8 @@ See that module for details.

-Options defining a Diameter application as configured in an -application option passed to -start_service/2.

+Options defining a Diameter application. +Has one the following types.

@@ -154,7 +145,8 @@ Options defining a Diameter application as configured in an

An unique identifier for the application in the scope of the service. -Optional, defaults to the value of the dictionary option.

+Defaults to the value of the dictionary option if +unspecified.

{dictionary, atom()} @@ -170,20 +162,20 @@ marker="diameter_dict">diameter_dict(4).

{module, application_module()}

-A callback module with which messages of the Diameter application are +The callback module with which messages of the Diameter application are handled. See diameter_app(3) for -information on the required interface and semantics.

+the required interface and semantics.

{state, term()}

The initial callback state. -Defaults to the value of the alias option if unspecified. -The prevailing state is passed to certain +The prevailing state is passed to some diameter_app(3) -callbacks, which can then return a new state.

+callbacks, which can then return a new state. +Defaults to the value of the alias option if unspecified.

{call_mutates_state, true|false} @@ -191,19 +183,18 @@ callbacks, which can then return a new state.

Specifies whether or not the pick_peer/4 -application callback (following from a call to -call/4) -can modifiy state, +application callback can modify the application state, Defaults to false if unspecified.

+

-Note that pick_peer callbacks are -serialized when these are allowed to modify state, which is a +pick_peer callbacks +are serialized when these are allowed to modify state, which is a potential performance bottleneck. A simple Diameter client may suffer no ill effects from using mutable -state but a server or agent that responds to incoming request but -sending its own requests should probably avoid it.

+state but a server or agent that responds to incoming request should +probably avoid it.

+
{answer_errors, callback|report|discard} @@ -214,9 +205,9 @@ decode errors are handled. If callback then errors result in a handle_answer/4 callback in the same fashion as for handle_request/3, in the -errors field of the diameter_packet record passed into -the callback. +marker="diameter_app#handle_request">handle_request/3, with +errors communicated in the errors field of the +#diameter_packet{} record passed to the callback. If report then an answer containing errors is discarded without a callback and a warning report is written to the log. If discard then an answer containing errors is silently @@ -240,7 +231,8 @@ Defaults to report if unspecified.

Options available to call/4 when -sending an outgoing Diameter request.

+sending an outgoing Diameter request. +Has one of the following types.

@@ -249,7 +241,7 @@ sending an outgoing Diameter request.

Extra arguments to append to callbacks to the callback module in question. -These are appended to any extra arguments configured with the callback +These are appended to any extra arguments configured on the callback itself. Multiple options append to the argument list.

@@ -299,120 +291,55 @@ to fail.

-AVP values used in outgoing CER/CEA messages during capabilities exchange. -Can be configured both on a service and a transport, the latter taking -precedence over the former.

+AVP values sent in outgoing CER or CEA messages during capabilities +exchange. +Can be configured both on a service and a transport, values specified +on the latter taking precedence over any specified on the former. +Has one of the following types.

{'Origin-Host', DiameterIdentity()} - -

-Value of the Origin-Host AVP in outgoing messages.

-
- {'Origin-Realm', DiameterIdentity()} - -

-Value of the Origin-Realm AVP in outgoing messages.

-
- {'Host-IP-Address', [Address()]}

-Values of Host-IP-Address AVPs. -Optional.

- -

-The list of addresses is available to the start function of a -transport module, which either uses them as is or returns a new list -in order for the correct list of addresses to be sent in capabilities -exchange messages.

+An address list is available to the start function of a +transport module, which +can return a new list for use in the subsequent CER or CEA. +Host-IP-Address need not be specified if the transport start function +returns an address list.

{'Vendor-Id', Unsigned32()} - -

-Value of the Vendor-Id AVP sent in an outgoing capabilities -exchange message.

-
- {'Product-Name', UTF8String()} - -

-Value of the Product-Name AVP sent in an outgoing capabilities -exchange message.

-
- {'Origin-State-Id', Unsigned32()}

-Value of Origin-State-Id to be included in outgoing messages sent by -diameter itself. -In particular, the AVP will be included in CER/CEA and DWR/DWA messages. -Optional.

- -

+Origin-State-Id is optional but will be included in outgoing messages +sent by diameter itself: CER/CEA, DWR/DWA and DPR/DPA. Setting a value of 0 (zero) is equivalent to not setting a value as documented in RFC 3588. The function origin_state_id/0 -can be used as to retrieve a value that is set when the diameter +can be used as to retrieve a value that is computed when the diameter application is started.

{'Supported-Vendor-Id', [Unsigned32()]} - -

-Values of Supported-Vendor-Id AVPs sent in an outgoing -capabilities exchange message. -Optional, defaults to the empty list.

-
- {'Auth-Application-Id', [Unsigned32()]} - -

-Values of Auth-Application-Id AVPs sent in an outgoing -capabilities exchange message. -Optional, defaults to the empty list.

-
- {'Inband-Security-Id', [Unsigned32()]}

-Values of Inband-Security-Id AVPs sent in an outgoing -capabilities exchange message. -Optional, defaults to the empty list, which is equivalent to a -list containing only 0 (= NO_INBAND_SECURITY).

- -

+Inband-Security-Id defaults to the empty list, which is equivalent to a +list containing only 0 (= NO_INBAND_SECURITY). If 1 (= TLS) is specified then TLS is selected if the CER/CEA received from the peer offers it.

{'Acct-Application-Id', [Unsigned32()]} - -

-Values of Acct-Application-Id AVPs sent in an outgoing -capabilities exchange message. -Optional, defaults to the empty list.

-
- {'Vendor-Specific-Application-Id', [Grouped()]} - -

-Values of Vendor-Specific-Application-Id AVPs sent in -an outgoing capabilities exchange message. -Optional, defaults to the empty list.

-
- {'Firmware-Revision', Unsigned32()} - -

-Value of the Firmware-Revision AVP sent in an outgoing capabilities -exchange message. -Optional.

-
@@ -444,11 +371,13 @@ eval(F) -> Applying an evaluable() E to an argument list A is meant in the sense of eval([E|A]).

+

-Beware of using local funs (that is, fun expressions not of the -form fun Module:Name/Arity) in situations in which the fun is -not short-lived and code is to be upgraded at runtime since any -processes retaining such a fun will have a reference to old code.

+Beware of using fun expressions of the form fun Name/Arity (not +fun Mod:Name/Arity) in situations in which the fun is not short-lived +and code is to be upgraded at runtime since any processes retaining +such a fun will have a reference to old code.

+
@@ -501,14 +430,14 @@ specified value, or all peers if the atom any.

Matches only those peers whose Origin-Realm has the -value, or all peers if the atom any.

+specified value, or all peers if the atom any.

{eval, evaluable()}

Matches only those peers for which the specified #evaluable() returns +marker="#evaluable">evaluable() returns true on the connection's diameter_caps record. Any other return value or exception is equivalent to false.

@@ -522,20 +451,21 @@ Matches only those peers not matched by the specified filter.

{all, [peer_filter()]}

-Matches only those peers matched by each filter of the specified list.

+Matches only those peers matched by each filter in the specified list.

{any, [peer_filter()]}

-Matches only those peers matched by at least one filter of the +Matches only those peers matched by at least one filter in the specified list.

+

-Note that the host and realm filters examine the +The host and realm filters examine the outgoing request as passed to call/4, assuming that this is a record- or list-valued diameter_app:message(), and that @@ -543,11 +473,12 @@ the message contains at most one of each AVP. If this is not the case then the {host|realm, DiameterIdentity()} filters must be used to achieve the desired result. -Note also that an empty host/realm (which should not be typical) +An empty host/realm (which should not be typical) is equivalent to an unspecified one for the purposes of filtering.

+

-An invalid filter is equivalent to {any, []}, a filter +An invalid filter is equivalent to {any,[]}, a filter that matches no peer.

@@ -556,12 +487,12 @@ that matches no peer.

service_event() = #diameter_event{}

-Event message sent to processes that have subscribed using subscribe/1.

+An event message sent to processes that have subscribed to these using +subscribe/1.

-The info field of the event record can be one of the -following.

+The info field of the event record can have one of the +following types.

@@ -578,19 +509,19 @@ Pkt = #diameter_packet{}

The RFC 3539 watchdog state machine has -transitioned into (up) or out of (down) the open +transitioned into (up) or out of (down) the OKAY state. -If a diameter_packet record is present in an up tuple -then there has been an exchange of capabilities exchange messages and -the record contains the received CER or CEA, otherwise the -connection has reestablished without the loss or transport +If a #diameter_packet{} record is present in an up event +then there has been a capabilties exchange on a newly established +transport connection and the record contains the received CER or CEA. +Otherwise a connection has reestablished without the loss or connectivity.

-Note that a single up/down event for a given peer corresponds to -as many peer_up/peer_down -callbacks as there are Diameter applications that have been negotiated -during capablilities exchange. +Note that a single up/down event for a given peer +corresponds to one peer_up/peer_down +callback for each of the Diameter applications negotiated during +capablilities exchange. That is, the event communicates connectivity with the peer as a whole while the callbacks communicate connectivity with respect to individual Diameter applications.

@@ -605,8 +536,10 @@ Opts = [transport_opt()]

A connecting transport is attempting to establish/reestablish a -transport connection with a peer following reconnect_timer or -watchdog_timer expiry.

+transport connection with a peer following reconnect_timer or +watchdog_timer +expiry.

{closed, Ref, Reason, Config} @@ -617,8 +550,8 @@ Config = {connect|listen, [transport_opt()

-Capabilities exchange has failed. Reason can be one of -the following.

+Capabilities exchange has failed. +Reason can have one of the following types.

@@ -635,11 +568,11 @@ CB = evaluable()

An incoming CER has been answered with the indicated result code or discarded. -The capabilities record contains pairs of values for the the local -node and remote peer. -The packet record contains the CER in question. +Caps contains pairs of values for the the local node and remote +peer. +Pkt contains the CER in question. In the case of rejection by a capabilities callback, the tuple -indicates the rejecting callback.

+contains the rejecting callback.

{'CER', Caps, {ResultCode, Pkt}} @@ -653,9 +586,8 @@ Pkt = #diameter_packet{}

An incoming CER contained errors and has been answered with the indicated result code. -The capabilities record contains only values for the the local -node. -The packet record contains the CER in question.

+Caps contains only values for the the local node. +Pkt contains the CER in question.

{'CEA', Result, Caps, Pkt} @@ -671,11 +603,11 @@ ResultCode = integer() An incoming CEA has been rejected for the indicated reason. An integer-valued Result indicates the result code sent by the peer. -The capabilities record contains pairs of values for the the local -node and remote peer. -The packet record contains the CEA in question. +Caps contains pairs of values for the the local node and remote +peer. +Pkt contains the CEA in question. In the case of rejection by a capabilities callback, the tuple -indicates the rejecting callback.

+contains the rejecting callback.

{'CEA', Caps, Pkt} @@ -686,9 +618,9 @@ Pkt = #diameter_packet{}

-An incoming CER contained errors and has been rejected. -The capabilities record contains only values for the the local node. -The packet record contains the CEA in question.

+An incoming CEA contained errors and has been rejected. +Caps contains only values for the the local node. +Pkt contains the CEA in question.

@@ -732,9 +664,9 @@ that is somewhat unique.

service_opt()

-Options accepted by start_service/2. -Can be any capability() tuple as +Can be any capability() as well as the following.

@@ -745,17 +677,15 @@ well as the following.

Defines a Diameter application supported by the service.

-A service must define one application for each Diameter application it -intends to support. -For an outgoing Diameter request, the application is specified by -passing the desired application's application_alias() to -call/4, while for an +A service must configure one application for each Diameter +application it intends to support. +For an outgoing Diameter request, the relevant application_alias() is +passed to call/4, while for an incoming request the application identifier in the message -header determines the application (and callback module), the -application identifier being specified in the dictionary file defining the -application.

+header determines the application, the identifier being specified in +the application's dictionary +file.

@@ -766,8 +696,9 @@ application.

transport_opt()

-Options accepted by add_transport/2.

+An option passed to add_transport/2. +Has one of the following types.

{transport_module, atom()} @@ -777,10 +708,6 @@ A module implementing a transport process as defined in diameter_transport(3). Defaults to diameter_tcp if unspecified.

-

-The interface required of a transport module is documented in diameter_transport(3).

-

Multiple transport_module and transport_config options are allowed. @@ -790,7 +717,7 @@ a transport_module being paired with the first default value for trailing modules. Transport starts will be attempted with each of the modules in order until one establishes a connection within the -corresponding timeout (see transport_config below) or all fail.

+corresponding timeout (see below) or all fail.

{transport_config, term()} @@ -824,28 +751,24 @@ To listen on both SCTP and TCP, define one transport for each.

{applications, [application_alias()]}

-The list of Diameter applications to which usage of the transport -should be restricted. -Defaults to all applications configured on the service -in question. -Must only specify applications defined on the service to which -the transport is added.

+The list of Diameter applications to which the transport should be +restricted. +Defaults to all applications configured on the service in question. +Applications not configured on the service in question are ignored.

{capabilities, [capability()]}

AVP's used to construct outgoing CER/CEA messages. -Any AVP specified takes precedence over a corresponding value specified -for the service in question.

+Values take precedence over any specified on the service in +question.

Specifying a capability as a transport option -may be particularly appropriate for Inband-Security-Id in case +may be particularly appropriate for Inband-Security-Id, in case TLS is desired over TCP as implemented by -diameter_tcp(3) but -not over SCTP as implemented by -diameter_sctp(3).

+diameter_tcp(3).

{capabilities_cb, evaluable()} @@ -854,9 +777,9 @@ not over SCTP as implemented by A callback invoked upon reception of CER/CEA during capabilities exchange in order to ask whether or not the connection should be accepted. -Applied to the transport reference (as returned by add_transport/2) and -diameter_caps record of the connection. +Applied to the relevant transport_ref() and the +#diameter_caps{} record of the connection. Returning ok accepts the connection. Returning integer() causes an incoming CER to be answered with the specified Result-Code. @@ -871,6 +794,8 @@ code causes the transport connection to be broken.

Multiple capabilities_cb options can be specified, in which case the corresponding callbacks are applied until either all return ok or one does not.

+ + {watchdog_timer, TwInit} @@ -892,6 +817,8 @@ the callback.

An integer value must be at least 6000 as required by RFC 3539. Defaults to 30000 if unspecified.

+ + {reconnect_timer, Tc} @@ -902,7 +829,7 @@ Tc = Unsigned32()

For a connecting transport, the RFC 3588 Tc timer, in milliseconds. -Note that this timer determines the frequency with which the transport +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 connection it's watchdog_timer that determines the frequency of @@ -915,8 +842,8 @@ regarded as an initial connection rather than a reestablishment, causing the RFC 3539 state machine to pass to state OPEN rather than REOPEN. Note that these semantics are not goverened by the RFC and -that a listening transport's reconnect_timer should be greater than its -peer's Tc plus jitter.

+that a listening transport's reconnect_timer should be greater +than its peer's Tw plus jitter.

Defaults to 30000 for a connecting transport and 60000 for a listening @@ -954,12 +881,12 @@ identifies the configuration.

-add_transport(SvcName, {connect|listen, Options}) +add_transport(SvcName, {connect|listen, [Opt]}) -> {ok, Ref} | {error, Reason} Add transport capability to a service. SvcName = service_name() -Options = [transport_opt()] +Opt = transport_opt() Ref = transport_ref() Reason = term() @@ -984,16 +911,20 @@ marker="diameter_app#peer_up">peer_up/3
callback after which the caller can exchange Diameter messages with the peer over the transport. In addition to CER/CEA, the service takes responsibility for the -handling of DWR/DWA and required by RFC 3539 as well as for DPR/DPA.

+handling of DWR/DWA and required by RFC 3539, as well as for DPR/DPA.

The returned reference uniquely identifies the transport within the scope of the service. Note that the function returns before a transport connection has been -established. +established.

+ + +

It is not an error to add a transport to a service that has not yet been configured: a service can be started after configuring -transports.

+its transports.

+
@@ -1002,48 +933,47 @@ transports.

-call(SvcName, App, Request, Options) -> ok | Answer | {error, Reason} +call(SvcName, App, Request, [Opt]) -> Answer | ok | {error, Reason} Send a Diameter request message. SvcName = service_name() App = application_alias() Request = diameter_app:message() Answer = term() -Options = [call_opt()] +Opt = call_opt()

-Send a Diameter request message and possibly return the answer or error.

+Send a Diameter request message.

-App identifies the Diameter application in which the request is +App specifies the Diameter application in which the request is defined and callbacks to the corresponding callback module will follow as described below and in diameter_app(3). -Unless the detach option has been specified to cause an earlier -return, the call returns either when an answer message is received -from the peer or an error occurs. -In the case of an answer, the return value is as returned by a +Unless the detach option is specified, the call returns either +when an answer message is received from the peer or an error occurs. +In the answer case, the return value is as returned by a handle_answer/4 callback. -In the case of an error, whether or not the error is returned directly +In the error case, whether or not the error is returned directly by diameter or from a handle_error/4 callback depends on whether or not the outgoing request is -successfully encoded for transmission from the peer, the cases being +successfully encoded for transmission to the peer, the cases being documented below.

If there are no suitable peers, or if pick_peer/4 -rejects them by returning 'false', then {error, no_connection} +rejects them by returning false, then {error,no_connection} is returned. Otherwise pick_peer/4 is followed by a prepare_request/3 -callback, the message is encoded and sent.

+callback, the message is encoded and then sent.

There are several error cases which may prevent an @@ -1056,7 +986,7 @@ callback:

If the initial encode of the outgoing request -fails, then the request process fails and {error, encode} +fails, then the request process fails and {error,encode} is returned.

@@ -1073,7 +1003,7 @@ callback takes place with Reason = timeout.

If the request is successfully encoded and sent but the service in question is stopped before an answer is received then a handle_error/4 -callback takes place Reason = cancel.

+callback takes place with Reason = cancel.

@@ -1100,7 +1030,7 @@ callback.

If an encode error takes place during retransmission then the request process fails and -{error, failure} is returned.

+{error,failure} is returned.

@@ -1108,7 +1038,7 @@ retransmission then the request process fails and If an application callback made in processing the request fails (pick_peer, prepare_request, prepare_retransmit, handle_answer or handle_error) then either -{error, encode} or {error, failure} +{error,encode} or {error,failure} is returned depending on whether or not there has been an attempt to send the request over the transport.

@@ -1116,9 +1046,9 @@ attempt to send the request over the transport.

-Note that {error, encode} is the only return value which +Note that {error,encode} is the only return value which guarantees that the request has not been sent over the -transport.

+transport connection.

@@ -1167,7 +1097,7 @@ An arity-3-valued Pred removes all transports for which Pred(Ref, Type, Opts) returns true, where Type and Opts are as passed to add_transport/2 and Ref is -as returned by the corresponding call. +as returned by it. The remaining forms are equivalent to an arity-3 fun as follows.

@@ -1183,7 +1113,7 @@ Pred = {M,F,A}: fun(Ref, Type, Opts) -> apply(M, F, [Ref, Type, Opts | A]) end

Removing a transport causes all associated transport connections to be broken. -A base application DPR message with +A DPR message with Disconnect-Cause DO_NOT_WANT_TO_TALK_TO_YOU will be sent to each connected peer before disassociating the transport configuration from the service and terminating the transport upon reception of @@ -1198,10 +1128,12 @@ DPA or timeout.

-service_info(SvcName, Item) -> term() +service_info(SvcName, Info) -> term() Return information about a started service. SvcName = service_name() +Info = Item | [Info] +Item = atom()

@@ -1224,16 +1156,14 @@ Return information about a started service. 'Firmware-Revision'

-Return a capability value as configured on the service at start_service/2. -Note that all capabilities are returned in a tagged list with the -capabilities item.

+Return a capability value as configured with start_service/2.

applications

-Return the list of applications configured on the service at start_service/2.

@@ -1241,22 +1171,22 @@ marker="#start_service">start_service/2. capabilities

-Return a tagged list of all capabilities values configured on the service -at start_service/2.

transport

-Return a list containing one entry for every transport configured on -the service with add_transport/2. Each entry is a tagged list containing both configuration and information about established peer connections. An example return value with for a client service with Origin-Host -"client.example.com" configured with a single transport connected to "server.example.com" -might look as follows.

+"client.example.com" configured with a single transport connected to +"server.example.com" might look as follows.

[[{ref,#Ref<0.0.0.93>}, @@ -1306,21 +1236,20 @@ might look as follows.

-Here ref is the transport_ref() of the service's -transport and options are as were passed to ref is a transport_ref() and options +the corresponding transport_opt() list passed to add_transport/2. The watchdog entry shows the state of a connection's RFC 3539 watchdog state machine. The peer entry identifies the diameter_app:peer_ref() for -which there will have been a peer_up callback for the -Diameter applications negotiated during capabilities exchange, which -are identified by the apps entry, common in this case -being the application_alias() of this -application with Application Id 0. +which there will have been peer_up callbacks for the +Diameter applications identified by the apps entry, +common being the application_alias(). The caps entry identifies the capabilities sent by the local node and received from the peer during capabilities exchange. The port entry displays socket-level information about the @@ -1353,7 +1282,7 @@ connection might look as follows.

{port,3868}]}]}, {accept,[[{watchdog,{<0.56.0>,{1346,171481,226895},okay}}, {peer,{<0.58.0>,{1346,171491,999511}}}, - {apps,[{0,server}]}, + {apps,[{0,common}]}, {caps,[{origin_host,{"server.example.com","client.example.com"}}, {origin_realm,{"example.com","example.com"}}, {host_ip_address,{[{127,0,0,1}],[{127,0,0,1}]}}, @@ -1419,7 +1348,7 @@ A return value for the server above might look as follows.

{port,3868}]}]}, {watchdog,{<0.56.0>,{1346,171481,226895},okay}}, {peer,{<0.58.0>,{1346,171491,999511}}}, - {apps,[{0,server}]}, + {apps,[{0,common}]}, {caps,[{origin_host,{"server.example.com","client.example.com"}}, {origin_realm,{"example.com","example.com"}}, {host_ip_address,{[{127,0,0,1}],[{127,0,0,1}]}}, @@ -1481,6 +1410,12 @@ The Diameter-level statistics returned by transport and +

+Requesting info for an unknown service causes undefined to be +returned. +Requesting a list of items causes a tagged list to be +returned.

+
@@ -1554,8 +1489,7 @@ Start a diameter service.

A service defines a locally-implemented Diameter node, specifying the -capabilities of the node to be used during capabilities exchange and -the Diameter applications that it supports. +capabilities to be advertised during capabilities exchange. Transports are added to a service using add_transport/2.

@@ -1599,6 +1533,19 @@ Stop the diameter application.

Stop a diameter service.

+

+Stopping a service causes all associated transport connections to be +broken. +A DPR message with be sent as in the case of remove_transport/2.

+ + +

+Stopping a transport does not remove any associated transports: +remove_transport/2 must +be called to remove transport configuration.

+
+
@@ -1614,7 +1561,7 @@ Stop a diameter service.

Subscribe to service_event() messages from +marker="#service_event">service_event() messages from a service.

diff --git a/lib/diameter/doc/src/diameter_app.xml b/lib/diameter/doc/src/diameter_app.xml index 6e5c957eec..f6d53808f5 100644 --- a/lib/diameter/doc/src/diameter_app.xml +++ b/lib/diameter/doc/src/diameter_app.xml @@ -140,8 +140,8 @@ list of {FieldName, FieldValue} pairs.

A third representation allows a message to be specified as a list -whose head is a diameter_header record and whose tail is a list -of diameter_avp records. +whose head is a #diameter_header{} record and whose tail is a list +of #diameter_avp{} records. This representation is used by diameter itself when relaying requests as directed by the return value of a handle_request/3 @@ -158,10 +158,9 @@ are sent exactly as specified.

packet() = #diameter_packet{}

-A container for incoming and outgoing Diameters message that's passed +A container for incoming and outgoing Diameter messages that's passed through encode/decode and transport. -Fields of a packet() record should not be set in return values except -as documented.

+Fields should not be set in return values except as documented.

@@ -356,7 +355,7 @@ Extra arguments passed to diameter:call/4 can be used to communicate transport data to the callback. A returned packet() can also set the header field to a -diameter_header record in order to specify values that should +#diameter_header{} record in order to specify values that should be preserved in the outgoing request, although this should typically not be necessary and allows the callback to set header values inappropriately. @@ -603,7 +602,7 @@ header of the relayed request.

The returned Opts should not specify detach. A subsequent handle_answer/4 callback for the relayed request must return its first -argument, the diameter_packet record containing the answer +argument, the #diameter_packet{} record containing the answer message. Note that the extra option can be specified to supply arguments that can distinguish the relay case from others if so desired. diff --git a/lib/diameter/doc/src/diameter_transport.xml b/lib/diameter/doc/src/diameter_transport.xml index 4ed02e3881..4890333669 100644 --- a/lib/diameter/doc/src/diameter_transport.xml +++ b/lib/diameter/doc/src/diameter_transport.xml @@ -93,16 +93,19 @@ It should not link to the parent. It should exit if its transport connection with its peer is lost.

-Transport processes for a given service are started sequentially.

- -

-The start function should use the 'Host-IP-Address' list on the service, -namely Svc#diameter_service.host_ip_address, and/or +The capabilities in the #diameter_service{} record are as +passed to diameter:start_service/2 and +diameter:add_transport/2, +values passed to the latter overriding those passed to the former. +The start function should use the Host-IP-Address list and/or Opts to select an appropriate list of local IP addresses, -and should return this list if different from the service addresses. -The returned list is used to populate 'Host-IP-Address' AVPs in outgoing -capabilities exchange messages, the service addresses being used -otherwise.

+and should return this list if different from the +#diameter_service{} addresses. +The returned list is used to populate Host-IP-Address AVPs in +outgoing capabilities exchange messages, the +#diameter_service{} addresses being used otherwise.

@@ -129,9 +132,10 @@ diameter.

An outbound Diameter message. -Packet can be either binary() (the message to be sent) -or a #diameter_packet{} whose transport_data field -containes a value other than undefined.

+Packet can be either binary() (the message to be sent) +or a #diameter_packet{} record whose transport_data +field contains a value other than undefined and whose bin field +contains the binary to send.

{diameter, {close, Pid}} @@ -140,7 +144,7 @@ containes a value other than undefined.

A request to close the transport connection. The transport process should terminate after closing the connection. -Pid is the pid() of the parent process.

+Pid is the pid() of the parent process.

{diameter, {tls, Ref, Type, Bool}} @@ -148,17 +152,17 @@ Pid is the pid() of the parent process.

Indication of whether or not capabilities exchange has selected inband security using TLS. -Ref is a reference() that must be included in the +Ref is a reference() that must be included in the {diameter, {tls, Ref}} reply message to the transport's parent process (see below). -Type is either connect or accept depending on +Type is either connect or accept depending on whether the process has been started for a connecting or listening transport respectively. -Bool is a boolean() indicating whether or not the transport connection -should be upgraded to TLS.

+Bool is a boolean() indicating whether or not the transport +connection should be upgraded to TLS.

-If TLS is requested (Bool = true) then a connecting process should +If TLS is requested (Bool = true) then a connecting process should initiate a TLS handshake with the peer and an accepting process should prepare to accept a handshake. A successful handshake should be followed by a {diameter, {tls, Ref}} @@ -182,18 +186,18 @@ to its parent.

{diameter, {self(), connected}}

-Inform the parent that the transport process with Type = accept has +Inform the parent that the transport process with Type=accept has established a connection with the peer. -Not sent if the transport process has Type = connect.

+Not sent if the transport process has Type=connect.

{diameter, {self(), connected, Remote}}

-Inform the parent that the transport process with Type = connect +Inform the parent that the transport process with Type=connect has established a connection with a peer. -Not sent if the transport process has Type = accept. -Remote is an arbitrary term that uniquely identifies the remote +Not sent if the transport process has Type=accept. +Remote is an arbitrary term that uniquely identifies the remote endpoint to which the transport has connected.

@@ -201,14 +205,14 @@ endpoint to which the transport has connected.

An inbound Diameter message. -Packet can be either binary() (the message to be sent) -or #diameter_packet{} -whose packet field contains a binary(). -Any value (other than undefined) set in +Packet can be either binary() (the received message) +or a #diameter_packet{} record +whose bin field contains the received binary(). +Any value (other than undefined) set in the transport_data field will be passed back with a corresponding answer message in the case that the inbound message is a request unless the sender sets another value. -How the transport_data is used/interpreted is up to the +How transport_data is used/interpreted is up to the transport module.

@@ -216,7 +220,7 @@ transport module.

Acknowledgment of a successful TLS handshake. -Ref is the reference() received in the +Ref is the reference() received in the {diameter, {tls, Ref, Type, Bool}} message in response to which the reply is sent. A transport must exit if a handshake is not successful.

-- cgit v1.2.3 From 6530d6b10490311d37080da982282a3b69bad059 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Wed, 29 Aug 2012 11:49:46 +0200 Subject: Add SCTP warning, more references --- lib/diameter/doc/src/diameter_sctp.xml | 48 +++++++++++++++++++--------- lib/diameter/doc/src/diameter_tcp.xml | 49 ++++++++++++++++++----------- lib/diameter/doc/src/diameter_transport.xml | 2 +- 3 files changed, 64 insertions(+), 35 deletions(-) (limited to 'lib') diff --git a/lib/diameter/doc/src/diameter_sctp.xml b/lib/diameter/doc/src/diameter_sctp.xml index 03e2f1f6be..7e02a07bb4 100644 --- a/lib/diameter/doc/src/diameter_sctp.xml +++ b/lib/diameter/doc/src/diameter_sctp.xml @@ -60,9 +60,9 @@ and implements the behaviour documented in Type = connect | accept Ref = diameter:transport_ref() Svc = #diameter_service{} -Opt = {raddr, inet:ip_address()} | {rport, integer()} | term() +Opt = {raddr, inet:ip_address()} | {rport, integer()} | term() Pid = pid() -LAddr = inet:ip_address() +LAddr = inet:ip_address() Reason = term() @@ -75,12 +75,13 @@ marker="diameter_transport#start">diameter_transport(3).

The only diameter_sctp-specific argument is the options list. Options raddr and rport specify the remote address and port for a connecting transport and not valid for a listening -transport. -The former is required while latter defaults to 3868 if unspecified. +transport: the former is required while latter defaults to 3868 if +unspecified. More than one raddr option can be specified, in which case the connecting transport in question attempts each in sequence until an association is established. -Remaining options are any accepted by gen_sctp:open/1, with the exception +Remaining options are any accepted by gen_sctp:open/1, with the exception of options mode, binary, list, active and sctp_events. Note that options ip and port specify the local address @@ -88,30 +89,45 @@ and port respectively.

Multiple ip options can be specified for a multihomed peer. -If none are specified then the values of Host-IP-Address -on the service are used. (In particular, one of these must be specified.) +If none are specified then the values of Host-IP-Address +in the #diameter_service{} record are used. +(In particular, one of these must be specified.) Option port defaults to 3868 for a listening transport and 0 for a connecting transport.

+ +

+An insufficiently large receive buffer may result in a peer having to +resend incoming messages: set the inet option recbuf to increase +the buffer size.

+ +

+An insufficiently large send buffer may result in outgoing messages +being discarded: set the inet option sndbuf to increase +the buffer size.

+
+

diameter_sctp uses the transport_data field of -the diameter_packet record to communicate the stream on which an +the #diameter_packet{} record to communicate the stream on which an inbound message has been received, or on which an outbound message should be sent: the value will be of the form {stream, Id} on an inbound message passed to a handle_request or handle_answer callback. -For an outbound message, either undefined (explicitly of -by specifying the outbound message as a binary()) or a tuple +For an outbound message, either undefined (explicitly or +by receiving the outbound message as a binary()) or a tuple should be set in the return value of handle_request (typically by retaining the value passed into this function) or prepare_request. -The value undefined uses a "next outbound stream" id and then -increments this modulo the total number outbound streams. That -is, successive values of undefined cycle through all outbound -streams.

+The value undefined uses a "next outbound stream" id and +increments this modulo the total number outbound streams. +That is, successive values of undefined cycle through all +outbound streams.

@@ -128,7 +144,9 @@ streams.

SEE ALSO

-diameter_transport(3)

+diameter_transport(3), +gen_sctp(3), +inet(3)

diff --git a/lib/diameter/doc/src/diameter_tcp.xml b/lib/diameter/doc/src/diameter_tcp.xml index 6ad98c8640..b42d65701e 100644 --- a/lib/diameter/doc/src/diameter_tcp.xml +++ b/lib/diameter/doc/src/diameter_tcp.xml @@ -38,8 +38,9 @@ under the License.

-This module implements diameter transport over TCP using gen_tcp. -It can be specified as the value of a transport_module option to +This module implements diameter transport over TCP using gen_tcp. +It can be specified as the value of a transport_module option to diameter:add_transport/2 and implements the behaviour documented in @@ -67,15 +68,15 @@ before configuring TLS capability on diameter transports.

Type = connect | accept Ref = diameter:transport_ref() Svc = #diameter_service{} -Opt = OwnOpt | SslOpt | OtherOpt +Opt = OwnOpt | SslOpt | TcpOpt Pid = pid() -LAddr = inet:ip_address() +LAddr = inet:ip_address() Reason = term() -OwnOpt = {raddr, inet:ip_address()} +OwnOpt = {raddr, inet:ip_address()} | {rport, integer()} | {port, integer()} SslOpt = {ssl_options, true | list()} -OtherOpt = term() +TcpOpt = term() @@ -89,25 +90,32 @@ Options raddr and rport specify the remote address and port for a connecting transport and are not valid for a listening transport. Option ssl_options must be specified for a transport -that must be able to support TLS: a value of true results in a +that should support TLS: a value of true results in a TLS handshake immediately upon connection establishment while -list() specifies options to be passed to ssl:connect/2 of ssl:ssl_accept/2 +list() specifies options to be passed to ssl:connect/2 or +ssl:ssl_accept/2 after capabilities exchange if TLS is negotiated. -Remaining options are any accepted by ssl:connect/3 or gen_tcp:connect/3 for -a connecting transport, or ssl:listen/3 or gen_tcp:listen/2 for +Remaining options are any accepted by ssl:connect/3 or gen_tcp:connect/3 for +a connecting transport, or ssl:listen/3 or gen_tcp:listen/2 for a listening transport, depending on whether or not {ssl_options, true} has been specified. -Options binary, packet and active cannot be specified. +Options binary, +packet and active cannot be specified. Also, option port can be specified for a listening transport to specify the local listening port, the default being the standardized 3868 if unspecified. -Note that option ip specifies the local address.

+Note that the option ip specifies the local address.

An ssl_options list must be specified if and only if -the transport in question has specified an Inband-Security-Id -AVP with value TLS on the relevant call to -Inband-Security-Id to +1 (TLS), as +specified to either start_service/2 or add_transport/2, @@ -122,9 +130,9 @@ that will not be forthcoming, which will eventually cause the RFC 3539 watchdog to take down the connection.

-If the service specifies more than one Host-IP-Address and -option ip is unspecified then the -first of the service's addresses is used as the local address.

+If the #diameter_service{} record has more than one +Host-IP-Address and option ip is unspecified then the +first of the these addresses is used as the local address.

The returned local address list has length one.

@@ -142,7 +150,10 @@ The returned local address list has length one.

diameter(3), -diameter_transport(3)

+diameter_transport(3), +gen_tcp(3), +inet(3), +ssl(3)

diff --git a/lib/diameter/doc/src/diameter_transport.xml b/lib/diameter/doc/src/diameter_transport.xml index 4890333669..e852041278 100644 --- a/lib/diameter/doc/src/diameter_transport.xml +++ b/lib/diameter/doc/src/diameter_transport.xml @@ -63,7 +63,7 @@ parent).

Svc = #diameter_service{} Opts = term() Pid = pid() -LAddrs = [inet:ip_address()] +LAddrs = [inet:ip_address()] Reason = term() -- cgit v1.2.3 From aa3b094b75248f6e8d29395dc46a980fdb670c4d Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Wed, 29 Aug 2012 18:18:58 +0200 Subject: Minor updates/corrections to Users Guide --- lib/diameter/doc/src/diameter_examples.xml | 3 +-- lib/diameter/doc/src/diameter_intro.xml | 27 ++++++++++++++------------- lib/diameter/doc/src/diameter_using.xml | 4 ++-- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'lib') diff --git a/lib/diameter/doc/src/diameter_examples.xml b/lib/diameter/doc/src/diameter_examples.xml index 966d1f1eee..1fd7755695 100644 --- a/lib/diameter/doc/src/diameter_examples.xml +++ b/lib/diameter/doc/src/diameter_examples.xml @@ -5,7 +5,7 @@
-2011 +20112012 Ericsson AB. All Rights Reserved. @@ -37,7 +37,6 @@ under the License.

-To be written. Example code can be found in the diameter application's examples subdirectory.

diff --git a/lib/diameter/doc/src/diameter_intro.xml b/lib/diameter/doc/src/diameter_intro.xml index ef08002a8b..bc2afbd453 100644 --- a/lib/diameter/doc/src/diameter_intro.xml +++ b/lib/diameter/doc/src/diameter_intro.xml @@ -4,7 +4,7 @@
-2011 +20112012 Ericsson AB. All Rights Reserved. @@ -44,11 +44,11 @@ agent. This chapter provides a short overview of the application.

-A Diameter peer is implemented by configuring a service and +A Diameter node is implemented by configuring a service and one or more transports using the interface module diameter. The service configuration defines the Diameter applications to be -supported by the peer and, typically, the capabilities that it should +supported by the node and, typically, the capabilities that it should send to remote peers at capabilities exchange upon the establishment of transport connections. A transport is configured on a service and provides protocol-specific @@ -57,16 +57,17 @@ diameter and implemented by a transport module. The diameter application provides two transport modules: diameter_tcp and diameter_sctp for transport over TCP -(using gen_tcp) and SCTP (using gen_sctp) respectively. +(using gen_tcp) and SCTP +(using gen_sctp) respectively. Other transports can be provided by any module that implements diameter's transport interface.

-While a service typically implements a single Diameter peer (as +While a service typically implements a single Diameter node (as identified by an Origin-Host AVP), transports can themselves be -associated with capabilities AVP's so that a single service be used to -implement more than one Diameter peer.

+associated with capabilities AVP's so that a single service can be +used to implement more than one Diameter node.

Each Diameter application defined on a service is configured with a @@ -76,19 +77,19 @@ diameter communicates the connectivity of remote peers, requests peer selection for outgoing requests, and communicates the reception of incoming Diameter request and answer messages. An application using diameter implements these application callback -modules to provide the functionality of the Diameter peer(s) it +modules to provide the functionality of the Diameter node(s) it implements.

-Each Diameter application is also configured with one or more -dictionary modules +Each Diameter application is also configured with a +dictionary module that provide encode/decode functionality for outgoing/incoming -Diameter messages. -A module is generated from a specification file using the diameterc utility. Dictionaries for the RFC 3588 Diameter Common Messages, Base -Accounting and Relay applications are provided by the diameter +Accounting and Relay applications are provided with the diameter application.

diff --git a/lib/diameter/doc/src/diameter_using.xml b/lib/diameter/doc/src/diameter_using.xml index 809b76bdf3..7d9c0cd492 100644 --- a/lib/diameter/doc/src/diameter_using.xml +++ b/lib/diameter/doc/src/diameter_using.xml @@ -5,7 +5,7 @@
-2011 +20112012 Ericsson AB. All Rights Reserved. @@ -23,7 +23,7 @@ under the License. -Using the stack +Usage -- cgit v1.2.3 From bacef78cef7998e5b71bf69c12e510d716cdea0a Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Wed, 29 Aug 2012 18:58:44 +0200 Subject: Update diameterc doc --- lib/diameter/doc/src/diameter_compile.xml | 45 +++++++++---------------------- 1 file changed, 12 insertions(+), 33 deletions(-) (limited to 'lib') diff --git a/lib/diameter/doc/src/diameter_compile.xml b/lib/diameter/doc/src/diameter_compile.xml index 60e08d41da..7a6ca48798 100644 --- a/lib/diameter/doc/src/diameter_compile.xml +++ b/lib/diameter/doc/src/diameter_compile.xml @@ -4,7 +4,7 @@
-2011 +20112012 Ericsson AB. All Rights Reserved. @@ -31,7 +31,7 @@ supplied.

-The diameterc utility is used to transform diameter +The diameterc utility is used to compile diameter dictionary files into Erlang source. The resulting source implements the interface diameter requires @@ -47,7 +47,7 @@ to encode and decode the dictionary's messages and AVP's.

] ]]>

-Transforms a single dictionary file. Valid options are as follows.

+Compiles a single dictionary file. Valid options are as follows.

@@ -64,47 +64,36 @@ Defaults to the current working directory.

Specifies a directory to add to the code path. -Use to point at beam files corresponding to dictionaries -inherited by the one being compiled using @inherits or ---inherits. -Inheritance is a beam dependency, not an erl/hrl dependency.

+Use to point at beam files compiled from inherited dictionaries, +@inherits in a dictionary file creating a beam dependency, not +an erl/hrl dependency.

Multiple -i options can be specified.

- -

-Supresses erl generation.

-
-

-Supresses hrl generation.

+Supresses erl and hrl generation, respectively.

]]> - -

-Set @name in the dictionary file. -Overrides any setting in the file itself.

-
- ]]>

-Set @prefix in the dictionary file. +Set @name and @prefix in the dictionary, +respectively. Overrides any setting in the file itself.

]]>

-Append an @inherits to the dictionary file. -Specifying '-' as the dictionary has the effect of clearing -any previous inherits, effectively ignoring previous inherits.

+Append an @inherits to the dictionary before compiling. +Specifying '-' as the dictionary has the effect of clearing any +previous inherits, causing them to be ignored.

Multiple --inherits options can be specified.

@@ -129,16 +118,6 @@ Returns 0 on success, non-zero on failure.

-
-BUGS - -

-The identification of errors in the source file is poor.

- -
- - -
SEE ALSO -- cgit v1.2.3 From 3b8c54429b4da595f72bc6c2738bd03ba03ab80c Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Thu, 30 Aug 2012 09:26:26 +0200 Subject: Add warning about 'host' filter --- lib/diameter/doc/src/diameter.xml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml index fdd18929df..0bfbf62cd3 100644 --- a/lib/diameter/doc/src/diameter.xml +++ b/lib/diameter/doc/src/diameter.xml @@ -463,6 +463,10 @@ specified list.

+

+An invalid filter is equivalent to {any,[]}, a filter +that matches no peer.

+

The host and realm filters examine the @@ -473,13 +477,18 @@ the message contains at most one of each AVP. If this is not the case then the {host|realm, DiameterIdentity()} filters must be used to achieve the desired result. -An empty host/realm (which should not be typical) -is equivalent to an unspecified one for the purposes of filtering.

+An empty DiameterIdentity() +(which should not be typical) +matches all hosts/realms for the purposes of filtering.

+

-An invalid filter is equivalent to {any,[]}, a filter -that matches no peer.

+A host filter is not typically desirable when setting +Destination-Host since it will remove peer agents from the +candidates list.

+
-- cgit v1.2.3 From b9f75367e58e8d0ece55f654c540b8c061c3f328 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Thu, 30 Aug 2012 09:39:48 +0200 Subject: Minor formatting fixes Type references enclosed in . --- lib/diameter/doc/src/diameter.xml | 57 +++++++++++++++-------------- lib/diameter/doc/src/diameter_transport.xml | 2 +- 2 files changed, 30 insertions(+), 29 deletions(-) (limited to 'lib') diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml index 0bfbf62cd3..38b3cdcba5 100644 --- a/lib/diameter/doc/src/diameter.xml +++ b/lib/diameter/doc/src/diameter.xml @@ -368,7 +368,8 @@ eval(F) ->

-Applying an evaluable() E to an argument list A +Applying an evaluable() +E to an argument list A is meant in the sense of eval([E|A]).

@@ -436,8 +437,8 @@ specified value, or all peers if the atom any.

{eval, evaluable()}

-Matches only those peers for which the specified evaluable() returns +Matches only those peers for which the specified evaluable() returns true on the connection's diameter_caps record. Any other return value or exception is equivalent to false.

@@ -471,9 +472,9 @@ that matches no peer.

The host and realm filters examine the outgoing request as passed to call/4, -assuming that this is a record- or list-valued diameter_app:message(), and that -the message contains at most one of each AVP. +assuming that this is a record- or list-valued diameter_app:message(), +and that the message contains at most one of each AVP. If this is not the case then the {host|realm, DiameterIdentity()} filters must be used to achieve the desired result. @@ -675,7 +676,7 @@ that is somewhat unique.

An option passed to start_service/2. -Can be any capability() as +Can be any capability() as well as the following.

@@ -688,8 +689,8 @@ Defines a Diameter application supported by the service.

A service must configure one application for each Diameter application it intends to support. -For an outgoing Diameter request, the relevant application_alias() is +For an outgoing Diameter request, the relevant application_alias() is passed to call/4, while for an incoming request the application identifier in the message header determines the application, the identifier being specified in @@ -786,8 +787,8 @@ TLS is desired over TCP as implemented by A callback invoked upon reception of CER/CEA during capabilities exchange in order to ask whether or not the connection should be accepted. -Applied to the relevant transport_ref() and the +Applied to the relevant transport_ref() and the #diameter_caps{} record of the connection. Returning ok accepts the connection. Returning integer() causes an incoming @@ -1075,7 +1076,7 @@ outgoing messages.

The value returned is the number of seconds since 19680120T031408Z, -the first value that can be encoded as a Diameter Time(), +the first value that can be encoded as a Diameter Time(), at the time the diameter application was started.

@@ -1245,20 +1246,20 @@ An example return value with for a client service with Origin-Host

-Here ref is a transport_ref() and options -the corresponding transport_opt() list passed to ref is a transport_ref() and options +the corresponding transport_opt() list passed to add_transport/2. The watchdog entry shows the state of a connection's RFC 3539 watchdog state machine. -The peer entry identifies the diameter_app:peer_ref() for +The peer entry identifies the diameter_app:peer_ref() for which there will have been peer_up callbacks for the Diameter applications identified by the apps entry, -common being the application_alias(). +common being the application_alias(). The caps entry identifies the capabilities sent by the local node and received from the peer during capabilities exchange. The port entry displays socket-level information about the @@ -1277,8 +1278,8 @@ during the lifetime of the transport configuration.

A listening transport presents its information slightly differently -since there may be multiple accepted connections for the same transport_ref(). +since there may be multiple accepted connections for the same transport_ref(). The transport info returned by a server with a single client connection might look as follows.

@@ -1405,10 +1406,10 @@ contrast to transport info.

Return a {{Counter, Ref}, non_neg_integer()} list of counter values. -Ref can be either a transport_ref() -or a diameter_app:peer_ref(). +Ref can be either a transport_ref() +or a diameter_app:peer_ref(). Entries for the latter are folded into corresponding entries for the former as peer connections go down. Entries for both are removed at

-Subscribe to service_event() messages from +Subscribe to service_event() messages from a service.

diff --git a/lib/diameter/doc/src/diameter_transport.xml b/lib/diameter/doc/src/diameter_transport.xml index e852041278..f355107096 100644 --- a/lib/diameter/doc/src/diameter_transport.xml +++ b/lib/diameter/doc/src/diameter_transport.xml @@ -162,7 +162,7 @@ transport respectively. connection should be upgraded to TLS.

-If TLS is requested (Bool = true) then a connecting process should +If TLS is requested (Bool=true) then a connecting process should initiate a TLS handshake with the peer and an accepting process should prepare to accept a handshake. A successful handshake should be followed by a {diameter, {tls, Ref}} -- cgit v1.2.3 From b1c9f8412fcf6261d84cd2043ca0b9cca680112f Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Thu, 30 Aug 2012 09:45:31 +0200 Subject: Fix/tweak references to other applications --- lib/diameter/doc/src/diameter.xml | 4 ++-- lib/diameter/doc/src/diameter_sctp.xml | 12 ++++++------ lib/diameter/doc/src/diameter_tcp.xml | 20 ++++++++++---------- lib/diameter/doc/src/diameter_transport.xml | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) (limited to 'lib') diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml index 38b3cdcba5..8635399d6f 100644 --- a/lib/diameter/doc/src/diameter.xml +++ b/lib/diameter/doc/src/diameter.xml @@ -665,8 +665,8 @@ The name of a service as passed to start_service/2 and with which the service is identified. There can be at most one service with a given name on a given node. -Note that erlang:make_ref/0 can be used to generate a service name -that is somewhat unique.

+Note that erlang:make_ref/0 +can be used to generate a service name that is somewhat unique.

diff --git a/lib/diameter/doc/src/diameter_sctp.xml b/lib/diameter/doc/src/diameter_sctp.xml index 7e02a07bb4..955169349c 100644 --- a/lib/diameter/doc/src/diameter_sctp.xml +++ b/lib/diameter/doc/src/diameter_sctp.xml @@ -4,7 +4,7 @@
-2011 +20112012 Ericsson AB. All Rights Reserved. @@ -60,9 +60,9 @@ and implements the behaviour documented in Type = connect | accept Ref = diameter:transport_ref() Svc = #diameter_service{} -Opt = {raddr, inet:ip_address()} | {rport, integer()} | term() +Opt = {raddr, inet:ip_address()} | {rport, integer()} | term() Pid = pid() -LAddr = inet:ip_address() +LAddr = inet:ip_address() Reason = term() @@ -81,7 +81,7 @@ More than one raddr option can be specified, in which case the connecting transport in question attempts each in sequence until an association is established. Remaining options are any accepted by gen_sctp:open/1, with the exception +marker="kernel:gen_sctp#open-1">gen_sctp:open/1, with the exception of options mode, binary, list, active and sctp_events. Note that options ip and port specify the local address @@ -99,13 +99,13 @@ connecting transport.

An insufficiently large receive buffer may result in a peer having to resend incoming messages: set the inet option recbuf to increase +marker="kernel:inet">inet(3) option recbuf to increase the buffer size.

An insufficiently large send buffer may result in outgoing messages being discarded: set the inet option sndbuf to increase +marker="kernel:inet">inet(3) option sndbuf to increase the buffer size.

diff --git a/lib/diameter/doc/src/diameter_tcp.xml b/lib/diameter/doc/src/diameter_tcp.xml index b42d65701e..3ffcebfd90 100644 --- a/lib/diameter/doc/src/diameter_tcp.xml +++ b/lib/diameter/doc/src/diameter_tcp.xml @@ -4,7 +4,7 @@
-2011 +20112012 Ericsson AB. All Rights Reserved. @@ -39,7 +39,7 @@ under the License.

This module implements diameter transport over TCP using gen_tcp. +marker="kernel:gen_tcp">gen_tcp. It can be specified as the value of a transport_module option to diameter:add_transport/2 @@ -70,9 +70,9 @@ before configuring TLS capability on diameter transports.

Svc = #diameter_service{} Opt = OwnOpt | SslOpt | TcpOpt Pid = pid() -LAddr = inet:ip_address() +LAddr = inet:ip_address() Reason = term() -OwnOpt = {raddr, inet:ip_address()} +OwnOpt = {raddr, inet:ip_address()} | {rport, integer()} | {port, integer()} SslOpt = {ssl_options, true | list()} @@ -93,15 +93,15 @@ Option ssl_options must be specified for a transport that should support TLS: a value of true results in a TLS handshake immediately upon connection establishment while list() specifies options to be passed to ssl:connect/2 or -ssl:ssl_accept/2 +marker="ssl:ssl#connect-2">ssl:connect/2 or +ssl:ssl_accept/2 after capabilities exchange if TLS is negotiated. Remaining options are any accepted by ssl:connect/3 or gen_tcp:connect/3 for +marker="ssl:ssl#connect-3">ssl:connect/3 or gen_tcp:connect/3 for a connecting transport, or ssl:listen/3 or gen_tcp:listen/2 for +marker="ssl:ssl#listen-2">ssl:listen/2 or gen_tcp:listen/2 for a listening transport, depending on whether or not {ssl_options, true} has been specified. Options binary, diff --git a/lib/diameter/doc/src/diameter_transport.xml b/lib/diameter/doc/src/diameter_transport.xml index f355107096..1bd45d9ce8 100644 --- a/lib/diameter/doc/src/diameter_transport.xml +++ b/lib/diameter/doc/src/diameter_transport.xml @@ -63,7 +63,7 @@ parent).

Svc = #diameter_service{} Opts = term() Pid = pid() -LAddrs = [inet:ip_address()] +LAddrs = [inet:ip_address()] Reason = term() -- cgit v1.2.3 From 62cc32d8dddb2aa89c3e2c973d4fc11a5e5db06f Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Thu, 30 Aug 2012 10:38:20 +0200 Subject: Correct doc on AVP P flag and add warning about its deprecation --- lib/diameter/doc/src/diameter_app.xml | 2 +- lib/diameter/doc/src/diameter_dict.xml | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/diameter/doc/src/diameter_app.xml b/lib/diameter/doc/src/diameter_app.xml index f6d53808f5..a358ccac33 100644 --- a/lib/diameter/doc/src/diameter_app.xml +++ b/lib/diameter/doc/src/diameter_app.xml @@ -5,7 +5,7 @@
-2011 +20112012 Ericsson AB. All Rights Reserved. diff --git a/lib/diameter/doc/src/diameter_dict.xml b/lib/diameter/doc/src/diameter_dict.xml index cc638dbc18..26d6ad4e56 100644 --- a/lib/diameter/doc/src/diameter_dict.xml +++ b/lib/diameter/doc/src/diameter_dict.xml @@ -275,10 +275,12 @@ Location-Information 350 Grouped MV Requested-Information 353 Enumerated V +

-Note that the P flag has been deprecated by the Diameter Maintenance -and Extensions Working Group of the IETF: diameter will set the P flag -to 0 as mandated by the current draft standard.

+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.

+
-- cgit v1.2.3 From 910055a9257ae0bd5c9203fccc2eb13d07c6dc21 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Thu, 30 Aug 2012 12:22:52 +0200 Subject: Fix broken references --- lib/diameter/doc/src/diameter.xml | 5 +++-- lib/diameter/doc/src/diameter_app.xml | 31 ++++++++++--------------------- 2 files changed, 13 insertions(+), 23 deletions(-) (limited to 'lib') diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml index 8635399d6f..b8652a7482 100644 --- a/lib/diameter/doc/src/diameter.xml +++ b/lib/diameter/doc/src/diameter.xml @@ -86,6 +86,7 @@ in this module.

OctetString() Time() Unsigned32() +UTF8String()

Types corresponding to RFC 3588 AVP Data Formats. @@ -312,7 +313,7 @@ returns an address list.

{'Vendor-Id', Unsigned32()} -{'Product-Name', UTF8String()} +{'Product-Name', UTF8String()} {'Origin-State-Id', Unsigned32()}

@@ -731,7 +732,7 @@ corresponding timeout (see below) or all fail.

{transport_config, term()} -{transport_config, term(), Unsigned32()} +{transport_config, term(), Unsigned32()}

A term passed as the third argument to the A tuple representing a Diameter peer connection.

- - -service_name() = term() - -

-The service supporting the Diameter application. -Specified to diameter:start_service/2 -when starting the service.

-
- state() = term() @@ -224,7 +213,7 @@ process.

Mod:peer_up(SvcName, Peer, State) -> NewState Invoked when a transport connection has been established -SvcName = #service_name() +SvcName = diameter:service_name() Peer = peer() State = NewState = state() @@ -243,7 +232,7 @@ the callback module in question has been configured.

Mod:peer_down(SvcName, Peer, State) -> NewState Invoked when a transport connection has been lost. -SvcName = service_name() +SvcName = diameter:service_name() Peer = peer() State = NewState = state() @@ -263,7 +252,7 @@ call to peer_up/3.

Candidates = [peer()] Peer = peer() | false -SvcName = service_name() +SvcName = diameter:service_name() State = NewState = state() @@ -334,7 +323,7 @@ or peer_down/3 callback.

Return a request for encoding and transport. Packet = packet() -SvcName = service_name() +SvcName = diameter:service_name() Peer = peer() Action = {send, packet() | message()} | {discard, Reason} | discard @@ -379,7 +368,7 @@ discarded}.

Return a request for encoding and retransmission. Packet = packet() -SvcName = service_name() +SvcName = diameter:service_name() Peer = peer() Result = {send, packet() | message()} | {discard, Reason} | discard @@ -410,7 +399,7 @@ discarded}.

Packet = packet() Request = message() -SvcName = service_name() +SvcName = diameter:service_name() Peer = peer() Result = term() @@ -462,7 +451,7 @@ marker="diameter#start_service">diameter:start_service/2.

Reason = timeout | failover | term() Request = message() -SvcName = service_name() +SvcName = diameter:service_name() Peer = peer() Result = term() @@ -495,10 +484,10 @@ callback returned false.

Packet = packet() SvcName = term() Peer = peer() -Action = Reply | {relay, Opts} | discard | {eval, Action, PostF} +Action = Reply | {relay, [Opt]} | discard | {eval, Action, PostF} Reply = {reply, message()} | {protocol_error, 3000..3999} -Opts = diameter:call_opts() +Opt = diameter:call_opt() PostF = diameter:evaluable() @@ -521,7 +510,7 @@ The argument packet() has the following sign #diameter_packet{header = #diameter_header{}, avps = [#diameter_avp{}], msg = record() | undefined, - errors = [Unsigned32() | {Unsigned32(), #diameter_avp{}}], + errors = [Unsigned32() | {Unsigned32(), #diameter_avp{}}], bin = binary(), transport_data = term()} -- cgit v1.2.3