OpenSDN source code
mac_learning_event.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
3  * Copyright Contributors to the OpenSDN project
4  */
5 
6 #ifndef SRC_VNSW_AGENT_MAC_LEARNING_MAC_LEARNING_EVENT_H_
7 #define SRC_VNSW_AGENT_MAC_LEARNING_MAC_LEARNING_EVENT_H_
8 
9 #include "cmn/agent.h"
10 #include "mac_learning_key.h"
11 #include "mac_learning_base.h"
12 
14 class MacIpLearningTable;
15 
17 public:
18  enum Event {
28 
29  };
30 
32  event_(event), pkt_info_(pkt) {}
35  }
36 
39  }
43  }
44 
46  uint32_t gen_id):
47  event_(event), db_entry_(entry), gen_id_(gen_id) {}
48 
50  return mac_learning_entry_;
51  }
52 
54  return event_;
55  }
56 
57  const DBEntry *db_entry() {
58  return db_entry_;
59  }
60 
62  return pkt_info_;
63  }
64 
65  uint32_t vrf_id() {
66  return vrf_id_;
67  }
68 
69  uint32_t gen_id() {
70  return gen_id_;
71  }
73  return ip_;
74  }
76  return mac_;
77  }
78 
79 private:
83  uint32_t vrf_id_;
85  uint32_t gen_id_;
88 };
89 //typedef boost::shared_ptr<MacLearningEntryRequest> MacLearningEntryRequestPtr;
90 
92 public:
95  TokenPool *pool);
97  void Shutdown() {}
98  virtual bool HandleEvent(MacLearningEntryRequestPtr ptr);
99  virtual bool TokenCheck();
100 
102  queue_.Enqueue(ptr);
103  }
104 
107  }
108 
109  void SetQueueDisable(bool disable) {
110  queue_.set_disable(disable);
111  }
112 
113 private:
118 };
120 public:
124  void Shutdown() {}
126 
128  queue_.Enqueue(ptr);
129  }
130 
133  }
134 
135  void SetQueueDisable(bool disable) {
136  queue_.set_disable(disable);
137  }
138 
139 private:
143 };
144 #endif
boost::asio::ip::address IpAddress
Definition: address.h:14
void SetQueueDisable(bool disable)
MacIpLearningTable * table_
bool HandleEvent(MacLearningEntryRequestPtr ptr)
DISALLOW_COPY_AND_ASSIGN(MacIpLearningRequestQueue)
void Enqueue(MacLearningEntryRequestPtr ptr)
MacIpLearningRequestQueue(MacIpLearningTable *table)
WorkQueue< MacLearningEntryRequestPtr > Queue
MacLearningEntryRequest(Event event, PktInfoPtr pkt)
const DBEntry * db_entry()
MacLearningEntryRequest(Event event, uint32_t vrf_id, IpAddress &ip, MacAddress &mac)
MacLearningEntryRequest(Event event, MacLearningEntryPtr ptr)
MacLearningEntryRequest(Event event, uint32_t vrf_id)
MacLearningEntryPtr mac_learning_entry()
MacLearningEntryPtr mac_learning_entry_
MacLearningEntryRequest(Event event, const DBEntry *entry, uint32_t gen_id)
void SetQueueDisable(bool disable)
MacLearningRequestQueue(MacLearningPartition *partition, TokenPool *pool)
DISALLOW_COPY_AND_ASSIGN(MacLearningRequestQueue)
MacLearningPartition * partition_
void Enqueue(MacLearningEntryRequestPtr ptr)
WorkQueue< MacLearningEntryRequestPtr > Queue
virtual bool HandleEvent(MacLearningEntryRequestPtr ptr)
virtual bool TokenCheck()
bool Enqueue(QueueEntryT entry)
Definition: queue_task.h:249
void set_disable(bool disabled)
Definition: queue_task.h:320
void MayBeStartRunner()
Definition: queue_task.h:282
boost::shared_ptr< MacLearningEntry > MacLearningEntryPtr
boost::shared_ptr< MacLearningEntryRequest > MacLearningEntryRequestPtr
boost::shared_ptr< PktInfo > PktInfoPtr
Definition: pkt_handler.h:61