void SwitchState::addVlan(const std::shared_ptr<Vlan>& vlan) { auto* fields = writableFields(); // For ease-of-use, automatically clone the VlanMap if we are still // pointing to a published map. if (fields->vlans->isPublished()) { fields->vlans = fields->vlans->clone(); } fields->vlans->addVlan(vlan); }
void SwitchState::addAcl(const std::shared_ptr<AclEntry>& acl) { auto* fields = writableFields(); // For ease-of-use, automatically clone the AclMap if we are still // pointing to a published map. if (fields->acls->isPublished()) { fields->acls = fields->acls->clone(); } fields->acls->addEntry(acl); }
void SwitchState::addIntf(const std::shared_ptr<Interface>& intf) { auto* fields = writableFields(); // For ease-of-use, automatically clone the InterfaceMap if we are still // pointing to a published map. if (fields->interfaces->isPublished()) { fields->interfaces = fields->interfaces->clone(); } fields->interfaces->addInterface(intf); }
void SwitchState::setDefaultVlan(VlanID id) { writableFields()->defaultVlan = id; }
void SwitchState::resetRouteTables(std::shared_ptr<RouteTableMap> rts) { writableFields()->routeTables.swap(rts); }
void SwitchState::addRouteTable(const std::shared_ptr<RouteTable>& rt) { writableFields()->routeTables->addRouteTable(rt); }
void SwitchState::resetIntfs(std::shared_ptr<InterfaceMap> intfs) { writableFields()->interfaces.swap(intfs); }
void SwitchState::setArpAgerInterval(std::chrono::seconds interval) { writableFields()->arpAgerInterval = interval; }
void SwitchState::resetPorts(std::shared_ptr<PortMap> ports) { writableFields()->ports.swap(ports); }
void SwitchState::addPort(const std::shared_ptr<Port>& port) { writableFields()->ports->addPort(port); }
void SwitchState::resetControlPlane( std::shared_ptr<ControlPlane> controlPlane) { writableFields()->controlPlane = controlPlane; }
void SwitchState::resetAcls(std::shared_ptr<AclMap> acls) { writableFields()->acls.swap(acls); }
void SwitchState::resetSflowCollectors( const std::shared_ptr<SflowCollectorMap>& collectors) { writableFields()->sFlowCollectors = collectors; }
void SwitchState::resetAggregatePorts( std::shared_ptr<AggregatePortMap> aggPorts) { writableFields()->aggPorts.swap(aggPorts); }
void SwitchState::setStaleEntryInterval(seconds interval) { writableFields()->staleEntryInterval = interval; }
void SwitchState::setMaxNeighborProbes(uint32_t maxNeighborProbes) { writableFields()->maxNeighborProbes = maxNeighborProbes; }
void SwitchState::setNdpTimeout(seconds timeout) { writableFields()->ndpTimeout = timeout; }
void SwitchState::registerPort(PortID id, const std::string& name) { writableFields()->ports->registerPort(id, name); }
void SwitchState::setArpTimeout(std::chrono::seconds timeout) { writableFields()->arpTimeout = timeout; }
void SwitchState::resetVlans(std::shared_ptr<VlanMap> vlans) { writableFields()->vlans.swap(vlans); }
void Vlan::addPort(PortID id, bool tagged) { writableFields()->ports.insert(make_pair(id, PortID(tagged))); }