9 #include <boost/foreach.hpp>
12 #include "bgp/bgp_peer_types.h"
23 bgp_xmpp_channel_(bgp_xmpp_channel) {
63 attrs.push_back(&nexthop);
65 attrs.push_back(&origin);
80 PublishedRTargetRoutes::const_iterator rt_loc =
102 uint32_t flags)
const {
122 as_t old_local_asn)
const {
130 for (PublishedRTargetRoutes::const_iterator it =
rtarget_routes_.begin();
139 PublishedRTargetRoutes::iterator rt_loc =
rtarget_routes_.find(rtarget);
141 pair<PublishedRTargetRoutes::iterator, bool> ret =
149 rt_loc->second.insert(rtinstance);
154 PublishedRTargetRoutes::iterator rt_loc =
rtarget_routes_.find(rtarget);
156 assert(rt_loc->second.erase(rtinstance));
157 if (rt_loc->second.empty()) {
171 RouteTargetList::iterator cur_next_it, cur_it;
172 cur_it = cur_next_it = current->begin();
173 RouteTargetList::const_iterator new_it = new_list.begin();
175 pair<RouteTargetList::iterator, bool> r;
177 while (cur_it != current->end() && new_it != new_list.end()) {
178 if (*new_it < *cur_it) {
179 r = current->insert(*new_it);
183 }
else if (*new_it > *cur_it) {
186 current->erase(cur_it);
187 cur_it = cur_next_it;
193 cur_next_it = cur_it;
195 for (; new_it != new_list.end(); ++new_it) {
196 r = current->insert(*new_it);
200 for (cur_next_it = cur_it;
201 cur_it != current->end();
202 cur_it = cur_next_it) {
205 current->erase(cur_it);
211 uint32_t flags)
const {
235 PublishedRTargetRoutes::const_iterator rt_loc =
263 vector<string> import_targets;
265 import_targets.push_back(rt.
ToString());
267 instance->set_import_targets(import_targets);
virtual const RouteTargetList & GetSubscribedRTargets(RoutingInstance *instance) const
const RouteTargetList & GetImportList() const
BgpTable * GetTable(Address::Family fmly)
TypePtr Locate(Type *attr)
virtual bool IsSubscriptionGrStale(RoutingInstance *instance) const
virtual bool IsSubscriptionLlgrStale(RoutingInstance *instance) const
void AddNewRTargetRoute(RoutingInstance *rtinstance, const RouteTarget &rtarget, BgpAttrPtr attr)
BgpXmppChannel * bgp_xmpp_channel_
std::unique_ptr< DBRequestData > data
virtual void Enqueue(DBRequest *req) const
RoutingInstanceMgr * routing_instance_mgr()
bool IsSubscriptionEmpty() const
bool Enqueue(DBRequest *req)
std::vector< BgpAttribute * > BgpAttrSpec
RoutingInstance * GetDefaultRoutingInstance()
void FillInfo(BgpNeighborRoutingInstance *instance, const RouteTargetList &targets) const
std::set< RouteTarget > RouteTargetList
virtual BgpAttrPtr GetRouteTargetRouteAttr() const
const RoutingInstance::RouteTargetList & GetSubscribedRTargets(RoutingInstance *instance) const
virtual int local_autonomous_system() const
PublishedRTargetRoutes rtarget_routes_
void Stale(const RouteTargetList &targets) const
as_t local_autonomous_system() const
boost::intrusive_ptr< const BgpAttr > BgpAttrPtr
std::unique_ptr< DBRequestKey > key
bool delete_in_progress() const
std::set< RoutingInstance * > RoutingInstanceList
void ASNUpdateCallback(as_t old_asn, as_t old_local_asn) const
BgpXmppRTargetManager(BgpXmppChannel *bgp_xmpp_channel)
uint32_t bgp_identifier() const
virtual void RTargetRouteOp(as_t asn, const RouteTarget &rtarget, BgpAttrPtr attr, bool add_change, uint32_t flags=0) const
bool IsSubscriptionLlgrStale(RoutingInstance *instance) const
virtual ~BgpXmppRTargetManager()
std::string ToString() const
bool IsSubscriptionGrStale(RoutingInstance *instance) const
virtual bool delete_in_progress() const
virtual const IPeer * Peer() const
void RoutingInstanceCallback(RoutingInstance *rt_instance, RouteTargetList *targets)
void DeleteRTargetRoute(RoutingInstance *rtinstance, const RouteTarget &rtarget)
virtual bool IsSubscriptionEmpty() const
void UpdateRouteTargetRouteFlag(RoutingInstance *routing_instance, const RouteTargetList &targets, uint32_t flags) const
void PublishRTargetRoute(RoutingInstance *rt_instance, bool add_change)
uint32_t GetRTargetRouteFlag(const RouteTarget &rtarget) const