Commit c19f1840 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

[5036] Support for parameters in hooks-libraries added.

parent fab8be8e
...@@ -41,7 +41,11 @@ ...@@ -41,7 +41,11 @@
"library": "/opt/lib/security.so" "library": "/opt/lib/security.so"
}, },
{ {
"library": "/opt/lib/charging.so" "library": "/opt/lib/charging.so",
"parameters": {
"path": "/var/kea/var",
"base-name": "kea-forensic6"
}
} }
] ]
} }
......
...@@ -744,6 +744,16 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence} ...@@ -744,6 +744,16 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
} }
} }
\"parameters\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::HOOKS_LIBRARIES:
return isc::dhcp::Dhcp6Parser::make_PARAMETERS(driver.loc_);
default:
return isc::dhcp::Dhcp6Parser::make_STRING("parameters", driver.loc_);
}
}
\"library\" { \"library\" {
switch(driver.ctx_) { switch(driver.ctx_) {
case isc::dhcp::Parser6Context::HOOKS_LIBRARIES: case isc::dhcp::Parser6Context::HOOKS_LIBRARIES:
......
...@@ -114,6 +114,7 @@ using namespace std; ...@@ -114,6 +114,7 @@ using namespace std;
HOOKS_LIBRARIES "hooks-libraries" HOOKS_LIBRARIES "hooks-libraries"
LIBRARY "library" LIBRARY "library"
PARAMETERS "parameters"
EXPIRED_LEASES_PROCESSING "expired-leases-processing" EXPIRED_LEASES_PROCESSING "expired-leases-processing"
...@@ -593,7 +594,10 @@ hooks_params: hooks_param ...@@ -593,7 +594,10 @@ hooks_params: hooks_param
| hooks_params COMMA hooks_param | hooks_params COMMA hooks_param
; ;
hooks_param: LIBRARY { hooks_param: library
| parameters;
library: LIBRARY {
ctx.enter(ctx.NO_KEYWORD); ctx.enter(ctx.NO_KEYWORD);
} COLON STRING { } COLON STRING {
ElementPtr lib(new StringElement($4, ctx.loc2pos(@4))); ElementPtr lib(new StringElement($4, ctx.loc2pos(@4)));
...@@ -601,6 +605,13 @@ hooks_param: LIBRARY { ...@@ -601,6 +605,13 @@ hooks_param: LIBRARY {
ctx.leave(); ctx.leave();
}; };
parameters: PARAMETERS {
ctx.enter(ctx.NO_KEYWORD);
} COLON value {
ctx.stack_.back()->set("parameters", $4);
ctx.leave();
}
// --- expired-leases-processing ------------------------ // --- expired-leases-processing ------------------------
expired_leases_processing: EXPIRED_LEASES_PROCESSING { expired_leases_processing: EXPIRED_LEASES_PROCESSING {
ElementPtr m(new MapElement(ctx.loc2pos(@1))); ElementPtr m(new MapElement(ctx.loc2pos(@1)));
......
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