CliXoN
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
netconf_filter.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 <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"
#include "netconf_filter.h"

Functions

static char * leafstring (cxobj *x)
 
static int xml_filter_recursive (cxobj *xfilter, cxobj *xparent, int *remove_me)
 
int xml_filter (cxobj *xfilter, cxobj *xconfig)
 

Function Documentation

static char* leafstring ( cxobj *  x)
static
int xml_filter ( cxobj *  xfilter,
cxobj *  xconfig 
)

Remove parts of configuration xml tree that does not match filter xml tree

Parameters
[in]xfilterFilter xml
[out]xconfConfiguration xml
Return values
0OK
-1Error This is the top-level function, calls a recursive variant.
static int xml_filter_recursive ( cxobj *  xfilter,
cxobj *  xparent,
int *  remove_me 
)
static

Internal recursive part where configuration xml tree is pruned frim filter assume parent has been selected and filter match (same name) as parent parent is pruned according to selection.

Parameters
[in]xfilterFilter xml
[out]xconfConfiguration xml
Return values
0OK
-1Error