OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vn_uve_entry_base.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef vnsw_agent_vn_uve_entry_base_h
6 #define vnsw_agent_vn_uve_entry_base_h
7 
8 #include <string>
9 #include <set>
10 #include <map>
11 #include <vector>
12 #include <virtual_network_types.h>
13 #include <oper/interface_common.h>
14 #include <oper/interface.h>
15 #include <oper/vn.h>
16 #include <tbb/mutex.h>
17 #include <cmn/agent_cmn.h>
18 
19 //The class that defines data-structures to store VirtualNetwork information
20 //required for sending VirtualNetwork UVE.
22 public:
23  typedef std::set<const Interface *> InterfaceSet;
24  typedef std::set<std::string> VmSet;
25 
26  VnUveEntryBase(Agent *agent, const VnEntry *vn);
27  VnUveEntryBase(Agent *agent);
28  virtual ~VnUveEntryBase();
29 
30  void set_vn(const VnEntry *vn) { vn_ = vn; }
31 
32  void InterfaceAdd(const Interface *intf);
33  void InterfaceDelete(const Interface *intf);
34  void VmAdd(const std::string &vm);
35  void VmDelete(const std::string &vm);
36  bool BuildInterfaceVmList(UveVirtualNetworkAgent &s_vn);
37  bool FrameVnMsg(const VnEntry *vn, UveVirtualNetworkAgent &uve);
38  const VnEntry *vn() const { return vn_; }
39  bool FrameVnAclRuleCountMsg(const VnEntry *vn,
40  UveVirtualNetworkAgent *uve);
41 
42  void set_changed(bool val) { changed_ = val; }
43  bool changed() const { return changed_; }
44  void set_deleted(bool value) { deleted_ = value; }
45  bool deleted() const { return deleted_; }
46  void set_renewed(bool value) { renewed_ = value; }
47  bool renewed() const { return renewed_; }
48  void set_add_by_vn_notify(bool val) { add_by_vn_notify_ = val; }
49  virtual void Reset();
50 
51 protected:
52  bool UveVnAclRuleCountChanged(int32_t size) const;
54  const VnEntry *vn_;
55  UveVirtualNetworkAgent uve_info_;
59 
60  // UVE entry is changed. Timer must generate UVE for this entry
61  bool changed_;
62  bool deleted_;
63  bool renewed_;
64 private:
65  bool UveVnInterfaceListChanged(const std::vector<string> &new_list) const;
66  bool UveVnVmListChanged(const std::vector<string> &new_list) const;
67  bool UveVnAclChanged(const std::string &name) const;
68  bool UveVnMirrorAclChanged(const std::string &name) const;
69 
71 };
72 
73 #endif // vnsw_agent_vn_uve_entry_base_h
bool deleted() const
void set_vn(const VnEntry *vn)
void set_add_by_vn_notify(bool val)
void set_renewed(bool value)
void InterfaceDelete(const Interface *intf)
InterfaceSet interface_tree_
void VmAdd(const std::string &vm)
void InterfaceAdd(const Interface *intf)
bool renewed() const
void set_changed(bool val)
void VmDelete(const std::string &vm)
const VnEntry * vn_
UveVirtualNetworkAgent uve_info_
bool UveVnAclRuleCountChanged(int32_t size) const
void set_deleted(bool value)
bool FrameVnAclRuleCountMsg(const VnEntry *vn, UveVirtualNetworkAgent *uve)
bool BuildInterfaceVmList(UveVirtualNetworkAgent &s_vn)
bool UveVnMirrorAclChanged(const std::string &name) const
Definition: agent.h:358
const VnEntry * vn() const
VnUveEntryBase(Agent *agent, const VnEntry *vn)
bool UveVnAclChanged(const std::string &name) const
bool UveVnInterfaceListChanged(const std::vector< string > &new_list) const
DISALLOW_COPY_AND_ASSIGN(VnUveEntryBase)
bool changed() const
std::set< std::string > VmSet
Definition: vn.h:151
bool UveVnVmListChanged(const std::vector< string > &new_list) const
std::set< const Interface * > InterfaceSet
virtual ~VnUveEntryBase()
virtual void Reset()
bool FrameVnMsg(const VnEntry *vn, UveVirtualNetworkAgent &uve)