}
}
+\"Control-agent\" {
+ switch(driver.ctx_) {
+ case isc::d2::D2ParserContext::CONFIG:
+ return isc::d2::D2Parser::make_CONTROL_AGENT(driver.loc_);
+ default:
+ return isc::d2::D2Parser::make_STRING("Control-agent", driver.loc_);
+ }
+}
+
{JSONString} {
/* A string has been matched. It contains the actual string and single quotes.
DHCP6 "Dhcp6"
DHCP4 "Dhcp4"
+ CONTROL_AGENT "Control-agent"
DHCPDDNS "DhcpDdns"
IP_ADDRESS "ip-address"
};
-// This defines the top-level { } that holds Dhcp6, Dhcp4, DhcpDdns or Logging
-// objects.
+// This defines the top-level { } that holds Control-agent, Dhcp6, Dhcp4,
+// DhcpDdns or Logging objects.
syntax_map: LCURLY_BRACKET {
// This code is executed when we're about to start parsing
// the content of the map
| logging_object
| dhcp4_json_object
| dhcpddns_object
+ | control_agent_json_object
| unknown_map_entry
;
ctx.leave();
};
+control_agent_json_object: CONTROL_AGENT {
+ ctx.enter(ctx.NO_KEYWORD);
+} COLON value {
+ ctx.stack_.back()->set("Control-agent", $4);
+ ctx.leave();
+};
+
// --- logging entry -----------------------------------------
// This defines the top level "Logging" object. It parses
}
}
+\"Control-agent\" {
+ switch(driver.ctx_) {
+ case isc::dhcp::Parser4Context::CONFIG:
+ return isc::dhcp::Dhcp4Parser::make_CONTROL_AGENT(driver.loc_);
+ default:
+ return isc::dhcp::Dhcp4Parser::make_STRING("Control-agent", driver.loc_);
+ }
+}
+
\"4o6-interface\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::SUBNET4:
DHCP6 "Dhcp6"
DHCPDDNS "DhcpDdns"
+ CONTROL_AGENT "Control-agent"
// Not real tokens, just a way to signal what the parser is expected to
// parse.
};
-// This defines the top-level { } that holds Dhcp6, Dhcp4, DhcpDdns or Logging
-// objects.
+// This defines the top-level { } that holds Control-agent, Dhcp6, Dhcp4,
+// DhcpDdns or Logging objects.
syntax_map: LCURLY_BRACKET {
// This code is executed when we're about to start parsing
// the content of the map
// for it.
};
-// This represents top-level entries: Dhcp6, Dhcp4, DhcpDdns, Logging
+// This represents top-level entries: Control-agent, Dhcp6, Dhcp4,
+// DhcpDdns, Logging
global_objects: global_object
| global_objects COMMA global_object
;
| logging_object
| dhcp6_json_object
| dhcpddns_json_object
+ | control_agent_json_object
| unknown_map_entry
;
ctx.leave();
};
+control_agent_json_object: CONTROL_AGENT {
+ ctx.enter(ctx.NO_KEYWORD);
+} COLON value {
+ ctx.stack_.back()->set("Control-agent", $4);
+ ctx.leave();
+};
+
// --- logging entry -----------------------------------------
// This defines the top level "Logging" object. It parses
}
}
+\"Control-agent\" {
+ switch(driver.ctx_) {
+ case isc::dhcp::Parser6Context::CONFIG:
+ return isc::dhcp::Dhcp6Parser::make_CONTROL_AGENT(driver.loc_);
+ default:
+ return isc::dhcp::Dhcp6Parser::make_STRING("Control-agent", driver.loc_);
+ }
+}
+
+
{JSONString} {
/* A string has been matched. It contains the actual string and single quotes.
We need to get those quotes out of the way and just use its content, e.g.
DHCP4 "Dhcp4"
DHCPDDNS "DhcpDdns"
+ CONTROL_AGENT "Control-agent"
// Not real tokens, just a way to signal what the parser is expected to
// parse.
};
-// This defines the top-level { } that holds Dhcp6, Dhcp4, DhcpDdns or Logging
-// objects.
+// This defines the top-level { } that holds Control-agent, Dhcp6, Dhcp4,
+// DhcpDdns or Logging objects.
syntax_map: LCURLY_BRACKET {
// This code is executed when we're about to start parsing
// the content of the map
| logging_object
| dhcp4_json_object
| dhcpddns_json_object
+ | control_agent_json_object
| unknown_map_entry
;
ctx.leave();
};
+control_agent_json_object: CONTROL_AGENT {
+ ctx.enter(ctx.NO_KEYWORD);
+} COLON value {
+ ctx.stack_.back()->set("Control-agent", $4);
+ ctx.leave();
+};
+
+
// --- logging entry -----------------------------------------
// This defines the top level "Logging" object. It parses
-// This is a basic configuration for the Kea DHCPv4 and DHCPv6 servers. Subnet
-// declarations are mostly commented out and no interfaces are listed.
-// Therefore, the servers will not listen or respond to any queries. The basic
-// configuration must be extended to specify interfaces on which the servers
-// should listen. There are a number of example options defined. These probably
-// don't make any sense in your network. Make sure you at least update the
-// following, before running this example in your network:
+// This is a basic configuration for the Kea DHCP servers and Kea Control
+// Agent. Subnet declarations are mostly commented out and no interfaces are
+// listed. Therefore, the servers will not listen or respond to any queries.
+// The basic configuration must be extended to specify interfaces on which
+// the servers should listen. There are a number of example options defined.
+// These probably don't make any sense in your network. Make sure you at least
+// update the following, before running this example in your network:
// - change the network interface names
// - change the subnets to match your actual network
// - change the option values to match your network
"reverse-ddns" : {}
},
+// This is a basic configuraton for the Kea Control Agent.
+// RESTful interface to be available at http://127.0.0.1:8080/
+"Control-agent": {
+ "http-host": "127.0.0.1",
+ "http-port": 8080,
+
+ // Specify location of the files to which the Control Agent
+ // should connect to forward commands to the DHCPv4 and DHCPv6
+ // server via unix domain socket.
+ "control-sockets": {
+ "dhcp4": {
+ "socket-type": "unix",
+ "socket-name": "/tmp/kea-dhcp4-ctrl.sock"
+ },
+ "dhcp6": {
+ "socket-type": "unix",
+ "socket-name": "/tmp/kea-dhcp6-ctrl.sock"
+ }
+ },
+
+ // Specify hooks libraries that are attached to the Control Agent.
+ // Such hooks libraries should support 'control_command_receive'
+ // hook point. This is currently commented out because it has to
+ // point to the existing hooks library. Otherwise the Control
+ // Agent will fail to start.
+ "hooks-libraries": [
+// {
+// "library": "/opt/local/control-agent-commands.so",
+// "parameters": {
+// "param1": "foo"
+// }
+// }
+ ]
+},
+
// Logging configuration starts here. Kea uses different loggers to log various
// activities. For details (e.g. names of loggers), see Chapter 18.
"Logging":
// of logs if told to do so.
"debuglevel": 0
},
- {
- // This specifies the logging for kea-dhcp6 logger, i.e. all logs
- // generated by Kea DHCPv6 server.
- "name": "kea-dhcp6",
- "output_options": [
- {
- "output": "@localstatedir@/log/kea-dhcp6.log"
- }
- ],
- "severity": "INFO",
- "debuglevel": 0
- },
- {
- // This specifies the logging for D2 (DHCP-DDNS) daemon.
- "name": "kea-dhcp-ddns",
- "output_options": [
- {
- "output": "@localstatedir@/log/kea-ddns.log"
- }
- ],
- "severity": "INFO",
- "debuglevel": 0
- }
+ {
+ // This specifies the logging for kea-dhcp6 logger, i.e. all logs
+ // generated by Kea DHCPv6 server.
+ "name": "kea-dhcp6",
+ "output_options": [
+ {
+ "output": "@localstatedir@/log/kea-dhcp6.log"
+ }
+ ],
+ "severity": "INFO",
+ "debuglevel": 0
+ },
+ {
+ // This specifies the logging for D2 (DHCP-DDNS) daemon.
+ "name": "kea-dhcp-ddns",
+ "output_options": [
+ {
+ "output": "@localstatedir@/log/kea-ddns.log"
+ }
+ ],
+ "severity": "INFO",
+ "debuglevel": 0
+ },
+ {
+ "name": "kea-ctrl-agent",
+ "output_options": [
+ {
+ "output": "@localstatedir@/log/kea-ctrl-agent.log"
+ }
+ ],
+ "severity": "INFO",
+ "debuglevel": 0
+ }
]
}
-
- // In the future releases, also Control Agent configuration will be kept here.
- // However, for the time being, it is kept in a separate file.
}