7 #include <boost/foreach.hpp>
17 using std::ostringstream;
22 : asn_list_(asn_list) {
36 delete as_path_spec_ptr;
41 delete as_path_spec_ptr;
49 delete as_path_spec_ptr;
54 delete as_path_spec_ptr;
61 oss <<
"as-path expand [ ";
65 oss.seekp(-1, oss.cur);
77 BOOST_FOREACH(
const string &community, communities) {
82 std::vector<uint32_t>::iterator it =
86 if (strcmp(op.c_str(),
"add") == 0) {
88 }
else if (strcmp(op.c_str(),
"remove") == 0) {
90 }
else if (strcmp(op.c_str(),
"set") == 0) {
114 if (
op_ ==
SET) oss <<
"community set [ ";
115 else if (
op_ ==
ADD) oss <<
"community add [ ";
116 else if (
op_ ==
REMOVE) oss <<
"community remove [ ";
122 oss.seekp(-1, oss.cur);
137 BOOST_FOREACH(
const string &community, communities) {
144 ExtCommunity::ExtCommunityList::iterator it =
148 if (strcmp(op.c_str(),
"add") == 0) {
150 }
else if (strcmp(op.c_str(),
"remove") == 0) {
152 }
else if (strcmp(op.c_str(),
"set") == 0) {
176 if (
op_ ==
SET) oss <<
"Extcommunity set [ ";
177 else if (
op_ ==
ADD) oss <<
"Extcommunity add [ ";
178 else if (
op_ ==
REMOVE) oss <<
"Extcommunity remove [ ";
184 oss.seekp(-1, oss.cur);
198 : local_pref_(local_pref) {
227 oss <<
"med " <<
med_;
const Community * community() const
const AsPathSpec & path() const
virtual bool IsEqual(const RoutingPolicyAction &med) const
AsPathSpec * Add(as2_t asn) const
virtual bool IsEqual(const RoutingPolicyAction &local_pref) const
std::vector< uint32_t > asn_list_
void set_community(CommunityPtr comm)
void set_as_path(AsPathPtr aspath)
virtual void operator()(BgpAttr *out_attr) const
const AsPath4Byte * aspath_4byte() const
std::string ToString() const
ExtCommunityDB * extcomm_db()
virtual bool IsEqual(const RoutingPolicyAction &as_path) const
AsPath4ByteSpec * Add(as_t asn) const
const AsPath * as_path() const
void set_local_pref(uint32_t local_pref)
const ExtCommunity * ext_community() const
const AsPath4ByteSpec & path() const
std::string ToString() const
void set_med(uint32_t med)
UpdateLocalPref(uint32_t local_pref)
bool enable_4byte_as() const
virtual void operator()(BgpAttr *out_attr) const
void set_ext_community(ExtCommunityPtr extcomm)
virtual void operator()(BgpAttr *out_attr) const
void set_aspath_4byte(AsPath4BytePtr aspath)
std::string ToString() const
UpdateAsPath(const std::vector< uint32_t > &asn_list)