F #2490: Add new unregister address range functionality

* Modify the IPAM driver
    * Modify AddressRangePool to call the new action script
    * Add example dummy script

(cherry picked from commit 7e36bc7c74)
This commit is contained in:
Alejandro Huertas Herrero authored and Ruben S. Montero committed 2018-10-18 15:22:44 +02:00
1 parent fbc40d7a8c
commit 552fc83e9b
8 files changed
+142 -13

No files matched your search

+5
View File
@@ -104,6 +104,11 @@ public:
return (type & 0x00000008) != 0;
}
bool is_ipam() const
{
return !attr->vector_value("IPAM_MAD").empty() && attr->vector_value("IPAM_MAD") != "internal";
}
// *************************************************************************
// Address Range initialization functions
// *************************************************************************
+10 -4
View File
@@ -36,10 +36,11 @@ class IPMAction : public ActionRequest
public:
enum Actions
{
REGISTER_ADDRESS_RANGE, /**< Register/Request a new IP network */
ALLOCATE_ADDRESS, /**< Request a specific IP (or range) */
GET_ADDRESS, /**< Request any free IP (or range) */
FREE_ADDRESS /**< Frees a previously requested IP */
REGISTER_ADDRESS_RANGE, /**< Register/Request a new IP network */
UNREGISTER_ADDRESS_RANGE, /**< Unregister IP network */
ALLOCATE_ADDRESS, /**< Request a specific IP (or range) */
GET_ADDRESS, /**< Request any free IP (or range) */
FREE_ADDRESS /**< Frees a previously requested IP */
};
IPMAction(Actions a, IPAMRequest *r):ActionRequest(ActionRequest::USER),
@@ -187,6 +188,11 @@ private:
*/
void register_address_range_action(IPAMRequest * ir);
/**
* Unregisters an address range.
*/
void unregister_address_range_action(IPAMRequest * ir);
/**
* Requests the IPAM a free address (or range)
*/
+8
View File
@@ -67,6 +67,14 @@ private:
send_message("REGISTER_ADDRESS_RANGE", id, arg);
}
/**
* Unregister an AddressRange from the IPAM
*/
void unregister_address_range(int id, const std::string& arg) const
{
send_message("UNREGISTER_ADDRESS_RANGE", id, arg);
}
/**
* Get a free address (or range)
*/