Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
function deb_repositories() {
apt-get -y install python-software-properties
add-apt-repository -y cloud-archive:havana
add-apt-repository -y ppa:webupd8team/java
echo "deb http://www.apache.org/dist/cassandra/debian 11x main" > /etc/apt/sources.list.d/cassandra.list
diff --git a/src/vnsw/agent/services/dhcp_proto.cc b/src/vnsw/agent/services/dhcp_proto.cc
index 3bf3aea..5eb222d 100644
--- a/src/vnsw/agent/services/dhcp_proto.cc
+++ b/src/vnsw/agent/services/dhcp_proto.cc
@@ -237,13 +237,16 @@ bool DhcpHandler::ReadOptions() {
return true;
}
-void DhcpHandler::FillDhcpInfo(uint32_t addr, int plen, uint32_t gw, uint32_t d
ns) {
diff --git a/src/vnsw/agent/services/dhcp_proto.h b/src/vnsw/agent/services/dhcp_proto.h
index 1b1bce4..f7cedf8 100644
--- a/src/vnsw/agent/services/dhcp_proto.h
+++ b/src/vnsw/agent/services/dhcp_proto.h
@@ -97,9 +97,11 @@ struct ConfigRecord {
uint16_t ifindex; // maps to VNid, VMid, itf
uint32_t plen;
uint32_t lease_time;
+ bool advertise_default;
diff --git a/src/vnsw/agent/oper/vn.h b/src/vnsw/agent/oper/vn.h
index f8e6488..55046b9 100644
--- a/src/vnsw/agent/oper/vn.h
+++ b/src/vnsw/agent/oper/vn.h
@@ -28,11 +28,13 @@ struct VnIpam {
uint32_t plen;
Ip4Address default_gw;
bool installed; // is the route to send pkts to host installed
+ bool advertise_default;
std::string ipam_name;
import vnc_api.vnc_api
class SubnetModifier():
def __init__(self, netname):
self._vnc = vnc_api.vnc_api.VncApi()
self._netname = netname
def toggle(self, onoff):
vnet = self._vnc.virtual_network_read(
fq_name = self._netname.split(':'))
ENABLE_CONTRAIL=yes
Q_PLUGIN=contrail
PHYSICAL_INTERFACE=eth0
disable_service n-net
enable_service q-svc
enable_service q-meta
enable_service neutron
@@ -129,11 +129,41 @@ BgpRoute *InetVpnTable::RouteReplicate(BgpServer *server,
return dest_route;
}
+static void RTargetStripPrivate(UpdateInfo *uinfo) {
+ const BgpAttr *attr = uinfo->roattr.attr();
+ const ExtCommunity *comm = attr->ext_community();
+ ExtCommunitySpec cspec;
+ bool changed = false;
+
@@ -284,7 +284,8 @@ BgpPeer::BgpPeer(BgpServer *server, RoutingInstance *instance,
remote_bgp_id_(0),
local_bgp_id_(server_->bgp_identifier()),
peer_type_((peer_as_ == local_as_) ? BgpProto::IBGP : BgpProto::EBGP),
- policy_(peer_type_, RibExportPolicy::BGP, peer_as_, -1, 0),
+ policy_(peer_type_, RibExportPolicy::BGP, peer_as_, -1, 0,
+ config->session_attributes().rtarget_strip_private),
peer_close_(new PeerClose(this)),
peer_stats_(new PeerStats(this)),
deleter_(new DeleteActor(this)),
import os
import sys
testdir = os.path.dirname(__file__)
topdir = os.path.abspath(os.path.join(testdir, '../../../../../'))
sys.path.insert(0, os.path.join(topdir, 'build/debug/config/api-server/ut-venv/lib/python2.7/site-packages'))
sys.path.append(os.path.join(testdir, '../../utils'))
from provision_bgp import BgpProvisioner
scons controller/src/config/api-server
scons controller/src/config/common
scons controller/src/sandesh
scons controller/src/discovery
scons tools/sandesh/library/python
(cd controller/src/config/api-server/tests; fab -f fab_tasks.py setup_and_run_api_srv:listen_port=50000)