OpenSDN source code
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 <cmn/agent_cmn.h>
17 
18 //The class that defines data-structures to store VirtualNetwork information
19 //required for sending VirtualNetwork UVE.
21 public:
22  typedef std::set<const Interface *> InterfaceSet;
23  typedef std::set<std::string> VmSet;
24 
25  VnUveEntryBase(Agent *agent, const VnEntry *vn);
26  VnUveEntryBase(Agent *agent);
27  virtual ~VnUveEntryBase();
28 
29  void set_vn(const VnEntry *vn) { vn_ = vn; }
30 
31  void InterfaceAdd(const Interface *intf);
32  void InterfaceDelete(const Interface *intf);
33  void VmAdd(const std::string &vm);
34  void VmDelete(const std::string &vm);
35  bool BuildInterfaceVmList(UveVirtualNetworkAgent &s_vn);
36  bool FrameVnMsg(const VnEntry *vn, UveVirtualNetworkAgent &uve);
37  const VnEntry *vn() const { return vn_; }
38  bool FrameVnAclRuleCountMsg(const VnEntry *vn,
39  UveVirtualNetworkAgent *uve);
40 
41  void set_changed(bool val) { changed_ = val; }
42  bool changed() const { return changed_; }
43  void set_deleted(bool value) { deleted_ = value; }
44  bool deleted() const { return deleted_; }
45  void set_renewed(bool value) { renewed_ = value; }
46  bool renewed() const { return renewed_; }
47  void set_add_by_vn_notify(bool val) { add_by_vn_notify_ = val; }
48  virtual void Reset();
49 
50 protected:
51  bool UveVnAclRuleCountChanged(int32_t size) const;
53  const VnEntry *vn_;
54  UveVirtualNetworkAgent uve_info_;
58 
59  // UVE entry is changed. Timer must generate UVE for this entry
60  bool changed_;
61  bool deleted_;
62  bool renewed_;
63 private:
64  bool UveVnInterfaceListChanged(const std::vector<string> &new_list) const;
65  bool UveVnVmListChanged(const std::vector<string> &new_list) const;
66  bool UveVnAclChanged(const std::string &name) const;
67  bool UveVnMirrorAclChanged(const std::string &name) const;
68 
70 };
71 
72 #endif // vnsw_agent_vn_uve_entry_base_h
Definition: agent.h:360
Definition: vn.h:151
void set_deleted(bool value)
bool UveVnAclRuleCountChanged(int32_t size) const
bool changed() const
void VmAdd(const std::string &vm)
bool UveVnInterfaceListChanged(const std::vector< string > &new_list) const
bool BuildInterfaceVmList(UveVirtualNetworkAgent &s_vn)
std::set< const Interface * > InterfaceSet
bool deleted() const
virtual void Reset()
virtual ~VnUveEntryBase()
std::set< std::string > VmSet
void set_vn(const VnEntry *vn)
void set_renewed(bool value)
InterfaceSet interface_tree_
DISALLOW_COPY_AND_ASSIGN(VnUveEntryBase)
void set_add_by_vn_notify(bool val)
bool UveVnAclChanged(const std::string &name) const
const VnEntry * vn_
void InterfaceAdd(const Interface *intf)
void set_changed(bool val)
bool FrameVnMsg(const VnEntry *vn, UveVirtualNetworkAgent &uve)
UveVirtualNetworkAgent uve_info_
void InterfaceDelete(const Interface *intf)
bool FrameVnAclRuleCountMsg(const VnEntry *vn, UveVirtualNetworkAgent *uve)
VnUveEntryBase(Agent *agent, const VnEntry *vn)
bool UveVnMirrorAclChanged(const std::string &name) const
bool renewed() const
const VnEntry * vn() const
bool UveVnVmListChanged(const std::vector< string > &new_list) const
void VmDelete(const std::string &vm)