From 2e848e9290c2c912df46a7f9b4cd93ce002e9ba9 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Sat, 6 Apr 2013 15:59:13 +0200 Subject: Add transport interface 'connected' message with local address list A transport module can return a local address list from its start/3 function in order to specify addresses to be used as Host-IP-Address during capabilities exchange. Now allow addresses to be communicated in a 'connected' message in the case of a connecting transport, so that diameter_tcp (in particular) can make local address configuration optional, communicating the gen_tcp default after connection establishment instead. --- lib/diameter/doc/src/diameter_transport.xml | 30 ++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'lib/diameter/doc') diff --git a/lib/diameter/doc/src/diameter_transport.xml b/lib/diameter/doc/src/diameter_transport.xml index 55b531155f..8bccf6521e 100644 --- a/lib/diameter/doc/src/diameter_transport.xml +++ b/lib/diameter/doc/src/diameter_transport.xml @@ -1,6 +1,8 @@ message()'> + MESSAGES'> + start/3'> inet:ip_address()'> @@ -12,7 +14,7 @@
-20112012 +20112013 Ericsson AB. All Rights Reserved. @@ -125,7 +127,7 @@ Ref is the value that was returned from the call to &mod_add_transport; that has lead to starting of a transport process.

-Svc contains the capabilities passed to &mod_start_service; and +Svc contains capabilities passed to &mod_start_service; and &mod_add_transport;, values passed to the latter overriding those passed to the former.

@@ -134,13 +136,16 @@ passed to the former.

&mod_transport_opt; list passed to &mod_add_transport;.

-The start function should use the Host-IP-Address list and/or -Config to select an appropriate list of local IP addresses, -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.

+The start function should use the Host-IP-Address list in +Svc and/or Config to select an appropriate list of local +IP addresses, and should return this list if different from the +Svc addresses. +In the connecting case, the local address list can instead be +communicated in a connected message (see &MESSAGES; below) +following connection establishment. +In either case, the local address list is used to populate +Host-IP-Address AVPs in outgoing capabilities exchange +messages.

A transport process must implement the message interface documented below. @@ -230,13 +235,16 @@ Not sent if the transport process has Type=connect.

{diameter, {self(), connected, Remote}} +{diameter, {self(), connected, Remote, [LocalAddr]}}

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. +Not sent if the transport process has Type=acceptRemote is an arbitrary term that uniquely identifies the remote -endpoint to which the transport has connected.

+endpoint to which the transport has connected. +A LocalAddr list has the same semantics as one returned from +&start;.

{diameter, {recv, &message;}} -- cgit v1.2.3 From 1b377b3d24596cbfb5b7ce20705dc9fce9aac0b6 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Thu, 28 Mar 2013 00:44:50 +0100 Subject: Make explicit local address to diameter_tcp:start/3 optional Use the default address address (as selected by gen_tcp) if none is configured, passing it in the new 'connected' message introduced by the previous commit. The corresponding update to diameter_sctp has to wait until problems with inet:sockname/1 are resolved: the function currently only returns one address, and sometimes {0,0,0,0}. See OTP-11018. --- lib/diameter/doc/src/diameter.xml | 5 +++-- lib/diameter/doc/src/diameter_tcp.xml | 20 ++++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) (limited to 'lib/diameter/doc') diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml index 7ea93d480b..97071ff323 100644 --- a/lib/diameter/doc/src/diameter.xml +++ b/lib/diameter/doc/src/diameter.xml @@ -343,8 +343,9 @@ Has one of the following types.

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.

+Host-IP-Address need not be specified if the transport module in +question communicates an address list as described in +&man_transport;

{'Vendor-Id', &dict_Unsigned32;} diff --git a/lib/diameter/doc/src/diameter_tcp.xml b/lib/diameter/doc/src/diameter_tcp.xml index 01c781d553..8e509aa829 100644 --- a/lib/diameter/doc/src/diameter_tcp.xml +++ b/lib/diameter/doc/src/diameter_tcp.xml @@ -1,5 +1,6 @@ start/3'> gen_tcp:connect/3'> start({Type, Ref}, Svc, [Opt]) - -> {ok, Pid, [LAddr]} | {error, Reason} + -> {ok, Pid} + | {ok, Pid, [LAddr]} + | {error, Reason} Start a transport process. Type = connect | accept @@ -153,13 +156,14 @@ that will not be forthcoming, which will eventually cause the RFC 3539 watchdog to take down the connection.

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

- +If an ip option is not specified then the first element of a +non-empty Host-IP-Address list in Svc provides the local +IP address. +If neither is specified then the default address selected by &gen_tcp; +is used. +In all cases, the selected address is either returned from +&start; or passed in a connected message over the transport +interface.

-- cgit v1.2.3