All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions | Variables
netconf_lib.c File Reference
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <signal.h>
#include <fcntl.h>
#include <time.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <syslog.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/param.h>
#include <assert.h>
#include <cligen/cligen.h>
#include <clixon/clixon.h>
#include "netconf_rpc.h"
#include "netconf_lib.h"


int add_preamble (cbuf *xf)
int add_postamble (cbuf *xf)
int add_error_preamble (cbuf *xf, char *reason)
int add_error_postamble (cbuf *xf)
int detect_endtag (char *tag, char ch, int *state)
char * netconf_get_target (cxobj *xn, char *path)
int netconf_output (int s, cbuf *xf, char *msg)


enum transport_type transport = NETCONF_SSH
int cc_closed = 0

Function Documentation

int add_error_postamble ( cbuf *  xf)
int add_error_preamble ( cbuf *  xf,
char *  reason 
int add_postamble ( cbuf *  xf)
int add_preamble ( cbuf *  xf)
int detect_endtag ( char *  tag,
char  ch,
int *  state 

Look for a text pattern in an input string, one char at a time

[in]tagWhat to look for
[in]chNew input character
[in,out]stateA state integer holding how far we have parsed.
Return values
0No, we havent detected end tag
1Yes, we have detected end tag! XXX: move to clicon_xml?
char* netconf_get_target ( cxobj *  xn,
char *  path 

Get "target" attribute, return actual database given candidate or running Caller must do error handling

Return values
dbnameActual database file name
int netconf_output ( int  s,
cbuf *  xf,
char *  msg 

Send netconf message from cbuf on socket

[in]cbCligen buffer that contains the XML message
[in]msgOnly for debug

Variable Documentation

int cc_closed = 0
enum transport_type transport = NETCONF_SSH