95 Dhcpv6Srv(uint16_t server_port = DHCP6_SERVER_PORT,
96 uint16_t client_port = 0);
111 return (io_service_);
250 NameChangeSender::Result result,
455 AllocEngine::ClientContext6& ctx,
473 AllocEngine::ClientContext6& ctx,
474 boost::shared_ptr<Option6IA> ia);
492 AllocEngine::ClientContext6& ctx,
549 AllocEngine::ClientContext6& ctx,
572 boost::shared_ptr<Option6IA> ia,
590 boost::shared_ptr<Option6IA> ia,
613 AllocEngine::ClientContext6& ctx,
649 AllocEngine::ClientContext6& ctx,
663 AllocEngine::ClientContext6& ctx);
710 AllocEngine::ClientContext6& ctx);
732 AllocEngine::ClientContext6& ctx);
746 AllocEngine::ClientContext6& ctx);
786 AllocEngine::ClientContext6& ctx);
837 const AllocEngine::ClientContext6& ctx);
850 const AllocEngine::ClientContext6& ctx);
905 AllocEngine::ClientContext6& ctx,
963 boost::shared_ptr<Option6IA> ia_rsp);
1093 void generateFqdn(
const Pkt6Ptr& answer,
1098 static void processStatsReceived(
const Pkt6Ptr& query);
1107 bool requestedInORO(
const Pkt6Ptr& query,
const uint16_t code)
const;
1180 #endif // DHCP6_SRV_H
virtual Pkt6Ptr receivePacket(int timeout)
dummy wrapper around IfaceMgr::receive6
uint16_t server_port_
UDP port number on which server listens.
boost::shared_ptr< DUID > DuidPtr
Pkt6Ptr processInfRequest(AllocEngine::ClientContext6 &ctx)
Processes incoming Information-request message.
int run()
Main server processing loop.
volatile bool shutdown_
Indicates if shutdown is in progress.
void classifyPacket(const Pkt6Ptr &pkt)
Assigns incoming packet to zero or more classes.
void sanityCheckDUID(const OptionPtr &opt, const std::string &opt_name)
verifies if received DUID option (client-id or server-id) is sane
bool inTestMode() const
Checks if the server is running in unit test mode.
void appendDefaultOptions(const Pkt6Ptr &question, Pkt6Ptr &answer, const CfgOptionList &co_list)
Appends default options to server's answer.
static std::string getVersion(bool extended)
returns Kea version on stdout and exit.
void shutdown() override
Instructs the server to shut down.
virtual void sendPacket(const Pkt6Ptr &pkt)
dummy wrapper around IfaceMgr::send()
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
void releaseLeases(const Pkt6Ptr &release, Pkt6Ptr &reply, AllocEngine::ClientContext6 &ctx)
Attempts to release received addresses.
void extendLeases(const Pkt6Ptr &query, Pkt6Ptr &reply, AllocEngine::ClientContext6 &ctx)
Attempts to extend the lifetime of IAs.
void processRSOO(const Pkt6Ptr &query, const Pkt6Ptr &rsp)
Processes Relay-supplied options, if present.
std::list< std::list< std::string > > jsonPathsToRedact() const finaloverride
Return a list of all paths that contain passwords or secrets for kea-dhcp6.
boost::shared_ptr< Option > OptionPtr
uint16_t getServerPort() const
Get UDP port on which server should listen.
static void processStatsSent(const Pkt6Ptr &response)
Updates statistics for transmitted packets.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
void appendRequestedOptions(const Pkt6Ptr &question, Pkt6Ptr &answer, const CfgOptionList &co_list)
Appends requested options to server's answer.
OptionPtr extendIA_PD(const Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx, Option6IAPtr ia)
Extends lifetime of the prefix.
void evaluateClasses(const Pkt6Ptr &pkt, bool depend_on_known)
Evaluate classes.
static const size_t MIN_MAC_LEN
Minimum length of a MAC address to be used in DUID generation.
static std::string duidToString(const OptionPtr &opt)
converts DUID to text Converts content of DUID option to a text representation, e.g.
boost::shared_ptr< NameChangeRequest > NameChangeRequestPtr
Defines a pointer to a NameChangeRequest.
DHCPv6DiscardMessageError(const char *file, size_t line, const char *what)
void processPacketBufferSend(hooks::CalloutHandlePtr &callout_handle, Pkt6Ptr &rsp)
Executes buffer6_send callout and sends the response.
boost::shared_ptr< CBControlDHCPv6 > CBControlDHCPv6Ptr
void setReservedClientClasses(const Pkt6Ptr &pkt, const AllocEngine::ClientContext6 &ctx)
Assigns classes retrieved from host reservation database.
NetworkStatePtr & getNetworkState()
Returns pointer to the network state used by the server.
boost::shared_ptr< Option6IA > Option6IAPtr
A pointer to the Option6IA object.
void conditionallySetReservedClientClasses(const Pkt6Ptr &pkt, const AllocEngine::ClientContext6 &ctx)
Assigns classes retrieved from host reservation database if they haven't been yet set...
void assignLeases(const Pkt6Ptr &question, Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx)
Assigns leases.
boost::shared_ptr< Pkt6 > Pkt6Ptr
A pointer to Pkt6 packet.
bool testUnicast(const Pkt6Ptr &pkt) const
Check if the message can be sent to unicast.
Pkt6Ptr processRebind(AllocEngine::ClientContext6 &ctx)
Processes incoming Rebind message.
void classifyByVendor(const Pkt6Ptr &pkt, std::string &classes)
Assign class using vendor-class-identifier option.
OptionPtr getServerID()
Returns server-identifier option.
std::list< ConstCfgOptionPtr > CfgOptionList
Const pointer list.
Pkt6Ptr processSolicit(AllocEngine::ClientContext6 &ctx)
Processes incoming Solicit and returns response.
static HWAddrPtr getMAC(const Pkt6Ptr &pkt)
Attempts to get a MAC/hardware address using configured sources.
void processPacketPktSend(hooks::CalloutHandlePtr &callout_handle, Pkt6Ptr &query, Pkt6Ptr &rsp)
Executes pkt6_send callout.
RequirementLevel
defines if certain option may, must or must not appear
Context information for the DHCPv6 leases allocation.
bool testServerID(const Pkt6Ptr &pkt)
Compare received server id with our server id.
void setStatusCode(boost::shared_ptr< Option6IA > &container, const OptionPtr &status)
A simple utility method that sets the status code.
void processPacketAndSendResponseNoThrow(Pkt6Ptr &query)
Process a single incoming DHCPv6 packet and sends the response.
void requiredClassify(const Pkt6Ptr &pkt, AllocEngine::ClientContext6 &ctx)
Assigns incoming packet to zero or more classes (required pass).
void appendRequestedVendorOptions(const Pkt6Ptr &question, Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx, const CfgOptionList &co_list)
Appends requested vendor options to server's answer.
static int getHookIndexBuffer6Send()
Returns the index of the buffer6_send hook.
void buildCfgOptionList(const Pkt6Ptr &question, AllocEngine::ClientContext6 &ctx, CfgOptionList &co_list)
Build the configured option list.
OptionPtr releaseIA_NA(const DuidPtr &duid, const Pkt6Ptr &query, int &general_status, boost::shared_ptr< Option6IA > ia, Lease6Ptr &old_lease)
Releases specific IA_NA option.
bool sanityCheck(const Pkt6Ptr &pkt)
Verifies if specified packet meets RFC requirements.
virtual ~Dhcpv6Srv()
Destructor. Used during DHCPv6 service shutdown.
NetworkStatePtr network_state_
Holds information about disabled DHCP service and/or disabled subnet/network scopes.
std::queue< isc::dhcp_ddns::NameChangeRequest > name_change_reqs_
Holds a list of isc::dhcp_ddns::NameChangeRequest objects, which are waiting for sending to kea-dhcp-...
std::vector< Lease6Ptr > Lease6Collection
A collection of IPv6 leases.
void processClientFqdn(const Pkt6Ptr &question, const Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx)
Processes Client FQDN Option.
OptionPtr assignIA_NA(const isc::dhcp::Pkt6Ptr &query, const isc::dhcp::Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx, Option6IAPtr ia)
Processes IA_NA option (and assigns addresses if necessary).
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Pkt6Ptr processRequest(AllocEngine::ClientContext6 &ctx)
Processes incoming Request and returns Reply response.
void discardPackets()
Discards parked packets Clears the packet parking lots of all packets.
Pkt6Ptr processRelease(AllocEngine::ClientContext6 &ctx)
Process incoming Release message.
virtual void d2ClientErrorHandler(const dhcp_ddns::NameChangeSender::Result result, dhcp_ddns::NameChangeRequestPtr &ncr)
Implements the error handler for DHCP_DDNS IO errors.
uint16_t client_port_
UDP port number to which server sends all responses.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-dhcp-ddns.
void initContext(const Pkt6Ptr &pkt, AllocEngine::ClientContext6 &ctx, bool &drop)
Initializes client context for specified packet.
CBControlDHCPv6Ptr getCBControl() const
Returns an object which controls access to the configuration backends.
void checkDynamicSubnetChange(const Pkt6Ptr &question, Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx, const Subnet6Ptr orig_subnet)
Iterates over new leases, update stale DNS entries.
void run_one()
Main server processing step.
OptionPtr releaseIA_PD(const DuidPtr &duid, const Pkt6Ptr &query, int &general_status, boost::shared_ptr< Option6IA > ia, Lease6Ptr &old_lease)
Releases specific IA_PD option.
void startD2()
Starts DHCP_DDNS client IO if DDNS updates are enabled.
This exception is thrown when DHCP server hits the error which should result in discarding the messag...
boost::shared_ptr< CalloutHandle > CalloutHandlePtr
A shared pointer to a CalloutHandle object.
void processDhcp6QueryAndSendResponse(Pkt6Ptr &query, Pkt6Ptr &rsp)
Process a single incoming DHCPv6 query.
asiolink::IOServicePtr & getIOService()
Returns pointer to the IO service used by the server.
Pkt6Ptr processRenew(AllocEngine::ClientContext6 &ctx)
Processes incoming Renew message.
void stopD2()
Stops DHCP_DDNS client IO if DDNS updates are enabled.
boost::shared_ptr< NetworkState > NetworkStatePtr
Pointer to the NetworkState object.
isc::dhcp::Subnet6Ptr selectSubnet(const Pkt6Ptr &question, bool &drop)
Selects a subnet for a given client's packet.
OptionPtr serverid_
Server DUID (to be sent in server-identifier option)
Base class for all services.
void processDhcp6Query(Pkt6Ptr &query, Pkt6Ptr &rsp)
Process a single incoming DHCPv6 query.
void setPacketStatisticsDefaults()
This function sets statistics related to DHCPv6 packets processing to their initial values...
boost::shared_ptr< AllocEngine > alloc_engine_
Allocation Engine.
Pkt6Ptr processDecline(AllocEngine::ClientContext6 &ctx)
Process incoming Decline message.
void processDhcp4Query(const Pkt6Ptr &dhcp4_query)
Processes incoming DHCPv4-query message.
CBControlDHCPv6Ptr cb_control_
Controls access to the configuration backends.
void processPacketAndSendResponse(Pkt6Ptr &query)
Process a single incoming DHCPv6 packet and sends the response.
boost::shared_ptr< Subnet6 > Subnet6Ptr
A pointer to a Subnet6 object.
OptionPtr assignIA_PD(const Pkt6Ptr &query, const isc::dhcp::Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx, boost::shared_ptr< Option6IA > ia)
Processes IA_PD option (and assigns prefixes if necessary).
void setTeeTimes(uint32_t preferred_lft, const Subnet6Ptr &subnet, Option6IAPtr &resp)
Sets the T1 and T2 timers in the outbound IA.
void sendResponseNoThrow(hooks::CalloutHandlePtr &callout_handle, Pkt6Ptr &query, Pkt6Ptr &rsp)
Process an unparked DHCPv6 packet and sends the response.
bool declineLeases(const Pkt6Ptr &decline, Pkt6Ptr &reply, AllocEngine::ClientContext6 &ctx)
Attempts to decline all leases in specified Decline message.
DHCPv4 and DHCPv6 allocation engine.
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
Dhcpv6Srv(uint16_t server_port=DHCP6_SERVER_PORT, uint16_t client_port=0)
Default constructor.
This file provides the classes needed to embody, compose, and decompose DNS update requests that are ...
Defines the D2ClientMgr class.
static const std::string VENDOR_CLASS_PREFIX
this is a prefix added to the content of vendor-class option
OptionPtr extendIA_NA(const Pkt6Ptr &query, const Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx, Option6IAPtr ia)
Extends lifetime of the specific IA_NA option.
bool declineLease(const Pkt6Ptr &decline, const Lease6Ptr lease, boost::shared_ptr< Option6IA > ia_rsp)
Declines specific IPv6 lease.
static uint16_t checkRelaySourcePort(const Pkt6Ptr &query)
Used for DHCPv4-over-DHCPv6 too.
void copyClientOptions(const Pkt6Ptr &question, Pkt6Ptr &answer)
Copies required options from client message to server answer.
Pkt6Ptr processConfirm(AllocEngine::ClientContext6 &ctx)
Processes incoming Confirm message and returns Reply.
void createNameChangeRequests(const Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx)
Creates a number of isc::dhcp_ddns::NameChangeRequest objects based on the DHCPv6 Client FQDN Option...
void processPacket(Pkt6Ptr &query, Pkt6Ptr &rsp)
Process a single incoming DHCPv6 packet.
OptionPtr declineIA(const Pkt6Ptr &decline, const DuidPtr &duid, int &general_status, boost::shared_ptr< Option6IA > ia, Lease6Collection &new_leases)
Declines leases in a single IA_NA option.