OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mac_learning_base.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef SRC_VNSW_AGENT_MAC_LEARNING_MAC_LEARNING_BASE_H_
6 #define SRC_VNSW_AGENT_MAC_LEARNING_MAC_LEARNING_BASE_H_
7 
8 #include "cmn/agent.h"
9 #include "mac_learning_key.h"
10 #include "pkt/flow_token.h"
11 
12 class MacAgingTable;
13 class MacAgingPartition;
15 
17 typedef boost::shared_ptr<MacLearningEntry> MacLearningEntryPtr;
18 typedef boost::shared_ptr<MacLearningEntryRequest> MacLearningEntryRequestPtr;
20 public:
22  deleted_(false) {
24  FindVrfFromIdIncludingDeletedVrf(vrf_id);
25 }
26 
27  virtual ~MacLearningEntry() {}
28  virtual bool Add() = 0;
29  virtual void Delete() = 0;
30  virtual void Resync() = 0;
31 
32 
33  VrfEntry* vrf() const {
34  return vrf_.get();
35  }
36 
37  virtual uint32_t vrf_id() = 0;
38 
39  virtual void AddWithToken() {
40  }
41 
42  virtual void AddToken(TokenPtr ptr) {
43  }
44 
45  virtual void ReleaseToken() {
46  }
47 
48  virtual void CopyToken(MacLearningEntry *entry) {
49  }
50 
51  virtual bool HasTokens() {
52  return false;
53  }
54 
55  bool deleted() const {
56  return deleted_;
57  }
58  virtual void EnqueueToTable(MacLearningEntryRequestPtr req)= 0;
59 
60 protected:
62  bool deleted_;
63 private:
65 };
66 #endif
static Agent * GetInstance()
Definition: agent.h:436
Definition: vrf.h:86
virtual void Resync()=0
virtual void AddWithToken()
virtual void EnqueueToTable(MacLearningEntryRequestPtr req)=0
virtual bool HasTokens()
virtual void CopyToken(MacLearningEntry *entry)
virtual uint32_t vrf_id()=0
virtual void Delete()=0
virtual void AddToken(TokenPtr ptr)
boost::shared_ptr< MacLearningEntryRequest > MacLearningEntryRequestPtr
DISALLOW_COPY_AND_ASSIGN(MacLearningEntry)
bool deleted() const
VrfTable * vrf_table() const
Definition: agent.h:485
virtual void ReleaseToken()
MacLearningEntry(uint32_t vrf_id)
virtual bool Add()=0
virtual ~MacLearningEntry()
boost::shared_ptr< Token > TokenPtr
Definition: flow_token.h:11
VrfEntry * vrf() const
boost::shared_ptr< MacLearningEntry > MacLearningEntryPtr