5 #include <boost/uuid/uuid_io.hpp>
6 #include <vnc_cfg_types.h>
24 using std::unique_ptr;
31 const std::string &name,
35 physical_interface_(),
37 physical_device_(NULL),
38 phy_dev_display_name_(),
39 phy_intf_display_name_(),
84 "Changing Physical Interface display name from " \
104 vn_uuid_ = boost::uuids::nil_uuid();
120 "Changing Physical Device display name from " \
153 const std::string &name) :
165 const std::string &display_name,
166 const std::string &port,
168 const uuid &device_uuid,
169 const std::string &phy_dev_display_name,
170 const std::string &phy_intf_display_name) :
172 display_name_(display_name),
173 physical_interface_(port), vm_interface_(vif), device_uuid_(device_uuid),
174 phy_dev_display_name_(phy_dev_display_name),
175 phy_intf_display_name_(phy_intf_display_name) {
185 const std::string &name,
203 const std::string &name) :
235 const std::string &physical_interface,
237 const std::string &phy_dev_display_name,
238 const std::string &phy_intf_display_name, uint16_t vlan) :
240 phy_dev_display_name, phy_intf_display_name),
248 void VlanLogicalInterface::SetSandeshData(SandeshLogicalInterface *data)
const {
249 data->set_vlan_tag(
vlan_);
262 const autogen::LogicalInterface *port) {
264 string physical_interface;
265 string phy_dev_display_name;
266 string phy_intf_display_name;
270 "physical-interface");
274 physical_interface = adj_node->
name();
275 autogen::PhysicalInterface *port =
276 static_cast <autogen::PhysicalInterface *>(adj_node->
GetObject());
278 phy_intf_display_name = port->display_name();
280 FindAdjacentIFMapNode(adj_node,
"physical-router");
282 autogen::PhysicalRouter *router =
283 static_cast<autogen::PhysicalRouter *
>(prouter_node->
GetObject());
284 phy_dev_display_name = router->display_name();
285 autogen::IdPermsType id_perms = router->id_perms();
286 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
294 (node,
"virtual-machine-interface");
296 autogen::VirtualMachineInterface *vmi =
297 static_cast<autogen::VirtualMachineInterface *
>
299 autogen::IdPermsType id_perms = vmi->id_perms();
300 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
306 (node,
"physical-router");
308 dev_name = adj_node->
name();
309 if (dev_uuid != boost::uuids::nil_uuid()) {
311 "Both physical-router and physical-interface links for "
312 "interface:", node->
name(),
313 "physical interface", physical_interface,
314 "prouter name", dev_name);
316 autogen::PhysicalRouter *router =
317 static_cast<autogen::PhysicalRouter *
>(adj_node->
GetObject());
318 autogen::IdPermsType id_perms = router->id_perms();
319 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
325 if (port->IsPropertySet(autogen::LogicalInterface::VLAN_TAG) ==
false) {
327 t.set_name(node->
name());
329 t.set_message(
"VLAN-Tag property not set. Ignoring node");
336 physical_interface, vmi_uuid, dev_uuid,
337 phy_dev_display_name,
338 phy_intf_display_name,
345 autogen::LogicalInterface *port =
346 static_cast <autogen::LogicalInterface *>(node->
GetObject());
349 autogen::IdPermsType id_perms = port->id_perms();
350 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong, u);
357 autogen::LogicalInterface *port =
358 static_cast <autogen::LogicalInterface *>(node->
GetObject());
370 if (req.
data.get() != NULL) {
380 autogen::LogicalInterface *port =
381 static_cast <autogen::LogicalInterface *>(node->
GetObject());
static LogicalInterfaceData * BuildData(Agent *agent, IFMapNode *node, const uuid &u, const autogen::LogicalInterface *port)
static LogicalInterfaceKey * BuildKey(IFMapNode *node, const boost::uuids::uuid &u)
PhysicalDevice * physical_device() const
static void CfgUuidSet(uint64_t ms_long, uint64_t ls_long, boost::uuids::uuid &u)
std::string display_name_
virtual ~VlanLogicalInterfaceData()
#define OPER_IFMAP_TRACE(obj,...)
virtual DBEntryBase::KeyPtr GetDBRequestKey() const
virtual LogicalInterface * AllocEntry(const InterfaceTable *table) const
uint32_t li_ifnode_to_req_
VlanLogicalInterfaceKey(const boost::uuids::uuid &uuid, const std::string &name)
std::string phy_intf_display_name_
PhysicalDeviceTable * physical_device_table() const
ConfigManager * config_manager() const
virtual ~LogicalInterface()
VlanLogicalInterface(const boost::uuids::uuid &uuid, const std::string &name, uint16_t vlan, const boost::uuids::uuid &lr_uuid)
std::unique_ptr< DBRequestData > data
virtual void GetOsParams(Agent *agent)
AgentDBEntry * FindActiveEntry(const DBEntry *key)
InterfaceTable * interface_table() const
bool Enqueue(DBRequest *req)
Interface * physical_interface() const
static std::string UuidToString(const boost::uuids::uuid &id)
void AddLogicalInterfaceNode(IFMapNode *node)
virtual std::string ToString() const
std::unique_ptr< DBRequestKey > KeyPtr
boost::uuids::uuid logical_router_uuid_
IFMapNode * FindAdjacentIFMapNode(IFMapNode *node, const char *type)
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)
#define IFMAP_ERROR(obj,...)
boost::uuids::uuid vn_uuid_
bool LogicalInterfaceProcessConfig(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
virtual ~LogicalInterfaceData()
virtual InterfaceKey * Clone() const
std::unique_ptr< DBRequestKey > key
virtual ~VlanLogicalInterfaceKey()
std::string physical_interface_
#define OPER_TRACE_ENTRY(obj, table,...)
const VnEntry * vn() const
const std::string & name() const
virtual ~VlanLogicalInterface()
IFMapObject * GetObject()
std::string phy_intf_display_name_
virtual bool CmpInterface(const DBEntry &rhs) const
virtual bool OnChange(const InterfaceTable *table, const LogicalInterfaceData *data)
static const uint32_t kInvalidIndex
InterfaceRef vm_interface_
VmInterface * vm_interface() const
PhysicalDeviceRef physical_device_
struct InterfaceOsParams os_params_
const std::string & name() const
boost::uuids::uuid device_uuid_
const boost::uuids::uuid & GetUuid() const
std::string phy_dev_display_name_
bool LogicalInterfaceIFNodeToReq(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
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)
std::string display_name_
boost::uuids::uuid vm_interface_
bool LogicalInterfaceIFNodeToUuid(IFMapNode *node, boost::uuids::uuid &u)
virtual ~LogicalInterfaceKey()