/*
*
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
This file is part of CLIXON.
CLIXON is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
CLIXON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with CLIXON; see the file LICENSE. If not, see
.
*
* IETF yang routing example
*/
#include
#include
#include
#include
#include
#include
/* clicon */
#include
/* Clicon library functions. */
#include
/* These include signatures for plugin and transaction callbacks. */
#include
/*! This is called on validate (and commit). Check validity of candidate
*/
int
transaction_validate(clicon_handle h,
transaction_data td)
{
if (debug)
transaction_print(stderr, td);
return 0;
}
/*! This is called on commit. Identify modifications and adjust machine state
*/
int
transaction_commit(clicon_handle h,
transaction_data td)
{
cxobj *target = transaction_target(td); /* wanted XML tree */
cxobj **vec;
int i;
size_t len;
/* Get all added i/fs */
vec = xpath_vec_flag(target, "//interface", XML_FLAG_ADD, &len);
for (i=0; i