-/* Copyright (C) 2017-2023 Internet Systems Consortium, Inc. ("ISC")
+/* Copyright (C) 2017-2024 Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
}
}
+\"http-headers\" {
+ switch(driver.ctx_) {
+ case ParserContext::AGENT:
+ return AgentParser::make_HTTP_HEADERS(driver.loc_);
+ default:
+ return AgentParser::make_STRING("http-headers", driver.loc_);
+ }
+}
+
\"user-context\" {
switch(driver.ctx_) {
case ParserContext::AGENT:
+ case ParserContext::HTTP_HEADERS:
case ParserContext::AUTHENTICATION:
case ParserContext::CLIENTS:
case ParserContext::SERVER:
\"comment\" {
switch(driver.ctx_) {
case ParserContext::AGENT:
+ case ParserContext::HTTP_HEADERS:
case ParserContext::AUTHENTICATION:
case ParserContext::CLIENTS:
case ParserContext::SERVER:
}
}
+\"name\" {
+ switch(driver.ctx_) {
+ case ParserContext::LOGGERS:
+ case ParserContext::HTTP_HEADERS:
+ return AgentParser::make_NAME(driver.loc_);
+ default:
+ return AgentParser::make_STRING("name", driver.loc_);
+ }
+}
+
+\"value\" {
+ switch(driver.ctx_) {
+ case ParserContext::HTTP_HEADERS:
+ return AgentParser::make_VALUE(driver.loc_);
+ default:
+ return AgentParser::make_STRING("value", driver.loc_);
+ }
+}
+
\"authentication\" {
switch(driver.ctx_) {
case ParserContext::AGENT:
}
}
-\"name\" {
- switch(driver.ctx_) {
- case ParserContext::LOGGERS:
- return AgentParser::make_NAME(driver.loc_);
- default:
- return AgentParser::make_STRING("name", driver.loc_);
- }
-}
-
\"output_options\" {
switch(driver.ctx_) {
case ParserContext::LOGGERS:
-/* Copyright (C) 2017-2023 Internet Systems Consortium, Inc. ("ISC")
+/* Copyright (C) 2017-2024 Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
CONTROL_AGENT "Control-agent"
HTTP_HOST "http-host"
HTTP_PORT "http-port"
+ HTTP_HEADERS "http-headers"
USER_CONTEXT "user-context"
COMMENT "comment"
+ NAME "name"
+ VALUE "value"
+
AUTHENTICATION "authentication"
TYPE "type"
BASIC "basic"
PARAMETERS "parameters"
LOGGERS "loggers"
- NAME "name"
OUTPUT_OPTIONS "output-options"
OUTPUT "output"
DEBUGLEVEL "debuglevel"
// Dhcp6.
global_param: http_host
| http_port
+ | http_headers
| trust_anchor
| cert_file
| key_file
ctx.leave();
};
+http_headers: HTTP_HEADERS {
+ ctx.unique("http-headers", ctx.loc2pos(@1));
+ ElementPtr l(new ListElement(ctx.loc2pos(@1)));
+ ctx.stack_.back()->set("http-headers", l);
+ ctx.enter(ctx.HTTP_HEADERS);
+} COLON LSQUARE_BRACKET http_header_list RSQUARE_BRACKET {
+ ctx.stack_.pop_back();
+ ctx.leave();
+};
+
+http_header_list: http_header
+ | not_empty_http_header_list COMMA http_header
+ | not_empty_http_header_list COMMA {
+ ctx.warnAboutExtraCommas(@2);
+ }
+ ;
+
+http_header: LCURLY_BRACKET {
+ ElementPtr m(new MapElement(ctx.loc2pos(@1)));
+ ctx.stack_.back()->add(m);
+ ctx.stack_.push_back(m);
+} http_header_params RCURLY_BRACKET {
+ ctx.stack_.pop_back();
+};
+
+http_header_params: http_header_param
+ | http_header_params COMMA http_header_param
+ | http_header_params COMMA {
+ ctx.warnAboutExtraCommas(@2);
+ }
+ ;
+
+http_header_param: name
+ | value
+ | user_context
+ | comment
+ | unknown_map_entry
+ ;
+
+name: NAME {
+ ctx.unique("name", ctx.loc2pos(@1));
+ ctx.enter(ctx.NO_KEYWORDS);
+} COLON STRING {
+ ElementPtr name(new StringElement($4, ctx.loc2pos(@4)));
+ ctx.stack_.back()->set("name", name);
+ ctx.leave();
+};
+
+value: VALUE {
+ ctx.unique("value", ctx.loc2pos(@1));
+ ctx.enter(ctx.NO_KEYWORDS);
+} COLON STRING {
+ ElementPtr value(new StringElement($4, ctx.loc2pos(@4)));
+ ctx.stack_.back()->set("value", value);
+ ctx.leave();
+};
+
// --- hooks-libraries ---------------------------------------------------------
hooks_libraries: HOOKS_LIBRARIES {
ctx.unique("hooks-libraries", ctx.loc2pos(@1));
| unknown_map_entry
;
-name: NAME {
- ctx.unique("name", ctx.loc2pos(@1));
- ctx.enter(ctx.NO_KEYWORDS);
-} COLON STRING {
- ElementPtr name(new StringElement($4, ctx.loc2pos(@4)));
- ctx.stack_.back()->set("name", name);
- ctx.leave();
-};
-
debuglevel: DEBUGLEVEL COLON INTEGER {
ctx.unique("debuglevel", ctx.loc2pos(@1));
ElementPtr dl(new IntElement($3, ctx.loc2pos(@3)));
return ("toplevel");
case AGENT:
return ("Control-agent");
+ case HTTP_HEADERS:
+ return ("http-headers");
case AUTHENTICATION:
return ("authentication");
case AUTH_TYPE:
-// Copyright (C) 2017-2023 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2024 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
///< Used while parsing content of Agent.
AGENT,
+ ///< Used while parsing HTTP headers.
+ HTTP_HEADERS,
+
///< Used while parsing Control-agent/Authentication.
AUTHENTICATION,
case isc::dhcp::Parser4Context::OPTION_DATA:
case isc::dhcp::Parser4Context::CLIENT_CLASSES:
case isc::dhcp::Parser4Context::SHARED_NETWORK:
+ case isc::dhcp::Parser4Context::HTTP_HEADERS:
case isc::dhcp::Parser4Context::LOGGERS:
return isc::dhcp::Dhcp4Parser::make_NAME(driver.loc_);
default:
case isc::dhcp::Parser4Context::CONTROL_SOCKET:
case isc::dhcp::Parser4Context::AUTHENTICATION:
case isc::dhcp::Parser4Context::CLIENTS:
+ case isc::dhcp::Parser4Context::HTTP_HEADERS:
case isc::dhcp::Parser4Context::DHCP_QUEUE_CONTROL:
case isc::dhcp::Parser4Context::DHCP_MULTI_THREADING:
case isc::dhcp::Parser4Context::LOGGERS:
case isc::dhcp::Parser4Context::CONTROL_SOCKET:
case isc::dhcp::Parser4Context::AUTHENTICATION:
case isc::dhcp::Parser4Context::CLIENTS:
+ case isc::dhcp::Parser4Context::HTTP_HEADERS:
case isc::dhcp::Parser4Context::DHCP_QUEUE_CONTROL:
case isc::dhcp::Parser4Context::DHCP_MULTI_THREADING:
case isc::dhcp::Parser4Context::LOGGERS:
}
}
+\"http-headers\" {
+ switch(driver.ctx_) {
+ case isc::dhcp::Parser6Context::CONTROL_SOCKET:
+ return isc::dhcp::Dhcp6Parser::make_HTTP_HEADERS(driver.loc_);
+ default:
+ return isc::dhcp::Dhcp6Parser::make_STRING("http-headers", driver.loc_);
+ }
+}
+
+\"value\" {
+ switch(driver.ctx_) {
+ case isc::dhcp::Parser6Context::HTTP_HEADERS:
+ return isc::dhcp::Dhcp6Parser::make_VALUE(driver.loc_);
+ default:
+ return isc::dhcp::Dhcp6Parser::make_STRING("value", driver.loc_);
+ }
+}
+
\"dhcp-queue-control\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::DHCP4:
USER_FILE "user-file"
PASSWORD_FILE "password-file"
CERT_REQUIRED "cert-required"
+ HTTP_HEADERS "http-headers"
+ VALUE "value"
DHCP_QUEUE_CONTROL "dhcp-queue-control"
ENABLE_QUEUE "enable-queue"
| cert_file
| key_file
| cert_required
+ | http_headers
| user_context
| comment
| unknown_map_entry
ctx.stack_.back()->set("cert-required", req);
};
+http_headers: HTTP_HEADERS {
+ ctx.unique("http-headers", ctx.loc2pos(@1));
+ ElementPtr l(new ListElement(ctx.loc2pos(@1)));
+ ctx.stack_.back()->set("http-headers", l);
+ ctx.enter(ctx.HTTP_HEADERS);
+} COLON LSQUARE_BRACKET http_header_list RSQUARE_BRACKET {
+ ctx.stack_.pop_back();
+ ctx.leave();
+};
+
+http_header_list: http_header
+ | not_empty_http_header_list COMMA http_header
+ | not_empty_http_header_list COMMA {
+ ctx.warnAboutExtraCommas(@2);
+ }
+ ;
+
+http_header: LCURLY_BRACKET {
+ ElementPtr m(new MapElement(ctx.loc2pos(@1)));
+ ctx.stack_.back()->add(m);
+ ctx.stack_.push_back(m);
+} http_header_params RCURLY_BRACKET {
+ ctx.stack_.pop_back();
+};
+
+http_header_params: http_header_param
+ | http_header_params COMMA http_header_param
+ | http_header_params COMMA {
+ ctx.warnAboutExtraCommas(@2);
+ }
+ ;
+
+http_header_param: name
+ | value
+ | user_context
+ | comment
+ | unknown_map_entry
+ ;
+
+value: VALUE {
+ ctx.unique("value", ctx.loc2pos(@1));
+ ctx.enter(ctx.NO_KEYWORD);
+} COLON STRING {
+ ElementPtr value(new StringElement($4, ctx.loc2pos(@4)));
+ ctx.stack_.back()->set("value", value);
+ ctx.leave();
+};
+
// --- authentication ---------------------------------------------
authentication: AUTHENTICATION {
return ("auth-type");
case CLIENTS:
return ("clients");
+ case HTTP_HEADERS:
+ return ("http-headers");
case DHCP_QUEUE_CONTROL:
return ("dhcp-queue-control");
case DHCP_MULTI_THREADING:
/// structures.
CLIENTS,
+ ///< Used while parsing Dhcp4/control-socket/http-headers structures.
+ HTTP_HEADERS,
+
/// Used while parsing Dhcp4/dhcp-queue-control structures.
DHCP_QUEUE_CONTROL,
case isc::dhcp::Parser6Context::CLIENT_CLASSES:
case isc::dhcp::Parser6Context::LOGGERS:
case isc::dhcp::Parser6Context::SHARED_NETWORK:
+ case isc::dhcp::Parser6Context::HTTP_HEADERS:
case isc::dhcp::Parser6Context::CONFIG_DATABASE:
return isc::dhcp::Dhcp6Parser::make_NAME(driver.loc_);
default:
case isc::dhcp::Parser6Context::CONTROL_SOCKET:
case isc::dhcp::Parser6Context::AUTHENTICATION:
case isc::dhcp::Parser6Context::CLIENTS:
+ case isc::dhcp::Parser6Context::HTTP_HEADERS:
case isc::dhcp::Parser6Context::DHCP_QUEUE_CONTROL:
case isc::dhcp::Parser6Context::DHCP_MULTI_THREADING:
case isc::dhcp::Parser6Context::LOGGERS:
case isc::dhcp::Parser6Context::CONTROL_SOCKET:
case isc::dhcp::Parser6Context::AUTHENTICATION:
case isc::dhcp::Parser6Context::CLIENTS:
+ case isc::dhcp::Parser6Context::HTTP_HEADERS:
case isc::dhcp::Parser6Context::DHCP_QUEUE_CONTROL:
case isc::dhcp::Parser6Context::DHCP_MULTI_THREADING:
case isc::dhcp::Parser6Context::LOGGERS:
}
}
+\"http-headers\" {
+ switch(driver.ctx_) {
+ case isc::dhcp::Parser4Context::CONTROL_SOCKET:
+ return isc::dhcp::Dhcp4Parser::make_HTTP_HEADERS(driver.loc_);
+ default:
+ return isc::dhcp::Dhcp4Parser::make_STRING("http-headers", driver.loc_);
+ }
+}
+
\"dhcp-queue-control\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DHCP6:
USER_FILE "user-file"
PASSWORD_FILE "password-file"
CERT_REQUIRED "cert-required"
+ HTTP_HEADERS "http-headers"
+ VALUE "value"
DHCP_QUEUE_CONTROL "dhcp-queue-control"
ENABLE_QUEUE "enable-queue"
| cert_file
| key_file
| cert_required
+ | http_headers
| user_context
| comment
| unknown_map_entry
ctx.stack_.back()->set("cert-required", req);
};
+http_headers: HTTP_HEADERS {
+ ctx.unique("http-headers", ctx.loc2pos(@1));
+ ElementPtr l(new ListElement(ctx.loc2pos(@1)));
+ ctx.stack_.back()->set("http-headers", l);
+ ctx.enter(ctx.HTTP_HEADERS);
+} COLON LSQUARE_BRACKET http_header_list RSQUARE_BRACKET {
+ ctx.stack_.pop_back();
+ ctx.leave();
+};
+
+http_header_list: http_header
+ | not_empty_http_header_list COMMA http_header
+ | not_empty_http_header_list COMMA {
+ ctx.warnAboutExtraCommas(@2);
+ }
+ ;
+
+http_header: LCURLY_BRACKET {
+ ElementPtr m(new MapElement(ctx.loc2pos(@1)));
+ ctx.stack_.back()->add(m);
+ ctx.stack_.push_back(m);
+} http_header_params RCURLY_BRACKET {
+ ctx.stack_.pop_back();
+};
+
+http_header_params: http_header_param
+ | http_header_params COMMA http_header_param
+ | http_header_params COMMA {
+ ctx.warnAboutExtraCommas(@2);
+ }
+ ;
+
+http_header_param: name
+ | value
+ | user_context
+ | comment
+ | unknown_map_entry
+ ;
+
+value: VALUE {
+ ctx.unique("value", ctx.loc2pos(@1));
+ ctx.enter(ctx.NO_KEYWORD);
+} COLON STRING {
+ ElementPtr value(new StringElement($4, ctx.loc2pos(@4)));
+ ctx.stack_.back()->set("value", value);
+ ctx.leave();
+};
+
// --- authentication ---------------------------------------------
authentication: AUTHENTICATION {
return ("auth-type");
case CLIENTS:
return ("clients");
+ case HTTP_HEADERS:
+ return ("http-headers");
case DHCP_QUEUE_CONTROL:
return ("dhcp-queue-control");
case DHCP_MULTI_THREADING:
/// structures.
CLIENTS,
+ ///< Used while parsing Dhcp6/control-socket/http-headers structures.
+ HTTP_HEADERS,
+
/// Used while parsing Dhcp6/dhcp-queue-control structures.
DHCP_QUEUE_CONTROL,