OpenSDN source code
mac_learning_base.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_BASE_H_
7 #define SRC_VNSW_AGENT_MAC_LEARNING_MAC_LEARNING_BASE_H_
8 
9 #include "cmn/agent.h"
10 #include "mac_learning_key.h"
11 #include "pkt/flow_token.h"
12 
13 class MacAgingTable;
14 class MacAgingPartition;
16 
17 class MacLearningEntry;
18 typedef boost::shared_ptr<MacLearningEntry> MacLearningEntryPtr;
19 typedef boost::shared_ptr<MacLearningEntryRequest> MacLearningEntryRequestPtr;
21 public:
23  deleted_(false) {
25  FindVrfFromIdIncludingDeletedVrf(vrf_id);
26 }
27 
28  virtual ~MacLearningEntry() {}
29  virtual bool Add() = 0;
30  virtual void Delete() = 0;
31  virtual void Resync() = 0;
32 
33 
34  VrfEntry* vrf() const {
35  return vrf_.get();
36  }
37 
38  virtual uint32_t vrf_id() = 0;
39 
40  virtual void AddWithToken() {
41  }
42 
43  virtual void AddToken(TokenPtr ptr) {
44  }
45 
46  virtual void ReleaseToken() {
47  }
48 
49  virtual void CopyToken(MacLearningEntry *entry) {
50  }
51 
52  virtual bool HasTokens() {
53  return false;
54  }
55 
56  bool deleted() const {
57  return deleted_;
58  }
60 
61 protected:
63  bool deleted_;
64 private:
66 };
67 #endif
VrfTable * vrf_table() const
Definition: agent.h:488
static Agent * GetInstance()
Definition: agent.h:439
bool deleted() const
virtual void EnqueueToTable(MacLearningEntryRequestPtr req)=0
virtual bool HasTokens()
virtual void CopyToken(MacLearningEntry *entry)
virtual void AddWithToken()
VrfEntry * vrf() const
virtual ~MacLearningEntry()
virtual uint32_t vrf_id()=0
virtual bool Add()=0
virtual void Resync()=0
virtual void ReleaseToken()
virtual void Delete()=0
MacLearningEntry(uint32_t vrf_id)
virtual void AddToken(TokenPtr ptr)
DISALLOW_COPY_AND_ASSIGN(MacLearningEntry)
Definition: vrf.h:90
boost::shared_ptr< Token > TokenPtr
Definition: flow_token.h:11
boost::shared_ptr< MacLearningEntry > MacLearningEntryPtr
boost::shared_ptr< MacLearningEntryRequest > MacLearningEntryRequestPtr