blob: a00e6b7536b733fbec99459e3b7b4698a0d400a9 [file] [log] [blame]
#pragma once
#include "types.hpp"
#include "util.hpp"
#include <systemd/sd-event.h>
namespace phosphor
{
namespace network
{
namespace rtnetlink
{
constexpr auto BUFSIZE = 4096;
/** General rtnetlink server which waits for the POLLIN event
and calls the call back once it gets the event.
Usage would be create the server with the call back
and call the run method.
*/
class Server
{
public:
/** @brief Constructor
*
* @details Sets up the server to handle incoming RTNETLINK events
*
* @param[in] eventPtr - Unique ptr reference to sd_event.
*/
Server(EventPtr& eventPtr);
Server() = delete;
~Server() = default;
Server(const Server&) = delete;
Server& operator=(const Server&) = delete;
Server(Server&&) = default;
Server& operator=(Server &&) = default;
};
} //namespace rtnetlink
} //namespce network
} //namespace phosphor