OpenSDN source code
vnswif_listener.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef linux_vnsw_agent_router_id_h
6 #define linux_vnsw_agent_router_id_h
7 
8 #include <string>
9 #include <boost/bind/bind.hpp>
10 #include <boost/function.hpp>
11 #include <boost/asio.hpp>
13 
14 using namespace boost::placeholders;
15 
16 namespace local = boost::asio::local;
17 
19 
20 public:
22  virtual ~VnswInterfaceListenerLinux();
23 
24 private:
25  friend class TestVnswIf;
26 
27  int CreateSocket();
28  virtual void SyncCurrentState();
29  virtual void RegisterAsyncReadHandler();
30  void ReadHandler(const boost::system::error_code &, std::size_t length);
31  void UpdateLinkLocalRoute(const Ip4Address &addr, uint8_t plen, bool del_rt);
32 
33 private:
34  void InitNetlinkScan(uint32_t type, uint32_t seqno);
35  int NlMsgDecode(struct nlmsghdr *nl, std::size_t len, uint32_t seq_no);
36  bool ProcessEvent(Event *re);
37 
38  int AddAttr(uint8_t *, int , void *, int );
39  string NetlinkTypeToString(uint32_t);
40  Event *HandleNetlinkRouteMsg(struct nlmsghdr *);
41  Event *HandleNetlinkIntfMsg(struct nlmsghdr *);
42  Event *HandleNetlinkAddrMsg(struct nlmsghdr *);
43 
45 };
46 
48 
49 #endif
boost::asio::ip::address_v4 Ip4Address
Definition: address.h:14
Definition: agent.h:360
DISALLOW_COPY_AND_ASSIGN(VnswInterfaceListenerLinux)
bool ProcessEvent(Event *re)
uint8_t type
Definition: load_balance.h:2
VnswInterfaceListenerLinux VnswInterfaceListener