libnetconf  0.10.0-146_trunk
NETCONF Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Call Home

Call Home is a mechanism how a NETCONF server can initiate connection to a NETCONF client. Specification for this technique can be found in NETCONF over SSH Call Home draft and in NETCONF over TLS RFC. Some other aspects of this are also described in NETCONF Server Configuration Data Model.

This Mechanism is extremely useful especially in case the device (NETCONF server) is deployed behind a NAT and management application is not able to connect (NETCONF client) to such a device.

See the Netopeer project as a reference implementation.

Call Home on the Client Side

This section describes how to receive Call Home connection.

Because the client usually doesn't except incoming connection, it is necessary to explicitly start listening for Call Home. For this, libnetconf provides nc_callhome_listen() function that allows to specify port where it will wait for incoming Call Home connections. The function makes the caller listening on all interfaces supporting both, IPv4 and IPv6 addresses. To stop listening, nc_callhome_listen_stop() can be used.

To get the first connection request from the queue of pending Call Home connections, use nc_callhome_accept(). It gets incoming Call Home TCP socket and uses it to establish a new NETCONF session according to given parameters similarly to nc_session_connect() function.

From this point, client can work with returned NETCONF session as usual. There is no special termination function for NETCONF session from Call Home.

Call Home on the Server Side

For Call Home, the server initiate connection. Therefore, transport protocol must be set before starting Call Home. It is done by nc_session_transport() function.

Next, server is supposed to prepare the list of servers, where libnetconf will be trying to establish the Call Home connection. There is a set of nc_callhome_mngmt_server_*() functions, used for this purpose.

Finally, there is nc_callhome_connect() to establish new NETCONF session based on Call Home mechanism. Note, that the function doesn't return a NETCONF session. It forks the process to start a standalone transport protocol server (SSH/TLS) according to the given parameters. It returns PID of the started process and TCP socket used for the communication. This socket can be used for monitoring state of the connection. Do not read any data from this socket.

Call Home workflow in libnetconf

callhome workflow