[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
netconf--
Below is an updated version of my "netconf in a nutshell" document
which I created last night (and which I decided to call netconf--
since it is using ancient 20 year old technology). I basically turned
the pseudo code into something concrete and made several things more
precise. There are of course open issues. Anyway, enjoy or ignore.
/js
/*
* <j.schoenwaelder@iu-bremen.de> April 2003
*
* Core netconf RPCs (as described section 5 of the xmlconf draft)
* specified using XDR as described in RFC 1832 (an IETF Draft Standard
* at the time of this writing).
*/
/*
* Netconf error status codes:
*/
enum netconfstat {
NETCONF_OK = 0, /* no error */
NETCONF_ERR = 1 /* xxx well known error codes ? xxx */
};
/*
* Netconf formats for configuration data:
*/
enum netconffmt {
NETCONF_FMT_XML = 1, /* XML encoded configuration data */
NETCONF_FMT_TXT = 2 /* opaque textual configuration data */
};
/*
* Netconf types for config names, filters, data, ...:
*/
typedef string netconfname<>; /* name of a configuration */
typedef string netconffilter<>; /* filter to be applied to a configuration */
struct netconfdata {
netconffmt format; /* format of the configuration data */
string data<>; /* configuration data */
};
const OPTION_TEST = 0x00000001; /* test-set instead set */
const OPTION_REPLACE = 0x00000002; /* replace instead merge */
const OPTION_IGNORE = 0x00000004; /* ignore errors */
/*
* Netconf results returned by the operations:
*/
/* xxx the xmlconf spec also reports a tag, a severity, action,
statement (?), and edit-path in case of failures xxx */
union netconfstatmsg switch (netconfstat status) {
case NETCONF_OK:
void;
default:
string message<>; /* human readable error message */
};
union netconfstatmsgdata switch (netconfstat status) {
case NETCONF_OK:
netconfdata data<>; /* configuration data */
default:
string errmsg<>; /* human readable error message */
};
/*
* Netconf arguments for the operations:
*/
struct getconfigargs {
netconfname config; /* name of config to retrieve */
netconffilter filter; /* config filter parameter */
netconffmt format; /* config format requested */
};
struct editconfigargs {
netconfname target; /* name of config to edit */
unsigned options; /* see option constants above */
netconffmt format; /* format of config data */
netconfdata data; /* config data */
};
struct copyconfigargs {
netconfname source; /* source config name */
netconfname target; /* target config name */
netconffmt format; /* format during the copy */
};
struct deleteconfigargs {
netconfname config; /* name of config to delete */
};
struct getstateargs {
netconffilter filter; /* state filter parameter */
netconffmt format; /* state format requested */
};
struct validateargs {
netconfname config; /* name of config to validate */
};
struct lockargs {
netconfname config; /* name of config to lock */
};
struct unlockargs {
netconfname config; /* name of config to unlock */
};
struct commitargs {
bool confirmed; /* request confirmed commit */
unsigned timeout; /* commit timeout in minutes */
};
/*
* Netconf RPC definitions and registrations:
*/
program NETCONFPROG {
version NETCONFVERS_ONE {
netconfstatmsgdata
NETCONFPROC_GETCONFIG(getconfigargs) = 1;
netconfstatmsg
NETCONFPROC_EDITCONFIG(editconfigargs) = 2;
netconfstatmsg
NETCONFPROC_COPYCONFIG(copyconfigargs) = 3;
netconfstatmsg
NETCONFPROC_DELETECONFIG(deleteconfigargs) = 4;
netconfstatmsgdata
NETCONFPROC_GETSTATE(getstateargs) = 5;
netconfstatmsg
NETCONFPROC_VALIDATE(validateargs) = 6;
netconfstatmsg
NETCONFPROC_LOCK(lockargs) = 7;
netconfstatmsg
NETCONFPROC_UNLOCK(unlockargs) = 8;
netconfstatmsg
NETCONFPROC_COMMIT(commitargs) = 9;
netconfstatmsg
NETCONFPROC_DISCARD() = 10; /* xxx ??? xxx */
} = 1;
} = 123456;
#if 0
/*
* Not sure if this is needed in an approach where sessions map to
* transport connections 1:1 and how notifications would be integrated
* well.
*/
void
kill_session(in unsigned session_id,
out string status);
void
open_notifications(in string format,
in string matching,
out string status);
void
close_notifications(out string status);
#endif
--
to unsubscribe send a message to xmlconf-request@ops.ietf.org with
the word 'unsubscribe' in a single line as the message text body.
archive: <http://ops.ietf.org/lists/xmlconf/>