84 Dhcpv6Srv(uint16_t port = DHCP6_SERVER_PORT);
174 NameChangeSender::Result result,
390 boost::shared_ptr<Option6IA> ia);
488 boost::shared_ptr<Option6IA> ia,
506 boost::shared_ptr<Option6IA> ia,
837 boost::shared_ptr<Option6IA> ia_rsp);
928 void generateFqdn(
const Pkt6Ptr& answer);
932 static void processStatsReceived(
const Pkt6Ptr& query);
941 bool requestedInORO(
const Pkt6Ptr& query,
const uint16_t code)
const;
1000 #endif // DHCP6_SRV_H virtual Pkt6Ptr receivePacket(int timeout)
dummy wrapper around IfaceMgr::receive6
boost::shared_ptr< DUID > DuidPtr
Pkt6Ptr processInfRequest(AllocEngine::ClientContext6 &ctx)
Processes incoming Information-request message.
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
void appendDefaultOptions(const Pkt6Ptr &question, Pkt6Ptr &answer, const CfgOptionList &co_list)
Appends default options to server's answer.
Dhcpv6Srv(uint16_t port=DHCP6_SERVER_PORT)
Default constructor.
static std::string getVersion(bool extended)
returns Kea version on stdout and exit.
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.
boost::shared_ptr< Option > OptionPtr
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....
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.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
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 assignLeases(const Pkt6Ptr &question, Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx)
Assigns leases.
boost::shared_ptr< Pkt6 > Pkt6Ptr
A pointer to Pkt6 packet.
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.
void shutdown()
Instructs the server to shut down.
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 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).
Pkt6Ptr processRequest(AllocEngine::ClientContext6 &ctx)
Processes incoming Request and returns Reply response.
void discardPackets()
Discards cached and parked packets Clears the call_handle store and packet parking lots of all packet...
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.
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.
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.
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.
boost::shared_ptr< AllocEngine > alloc_engine_
Allocation Engine.
bool run()
Main server processing loop.
Pkt6Ptr processDecline(AllocEngine::ClientContext6 &ctx)
Process incoming Decline message.
void processDhcp4Query(const Pkt6Ptr &dhcp4_query)
Processes incoming DHCPv4-query message.
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).
uint16_t getPort() const
Get UDP port on which server should listen.
bool declineLeases(const Pkt6Ptr &decline, Pkt6Ptr &reply, AllocEngine::ClientContext6 &ctx)
Attempts to decline all leases in specified Decline message.
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
bool testUnicast(const Pkt6Ptr &pkt) const
Check if the message can be sent to unicast.
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.