58 const string& suffix) {
65 string exported_data = prefix + suffix +
"=" +
data;
66 vars.push_back(exported_data);
73 const string& suffix) {
74 string exported_data = prefix + suffix +
"=" + boost::lexical_cast<string>(value);
75 vars.push_back(exported_data);
82 const string& suffix) {
83 string exported_data = prefix + suffix +
"=" + value;
84 vars.push_back(exported_data);
91 const string& suffix) {
104 const string& prefix,
105 const string& suffix) {
117 const string& prefix,
118 const string& suffix) {
130 const string& prefix,
131 const string& suffix) {
134 prefix +
"_OPTION_" +
135 boost::lexical_cast<string>(option->getType()),
144 const string& prefix,
145 const string& suffix) {
148 prefix +
"_OPTION_" +
149 boost::lexical_cast<string>(option->getType()) +
157 const string& prefix,
158 const string& suffix) {
161 prefix +
"_IAID", suffix);
163 prefix +
"_IA_TYPE", suffix);
165 prefix +
"_IA_T1", suffix);
167 prefix +
"_IA_T2", suffix);
179 const string& prefix,
180 const string& suffix) {
183 prefix +
"_ID", suffix);
185 prefix +
"_NAME", suffix);
186 auto prefix_data = subnet4->get();
188 prefix +
"_PREFIX", suffix);
190 prefix +
"_PREFIX_LEN", suffix);
202 const string& prefix,
203 const string& suffix) {
206 prefix +
"_ID", suffix);
208 prefix +
"_NAME", suffix);
209 auto prefix_data = subnet6->get();
211 prefix +
"_PREFIX", suffix);
213 prefix +
"_PREFIX_LEN", suffix);
225 const string& prefix,
226 const string& suffix) {
229 prefix +
"_ADDRESS", suffix);
231 prefix +
"_CLTT", suffix);
233 prefix +
"_HOSTNAME", suffix);
235 prefix +
"_HWADDR", suffix);
237 prefix +
"_STATE", suffix);
239 prefix +
"_SUBNET_ID", suffix);
241 prefix +
"_VALID_LIFETIME", suffix);
243 prefix +
"_CLIENT_ID", suffix);
259 const string& prefix,
260 const string& suffix) {
263 prefix +
"_ADDRESS", suffix);
265 prefix +
"_CLTT", suffix);
267 prefix +
"_HOSTNAME", suffix);
269 prefix +
"_HWADDR", suffix);
271 prefix +
"_STATE", suffix);
273 prefix +
"_SUBNET_ID", suffix);
275 prefix +
"_VALID_LIFETIME", suffix);
277 prefix +
"_DUID", suffix);
279 prefix +
"_IAID", suffix);
281 prefix +
"_PREFERRED_LIFETIME", suffix);
283 prefix +
"_PREFIX_LEN", suffix);
285 prefix +
"_TYPE", suffix);
305 const string& prefix,
306 const string& suffix) {
309 prefix +
"_SIZE", suffix);
310 for (
size_t i = 0; i < leases4->size(); ++i) {
313 boost::lexical_cast<string>(i),
324 const string& prefix,
325 const string& suffix) {
328 prefix +
"_SIZE", suffix);
329 for (
size_t i = 0; i < leases6->size(); ++i) {
332 boost::lexical_cast<string>(i),
343 const string& prefix,
344 const string& suffix) {
347 prefix +
"_TYPE", suffix);
349 prefix +
"_TXID", suffix);
351 prefix +
"_LOCAL_ADDR", suffix);
353 prefix +
"_LOCAL_PORT", suffix);
355 prefix +
"_REMOTE_ADDR", suffix);
357 prefix +
"_REMOTE_PORT", suffix);
359 prefix +
"_IFACE_INDEX", suffix);
361 prefix +
"_IFACE_NAME", suffix);
363 prefix +
"_HOPS", suffix);
365 prefix +
"_SECS", suffix);
367 prefix +
"_FLAGS", suffix);
369 prefix +
"_CIADDR", suffix);
371 prefix +
"_SIADDR", suffix);
373 prefix +
"_YIADDR", suffix);
375 prefix +
"_GIADDR", suffix);
377 prefix +
"_RELAYED", suffix);
379 prefix +
"_HWADDR", suffix);
381 prefix +
"_LOCAL_HWADDR", suffix);
383 prefix +
"_REMOTE_HWADDR", suffix);
413 prefix +
"_HWADDR", suffix);
415 prefix +
"_LOCAL_HWADDR", suffix);
417 prefix +
"_REMOTE_HWADDR", suffix);
424 const string& prefix,
425 const string& suffix) {
428 prefix +
"_TYPE", suffix);
430 prefix +
"_TXID", suffix);
432 prefix +
"_LOCAL_ADDR", suffix);
434 prefix +
"_LOCAL_PORT", suffix);
436 prefix +
"_REMOTE_ADDR", suffix);
438 prefix +
"_REMOTE_PORT", suffix);
440 prefix +
"_IFACE_INDEX", suffix);
442 prefix +
"_IFACE_NAME", suffix);
444 prefix +
"_REMOTE_HWADDR", suffix);
445 string proto_data = (pkt6->getProto() ==
Pkt6::UDP ?
"UDP" :
"TCP");
447 prefix +
"_PROTO", suffix);
449 prefix +
"_CLIENT_ID", suffix);
469 prefix +
"_REMOTE_HWADDR", suffix);
472 prefix +
"_CLIENT_ID", suffix);
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
A generic exception that is thrown if a parameter given to a method or function is considered invalid...
A generic exception that is thrown when an object can not be found.
The IOService class is a wrapper for the ASIO io_context class.
Utility class for spawning new processes.
@ RELAY_SEARCH_FROM_CLIENT
isc::data::ConstElementPtr getParameter(const std::string &name)
Returns configuration parameter for the library.
static void extractBoolean(isc::asiolink::ProcessEnvVars &vars, const bool value, const std::string &prefix="", const std::string &suffix="")
Extract boolean data and append to environment.
RunScriptImpl()
Constructor.
static void extractInteger(isc::asiolink::ProcessEnvVars &vars, const uint64_t value, const std::string &prefix="", const std::string &suffix="")
Extract integer data and append to environment.
void configure(isc::hooks::LibraryHandle &handle)
This function parses and applies configuration parameters.
static void extractLease4(isc::asiolink::ProcessEnvVars &vars, const isc::dhcp::Lease4Ptr &lease4, const std::string &prefix="", const std::string &suffix="")
Extract Lease4 data and append to environment.
static void extractString(isc::asiolink::ProcessEnvVars &vars, const std::string &value, const std::string &prefix="", const std::string &suffix="")
Extract string data and append to environment.
static void extractSubnet4(isc::asiolink::ProcessEnvVars &vars, const isc::dhcp::ConstSubnet4Ptr subnet4, const std::string &prefix="", const std::string &suffix="")
Extract Subnet4 data and append to environment.
void setSync(const bool sync)
Set the synchronous call mode for the target script.
static void extractDUID(isc::asiolink::ProcessEnvVars &vars, const isc::dhcp::DuidPtr duid, const std::string &prefix="", const std::string &suffix="")
Extract DUID data and append to environment.
static void extractSubnet6(isc::asiolink::ProcessEnvVars &vars, const isc::dhcp::ConstSubnet6Ptr subnet6, const std::string &prefix="", const std::string &suffix="")
Extract Subnet6 data and append to environment.
static void extractHWAddr(isc::asiolink::ProcessEnvVars &vars, const isc::dhcp::HWAddrPtr &hwaddr, const std::string &prefix="", const std::string &suffix="")
Extract HWAddr data and append to environment.
void setName(const std::string &name)
Set name of the target script.
static void extractOptionIA(isc::asiolink::ProcessEnvVars &vars, const isc::dhcp::Option6IAPtr option6IA, const std::string &prefix="", const std::string &suffix="")
Extract Option6IA data and append to environment.
void runScript(const isc::asiolink::ProcessArgs &args, const isc::asiolink::ProcessEnvVars &vars)
Run Script with specified arguments and environment parameters.
static void extractLeases6(isc::asiolink::ProcessEnvVars &vars, const isc::dhcp::Lease6CollectionPtr &leases6, const std::string &prefix="", const std::string &suffix="")
Extract Lease6Collection data and append to environment.
static void extractLease6(isc::asiolink::ProcessEnvVars &vars, const isc::dhcp::Lease6Ptr &lease6, const std::string &prefix="", const std::string &suffix="")
Extract Lease6 data and append to environment.
static void extractClientId(isc::asiolink::ProcessEnvVars &vars, const isc::dhcp::ClientIdPtr client_id, const std::string &prefix="", const std::string &suffix="")
Extract ClientId data and append to environment.
static void extractPkt6(isc::asiolink::ProcessEnvVars &vars, const isc::dhcp::Pkt6Ptr &pkt6, const std::string &prefix="", const std::string &suffix="")
Extract Pkt6 data and append to environment.
static void extractSubOption(isc::asiolink::ProcessEnvVars &vars, const isc::dhcp::OptionPtr option, uint16_t code, const std::string &prefix="", const std::string &suffix="")
Extract Option SubOption data and append to environment.
static void extractPkt4(isc::asiolink::ProcessEnvVars &vars, const isc::dhcp::Pkt4Ptr &pkt4, const std::string &prefix="", const std::string &suffix="")
Extract Pkt4 data and append to environment.
static void extractOption(isc::asiolink::ProcessEnvVars &vars, const isc::dhcp::OptionPtr option, const std::string &prefix="", const std::string &suffix="")
Extract Option data and append to environment.
static void extractLeases4(isc::asiolink::ProcessEnvVars &vars, const isc::dhcp::Lease4CollectionPtr &leases4, const std::string &prefix="", const std::string &suffix="")
Extract Lease4Collection data and append to environment.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
std::vector< std::string > ProcessArgs
Type of the container holding arguments of the executable being run as a background process.
std::vector< std::string > ProcessEnvVars
Type of the container holding environment variables of the executable being run as a background proce...
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< Lease4Collection > Lease4CollectionPtr
A shared pointer to the collection of IPv4 leases.
boost::shared_ptr< const Subnet6 > ConstSubnet6Ptr
A const pointer to a Subnet6 object.
boost::shared_ptr< const Subnet4 > ConstSubnet4Ptr
A const pointer to a Subnet4 object.
boost::shared_ptr< Pkt4 > Pkt4Ptr
A pointer to Pkt4 object.
boost::shared_ptr< DUID > DuidPtr
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
boost::shared_ptr< Option6IA > Option6IAPtr
A pointer to the Option6IA object.
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
boost::shared_ptr< ClientId > ClientIdPtr
Shared pointer to a Client ID.
boost::shared_ptr< Lease6Collection > Lease6CollectionPtr
A shared pointer to the collection of IPv6 leases.
boost::shared_ptr< Pkt6 > Pkt6Ptr
A pointer to Pkt6 packet.
@ RAI_OPTION_AGENT_CIRCUIT_ID
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
boost::shared_ptr< Option > OptionPtr
Defines the logger used by the top-level component of kea-lfc.
static std::string statesToText(const uint32_t state)
Returns name of the lease states specific to DHCPv4.
static std::string statesToText(const uint32_t state)
Returns name of the lease states specific to DHCPv6.
static std::string typeToText(Type type)
returns text representation of a lease type