File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -251,5 +251,9 @@ bool ExtIface::is_used() const {
251251 return cubes_.size () > 0 || peer_ != nullptr ;
252252}
253253
254+ std::string ExtIface::get_iface_name () const {
255+ return iface_;
256+ }
257+
254258} // namespace polycubed
255259} // namespace polycube
Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ class ExtIface : public PeerIface {
4848 void set_next_index (uint16_t index);
4949 bool is_used () const ;
5050
51+ std::string get_iface_name () const ;
52+
5153 protected:
5254 static std::set<std::string> used_ifaces;
5355 int load_ingress ();
Original file line number Diff line number Diff line change @@ -151,8 +151,11 @@ nlohmann::json TransparentCube::to_json() const {
151151
152152 std::string parent;
153153 if (parent_) {
154- auto port_parent = dynamic_cast <Port *>(parent_);
155- parent = port_parent->get_path ();
154+ if (auto port_parent = dynamic_cast <Port *>(parent_)) {
155+ parent = port_parent->get_path ();
156+ } else if (auto iface_parent = dynamic_cast <ExtIface *>(parent_)) {
157+ parent = iface_parent->get_iface_name ();
158+ }
156159 }
157160
158161 j[" parent" ] = parent;
You can’t perform that action at this time.
0 commit comments