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  * Copyright Contributors to the OpenSDN project
4  */
5 
6 #ifndef linux_vnsw_agent_router_id_h
7 #define linux_vnsw_agent_router_id_h
8 
9 #include <string>
10 #include <boost/bind/bind.hpp>
11 #include <boost/function.hpp>
12 #include <boost/asio.hpp>
14 
15 using namespace boost::placeholders;
16 
17 namespace local = boost::asio::local;
18 
20 
21 public:
23  virtual ~VnswInterfaceListenerLinux();
24 
25 private:
26  friend class TestVnswIf;
27 
28  int CreateSocket();
29  virtual void SyncCurrentState();
30  virtual void RegisterAsyncReadHandler();
31  void ReadHandler(const boost::system::error_code &, std::size_t length);
32  void UpdateLinkLocalRoute(const Ip4Address &addr, uint8_t plen, bool del_rt);
33 
34 private:
35  void InitNetlinkScan(uint32_t type, uint32_t seqno);
36  int NlMsgDecode(struct nlmsghdr *nl, std::size_t len, uint32_t seq_no);
37  bool ProcessEvent(Event *re);
38 
39  int AddAttr(uint8_t *, int , void *, int );
40  string NetlinkTypeToString(uint32_t);
41  Event *HandleNetlinkRouteMsg(struct nlmsghdr *);
42  Event *HandleNetlinkIntfMsg(struct nlmsghdr *);
43  Event *HandleNetlinkAddrMsg(struct nlmsghdr *);
44 
46 };
47 
49 
50 #endif
boost::asio::ip::address_v4 Ip4Address
Definition: address.h:15
Definition: agent.h:361
DISALLOW_COPY_AND_ASSIGN(VnswInterfaceListenerLinux)
bool ProcessEvent(Event *re)
uint8_t type
Definition: load_balance.h:2
VnswInterfaceListenerLinux VnswInterfaceListener