7#ifndef CLIENT_HANDLER_H
8#define CLIENT_HANDLER_H
11#include <boost/noncopyable.hpp>
12#include <boost/multi_index_container.hpp>
13#include <boost/multi_index/hashed_index.hpp>
14#include <boost/multi_index/member.hpp>
15#include <boost/shared_ptr.hpp>
33 return (boost::make_shared<Continuation>(cont));
87 typedef boost::multi_index_container<
93 boost::multi_index::indexed_by<
96 boost::multi_index::hashed_unique<
99 boost::multi_index::member<
119 static void add(
const ClientPtr& client);
126 static void del(
const DuidPtr& duid);
131 static std::mutex mutex_;
134 static ClientContainer clients_;
Client race avoidance RAII handler.
boost::shared_ptr< Client > ClientPtr
The type of shared pointers to clients.
virtual ~ClientHandler()
Destructor.
bool tryLock(Pkt4Ptr query, ContinuationPtr cont=ContinuationPtr())
Tries to acquires a client.
ClientHandler()
Public interface.
std::function< void()> Continuation
Define the type of packet processing continuation.
boost::shared_ptr< DUID > DuidPtr
ContinuationPtr makeContinuation(Continuation &&cont)
Continuation factory.
boost::shared_ptr< Continuation > ContinuationPtr
Define the type of shared pointers to continuations.
boost::shared_ptr< Pkt6 > Pkt6Ptr
A pointer to Pkt6 packet.
Defines the logger used by the top-level component of kea-lfc.
Class (aka static) types, methods and members.
uint32_t transid_
Cached transaction ID.
Client(Pkt4Ptr query, ClientIdPtr client_id, HWAddrPtr hwaddr)
Constructor.
std::vector< uint8_t > duid_
Cached binary client ID.
Pkt4Ptr next_query_
The next query.
bool relayed_
Cached relayed flag.
ContinuationPtr cont_
The continuation to process next query for the client.
uint8_t msg_type_
Cached message type.
std::thread::id thread_
The ID of the thread processing the query.