OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
logical_interface.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
3  */
4 #ifndef SRC_VNSW_AGENT_OPER_LOGICAL_PORT_H_
5 #define SRC_VNSW_AGENT_OPER_LOGICAL_PORT_H_
6 
7 #include <cmn/agent_cmn.h>
8 #include <cmn/agent.h>
9 #include <string>
10 
12 
13 class VmInterface;
14 class SandeshLogicalInterface;
15 
16 struct LogicalInterfaceKey;
18 
19 class LogicalInterface : public Interface {
20  public:
21  enum Type {
23  };
24 
26  const std::string &name,
28  virtual ~LogicalInterface();
29 
30  virtual bool CmpInterface(const DBEntry &rhs) const;
31  virtual std::string ToString() const;
32  virtual bool Delete(const DBRequest *req);
33  virtual void GetOsParams(Agent *agent);
34  virtual bool OnChange(const InterfaceTable *table,
35  const LogicalInterfaceData *data);
36 
37  const std::string &display_name() const { return display_name_; }
38  const std::string &phy_dev_display_name() const { return phy_dev_display_name_; }
39  const std::string &phy_intf_display_name() const { return phy_intf_display_name_; }
41  VmInterface *vm_interface() const;
43 
44  private:
45  friend class InterfaceTable;
46  std::string display_name_;
51  std::string phy_dev_display_name_;
55 };
56 
59  const std::string &name);
60  virtual ~LogicalInterfaceKey();
61 
62 };
63 
66  const std::string &display_name,
67  const std::string &physical_interface,
68  const boost::uuids::uuid &vif,
69  const boost::uuids::uuid &device_uuid,
70  const std::string &phy_dev_display_name,
71  const std::string &phy_intf_display_name);
72  virtual ~LogicalInterfaceData();
73 
74  std::string display_name_;
75  std::string physical_interface_;
78  std::string phy_dev_display_name_;
80 };
81 
84  const std::string &name);
85  virtual ~VlanLogicalInterfaceKey();
86 
87  virtual LogicalInterface *AllocEntry(const InterfaceTable *table) const;
88  virtual LogicalInterface *AllocEntry(const InterfaceTable *table,
89  const InterfaceData *data) const;
90  virtual InterfaceKey *Clone() const;
91 };
92 
95  const std::string &display_name,
96  const std::string &physical_interface,
97  const boost::uuids::uuid &vif,
98  const boost::uuids::uuid &device_uuid,
99  const std::string &phy_dev_display_name,
100  const std::string &phy_intf_display_name,
101  uint16_t vlan);
102  virtual ~VlanLogicalInterfaceData();
103 
104  uint16_t vlan_;
105 };
106 
108  public:
110  const std::string &name, uint16_t vlan,
111  const boost::uuids::uuid &lr_uuid);
112  virtual ~VlanLogicalInterface();
113  virtual DBEntryBase::KeyPtr GetDBRequestKey() const;
114 
115  uint16_t vlan() const { return vlan_; }
116 
117  private:
118  // IMP: vlan_ cannot be changed
119  uint16_t vlan_;
121 };
122 
123 #endif // SRC_VNSW_AGENT_OPER_LOGICAL_PORT_H_
uint16_t vlan() const
const std::string & display_name() const
PhysicalDevice * physical_device() const
std::string display_name_
DISALLOW_COPY_AND_ASSIGN(LogicalInterface)
virtual DBEntryBase::KeyPtr GetDBRequestKey() const
virtual LogicalInterface * AllocEntry(const InterfaceTable *table) const
VlanLogicalInterfaceKey(const boost::uuids::uuid &uuid, const std::string &name)
std::string phy_intf_display_name_
virtual ~LogicalInterface()
VlanLogicalInterface(const boost::uuids::uuid &uuid, const std::string &name, uint16_t vlan, const boost::uuids::uuid &lr_uuid)
virtual void GetOsParams(Agent *agent)
boost::uuids::uuid uuid
Interface * physical_interface() const
virtual std::string ToString() const
DISALLOW_COPY_AND_ASSIGN(VlanLogicalInterface)
const boost::uuids::uuid & logical_router_uuid() const
Definition: interface.h:146
std::unique_ptr< DBRequestKey > KeyPtr
Definition: db_entry.h:25
LogicalInterfaceData(Agent *agent, IFMapNode *node, const std::string &display_name, const std::string &physical_interface, const boost::uuids::uuid &vif, const boost::uuids::uuid &device_uuid, const std::string &phy_dev_display_name, const std::string &phy_intf_display_name)
boost::uuids::uuid vn_uuid_
Definition: agent.h:358
virtual InterfaceKey * Clone() const
std::string physical_interface_
void Delete()
Definition: db_entry.cc:131
std::string phy_intf_display_name_
virtual bool CmpInterface(const DBEntry &rhs) const
const Agent * agent() const
Definition: oper_db.h:65
const std::string & phy_intf_display_name() const
virtual bool OnChange(const InterfaceTable *table, const LogicalInterfaceData *data)
const std::string & phy_dev_display_name() const
InterfaceRef vm_interface_
PhysicalDeviceRef physical_device_
VmInterface * vm_interface() const
const std::string & name() const
Definition: interface.h:114
boost::uuids::uuid device_uuid_
boost::intrusive_ptr< Interface > InterfaceRef
Definition: agent.h:49
boost::intrusive_ptr< PhysicalDevice > PhysicalDeviceRef
Definition: agent.h:153
std::string phy_dev_display_name_
LogicalInterface(const boost::uuids::uuid &uuid, const std::string &name, const boost::uuids::uuid &logical_router_uuid)
std::string phy_dev_display_name_
VlanLogicalInterfaceData(Agent *agent, IFMapNode *node, const std::string &display_name, const std::string &physical_interface, const boost::uuids::uuid &vif, const boost::uuids::uuid &device_uuid, const std::string &phy_dev_display_name, const std::string &phy_intf_display_name, uint16_t vlan)
InterfaceRef physical_interface_
boost::uuids::uuid vm_uuid_
LogicalInterfaceKey(const boost::uuids::uuid &uuid, const std::string &name)
boost::uuids::uuid vm_interface_