libnetconf  0.10.0-146_trunk
NETCONF Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
session.h File Reference

Functions to handle NETCONF sessions. More...

#include "transport.h"
#include "netconf.h"
Include dependency graph for session.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int nc_cpblts_add (struct nc_cpblts *capabilities, const char *capability_string)
 Add another capability string into the NETCONF capabilities structure. More...
 
int nc_cpblts_count (const struct nc_cpblts *c)
 Get the number of capabilities in the structure. More...
 
int nc_cpblts_enabled (const struct nc_session *session, const char *capability_string)
 Check if the given capability is supported by the session. More...
 
void nc_cpblts_free (struct nc_cpblts *c)
 Free NETCONF capabilities structure. More...
 
const char * nc_cpblts_get (const struct nc_cpblts *c, const char *capability_string)
 Get complete capability string including parameters. More...
 
const char * nc_cpblts_iter_next (struct nc_cpblts *c)
 Get the next capability string from the given NETCONF capabilities structure. More...
 
void nc_cpblts_iter_start (struct nc_cpblts *c)
 Move NETCONF capabilities structure iterator to the beginning of the capability strings list. More...
 
struct nc_cpblts * nc_cpblts_new (const char *const list[])
 Create a new NETCONF capabilities structure. More...
 
int nc_cpblts_remove (struct nc_cpblts *capabilities, const char *capability_string)
 Remove the specified capability string from the NETCONF capabilities structure. More...
 
int nc_msgid_compare (const nc_msgid id1, const nc_msgid id2)
 Compare two message IDs if they are the same. More...
 
struct nc_session * nc_session_dummy (const char *sid, const char *username, const char *hostname, struct nc_cpblts *capabilities)
 Create a disconnected session structure. More...
 
void nc_session_free (struct nc_session *session)
 Cleanup the session structure and free all the allocated resources. More...
 
struct nc_cpblts * nc_session_get_cpblts (const struct nc_session *session)
 Get list of capabilities associated with the session. More...
 
struct nc_cpblts * nc_session_get_cpblts_default (void)
 Get NULL terminated list of the default capabilities supported by libnetconf including the list of namespaces provided by the datastores created with ncds_new() and initialized by ncds_init(). More...
 
int nc_session_get_eventfd (const struct nc_session *session)
 Get the input file descriptor to asynchronous control of input events. More...
 
const char * nc_session_get_host (const struct nc_session *session)
 Get NETCONF session host. More...
 
const char * nc_session_get_id (const struct nc_session *session)
 Get NETCONF session ID. More...
 
const char * nc_session_get_port (const struct nc_session *session)
 Get NETCONF session port number. More...
 
NC_SESSION_STATUS nc_session_get_status (const struct nc_session *session)
 Get information about the session current status. More...
 
NC_TRANSPORT nc_session_get_transport (const struct nc_session *session)
 Get transport protocol used for the NETCONF session. More...
 
const char * nc_session_get_user (const struct nc_session *session)
 Get NETCONF session username. More...
 
int nc_session_get_version (const struct nc_session *session)
 Get NETCONF protocol version used in the given session. More...
 
int nc_session_monitor (struct nc_session *session)
 Add the session into the internal list of monitored sessions that are returned as part of netconf-state information defined in RFC 6022. More...
 
int nc_session_notif_allowed (struct nc_session *session)
 Tell me if the notification subscription is allowed on the given session. More...
 
NC_MSG_TYPE nc_session_recv_notif (struct nc_session *session, int timeout, nc_ntf **ntf)
 Receive a <notification> message from the specified NETCONF session. This function is supposed to be performed only by NETCONF clients. More...
 
NC_MSG_TYPE nc_session_recv_reply (struct nc_session *session, int timeout, nc_reply **reply)
 Receive <rpc-reply> response from the specified NETCONF session. This function is supposed to be performed only by NETCONF clients. More...
 
NC_MSG_TYPE nc_session_recv_rpc (struct nc_session *session, int timeout, nc_rpc **rpc)
 Receive <rpc> request from the specified NETCONF session. This function is supposed to be performed only by NETCONF servers. More...
 
int nc_session_send_notif (struct nc_session *session, const nc_ntf *ntf)
 Send <notification> message from server to client. More...
 
NC_MSG_TYPE nc_session_send_recv (struct nc_session *session, nc_rpc *rpc, nc_reply **reply)
 Send <rpc> and receive <rpc-reply> via the specified NETCONF session. More...
 
const nc_msgid nc_session_send_reply (struct nc_session *session, const nc_rpc *rpc, const nc_reply *reply)
 Send <rpc-reply> response via specified NETCONF session. This function is supposed to be performed only by NETCONF servers. More...
 
const nc_msgid nc_session_send_rpc (struct nc_session *session, nc_rpc *rpc)
 Send <rpc> request via specified NETCONF session. This function is supposed to be performed only by NETCONF clients. More...
 

Detailed Description

Functions to handle NETCONF sessions.

Author
Radek Krejci rkrej.nosp@m.ci@c.nosp@m.esnet.nosp@m..cz Copyright (c) 2012-2014 CESNET, z.s.p.o.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the Company nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

ALTERNATIVELY, provided that this notice is retained in full, this product may be distributed under the terms of the GNU General Public License (GPL) version 2 or later, in which case the provisions of the GPL apply INSTEAD OF those given above.

This software is provided ``as is, and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the company or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.