8 #include <boost/foreach.hpp>
18 using std::ostringstream;
23 : asn_list_(asn_list) {
37 delete as_path_spec_ptr;
42 delete as_path_spec_ptr;
50 delete as_path_spec_ptr;
55 delete as_path_spec_ptr;
62 oss <<
"as-path expand [ ";
66 oss.seekp(-1, oss.cur);
78 BOOST_FOREACH(
const string &community,
communities) {
83 std::vector<uint32_t>::iterator it =
87 if (strcmp(op.c_str(),
"add") == 0) {
89 }
else if (strcmp(op.c_str(),
"remove") == 0) {
91 }
else if (strcmp(op.c_str(),
"set") == 0) {
115 if (
op_ ==
SET) oss <<
"community set [ ";
116 else if (
op_ ==
ADD) oss <<
"community add [ ";
117 else if (
op_ ==
REMOVE) oss <<
"community remove [ ";
123 oss.seekp(-1, oss.cur);
138 BOOST_FOREACH(
const string &community,
communities) {
145 ExtCommunity::ExtCommunityList::iterator it =
149 if (strcmp(op.c_str(),
"add") == 0) {
151 }
else if (strcmp(op.c_str(),
"remove") == 0) {
153 }
else if (strcmp(op.c_str(),
"set") == 0) {
177 if (
op_ ==
SET) oss <<
"Extcommunity set [ ";
178 else if (
op_ ==
ADD) oss <<
"Extcommunity add [ ";
179 else if (
op_ ==
REMOVE) oss <<
"Extcommunity remove [ ";
185 oss.seekp(-1, oss.cur);
199 : local_pref_(local_pref) {
228 oss <<
"med " <<
med_;
const AsPath4ByteSpec & path() const
const AsPathSpec & path() const
void set_aspath_4byte(AsPath4BytePtr aspath)
const AsPath * as_path() const
void set_community(CommunityPtr comm)
void set_as_path(AsPathPtr aspath)
void set_med(uint32_t med)
void set_local_pref(uint32_t local_pref)
const Community * community() const
const ExtCommunity * ext_community() const
const AsPath4Byte * aspath_4byte() const
void set_ext_community(ExtCommunityPtr extcomm)
ExtCommunityDB * extcomm_db()
bool enable_4byte_as() const
UpdateAsPath(const std::vector< uint32_t > &asn_list)
virtual void operator()(BgpAttr *out_attr) const
virtual bool IsEqual(const RoutingPolicyAction &as_path) const
std::vector< uint32_t > asn_list_
std::string ToString() const
UpdateLocalPref(uint32_t local_pref)
virtual bool IsEqual(const RoutingPolicyAction &local_pref) const
std::string ToString() const
virtual void operator()(BgpAttr *out_attr) const
std::string ToString() const
virtual bool IsEqual(const RoutingPolicyAction &med) const
virtual void operator()(BgpAttr *out_attr) const
AsPath4ByteSpec * Add(as_t asn) const
AsPathSpec * Add(as2_t asn) const