OpenSDN source code
ksync_sock_user.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 ctrlplane_ksync_sock_user_h
7 #define ctrlplane_ksync_sock_user_h
8 
9 #include <queue>
10 #include <mutex>
11 
12 #include <boost/asio.hpp>
13 #include <boost/asio/buffer.hpp>
14 
15 #include <boost/unordered_map.hpp>
16 #include "ksync_sock.h"
17 
18 #include "nl_util.h"
19 #include "vr_types.h"
20 #include "vr_flow.h"
21 #include "vr_bridge.h"
22 
23 using boost::asio::ip::udp;
24 
26 
27 class vrouter_ops_test : public vrouter_ops {
28 private:
29  virtual void Process(SandeshContext *context);
30 };
31 
33 public:
35  virtual ~KSyncUserSockContext() {}
36  uint32_t GetSeqNum() { return seqno_; }
37  virtual void IfMsgHandler(vr_interface_req *req);
38  virtual void NHMsgHandler(vr_nexthop_req *req);
39  virtual void RouteMsgHandler(vr_route_req *req);
40  virtual void MplsMsgHandler(vr_mpls_req *req);
41  virtual void MirrorMsgHandler(vr_mirror_req *req);
42  virtual int VrResponseMsgHandler(vr_response *req) {return 0;};
43  virtual void FlowMsgHandler(vr_flow_req *req);
44  virtual void VrfAssignMsgHandler(vr_vrf_assign_req *req);
45  virtual void VrfMsgHandler(vr_vrf_req *req);
46  virtual void VrfStatsMsgHandler(vr_vrf_stats_req *req);
47  virtual void DropStatsMsgHandler(vr_drop_stats_req *req);
48  virtual void VxLanMsgHandler(vr_vxlan_req *req);
49  virtual void QosConfigMsgHandler(vr_qos_map_req *req);
50  virtual void ForwardingClassMsgHandler(vr_fc_map_req *req);
51  virtual void VrouterOpsMsgHandler(vrouter_ops *req);
52  virtual void Process() {}
53 private:
54  uint32_t seqno_;
55 };
56 
57 struct TestRouteCmp {
58  bool operator()(const vr_route_req &lhs, const vr_route_req &rhs) const {
59  if (lhs.get_rtr_family() != rhs.get_rtr_family()) {
60  return lhs.get_rtr_family() < rhs.get_rtr_family();
61  }
62  if (lhs.get_rtr_vrf_id() != rhs.get_rtr_vrf_id()) {
63  return lhs.get_rtr_vrf_id() < rhs.get_rtr_vrf_id();
64  }
65  if (lhs.get_rtr_family() == AF_BRIDGE) {
66  return lhs.get_rtr_mac() < rhs.get_rtr_mac();
67  }
68  if (lhs.get_rtr_prefix_len() != rhs.get_rtr_prefix_len()) {
69  return lhs.get_rtr_prefix_len() < rhs.get_rtr_prefix_len();
70  }
71  return lhs.get_rtr_prefix() < rhs.get_rtr_prefix();
72  }
73 };
74 
76  bool operator() (const vr_vrf_assign_req &lhs, const vr_vrf_assign_req &rhs) const {
77  if (lhs.get_var_vif_index() != rhs.get_var_vif_index()) {
78  return lhs.get_var_vif_index() < rhs.get_var_vif_index();
79  }
80 
81  return lhs.get_var_vlan_id() < rhs.get_var_vlan_id();
82  }
83 };
84 
85 //this class stores all netlink sandesh messages in a map
86 //used for unit testing or userspace datapath integration
87 class KSyncSockTypeMap : public KSyncSock {
88 public:
92  };
93 
94  KSyncSockTypeMap(boost::asio::io_context &ios) : KSyncSock(), sock_(ios), ksync_error_() {
95  block_msg_processing_ = false;
96  is_incremental_index_ = false;
97  }
99  assert(nh_map.size() == 0);
100  assert(flow_map.size() == 0);
101  assert(if_map.size() == 0);
102  assert(rt_tree.size() == 0);
103  assert(mpls_map.size() == 0);
104  assert(mirror_map.size() == 0);
105  assert(vrf_assign_tree.size() == 0);
106  assert(vxlan_map.size() == 0);
107  singleton_ = NULL;
108  }
109 
110  typedef std::map<int, vr_nexthop_req> ksync_map_nh;
112  typedef boost::unordered_map<int, vr_flow_req> ksync_map_flow;
114  typedef std::map<int, vr_interface_req> ksync_map_if;
116  typedef std::set<vr_route_req, TestRouteCmp> ksync_rt_tree;
118  typedef std::map<int, vr_mpls_req> ksync_map_mpls;
120  typedef std::map<int, vr_mirror_req> ksync_map_mirror;
122  typedef std::set<vr_vrf_assign_req, TestVrfAssignCmp> ksync_vrf_assign_tree;
124  typedef std::map<int, vr_vrf_stats_req> ksync_map_vrf_stats;
126  vr_drop_stats_req drop_stats;
127  vrouter_ops ksync_vrouter_ops;
128  typedef std::map<int, vr_vxlan_req> ksync_map_vxlan;
130  typedef std::map<int, vr_vrf_req> ksync_map_vrf;
132  typedef std::queue<KSyncUserSockContext *> ksync_map_ctx_queue;
134  std::mutex ctx_queue_lock_;
135 
136  virtual uint32_t GetSeqno(char *data);
137  virtual bool IsMoreData(char *data);
138  virtual bool BulkDecoder(char *data, KSyncBulkSandeshContext *ctxt);
139  virtual bool Decoder(char *data, AgentSandeshContext *ctxt);
140  virtual bool Validate(char *data);
141  virtual void AsyncReceive(boost::asio::mutable_buffers_1, HandlerCb);
142  virtual void AsyncSendTo(KSyncBufferList *iovec, uint32_t seq_no,
143  HandlerCb cb);
144  virtual std::size_t SendTo(KSyncBufferList *iovec, uint32_t seq_no);
145  virtual void Receive(boost::asio::mutable_buffers_1);
146 
147  void PurgeTxBuffer();
148  void ProcessSandesh(const uint8_t *, std::size_t, KSyncUserSockContext *);
149  static void set_error_code(int code) { error_code_ = code; }
150  static int error_code() { return error_code_; }
151  static void SimulateResponse(uint32_t, int, int);
152  static void SendNetlinkDoneMsg(uint32_t seq_num);
153  static void IfDumpResponse(uint32_t);
154  static void IfNetlinkMsgSend(uint32_t seq_num, ksync_map_if::const_iterator it);
155  static void IfStatsUpdate(int, int, int, int, int, int, int);
156  static void IfStatsSet(int, int, int, int, int, int, int);
157  static void InterfaceAdd(int id, int flags = 0, int mac_size = 6);
158  static void InterfaceDelete(int id);
159  static void NHAdd(int id, int flags = 0);
160  static void NHDelete(int id);
161  static void MplsAdd(int id);
162  static void MplsDelete(int id);
163  static void MirrorAdd(int id);
164  static void MirrorDelete(int id);
165  static void RouteAdd(vr_route_req &req);
166  static void RouteDelete(vr_route_req &req);
167  static void VrfAssignAdd(vr_vrf_assign_req &req);
168  static void VrfAssignDelete(vr_vrf_assign_req &req);
169  static void VrfAdd(vr_vrf_req &req);
170  static void VrfDelete(vr_vrf_req &req);
171  static void VrfStatsAdd(int vrf_id);
172  static void VrfStatsUpdate(int vrf_id, const vr_vrf_stats_req &req);
173  static void VrfStatsDelete(int vrf_id);
174  static void VxlanAdd(int id);
175  static void VxlanDelete(int id);
176 
177  static void SetDropStats(const vr_drop_stats_req &req);
178  static void SetVRouterOps(const vrouter_ops &req);
179  static int IfCount();
180  static int NHCount();
181  static int MplsCount();
182  static int RouteCount();
183  static int VxLanCount();
185  static void Init(boost::asio::io_context &ios);
186  static void Shutdown();
187  static vr_flow_entry *FlowMmapAlloc(int size);
188  static void FlowMmapFree();
189  static vr_flow_entry *GetFlowEntry(int idx);
190  static void SetFlowEntry(vr_flow_req *req, bool set);
191  static void IncrFlowStats(int idx, int pkts, int bytes);
192  static void SetTcpFlag(int idx, uint32_t flags);
193  static void SetOFlowStats(int idx, uint8_t pkts, uint16_t bytes);
194  static void SetFlowTcpFlags(int idx, uint16_t flags);
195  static void SetEvictedFlag(int idx);
196  static void ResetEvictedFlag(int idx);
197  static void FlowNatResponse(uint32_t seq_num, vr_flow_req *req, int code = 0);
198  static void SetUnderlaySourcePort(int idx, int port);
199  vr_bridge_entry* BridgeMmapAlloc(int size);
200  void BridgeMmapFree();
201  vr_bridge_entry* GetBridgeEntry(int idx);
202  void SetBridgeEntry(uint32_t idx, vr_route_req *req, bool set);
203  void UpdateBridgeEntryInactiveFlag(int idx, bool set);
204  friend class MockDumpHandlerBase;
205  friend class RouteDumpHandler;
206  friend class VrfAssignDumpHandler;
207  friend class VrfDumpHandler;
208  void SetBlockMsgProcessing(bool enable);
210  std::scoped_lock lock(ctx_queue_lock_);
211  return block_msg_processing_;
212  }
213 
214  void set_is_incremental_index(bool incremental) {
215  is_incremental_index_ = incremental;
216  }
217 
219 
220  void SetKSyncError(KSyncSockEntryType type, int ksync_error) {
221  ksync_error_[type] = ksync_error;
222  }
223 
225  return ksync_error_[type];
226  }
227 
228  // Add a response in nl_client into tx_buff_list_
229  void AddNetlinkTxBuff(struct nl_client *cl);
230  void InitNetlinkDoneMsg(struct nlmsghdr *nlh, uint32_t seq_num);
231  void DisableReceiveQueue(bool disable);
232 private:
233  void PurgeBlockedMsg();
234  udp::socket sock_;
235  udp::endpoint local_ep_;
240  static vr_flow_entry *flow_table_;
241  vr_bridge_entry *bridge_table_;
242  static int error_code_;
243  // List of nl_client messages to be sent. In case of bulk message, all
244  // responses are initially put into this list and finally NL_MULTI
245  // netlink messages are sent
246  std::vector<struct nl_client> tx_buff_list_;
248 };
249 
251 public:
253  virtual ~MockDumpHandlerBase() {}
254  void SendDumpResponse(uint32_t seq_num, Sandesh *);
255  void SendGetResponse(uint32_t seq_num, int idx);
256  virtual Sandesh* GetFirst(Sandesh *) = 0;
257  virtual Sandesh* GetNext(Sandesh *) = 0;
258  virtual Sandesh* Get(int idx) = 0;
259 };
260 
262 public:
264  virtual Sandesh* GetFirst(Sandesh *);
265  virtual Sandesh* GetNext(Sandesh *);
266  virtual Sandesh* Get(int idx);
267 private:
268  vr_drop_stats_req drop_stats_req;
269 };
270 
272 public:
274  virtual Sandesh* GetFirst(Sandesh *);
275  virtual Sandesh* GetNext(Sandesh *);
276  virtual Sandesh* Get(int idx);
277 };
278 
280 public:
282  virtual Sandesh* GetFirst(Sandesh *);
283  virtual Sandesh* GetNext(Sandesh *);
284  virtual Sandesh* Get(int idx);
285 };
286 
288 public:
290  virtual Sandesh* GetFirst(Sandesh *);
291  virtual Sandesh* GetNext(Sandesh *);
292  virtual Sandesh* Get(int idx);
293 };
294 
296 public:
298  virtual Sandesh* GetFirst(Sandesh *);
299  virtual Sandesh* GetNext(Sandesh *);
300  /* GET operation is not supported for vrf assign */
301  virtual Sandesh* Get(int idx) {
302  return NULL;
303  }
304 };
305 
307 public:
309  virtual Sandesh* GetFirst(Sandesh *);
310  virtual Sandesh* GetNext(Sandesh *);
311  /* GET operation is not supported for route */
312  virtual Sandesh* Get(int idx) {
313  return NULL;
314  }
315 };
316 
318 public:
320  virtual Sandesh* GetFirst(Sandesh *);
321  virtual Sandesh* GetNext(Sandesh *);
322  virtual Sandesh* Get(int idx);
323 };
324 
326 public:
328  virtual Sandesh* GetFirst(Sandesh *);
329  virtual Sandesh* GetNext(Sandesh *);
330  virtual Sandesh* Get(int idx);
331 };
332 
334 public:
336  virtual Sandesh* GetFirst(Sandesh *);
337  virtual Sandesh* GetNext(Sandesh *);
338  virtual Sandesh* Get(int idx);
339 };
340 
342 public:
344  virtual Sandesh* GetFirst(Sandesh *) { return NULL; }
345  virtual Sandesh* GetNext(Sandesh *) { return NULL; }
346  virtual Sandesh* Get(int idx) {
348  return &sock->drop_stats;
349  }
350 };
351 
353 public:
355  virtual Sandesh* GetFirst(Sandesh *) { return NULL;}
356  virtual Sandesh* GetNext(Sandesh *) { return NULL;}
357  virtual Sandesh* Get(int idx) {
359  return &sock->ksync_vrouter_ops;
360  }
361 };
362 
363 
365 public:
366  KSyncUserSockIfContext(uint32_t seq_num, vr_interface_req *req) : KSyncUserSockContext(seq_num) {
367  if (req) {
368  req_ = new vr_interface_req(*req);
369  } else {
370  req_ = NULL;
371  }
372  }
374  if (req_) {
375  delete req_;
376  req_ = NULL;
377  }
378  }
379 
380  virtual void Process();
381 private:
382  vr_interface_req *req_;
383 };
384 
386 public:
387  KSyncUserSockNHContext(uint32_t seq_num, vr_nexthop_req *req) : KSyncUserSockContext(seq_num) {
388  if (req) {
389  req_ = new vr_nexthop_req(*req);
390  } else {
391  req_ = NULL;
392  }
393  }
395  if (req_) {
396  delete req_;
397  req_ = NULL;
398  }
399  }
400 
401  virtual void Process();
402 private:
403  vr_nexthop_req *req_;
404 };
405 
407 public:
408  KSyncUserSockMplsContext(uint32_t seq_num, vr_mpls_req *req) : KSyncUserSockContext(seq_num) {
409  if (req) {
410  req_ = new vr_mpls_req(*req);
411  } else {
412  req_ = NULL;
413  }
414  }
416  if (req_) {
417  delete req_;
418  req_ = NULL;
419  }
420  }
421 
422  virtual void Process();
423 private:
424  vr_mpls_req *req_;
425 };
426 
428 public:
429  KSyncUserSockFlowContext(uint32_t seq_num, vr_flow_req *req) : KSyncUserSockContext(seq_num) {
430  if (req) {
431  req_ = new vr_flow_req(*req);
432  } else {
433  req_ = NULL;
434  }
435  }
437  if (req_) {
438  delete req_;
439  req_ = NULL;
440  }
441  }
442 
443  virtual void Process();
444 private:
445  vr_flow_req *req_;
446 };
447 
449 public:
450  KSyncUserSockRouteContext(uint32_t seq_num, vr_route_req *req) :
451  KSyncUserSockContext(seq_num) {
452  if (req) {
453  /* For delete of AF_BRIDGE entries, we need rtr_index of
454  * vr_route_req to find vr_bridge_entry and reset its flags. The
455  * rtr_index is configured while doing add of AF_BRIDGE entry. When
456  * delete of AF_BRIDGE arrives, we do lookup of vr_route_req from
457  * our tree to figure out the rtr_index */
458  if ((req->get_h_op() == sandesh_op::DEL) &&
459  (req->get_rtr_family() == AF_BRIDGE)) {
461  KSyncSockTypeMap::ksync_rt_tree::iterator it =
462  sock->rt_tree.find(*req);
463  assert (it != sock->rt_tree.end());
464  const vr_route_req &tmp_req = *it;
465  req_ = new vr_route_req(tmp_req);
466  /* Change the operation to DELETE after picking request from
467  * our tree */
468  req_->set_h_op(sandesh_op::DEL);
469  } else {
470  req_ = new vr_route_req(*req);
471  }
472  } else {
473  req_ = NULL;
474  }
475  }
477  if (req_) {
478  delete req_;
479  req_ = NULL;
480  }
481  }
482 
483  virtual void Process();
484 private:
485  vr_route_req *req_;
486 };
487 
489 public:
490  KSyncUserSockVrfAssignContext(uint32_t seq_num, vr_vrf_assign_req *req) :
491  KSyncUserSockContext(seq_num) {
492  if (req) {
493  req_ = new vr_vrf_assign_req(*req);
494  } else {
495  req_ = NULL;
496  }
497  }
499  if (req_) {
500  delete req_;
501  req_ = NULL;
502  }
503  }
504 
505  virtual void Process();
506 private:
507  vr_vrf_assign_req *req_;
508 };
509 
511 public:
512  KSyncUserSockVrfContext(uint32_t seq_num, vr_vrf_req *req) :
513  KSyncUserSockContext(seq_num) {
514  if (req) {
515  req_ = new vr_vrf_req(*req);
516  } else {
517  req_ = NULL;
518  }
519  }
521  if (req_) {
522  delete req_;
523  req_ = NULL;
524  }
525  }
526 
527  virtual void Process();
528 private:
529  vr_vrf_req *req_;
530 };
531 
533 public:
534  KSyncUserSockVrfStatsContext(uint32_t seq_num, vr_vrf_stats_req *req) : KSyncUserSockContext(seq_num) {
535  if (req) {
536  req_ = new vr_vrf_stats_req(*req);
537  } else {
538  req_ = NULL;
539  }
540  }
542  if (req_) {
543  delete req_;
544  req_ = NULL;
545  }
546  }
547 
548  virtual void Process();
549 private:
550  vr_vrf_stats_req *req_;
551 };
552 
554 public:
555  KSyncUserSockVxLanContext(uint32_t seq_num, vr_vxlan_req *req) : KSyncUserSockContext(seq_num) {
556  if (req) {
557  req_ = new vr_vxlan_req(*req);
558  } else {
559  req_ = NULL;
560  }
561  }
563  if (req_) {
564  delete req_;
565  req_ = NULL;
566  }
567  }
568 
569  virtual void Process();
570 private:
571  vr_vxlan_req *req_;
572 };
573 
575 public:
576  KSyncUserSockDropStatsContext(uint32_t seq_num, vr_drop_stats_req *req) : KSyncUserSockContext(seq_num) {
577  if (req) {
578  req_ = new vr_drop_stats_req(*req);
579  } else {
580  req_ = NULL;
581  }
582  }
584  if (req_) {
585  delete req_;
586  req_ = NULL;
587  }
588  }
589 
590  virtual void Process();
591 private:
592  vr_drop_stats_req *req_;
593 };
594 
596 public:
597  KSyncUserVrouterOpsContext(uint32_t seq_num, vrouter_ops *req) :
598  KSyncUserSockContext(seq_num) {
599  if (req) {
600  req_ = new vrouter_ops(*req);
601  } else {
602  req_ = NULL;
603  }
604  }
606  if (req_) {
607  delete req_;
608  req_ = NULL;
609  }
610  }
611 
612  virtual void Process();
613 private:
614  vrouter_ops *req_;
615 };
616 
617 
618 #endif // ctrlplane_ksync_sock_user_h
virtual Sandesh * GetFirst(Sandesh *)
virtual Sandesh * GetNext(Sandesh *)
virtual Sandesh * Get(int idx)
virtual Sandesh * GetFirst(Sandesh *)
virtual Sandesh * Get(int idx)
vr_drop_stats_req drop_stats_req
virtual Sandesh * GetNext(Sandesh *)
static int VxLanCount()
void UpdateBridgeEntryInactiveFlag(int idx, bool set)
ksync_map_vrf_stats vrf_stats_map
static void MplsAdd(int id)
static void VrfDelete(vr_vrf_req &req)
static void SetUnderlaySourcePort(int idx, int port)
static void Init(boost::asio::io_context &ios)
void set_is_incremental_index(bool incremental)
static void SimulateResponse(uint32_t, int, int)
int GetKSyncError(KSyncSockEntryType type)
static vr_flow_entry * GetFlowEntry(int idx)
static void SetFlowEntry(vr_flow_req *req, bool set)
static void IfStatsSet(int, int, int, int, int, int, int)
virtual bool BulkDecoder(char *data, KSyncBulkSandeshContext *ctxt)
static void SetEvictedFlag(int idx)
static int MplsCount()
static void VrfStatsUpdate(int vrf_id, const vr_vrf_stats_req &req)
virtual bool Validate(char *data)
static void FlowNatResponse(uint32_t seq_num, vr_flow_req *req, int code=0)
static void IfDumpResponse(uint32_t)
static int IfCount()
ksync_map_if if_map
virtual bool IsMoreData(char *data)
static void FlowMmapFree()
static void VrfStatsDelete(int vrf_id)
vr_bridge_entry * bridge_table_
static void MirrorDelete(int id)
static void InterfaceDelete(int id)
static int error_code()
static void IncrFlowStats(int idx, int pkts, int bytes)
std::map< int, vr_vxlan_req > ksync_map_vxlan
DISALLOW_COPY_AND_ASSIGN(KSyncSockTypeMap)
static int NHCount()
void SetBridgeEntry(uint32_t idx, vr_route_req *req, bool set)
std::set< vr_vrf_assign_req, TestVrfAssignCmp > ksync_vrf_assign_tree
virtual uint32_t GetSeqno(char *data)
vr_bridge_entry * GetBridgeEntry(int idx)
static void VxlanDelete(int id)
virtual void AsyncSendTo(KSyncBufferList *iovec, uint32_t seq_no, HandlerCb cb)
static KSyncSockTypeMap * GetKSyncSockTypeMap()
ksync_rt_tree rt_tree
static void SetTcpFlag(int idx, uint32_t flags)
virtual void Receive(boost::asio::mutable_buffers_1)
static void MirrorAdd(int id)
std::map< int, vr_mpls_req > ksync_map_mpls
void AddNetlinkTxBuff(struct nl_client *cl)
virtual std::size_t SendTo(KSyncBufferList *iovec, uint32_t seq_no)
std::vector< struct nl_client > tx_buff_list_
virtual void AsyncReceive(boost::asio::mutable_buffers_1, HandlerCb)
void SetBlockMsgProcessing(bool enable)
void DisableReceiveQueue(bool disable)
static void VxlanAdd(int id)
static void Shutdown()
static void ResetEvictedFlag(int idx)
std::map< int, vr_nexthop_req > ksync_map_nh
static void VrfStatsAdd(int vrf_id)
static int error_code_
ksync_map_mpls mpls_map
std::queue< KSyncUserSockContext * > ksync_map_ctx_queue
static void SetDropStats(const vr_drop_stats_req &req)
void SetKSyncError(KSyncSockEntryType type, int ksync_error)
static void IfStatsUpdate(int, int, int, int, int, int, int)
KSyncSockTypeMap(boost::asio::io_context &ios)
ksync_map_mirror mirror_map
static void VrfAssignAdd(vr_vrf_assign_req &req)
ksync_vrf_assign_tree vrf_assign_tree
vrouter_ops ksync_vrouter_ops
ksync_map_ctx_queue ctx_queue_
ksync_map_vxlan vxlan_map
ksync_map_vrf vrf_map
static vr_flow_entry * FlowMmapAlloc(int size)
static void VrfAdd(vr_vrf_req &req)
static void SendNetlinkDoneMsg(uint32_t seq_num)
std::map< int, vr_vrf_stats_req > ksync_map_vrf_stats
static int RouteCount()
std::mutex ctx_queue_lock_
static void SetFlowTcpFlags(int idx, uint16_t flags)
void ProcessSandesh(const uint8_t *, std::size_t, KSyncUserSockContext *)
int ksync_error_[KSYNC_MAX_ENTRY_TYPE]
std::map< int, vr_vrf_req > ksync_map_vrf
boost::unordered_map< int, vr_flow_req > ksync_map_flow
static void SetOFlowStats(int idx, uint8_t pkts, uint16_t bytes)
udp::endpoint local_ep_
static void NHAdd(int id, int flags=0)
static void SetVRouterOps(const vrouter_ops &req)
static void RouteAdd(vr_route_req &req)
static void InterfaceAdd(int id, int flags=0, int mac_size=6)
static void RouteDelete(vr_route_req &req)
static void MplsDelete(int id)
virtual bool Decoder(char *data, AgentSandeshContext *ctxt)
std::map< int, vr_mirror_req > ksync_map_mirror
void InitNetlinkDoneMsg(struct nlmsghdr *nlh, uint32_t seq_num)
static void NHDelete(int id)
static void IfNetlinkMsgSend(uint32_t seq_num, ksync_map_if::const_iterator it)
static void set_error_code(int code)
static vr_flow_entry * flow_table_
ksync_map_nh nh_map
static KSyncSockTypeMap * singleton_
static void VrfAssignDelete(vr_vrf_assign_req &req)
vr_drop_stats_req drop_stats
std::map< int, vr_interface_req > ksync_map_if
vr_bridge_entry * BridgeMmapAlloc(int size)
ksync_map_flow flow_map
std::set< vr_route_req, TestRouteCmp > ksync_rt_tree
boost::function< void(const boost::system::error_code &, size_t)> HandlerCb
Definition: ksync_sock.h:327
virtual void VxLanMsgHandler(vr_vxlan_req *req)
virtual void Process()
virtual void MplsMsgHandler(vr_mpls_req *req)
virtual void RouteMsgHandler(vr_route_req *req)
virtual int VrResponseMsgHandler(vr_response *req)
virtual void FlowMsgHandler(vr_flow_req *req)
virtual void VrfAssignMsgHandler(vr_vrf_assign_req *req)
virtual void DropStatsMsgHandler(vr_drop_stats_req *req)
virtual void NHMsgHandler(vr_nexthop_req *req)
virtual void QosConfigMsgHandler(vr_qos_map_req *req)
virtual ~KSyncUserSockContext()
virtual void MirrorMsgHandler(vr_mirror_req *req)
virtual void VrfStatsMsgHandler(vr_vrf_stats_req *req)
virtual void IfMsgHandler(vr_interface_req *req)
virtual void VrfMsgHandler(vr_vrf_req *req)
virtual void VrouterOpsMsgHandler(vrouter_ops *req)
virtual void ForwardingClassMsgHandler(vr_fc_map_req *req)
KSyncUserSockContext(uint32_t num)
KSyncUserSockDropStatsContext(uint32_t seq_num, vr_drop_stats_req *req)
KSyncUserSockFlowContext(uint32_t seq_num, vr_flow_req *req)
vr_interface_req * req_
KSyncUserSockIfContext(uint32_t seq_num, vr_interface_req *req)
KSyncUserSockMplsContext(uint32_t seq_num, vr_mpls_req *req)
KSyncUserSockNHContext(uint32_t seq_num, vr_nexthop_req *req)
vr_nexthop_req * req_
KSyncUserSockRouteContext(uint32_t seq_num, vr_route_req *req)
KSyncUserSockVrfAssignContext(uint32_t seq_num, vr_vrf_assign_req *req)
KSyncUserSockVrfContext(uint32_t seq_num, vr_vrf_req *req)
KSyncUserSockVrfStatsContext(uint32_t seq_num, vr_vrf_stats_req *req)
KSyncUserSockVxLanContext(uint32_t seq_num, vr_vxlan_req *req)
KSyncUserVrouterOpsContext(uint32_t seq_num, vrouter_ops *req)
virtual Sandesh * GetFirst(Sandesh *)
virtual Sandesh * GetNext(Sandesh *)
virtual Sandesh * Get(int idx)
virtual Sandesh * Get(int idx)=0
void SendDumpResponse(uint32_t seq_num, Sandesh *)
virtual ~MockDumpHandlerBase()
virtual Sandesh * GetNext(Sandesh *)=0
void SendGetResponse(uint32_t seq_num, int idx)
virtual Sandesh * GetFirst(Sandesh *)=0
virtual Sandesh * GetFirst(Sandesh *)
virtual Sandesh * GetNext(Sandesh *)
virtual Sandesh * Get(int idx)
virtual Sandesh * Get(int idx)
virtual Sandesh * GetFirst(Sandesh *)
virtual Sandesh * GetNext(Sandesh *)
virtual Sandesh * GetFirst(Sandesh *)
virtual Sandesh * Get(int idx)
virtual Sandesh * GetNext(Sandesh *)
virtual Sandesh * GetFirst(Sandesh *)
virtual Sandesh * GetNext(Sandesh *)
virtual Sandesh * Get(int idx)
virtual Sandesh * Get(int idx)
virtual Sandesh * GetNext(Sandesh *)
virtual Sandesh * GetFirst(Sandesh *)
virtual Sandesh * Get(int idx)
virtual Sandesh * GetFirst(Sandesh *)
virtual Sandesh * GetNext(Sandesh *)
virtual Sandesh * GetNext(Sandesh *)
virtual Sandesh * GetFirst(Sandesh *)
virtual Sandesh * Get(int idx)
virtual Sandesh * GetFirst(Sandesh *)
virtual Sandesh * Get(int idx)
virtual Sandesh * GetNext(Sandesh *)
virtual void Process(SandeshContext *context)
std::vector< boost::asio::mutable_buffers_1 > KSyncBufferList
Definition: ksync_sock.h:38
uint8_t type
Definition: load_balance.h:2
bool operator()(const vr_route_req &lhs, const vr_route_req &rhs) const
bool operator()(const vr_vrf_assign_req &lhs, const vr_vrf_assign_req &rhs) const