6 #include <boost/uuid/uuid_io.hpp>
15 #include <vnc_cfg_types.h>
16 #include <agent_types.h>
37 using namespace autogen;
39 using namespace boost;
40 using boost::assign::map_list_of;
41 using boost::assign::list_of;
49 const std::string& dns,
bool dhcp,
const std::string &name,
50 const std::vector<autogen::DhcpOptionType> &dhcp_options,
51 const std::vector<autogen::RouteType> &host_routes,
53 : plen(len), installed(false), dhcp_enable(dhcp), dhcp_enable_v6(dhcp), ipam_name(name),
55 boost::system::error_code ec;
56 ip_prefix = IpAddress::from_string(ip, ec);
76 ~(0xFFFFFFFF << (32 -
plen))) ==
77 (ip.to_v4().to_ulong() | ~(0xFFFFFFFF << (32 -
plen))));
78 }
else if (
ip_prefix.is_v6() && ip.is_v6()) {
89 vxlan_id_(0), vnid_(0), active_vxlan_id_(0), bridging_(true),
90 layer3_forwarding_(true), admin_state_(true), table_label_(0),
91 enable_rpf_(true), flood_unknown_unicast_(false),
92 forwarding_mode_(
Agent::L2_L3), mirror_destination_(false),
93 underlay_forwarding_(false), vxlan_routing_vn_(false),
94 logical_router_uuid_(), cfg_igmp_enable_(false), vn_max_flows_(0),
107 std::stringstream uuidstring;
109 return uuidstring.str();
117 const VnKey *k =
static_cast<const VnKey *
>(key);
140 if (
acl_.get() != acl) {
173 bool rebake_vxlan =
false;
174 if (vrf != old_vrf.get()) {
195 bool resync_routes =
false;
197 ret |= resync_routes;
245 if (
vrf_.get() != NULL) {
324 if (op_del || old_vxlan != new_vxlan ||
vrf_.get() == NULL) {
325 if (old_vxlan != 0) {
332 if (op_del ==
false &&
vrf_.get() != NULL && new_vxlan != 0) {
339 return (old_vxlan != new_vxlan);
353 bool routing = (forwarding_mode ==
Agent::L2) ?
false :
true;
372 for (
unsigned int i = 0; i <
ipam_.size(); ++i) {
404 std::sort(new_ipam.begin(), new_ipam.end());
406 std::vector<VnIpam>::iterator it_old =
ipam_.begin();
407 std::vector<VnIpam>::iterator it_new = new_ipam.begin();
409 while (it_old !=
ipam_.end() && it_new != new_ipam.end()) {
410 if (*it_old < *it_new) {
415 }
else if (*it_new < *it_old) {
428 for (; it_old !=
ipam_.end(); ++it_old) {
434 for (; it_new != new_ipam.end(); ++it_new) {
453 if (install ==
false && old_ipam->
installed ==
false)
456 if (install ==
false && old_ipam->
installed ==
true) {
461 if (install ==
true && old_ipam->
installed ==
false) {
467 bool changed =
false;
468 bool policy = (agent->
tsn_enabled()) ?
false :
true;
538 bool policy = (agent->
tsn_enabled()) ?
false :
true;
560 if (address.is_v4()) {
563 address.to_v4(), 32,
GetName(), policy);
564 }
else if (address.is_v6()) {
567 address.to_v6(), 128,
GetName(), policy);
574 if (address.is_v4()) {
576 (
vrf_->GetInet4UnicastRouteTable())->DeleteReq
577 (agent->
local_peer(),
vrf_->GetName(), address.to_v4(), 32, NULL);
578 }
else if (address.is_v6()) {
580 (
vrf_->GetInet6UnicastRouteTable())->DeleteReq
589 GetInetUnicastRouteTable(ipam->
ip_prefix))->AddIpamSubnetRoute
598 GetInetUnicastRouteTable(ipam->
ip_prefix))->DeleteReq
608 RegisterWalker(static_cast<AgentRouteWalker *>
609 (route_resync_walker_.get()));
621 std::vector<OperDhcpOptions::HostRoute> *routes)
const {
622 VnData::VnIpamDataMap::const_iterator it =
vn_ipam_data_.find(ipam);
624 *routes = it->second.oper_dhcp_options_.host_routes();
631 std::string *ipam_name)
const {
632 for (
unsigned int i = 0; i <
ipam_.size(); i++) {
633 if (
ipam_[i].IsSubnetMember(vm_addr)) {
634 *ipam_name =
ipam_[i].ipam_name;
642 std::string *ipam_name,
643 autogen::IpamType *ipam)
const {
652 for (
unsigned int i = 0; i <
ipam_.size(); i++) {
653 if (
ipam_[i].IsSubnetMember(ip)) {
685 autogen::IpamType *ipam_type,
686 autogen::VirtualDnsType *vdns_type)
const {
687 std::string ipam_name;
690 ipam_type->ipam_dns_method !=
"virtual-dns-server")
694 ipam_type->ipam_dns_server.virtual_dns_server_name, vdns_type))
701 uint8_t *plen)
const {
702 for (uint32_t i = 0; i <
ipam_.size(); ++i) {
703 if (!
ipam_[i].IsV6()) {
708 *prefix =
ipam_[i].ip_prefix.to_v6();
709 *plen = (uint8_t)
ipam_[i].plen;
719 std::string name(
name_.c_str());
721 if (strtok_r(const_cast<char *>(name.c_str()),
":", &saveptr) == NULL)
723 char *project = strtok_r(NULL,
":", &saveptr);
724 return (project == NULL) ?
"" : std::string(project);
765 const VnKey *key =
static_cast<const VnKey *
>(k);
767 return std::unique_ptr<DBEntry>(
static_cast<DBEntry *
>(vn));
835 UpdateVxLanNetworkIdentifierMode();
862 vector<string> vn_token_result;
863 vector<string> vrf_token_result;
864 uint32_t vrf_token_result_size = 0;
866 split(vn_token_result, vn_name, is_any_of(
":"), token_compress_on);
867 split(vrf_token_result, vrf_name, is_any_of(
":"), token_compress_on);
868 vrf_token_result_size = vrf_token_result.size();
876 if (vrf_token_result_size == 1) {
879 if ((vrf_token_result.at(vrf_token_result_size - 1) ==
880 vrf_token_result.at(vrf_token_result_size - 2)) &&
881 (vn_token_result.at(vn_token_result.size() - 1) ==
882 vrf_token_result.at(vrf_token_result_size - 1))) {
889 std::string node_type) {
900 if (cfg_vn->IsPropertySet(autogen::VirtualNetwork::NETWORK_ID))
901 return cfg_vn->network_id();
903 return cfg_vn->properties().network_id;
907 bool *rpf,
bool *flood_unknown_unicast,
909 bool *mirror_destination) {
912 VirtualNetwork *cfg = static_cast <VirtualNetwork *> (node->
GetObject());
913 autogen::VirtualNetworkType properties = cfg->properties();
915 if (properties.rpf ==
"disable") {
919 *flood_unknown_unicast = cfg->flood_unknown_unicast();
920 *mirror_destination = properties.mirror_destination;
927 const std::string &ipam_name,
928 std::vector<VnIpam> *vn_ipam) {
929 for (
unsigned int i = 0; i < subnets.size(); ++i) {
932 std::string dns_server_address = subnets[i].dns_server_address;
933 boost::system::error_code ec;
935 IpAddress::from_string(dns_server_address, ec);
936 if (ec.value() || dns_server.is_unspecified()) {
937 dns_server_address = subnets[i].default_gateway;
941 (
VnIpam(subnets[i].subnet.ip_prefix,
942 subnets[i].subnet.ip_prefix_len,
943 subnets[i].default_gateway,
945 subnets[i].enable_dhcp, ipam_name,
946 subnets[i].dhcp_option_list.dhcp_option,
947 subnets[i].host_routes.route,
948 subnets[i].alloc_unit));
954 using boost::uuids::nil_uuid;
958 VirtualNetwork *cfg = static_cast <VirtualNetwork *> (node->
GetObject());
961 uuid acl_uuid = nil_uuid();
962 uuid mirror_cfg_acl_uuid = nil_uuid();
963 uuid qos_config_uuid = nil_uuid();
964 string vrf_name =
"";
965 std::vector<VnIpam> vn_ipam;
967 std::string ipam_name;
969 bool underlay_forwarding =
false;
970 bool vxlan_routing_vn =
false;
971 uuid logical_router_uuid = nil_uuid();
972 uuid health_check_uuid = nil_uuid();
986 AccessControlList *acl_cfg =
static_cast<AccessControlList *
>
989 autogen::IdPermsType id_perms = acl_cfg->id_perms();
990 if (acl_cfg->entries().dynamic) {
991 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
992 mirror_cfg_acl_uuid);
994 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
1001 vrf_name = adj_node->
name();
1005 autogen::QosConfig *qc =
1006 static_cast<autogen::QosConfig *
>(adj_node->
GetObject());
1007 autogen::IdPermsType id_perms = qc->id_perms();
1008 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
1013 uuid slo_uuid = nil_uuid();
1014 autogen::SecurityLoggingObject *slo =
1015 static_cast<autogen::SecurityLoggingObject *
>(adj_node->
1017 autogen::IdPermsType id_perms = slo->id_perms();
1018 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
1020 slo_list.push_back(slo_uuid);
1026 ipam_name = ipam_node->name();
1027 VirtualNetworkNetworkIpam *vnni =
1028 static_cast<VirtualNetworkNetworkIpam *
>
1030 VnSubnetsType subnets;
1032 subnets = vnni->data();
1034 autogen::NetworkIpam *network_ipam =
1035 static_cast<autogen::NetworkIpam *
>(ipam_node->GetObject());
1036 const std::string subnet_method =
1037 boost::to_lower_copy(network_ipam->ipam_subnet_method());
1039 if (subnet_method ==
"flat-subnet") {
1041 ipam_name, &vn_ipam);
1054 underlay_forwarding =
true;
1059 "logical-router-virtual-network") == 0) {
1060 autogen::LogicalRouterVirtualNetwork *lr_vn_node =
1061 dynamic_cast<autogen::LogicalRouterVirtualNetwork *
>
1063 autogen::LogicalRouter *lr = NULL;
1068 lr =
dynamic_cast<autogen::LogicalRouter *
>(lr_adj_node->
1072 if (lr_vn_node && lr) {
1073 autogen::IdPermsType id_perms = lr->id_perms();
1075 id_perms.uuid.uuid_lslong,
1076 logical_router_uuid);
1077 autogen::LogicalRouterVirtualNetworkType data =
1079 if (data.logical_router_virtual_network_type ==
1080 "InternalVirtualNetwork")
1082 vxlan_routing_vn =
true;
1087 if (adj_node->
table() ==
1089 MulticastPolicy *mcast_group =
static_cast<MulticastPolicy *
>
1091 assert(mcast_group);
1092 autogen::IdPermsType id_perms = mcast_group->id_perms();
1093 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
1095 mp_list.push_back(mp_uuid);
1098 if (adj_node->
table() ==
1100 autogen::ServiceHealthCheck *hc =
1101 static_cast<autogen::ServiceHealthCheck *
> (adj_node->
GetObject());
1103 if (hc->properties().health_check_type.find(
"vn-ip-list") == std::string::npos)
1105 autogen::IdPermsType id_perms = hc->id_perms();
1106 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
1112 std::sort(vn_ipam.begin(), vn_ipam.end());
1116 bool flood_unknown_unicast;
1117 bool mirror_destination;
1118 bool pbb_evpn_enable = cfg->pbb_evpn_enable();
1119 bool pbb_etree_enable = cfg->pbb_etree_enable();
1120 bool layer2_control_word = cfg->layer2_control_word();
1121 bool cfg_igmp_enable = cfg->igmp_enable();
1122 uint32_t vn_max_flows = cfg->properties().max_flows;
1123 bool mac_ip_learning_enable = cfg->mac_ip_learning_enable();
1126 &forwarding_mode, &mirror_destination);
1128 mirror_acl_uuid, mirror_cfg_acl_uuid, vn_ipam,
1129 vn_ipam_data, cfg->properties().vxlan_network_identifier,
1130 GetCfgVnId(cfg), cfg->id_perms().enable, enable_rpf,
1131 flood_unknown_unicast, forwarding_mode,
1132 qos_config_uuid, mirror_destination, pbb_etree_enable,
1133 pbb_evpn_enable, layer2_control_word, slo_list,
1134 underlay_forwarding, vxlan_routing_vn,
1135 logical_router_uuid, mp_list, cfg_igmp_enable,
1136 vn_max_flows, mac_ip_learning_enable,
1141 VirtualNetwork *cfg = static_cast <VirtualNetwork *> (node->
GetObject());
1143 autogen::IdPermsType id_perms = cfg->id_perms();
1144 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong, u);
1151 assert(!u.is_nil());
1180 const std::vector<VnIpam> &ipam,
1182 int vxlan_id,
bool admin_state,
bool enable_rpf,
1183 bool flood_unknown_unicast,
bool pbb_etree_enable,
1184 bool pbb_evpn_enable,
bool layer2_control_word) {
1185 using boost::uuids::nil_uuid;
1190 bool mirror_destination =
false;
1192 nil_uuid(), ipam, vn_ipam_data,
1193 vxlan_id, vn_id, admin_state, enable_rpf,
1195 mirror_destination, pbb_etree_enable,
1196 pbb_evpn_enable, layer2_control_word, empty_list,
1197 false,
false, nil_uuid(), empty_list,
false, 0,
1200 req.
data.reset(data);
1207 req.
data.reset(NULL);
1216 req.
data.reset(NULL);
1224 VnListResp *resp =
static_cast<VnListResp *
>(sresp);
1231 data.set_vn_id(
vnid_);
1235 data.set_acl_uuid(
"");
1241 data.set_vrf_name(
"");
1247 data.set_mirror_acl_uuid(
"");
1253 data.set_mirror_cfg_acl_uuid(
"");
1256 std::vector<VnIpamData> vn_subnet_sandesh_list;
1257 const std::vector<VnIpam> &vn_ipam =
GetVnIpam();
1258 for (
unsigned int i = 0; i < vn_ipam.size(); ++i) {
1260 entry.set_ip_prefix(vn_ipam[i].ip_prefix.to_string());
1261 entry.set_prefix_len(vn_ipam[i].plen);
1262 entry.set_gateway(vn_ipam[i].default_gw.to_string());
1263 entry.set_ipam_name(vn_ipam[i].ipam_name);
1264 entry.set_dhcp_enable(vn_ipam[i].dhcp_enable ?
"true" :
"false");
1265 entry.set_dhcp_enable_v6(vn_ipam[i].dhcp_enable_v6 ?
"true" :
"false");
1266 entry.set_dns_server(vn_ipam[i].dns_server.to_string());
1267 vn_subnet_sandesh_list.push_back(entry);
1269 data.set_ipam_data(vn_subnet_sandesh_list);
1271 std::vector<VnIpamHostRoutes> vn_ipam_host_routes_list;
1272 for (VnData::VnIpamDataMap::const_iterator it =
vn_ipam_data_.begin();
1274 VnIpamHostRoutes vn_ipam_host_routes;
1275 vn_ipam_host_routes.ipam_name = it->first;
1276 const std::vector<OperDhcpOptions::HostRoute> &host_routes =
1277 it->second.oper_dhcp_options_.host_routes();
1278 for (uint32_t i = 0; i < host_routes.size(); ++i) {
1279 vn_ipam_host_routes.host_routes.push_back(
1282 vn_ipam_host_routes_list.push_back(vn_ipam_host_routes);
1284 data.set_ipam_host_routes(vn_ipam_host_routes_list);
1286 data.set_layer2_forwarding(
bridging());
1293 std::vector<SecurityLoggingObjectLink>
slo_list;
1294 UuidList::const_iterator sit =
slo_list_.begin();
1296 SecurityLoggingObjectLink slo_entry;
1297 slo_entry.set_slo_uuid(to_string(*sit));
1298 slo_list.push_back(slo_entry);
1301 data.set_slo_list(slo_list);
1302 std::vector<VnSandeshData> &list =
1303 const_cast<std::vector<VnSandeshData>&
>(resp->get_vn_list());
1304 std::vector<MulticastPolicyLink>
mp_list;
1305 UuidList::const_iterator mpit =
mp_list_.begin();
1307 MulticastPolicyLink mp_entry;
1308 mp_entry.set_mp_uuid(to_string(*mpit));
1309 mp_list.push_back(mp_entry);
1312 data.set_mp_list(mp_list);
1318 list.push_back(data);
1323 VnObjectLogInfo info;
1330 string mirror_acl_uuid;
1331 string mirror_cfg_acl_uuid;
1333 info.set_uuid(vn_uuid);
1336 case AgentLogEvent::ADD:
1337 str.assign(
"Addition ");
1339 case AgentLogEvent::DEL:
1340 str.assign(
"Deletion ");
1341 info.set_event(str);
1342 VN_OBJECT_LOG_LOG(
"AgentVn", SandeshLevel::SYS_INFO, info);
1344 case AgentLogEvent::CHANGE:
1345 str.assign(
"Modification ");
1352 info.set_event(str);
1355 info.set_acl_uuid(acl_uuid);
1359 info.set_mirror_acl_uuid(mirror_acl_uuid);
1361 if (mirror_cfg_acl) {
1363 info.set_mirror_cfg_acl_uuid(mirror_cfg_acl_uuid);
1369 vector<VnObjectLogIpam> ipam_list;
1370 VnObjectLogIpam sandesh_ipam;
1371 vector<VnIpam>::const_iterator it =
ipam_.begin();
1372 while (it !=
ipam_.end()) {
1374 sandesh_ipam.set_ip_prefix(ipam.
ip_prefix.to_string());
1375 sandesh_ipam.set_prefix_len(ipam.
plen);
1376 sandesh_ipam.set_gateway_ip(ipam.
default_gw.to_string());
1377 sandesh_ipam.set_ipam_name(ipam.
ipam_name);
1378 sandesh_ipam.set_dhcp_enable(ipam.
dhcp_enable ?
"true" :
"false");
1379 sandesh_ipam.set_dhcp_enable_v6(ipam.
dhcp_enable_v6 ?
"true" :
"false");
1380 sandesh_ipam.set_dns_server(ipam.
dns_server.to_string());
1381 ipam_list.push_back(sandesh_ipam);
1385 if (ipam_list.size()) {
1386 info.set_ipam_list(ipam_list);
1391 VN_OBJECT_LOG_LOG(
"AgentVn", SandeshLevel::SYS_INFO, info);
1394 void VnListReq::HandleRequest()
const {
1396 get_vxlan_id(), get_ipam_name()));
1397 sand->DoSandesh(sand);
1401 const std::string &context) {
1441 autogen::NetworkIpam *network_ipam =
1442 static_cast <autogen::NetworkIpam *> (node->
GetObject());
1443 assert(network_ipam);
1445 bool change =
false;
1448 if (
IpamChanged(it->second, network_ipam->mgmt())) {
1449 it->second = network_ipam->mgmt();
1454 network_ipam->mgmt()));
1468 autogen::VirtualDns *virtual_dns =
1469 static_cast <autogen::VirtualDns *> (node->
GetObject());
1470 assert(virtual_dns);
1474 it->second = virtual_dns->data();
1477 virtual_dns->data()));
1495 const autogen::IpamType &cur)
const {
1496 if (old.ipam_method != cur.ipam_method ||
1497 old.ipam_dns_method != cur.ipam_dns_method)
1500 if ((old.ipam_dns_server.virtual_dns_server_name !=
1501 cur.ipam_dns_server.virtual_dns_server_name) ||
1502 (old.ipam_dns_server.tenant_dns_server_address.ip_address !=
1503 cur.ipam_dns_server.tenant_dns_server_address.ip_address))
1506 if (old.cidr_block.ip_prefix != cur.cidr_block.ip_prefix ||
1507 old.cidr_block.ip_prefix_len != cur.cidr_block.ip_prefix_len)
1510 if (old.dhcp_option_list.dhcp_option.size() !=
1511 cur.dhcp_option_list.dhcp_option.size())
1514 for (uint32_t i = 0; i < old.dhcp_option_list.dhcp_option.size(); i++) {
1515 if ((old.dhcp_option_list.dhcp_option[i].dhcp_option_name !=
1516 cur.dhcp_option_list.dhcp_option[i].dhcp_option_name) ||
1517 (old.dhcp_option_list.dhcp_option[i].dhcp_option_value !=
1518 cur.dhcp_option_list.dhcp_option[i].dhcp_option_value) ||
1519 (old.dhcp_option_list.dhcp_option[i].dhcp_option_value_bytes !=
1520 cur.dhcp_option_list.dhcp_option[i].dhcp_option_value_bytes))
1524 if (old.host_routes.route.size() != cur.host_routes.route.size())
1527 for (uint32_t i = 0; i < old.host_routes.route.size(); i++) {
1528 if ((old.host_routes.route[i].prefix !=
1529 cur.host_routes.route[i].prefix) ||
1530 (old.host_routes.route[i].next_hop !=
1531 cur.host_routes.route[i].next_hop) ||
1532 (old.host_routes.route[i].next_hop_type !=
1533 cur.host_routes.route[i].next_hop_type) ||
1534 (old.host_routes.route[i].community_attributes.community_attribute !=
1535 cur.host_routes.route[i].community_attributes.community_attribute))
1543 IpamDomainConfigMap::iterator it =
ipam_config_.find(name);
1551 autogen::VirtualDnsType *vdns_type) {
1552 VdnsDomainConfigMap::iterator it =
vdns_config_.find(vdns);
1555 *vdns_type = it->second;
const UuidList & slo_list() const
bool mac_ip_learning_enable_
IpAddress GetDnsFromIpam(const IpAddress &ip) const
void SendObjectLog(AgentLogEvent::type event) const
void ResyncReq(const boost::uuids::uuid &vn)
void AddNetworkIpamNode(IFMapNode *node)
void ConfigDelete(IFMapNode *node)
bool IsVRFServiceChainingInstance(const string &vn_name, const string &vrf_name)
bool mac_ip_learning_enable() const
static void CfgUuidSet(uint64_t ms_long, uint64_t ls_long, boost::uuids::uuid &u)
void PropogateNodeChange(IFMapNode *node)
virtual bool IFNodeToUuid(IFMapNode *node, boost::uuids::uuid &u)
void AddVirtualDnsNode(IFMapNode *node)
const AclDBEntry * GetAcl() const
DomainConfig * domain_config_table() const
std::string GetString(const std::string &key) const
boost::uuids::uuid logical_router_uuid_
const VnIpam * GetIpam(const IpAddress &ip) const
DBTableBase * get_table() const
VnData * BuildData(IFMapNode *node)
std::pair< std::string, VnIpamLinkData > VnIpamDataPair
void IpamAddChange(IFMapNode *node)
std::map< std::string, VnIpamLinkData > VnIpamDataMap
DomainConfig * domain_config_
bool UpdateForwardingMode(Agent *agent)
void CallIpamCb(IFMapNode *node)
void DelIpamRoutes(Agent *agent, VnIpam *ipam, VrfEntry *vrf)
IpamDomainConfigMap ipam_config_
static DBTableBase * CreateTable(DB *db, const std::string &name)
void CallVdnsCb(IFMapNode *node)
ConfigManager * config_manager() const
boost::asio::ip::address IpAddress
std::pair< std::string, autogen::VirtualDnsType > VdnsDomainConfigPair
virtual ~OperNetworkIpam()
bool ChangeHandler(Agent *agent, const DBRequest *req)
virtual AgentSandeshPtr GetAgentSandesh(const AgentSandeshArguments *args, const std::string &context)
void DelVn(const boost::uuids::uuid &vn_uuid)
std::unique_ptr< DBRequestData > data
VnEntry(Agent *agent, boost::uuids::uuid id)
uint32_t vn_max_flows() const
DBTableWalkRef AllocWalker(WalkFn walk_fn, WalkCompleteFn walk_complete)
virtual const char * Typename() const =0
void ConfigManagerEnqueue(IFMapNode *node)
AgentDBEntry * FindActiveEntry(const DBEntry *key)
InterfaceTable * interface_table() const
bool Enqueue(DBRequest *req)
bool GetIpam(const std::string &name, autogen::IpamType *ipam)
AclDBEntryRef mirror_acl_
IpAddress GetSubnetAddress() const
Agent::ForwardingMode forwarding_mode() const
adjacency_iterator end(DBGraph *graph)
const string & GetName() const
static std::string UuidToString(const boost::uuids::uuid &id)
virtual ~OperVirtualDns()
const boost::uuids::uuid & GetUuid() const
bool pbb_etree_enable() const
boost::uuids::uuid acl_id_
IFMapNode * FindTarget(IFMapAgentTable *table, IFMapNode *node, std::string node_type)
virtual KeyPtr GetDBRequestKey() const
void ConfigManagerEnqueue(IFMapNode *node)
void UpdateRoutesInVrf(VrfEntry *vrf)
static Ip4Address GetIp4SubnetAddress(const Ip4Address &prefix, uint16_t plen)
void set_fabric_vn_uuid(const boost::uuids::uuid &uuid)
std::unique_ptr< DBRequestKey > KeyPtr
VdnsDomainConfigMap vdns_config_
bool GetIpamVdnsData(const IpAddress &vm_addr, autogen::IpamType *ipam_type, autogen::VirtualDnsType *vdns_type) const
bool ApplyIpam(Agent *agent, VnIpam *ipam, VrfEntry *old_vrf, bool del)
OperDhcpOptions oper_dhcp_options
void ReleaseWalker(DBTableWalkRef &walk)
static Ip6Address GetIp6SubnetAddress(const Ip6Address &prefix, uint16_t plen)
bool flood_unknown_unicast() const
IFMapDependencyManager * dependency_manager()
bool IsSubnetMember(const IpAddress &ip) const
virtual void SetKey(const DBRequestKey *key)
const DBGraph * GetGraph() const
std::string GetProject() const
Agent::ForwardingMode forwarding_mode() const
void WalkAgain(DBTableWalkRef walk)
IFMapNode * FindAdjacentIFMapNode(IFMapNode *node, const char *type)
IFMapAgentTable * cfg_vm_interface_table() const
bool cfg_igmp_enable() const
GlobalVrouter * global_vrouter() const
void VDnsAddChange(IFMapNode *node)
VnIpam(const std::string &ip, uint32_t len, const std::string &gw, const std::string &dns, bool dhcp, const std::string &name, const std::vector< autogen::DhcpOptionType > &dhcp_options, const std::vector< autogen::RouteType > &host_routes, uint32_t alloc)
OperNetworkIpam(Agent *agent, DomainConfig *domain_config)
bool IpamChanged(const autogen::IpamType &old, const autogen::IpamType &cur) const
virtual bool OperDBDelete(DBEntry *entry, const DBRequest *req)
void VnEntryWalkDone(DBTable::DBTableWalkRef walk_ref, DBTableBase *partition)
virtual std::unique_ptr< DBEntry > AllocEntry(const DBRequestKey *k) const
AgentRouteWalkerManager * agent_route_walk_manager() const
void ConfigAddChange(IFMapNode *node)
void ConfigAddChange(IFMapNode *node)
uint32_t GetAllocUnitFromIpam(const IpAddress &ip) const
virtual bool OperDBResync(DBEntry *entry, const DBRequest *req)
AgentRouteWalkerPtr route_resync_walker_
bool HandleIpamChange(Agent *agent, VnIpam *old_ipam, VnIpam *new_ipam)
boost::asio::ip::address_v6 Ip6Address
std::vector< Callback > ipam_callback_
std::unique_ptr< DBRequestKey > key
std::vector< VnIpam > ipam_
IFMapAgentTable * cfg_multicast_policy_table() const
bool GetVnHostRoutes(const std::string &ipam, std::vector< OperDhcpOptions::HostRoute > *routes) const
IFMapAgentTable * cfg_vn_network_ipam_table() const
const AclDBEntry * GetMirrorAcl() const
virtual bool OperDBOnChange(DBEntry *entry, const DBRequest *req)
bool AddIpamRoutes(Agent *agent, VnIpam *ipam)
std::pair< std::string, autogen::IpamType > IpamDomainConfigPair
virtual bool IsLess(const DBEntry &rhs) const
void ConfigDelete(IFMapNode *node)
VxLanId * Locate(uint32_t vxlan_id, const boost::uuids::uuid &vn, const std::string &vrf, bool flood_unknown_unicast, bool mirror_destination, bool learning_enabled, bool bridge)
bool flood_unknown_unicast_
PhysicalDeviceVnTable * physical_device_vn_table() const
Agent::ForwardingMode forwarding_mode_
std::vector< Callback > vdns_callback_
const Peer * local_peer() const
bool underlay_forwarding_
bool DBEntrySandesh(Sandesh *sresp, std::string &name) const
const std::vector< VnIpam > & GetVnIpam() const
class boost::shared_ptr< AgentSandesh > AgentSandeshPtr
VxLanNetworkIdentifierMode vxlan_network_identifier_mode() const
VnEntry * Find(const boost::uuids::uuid &vn_uuid)
boost::uuids::uuid mirror_acl_id_
const std::string & name() const
boost::uuids::uuid health_check_uuid_
AgentQosConfigConstRef qos_config_
void AddHostRoute(const IpAddress &address, bool policy)
VnIpamDataMap vn_ipam_data_
std::vector< boost::uuids::uuid > UuidList
IFMapAgentTable * cfg_health_check_table() const
IFMapNode * ifmap_node() const
VrfTable * vrf_table() const
virtual bool Delete(DBEntry *entry, const DBRequest *req)
bool UpdateVxlan(Agent *agent, bool op_del)
bool underlay_forwarding_
IFMapAgentTable * cfg_qos_table() const
IFMapObject * GetObject()
void set_host_routes(const HostOptionsList &host_routes)
boost::uuids::uuid qos_config_uuid_
DomainConfig * domain_config_
IFMapAgentTable * cfg_acl_table() const
int GetCfgVnId(autogen::VirtualNetwork *cfg_vn)
VrfEntry * GetVrf() const
AclDBEntryRef mirror_cfg_acl_
boost::uuids::uuid mirror_cfg_acl_id_
void CfgForwardingFlags(IFMapNode *node, bool *rpf, bool *flood_unknown_unicast, Agent::ForwardingMode *forwarding_mode, bool *mirror_destination)
boost::function< void(IFMapNode *)> Callback
AgentQosConfigTable * qos_config_table() const
VxLanTable * vxlan_table() const
bool CanInstallIpam(const VnIpam *ipam)
void AddVn(const boost::uuids::uuid &vn_uuid, const string &name, const boost::uuids::uuid &acl_id, const string &vrf_name, const std::vector< VnIpam > &ipam, const VnData::VnIpamDataMap &vn_ipam_data, int vn_id, int vxlan_id, bool admin_state, bool enable_rpf, bool flood_unknown_unicast, bool pbb_etree_enable, bool pbb_evpn_enable, bool layer2_control_word)
bool flood_unknown_unicast_
const boost::uuids::uuid & health_check_uuid() const
bool layer3_forwarding() const
void BuildVnIpamData(const std::vector< autogen::IpamSubnetType > &subnets, const std::string &ipam_name, std::vector< VnIpam > *vn_ipam)
virtual DBEntry * OperDBAdd(const DBRequest *req)
boost::uuids::uuid health_check_uuid_
void IpamDelete(IFMapNode *node)
bool layer2_control_word_
MirrorCfgTable * mirror_cfg_table() const
OperVirtualDns(Agent *agent, DomainConfig *domain_config)
const AgentQosConfig * qos_config() const
void DelHostRoute(const IpAddress &address)
IFMapAgentTable * cfg_vrf_table() const
Agent::ForwardingMode TranslateForwardingMode(const std::string &mode) const
void RegisterIpamCb(Callback cb)
const std::string & linklocal_vrf_name()
bool layer2_control_word() const
static bool IsGwHostRouteRequired(const Agent *agent)
IFMapAgentTable * cfg_vn_table() const
const boost::uuids::uuid & GetUuid() const
bool mac_ip_learning_enable_
const string & GetName() const
OperDhcpOptions oper_dhcp_options_
void AddSubnetRoute(VnIpam *ipam)
std::vector< VnIpam > ipam_
bool GetVDns(const std::string &vdns, autogen::VirtualDnsType *vdns_type)
boost::intrusive_ptr< DBTableWalk > DBTableWalkRef
void GlobalVrouterConfigChanged()
virtual bool ProcessConfig(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
Agent::ForwardingMode forwarding_mode_
AgentConfig * cfg() const
boost::uuids::uuid logical_router_uuid_
void AddVnNode(IFMapNode *node)
const std::string & fabric_vn_name() const
IFMapAgentTable * cfg_slo_table() const
bool SkipNode(IFMapNode *node)
bool GetIpamName(const IpAddress &vm_addr, std::string *ipam_name) const
AclTable * acl_table() const
const UuidList & mp_list() const
adjacency_iterator begin(DBGraph *graph)
VnData::VnIpamDataMap vn_ipam_data_
virtual bool IFNodeToReq(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
bool IsIp6SubnetMember(const Ip6Address &ip, const Ip6Address &subnet, uint8_t plen)
DBTable::DBTableWalkRef walk_ref_
bool VnEntryWalk(DBTablePartBase *partition, DBEntryBase *entry)
bool Resync(Agent *agent)
bool GetPrefix(const Ip6Address &ip, Ip6Address *prefix, uint8_t *plen) const
void VDnsDelete(IFMapNode *node)
void UpdateHostRoute(Agent *agent, const IpAddress &old_address, const IpAddress &new_address, bool policy)
const boost::uuids::uuid GetMirrorUuid(const std::string &vn_name) const
const AclDBEntry * GetMirrorCfgAcl() const
void DelSubnetRoute(VnIpam *ipam)
virtual string ToString() const
bool UpdateIpam(Agent *agent, std::vector< VnIpam > &new_ipam)
bool layer2_control_word_
IpAddress GetGatewayFromIpam(const IpAddress &ip) const
void GlobalVrouterConfigChanged()
void set_options(const DhcpOptionsList &options)
void RegisterVdnsCb(Callback cb)
bool ApplyAllIpam(Agent *agent, VrfEntry *old_vrf, bool del)
bool GetIpamData(const IpAddress &vm_addr, std::string *ipam_name, autogen::IpamType *ipam_type) const
static VnTable * vn_table_
VnTable(DB *db, const std::string &name)