5 #ifndef vnsw_agent_contrail_pkt0_interface_hpp
6 #define vnsw_agent_contrail_pkt0_interface_hpp
9 #include <boost/bind/bind.hpp>
10 #include <boost/function.hpp>
11 #include <boost/asio.hpp>
15 using namespace boost::placeholders;
25 virtual void InitControlInterface();
26 virtual void IoShutdownControlInterface();
27 virtual void ShutdownControlInterface();
29 const std::string &
Name()
const {
return name_; }
31 const unsigned char *
mac_address()
const {
return mac_address_; }
34 void SendImpl(uint8_t *buff, uint16_t buff_len,
const PacketBufferPtr &pkt,
35 buffer_list& buff_list);
38 void ReadHandler(
const boost::system::error_code &err, std::size_t length);
39 void WriteHandler(
const boost::system::error_code &error,
40 std::size_t length, uint8_t *buff);
44 unsigned char mac_address_[ETHER_ADDR_LEN];
46 boost::asio::posix::stream_descriptor
input_;
58 void InitControlInterface();
66 static const uint32_t kConnectTimeout = 1000;
70 static void CreateMockAgent(
const string&);
73 boost::asio::io_context *
io);
76 virtual void InitControlInterface();
77 virtual void IoShutdownControlInterface();
78 virtual void ShutdownControlInterface();
79 const std::string &
Name()
const {
return name_; }
84 void ReadHandler(
const boost::system::error_code &err, std::size_t length);
85 void WriteHandler(
const boost::system::error_code &error,
87 void CreateUnixSocket();
88 void StartConnectTimer();
92 boost::asio::local::datagram_protocol::socket
socket_;
std::vector< boost::asio::const_buffer > buffer_list
const unsigned char * mac_address() const
const std::string & Name() const
PktHandler * pkt_handler_
boost::asio::posix::stream_descriptor input_
DISALLOW_COPY_AND_ASSIGN(Pkt0Interface)
DISALLOW_COPY_AND_ASSIGN(Pkt0RawInterface)
static string sVrouterSocketPath
PktHandler * pkt_handler_
boost::scoped_ptr< Timer > timer_
boost::asio::local::datagram_protocol::socket socket_
const std::string & Name() const
static string sAgentSocketPath
DISALLOW_COPY_AND_ASSIGN(Pkt0Socket)
boost::shared_ptr< PacketBuffer > PacketBufferPtr