Kea 2.7.0
isc::yang::AdaptorSubnet Class Reference

JSON adaptor for subnets adding IDs and canonizes relays. More...

#include <adaptor_subnet.h>

+ Inheritance diagram for isc::yang::AdaptorSubnet:

Public Member Functions

virtual ~AdaptorSubnet ()=default
 Destructor.
 

Static Public Member Functions

static void assignID (isc::data::ElementPtr subnet, isc::dhcp::SubnetIDSet &set, isc::dhcp::SubnetID &next)
 Assign subnet ID.
 
static bool collectID (isc::data::ConstElementPtr subnet, isc::dhcp::SubnetIDSet &set)
 Collect a subnet ID.
 
static void updateRelay (isc::data::ElementPtr subnet)
 Update relay.
 

Detailed Description

JSON adaptor for subnets adding IDs and canonizes relays.

Adding IDs is done in two passes walking through subnets. -1- Add in the set used values and return false when there is no ID so the caller can decide if the second pass is needed. -2- For a subnet without an ID, assigned the next unused ID.

Note as all canonization adaptors it is optional, i.e., code should work without it.

Definition at line 25 of file adaptor_subnet.h.

Constructor & Destructor Documentation

◆ ~AdaptorSubnet()

virtual isc::yang::AdaptorSubnet::~AdaptorSubnet ( )
virtualdefault

Destructor.

Member Function Documentation

◆ assignID()

void isc::yang::AdaptorSubnet::assignID ( isc::data::ElementPtr subnet,
isc::dhcp::SubnetIDSet & set,
isc::dhcp::SubnetID & next )
static

Assign subnet ID.

Parameters
subnetThe subnet.
setThe reference to the set of assigned IDs.
nextThe next ID.

Definition at line 30 of file adaptor_subnet.cc.

References isc::data::Element::create().

Referenced by isc::yang::AdaptorConfig::sharedNetworksAssignID(), and isc::yang::AdaptorConfig::subnetsAssignID().

+ Here is the call graph for this function:

◆ collectID()

bool isc::yang::AdaptorSubnet::collectID ( isc::data::ConstElementPtr subnet,
isc::dhcp::SubnetIDSet & set )
static

Collect a subnet ID.

Parameters
subnetThe subnet.
setThe reference to the set of assigned IDs.
Returns
True if the subnet has an ID, false otherwise.

Definition at line 20 of file adaptor_subnet.cc.

Referenced by isc::yang::AdaptorConfig::subnetsCollectID().

◆ updateRelay()

void isc::yang::AdaptorSubnet::updateRelay ( isc::data::ElementPtr subnet)
static

Update relay.

Can be used for shared networks too.

Parameters
subnetThe subnet.

Definition at line 44 of file adaptor_subnet.cc.

Referenced by isc::yang::AdaptorConfig::sanitizeRelayInSharedNetworks(), and isc::yang::AdaptorConfig::sanitizeRelaySubnets().


The documentation for this class was generated from the following files: