6 #include <boost/uuid/uuid_io.hpp>
7 #include <vnc_cfg_types.h>
25 using std::unique_ptr;
32 const std::string &name,
36 physical_interface_(),
38 physical_device_(NULL),
39 phy_dev_display_name_(),
40 phy_intf_display_name_(),
85 "Changing Physical Interface display name from " \
105 vn_uuid_ = boost::uuids::nil_uuid();
121 "Changing Physical Device display name from " \
154 const std::string &name) :
166 const std::string &display_name,
167 const std::string &port,
169 const uuid &device_uuid,
170 const std::string &phy_dev_display_name,
171 const std::string &phy_intf_display_name) :
173 display_name_(display_name),
174 physical_interface_(port), vm_interface_(vif), device_uuid_(device_uuid),
175 phy_dev_display_name_(phy_dev_display_name),
176 phy_intf_display_name_(phy_intf_display_name) {
186 const std::string &name,
204 const std::string &name) :
236 const std::string &physical_interface,
238 const std::string &phy_dev_display_name,
239 const std::string &phy_intf_display_name, uint16_t vlan) :
241 phy_dev_display_name, phy_intf_display_name),
249 void VlanLogicalInterface::SetSandeshData(SandeshLogicalInterface *data)
const {
250 data->set_vlan_tag(
vlan_);
263 const autogen::LogicalInterface *port) {
265 string physical_interface;
266 string phy_dev_display_name;
267 string phy_intf_display_name;
271 "physical-interface");
275 physical_interface = adj_node->
name();
276 autogen::PhysicalInterface *port =
277 static_cast <autogen::PhysicalInterface *
>(adj_node->
GetObject());
279 phy_intf_display_name = port->display_name();
281 FindAdjacentIFMapNode(adj_node,
"physical-router");
283 autogen::PhysicalRouter *router =
284 static_cast<autogen::PhysicalRouter *
>(prouter_node->
GetObject());
285 phy_dev_display_name = router->display_name();
286 autogen::IdPermsType id_perms = router->id_perms();
287 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
295 (node,
"virtual-machine-interface");
297 autogen::VirtualMachineInterface *vmi =
298 static_cast<autogen::VirtualMachineInterface *
>
300 autogen::IdPermsType id_perms = vmi->id_perms();
301 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
307 (node,
"physical-router");
309 dev_name = adj_node->
name();
310 if (dev_uuid != boost::uuids::nil_uuid()) {
312 "Both physical-router and physical-interface links for "
313 "interface:", node->
name(),
314 "physical interface", physical_interface,
315 "prouter name", dev_name);
317 autogen::PhysicalRouter *router =
318 static_cast<autogen::PhysicalRouter *
>(adj_node->
GetObject());
319 autogen::IdPermsType id_perms = router->id_perms();
320 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
326 if (port->IsPropertySet(autogen::LogicalInterface::VLAN_TAG) ==
false) {
328 t.set_name(node->
name());
330 t.set_message(
"VLAN-Tag property not set. Ignoring node");
337 physical_interface, vmi_uuid, dev_uuid,
338 phy_dev_display_name,
339 phy_intf_display_name,
346 autogen::LogicalInterface *port =
347 static_cast <autogen::LogicalInterface *
>(node->
GetObject());
350 autogen::IdPermsType id_perms = port->id_perms();
351 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong, u);
358 autogen::LogicalInterface *port =
359 static_cast <autogen::LogicalInterface *
>(node->
GetObject());
371 if (req.
data.get() != NULL) {
381 autogen::LogicalInterface *port =
382 static_cast <autogen::LogicalInterface *
>(node->
GetObject());
#define OPER_IFMAP_TRACE(obj,...)
#define IFMAP_ERROR(obj,...)
static void CfgUuidSet(uint64_t ms_long, uint64_t ls_long, boost::uuids::uuid &u)
#define OPER_TRACE_ENTRY(obj, table,...)
AgentDBEntry * FindActiveEntry(const DBEntry *key)
InterfaceTable * interface_table() const
ConfigManager * config_manager() const
PhysicalDeviceTable * physical_device_table() const
void AddLogicalInterfaceNode(IFMapNode *node)
IFMapNode * FindAdjacentIFMapNode(IFMapNode *node, const char *type)
std::unique_ptr< DBRequestKey > KeyPtr
bool Enqueue(DBRequest *req)
const std::string & name() const
IFMapObject * GetObject()
bool LogicalInterfaceProcessConfig(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
bool LogicalInterfaceIFNodeToUuid(IFMapNode *node, boost::uuids::uuid &u)
bool LogicalInterfaceIFNodeToReq(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
uint32_t li_ifnode_to_req_
const std::string & name() const
struct InterfaceOsParams os_params_
static const uint32_t kInvalidIndex
boost::uuids::uuid vn_uuid_
InterfaceRef vm_interface_
virtual ~LogicalInterface()
PhysicalDeviceRef physical_device_
virtual bool CmpInterface(const DBEntry &rhs) const
virtual void GetOsParams(Agent *agent)
std::string phy_dev_display_name_
boost::uuids::uuid vm_uuid_
std::string display_name_
PhysicalDevice * physical_device() const
VmInterface * vm_interface() const
InterfaceRef physical_interface_
std::string phy_intf_display_name_
virtual bool OnChange(const InterfaceTable *table, const LogicalInterfaceData *data)
Interface * physical_interface() const
virtual std::string ToString() const
LogicalInterface(const boost::uuids::uuid &uuid, const std::string &name, const boost::uuids::uuid &logical_router_uuid)
VlanLogicalInterface(const boost::uuids::uuid &uuid, const std::string &name, uint16_t vlan, const boost::uuids::uuid &lr_uuid)
virtual DBEntryBase::KeyPtr GetDBRequestKey() const
virtual ~VlanLogicalInterface()
const VnEntry * vn() const
const boost::uuids::uuid & GetUuid() const
static LogicalInterfaceKey * BuildKey(IFMapNode *node, const boost::uuids::uuid &u)
static LogicalInterfaceData * BuildData(Agent *agent, IFMapNode *node, const uuid &u, const autogen::LogicalInterface *port)
static std::string UuidToString(const boost::uuids::uuid &id)
std::unique_ptr< DBRequestKey > key
std::unique_ptr< DBRequestData > data
boost::uuids::uuid logical_router_uuid_
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)
virtual ~LogicalInterfaceData()
std::string phy_dev_display_name_
boost::uuids::uuid device_uuid_
std::string display_name_
std::string physical_interface_
std::string phy_intf_display_name_
boost::uuids::uuid vm_interface_
LogicalInterfaceKey(const boost::uuids::uuid &uuid, const std::string &name)
virtual ~LogicalInterfaceKey()
virtual ~VlanLogicalInterfaceData()
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)
virtual InterfaceKey * Clone() const
virtual ~VlanLogicalInterfaceKey()
VlanLogicalInterfaceKey(const boost::uuids::uuid &uuid, const std::string &name)
virtual LogicalInterface * AllocEntry(const InterfaceTable *table) const