Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastian Schrader
Kea
Commits
65ce0078
Commit
65ce0078
authored
Jul 10, 2017
by
Marcin Siodelski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[5108] Control agent's configuration can be shared with other components.
parent
ea17790e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
139 additions
and
40 deletions
+139
-40
src/bin/d2/d2_lexer.ll
src/bin/d2/d2_lexer.ll
+9
-0
src/bin/d2/d2_parser.yy
src/bin/d2/d2_parser.yy
+11
-2
src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_lexer.ll
+9
-0
src/bin/dhcp4/dhcp4_parser.yy
src/bin/dhcp4/dhcp4_parser.yy
+13
-3
src/bin/dhcp6/dhcp6_lexer.ll
src/bin/dhcp6/dhcp6_lexer.ll
+10
-0
src/bin/dhcp6/dhcp6_parser.yy
src/bin/dhcp6/dhcp6_parser.yy
+12
-2
src/bin/keactrl/kea.conf.pre
src/bin/keactrl/kea.conf.pre
+75
-33
No files found.
src/bin/d2/d2_lexer.ll
View file @
65ce0078
...
...
@@ -467,6 +467,15 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"
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.
...
...
src/bin/d2/d2_parser.yy
View file @
65ce0078
...
...
@@ -51,6 +51,7 @@ using namespace std;
DHCP6 "Dhcp6"
DHCP4 "Dhcp4"
CONTROL_AGENT "Control-agent"
DHCPDDNS "DhcpDdns"
IP_ADDRESS "ip-address"
...
...
@@ -204,8 +205,8 @@ unknown_map_entry: STRING COLON {
};
// 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
...
...
@@ -227,6 +228,7 @@ global_object: dhcp6_json_object
| logging_object
| dhcp4_json_object
| dhcpddns_object
| control_agent_json_object
| unknown_map_entry
;
...
...
@@ -613,6 +615,13 @@ dhcp4_json_object: DHCP4 {
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
...
...
src/bin/dhcp4/dhcp4_lexer.ll
View file @
65ce0078
...
...
@@ -1246,6 +1246,15 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"
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_);
}
}
\"
4
o6-interface\
" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::SUBNET4:
...
...
src/bin/dhcp4/dhcp4_parser.yy
View file @
65ce0078
...
...
@@ -183,6 +183,7 @@ using namespace std;
DHCP6 "Dhcp6"
DHCPDDNS "DhcpDdns"
CONTROL_AGENT "Control-agent"
// Not real tokens, just a way to signal what the parser is expected to
// parse.
...
...
@@ -338,8 +339,8 @@ unknown_map_entry: STRING COLON {
};
// 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
...
...
@@ -351,7 +352,8 @@ syntax_map: LCURLY_BRACKET {
// 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
;
...
...
@@ -361,6 +363,7 @@ global_object: dhcp4_object
| logging_object
| dhcp6_json_object
| dhcpddns_json_object
| control_agent_json_object
| unknown_map_entry
;
...
...
@@ -1656,6 +1659,13 @@ dhcpddns_json_object: DHCPDDNS {
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
...
...
src/bin/dhcp6/dhcp6_lexer.ll
View file @
65ce0078
...
...
@@ -1377,6 +1377,16 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"
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.
...
...
src/bin/dhcp6/dhcp6_parser.yy
View file @
65ce0078
...
...
@@ -190,6 +190,7 @@ using namespace std;
DHCP4 "Dhcp4"
DHCPDDNS "DhcpDdns"
CONTROL_AGENT "Control-agent"
// Not real tokens, just a way to signal what the parser is expected to
// parse.
...
...
@@ -347,8 +348,8 @@ unknown_map_entry: STRING COLON {
};
// 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
...
...
@@ -370,6 +371,7 @@ global_object: dhcp6_object
| logging_object
| dhcp4_json_object
| dhcpddns_json_object
| control_agent_json_object
| unknown_map_entry
;
...
...
@@ -1752,6 +1754,14 @@ dhcpddns_json_object: DHCPDDNS {
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
...
...
src/bin/keactrl/kea.conf.pre
View file @
65ce0078
// This is a basic configuration for the Kea DHCP
v4 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
...
...
@@ -734,6 +734,41 @@
"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":
...
...
@@ -776,32 +811,39 @@
// 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.
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment