Commit 81474963 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰 Committed by Francis Dupont

[#5,!49] Added DHCPv4-specific netconf example config.

parent 46408c1e
......@@ -59,6 +59,7 @@ nobase_dist_doc_DATA += examples/kea6/stateless.json
nobase_dist_doc_DATA += examples/kea6/with-ddns.json
nobase_dist_doc_DATA += examples/netconf/comments.json
nobase_dist_doc_DATA += examples/netconf/simple.json
nobase_dist_doc_DATA += examples/netconf/simple-dhcp4.json
devel:
mkdir -p html
......
// This is a simple example of a configuration for Netconf that handles
// DHCPv4 configuration. This example provides YANG interface for
// DHCPv4 server only.
{
"Netconf":
{
// This map specifies how each server is managed:
// the YANG model to use and the control channel.
"managed-servers":
{
// This is how Netconf can communicate with the DHCPv4 server.
"dhcp4":
{
// Eventually, the kea-netconf will be able to handle multiple
// models. However, for the time being the only choice for
// DHCPv4 server is kea-dhcp4-server model.
"model": "kea-dhcp4-server",
// Currently three control channel types are supported:
// - "stdout" which output the configuration on the standard
// output (this is mainly for testing purposes, but you can
// use simple script (such as curl or socat) to pass that
// information to the server.
// - "unix" which uses the local control channel supported by
// "dhcp4" and "dhcp6" servers ("d2" support is coming in Kea 1.5)
// - "http" which uses the Control Agent (CA) to manage itself or
// to forward commands to "dhcp4" or "dhcp6".
"control-socket":
{
"socket-type": "unix",
"socket-name": "/tmp/kea4-ctrl-socket"
},
// Comment is optional. You can put some notes here.
"comment": "Kea DHCP4 server serving network on floor 13"
}
},
// Netconf is able to load hook libraries that augment its operation.
// The primary functionality is the ability to add new commands.
"hooks-libraries": [
// Hook libraries list may contain more than one library.
{
// The only necessary parameter is the library filename.
"library": "/opt/local/netconf-commands.so",
// Some libraries may support parameters. Make sure you
// type this section carefully, as the CA does not validate
// it (because the format is library specific).
"parameters": {
"param1": "foo"
}
}
]
},
// Similar to other Kea components, Netconf also uses logging.
"Logging":
{
"loggers": [
{
"name": "kea-netconf",
"output_options": [
{
"output": "/var/log/kea-netconf.log",
// Several additional parameters are possible in addition
// to the typical output. Flush determines whether logger
// flushes output to a file. Maxsize determines maximum
// filesize before the file is being rotated. maxver
// specifies the maximum number of rotated files being
// kept.
"flush": true,
"maxsize": 204800,
"maxver": 4
}
],
"severity": "INFO",
"debuglevel": 0
}
]
}
}
......@@ -172,7 +172,7 @@ TEST(ParserTest, keywordNetconf) {
TEST(ParserTest, keywordSubNetconf) {
// This is similar to previous test, but note the lack of outer
// map and Netconf-agent.
// map and Netconf.
string txt = "{\n"
" \"managed-servers\": {"
" \"dhcp4\": {"
......@@ -348,6 +348,7 @@ TEST(ParserTest, file) {
vector<string> configs;
configs.push_back("comments.json");
configs.push_back("simple.json");
configs.push_back("simple-dhcp4.json");
for (int i = 0; i<configs.size(); i++) {
testFile(string(CFG_EXAMPLES) + "/" + configs[i]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment