def new_map_entry(dp_id, dp_port, re_id, name): """ returns instance of FIBMap """ port = FIBCPort(id=dp_id, port=dp_port) link = FIBCLink(re_id=re_id, name=name) return FIBMap(port=port, link=link)
def find_by_vs(self, vs_id, vs_port): """ find entry by vs(vs_id, vs_port) """ key = FIBCPort(id=vs_id, port=vs_port) for entry in self.entries.values(): if entry["vs"] == key: return entry return None
def find_by_dp(self, dp_id, dp_port): """ find entry by dp(dp_id, dp_port) """ key = FIBCPort(id=dp_id, port=dp_port) for entry in self.entries.values(): if entry["dp"] == key: return entry return None
def find_by_port(self, dp_id, dp_port): """ Select entry by port. """ port = FIBCPort(id=dp_id, port=dp_port) return self.ports[port]