6 #include <boost/uuid/uuid_io.hpp>
15 #include <vnc_cfg_types.h>
16 #include <agent_types.h>
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 update_vxlan_state =
false;
174 if (vrf != old_vrf.get()) {
179 update_vxlan_state =
true;
195 bool resync_routes =
false;
197 ret |= resync_routes;
214 update_vxlan_state =
true;
222 update_vxlan_state =
true;
230 update_vxlan_state =
true;
236 update_vxlan_state =
true;
242 update_vxlan_state =
true;
246 if (update_vxlan_state) {
251 if (
vrf_.get() != NULL) {
325 if (op_del || old_vxlan != new_vxlan ||
vrf_.get() == NULL) {
326 if (old_vxlan != 0) {
333 if (op_del ==
false &&
vrf_.get() != NULL && new_vxlan != 0) {
340 return (old_vxlan != new_vxlan);
373 for (
unsigned int i = 0; i <
ipam_.size(); ++i) {
405 std::sort(new_ipam.begin(), new_ipam.end());
407 std::vector<VnIpam>::iterator it_old =
ipam_.begin();
408 std::vector<VnIpam>::iterator it_new = new_ipam.begin();
410 while (it_old !=
ipam_.end() && it_new != new_ipam.end()) {
411 if (*it_old < *it_new) {
416 }
else if (*it_new < *it_old) {
429 for (; it_old !=
ipam_.end(); ++it_old) {
435 for (; it_new != new_ipam.end(); ++it_new) {
454 if (install ==
false && old_ipam->
installed ==
false)
457 if (install ==
false && old_ipam->
installed ==
true) {
462 if (install ==
true && old_ipam->
installed ==
false) {
468 bool changed =
false;
469 bool policy = (agent->
tsn_enabled()) ?
false :
true;
539 bool policy = (agent->
tsn_enabled()) ?
false :
true;
561 if (address.is_v4()) {
564 address.to_v4(), 32,
GetName(), policy);
565 }
else if (address.is_v6()) {
568 address.to_v6(), 128,
GetName(), policy);
575 if (address.is_v4()) {
577 (
vrf_->GetInet4UnicastRouteTable())->DeleteReq
578 (agent->
local_peer(),
vrf_->GetName(), address.to_v4(), 32, NULL);
579 }
else if (address.is_v6()) {
581 (
vrf_->GetInet6UnicastRouteTable())->DeleteReq
590 GetInetUnicastRouteTable(ipam->
ip_prefix))->AddIpamSubnetRoute
599 GetInetUnicastRouteTable(ipam->
ip_prefix))->DeleteReq
622 std::vector<OperDhcpOptions::HostRoute> *routes)
const {
623 VnData::VnIpamDataMap::const_iterator it =
vn_ipam_data_.find(ipam);
625 *routes = it->second.oper_dhcp_options_.host_routes();
632 std::string *ipam_name)
const {
633 for (
unsigned int i = 0; i <
ipam_.size(); i++) {
634 if (
ipam_[i].IsSubnetMember(vm_addr)) {
635 *ipam_name =
ipam_[i].ipam_name;
643 std::string *ipam_name,
644 autogen::IpamType *ipam)
const {
653 for (
unsigned int i = 0; i <
ipam_.size(); i++) {
654 if (
ipam_[i].IsSubnetMember(ip)) {
686 autogen::IpamType *ipam_type,
687 autogen::VirtualDnsType *vdns_type)
const {
688 std::string ipam_name;
691 ipam_type->ipam_dns_method !=
"virtual-dns-server")
695 ipam_type->ipam_dns_server.virtual_dns_server_name, vdns_type))
702 uint8_t *plen)
const {
703 for (uint32_t i = 0; i <
ipam_.size(); ++i) {
704 if (!
ipam_[i].IsV6()) {
709 *prefix =
ipam_[i].ip_prefix.to_v6();
710 *plen = (uint8_t)
ipam_[i].plen;
720 std::string name(
name_.c_str());
722 if (strtok_r(
const_cast<char *
>(name.c_str()),
":", &saveptr) == NULL)
724 char *project = strtok_r(NULL,
":", &saveptr);
725 return (project == NULL) ?
"" : std::string(project);
776 const VnKey *key =
static_cast<const VnKey *
>(k);
778 return std::unique_ptr<DBEntry>(
static_cast<DBEntry *
>(vn));
846 UpdateVxLanNetworkIdentifierMode();
873 vector<string> vn_token_result;
874 vector<string> vrf_token_result;
875 uint32_t vrf_token_result_size = 0;
877 split(vn_token_result, vn_name, is_any_of(
":"), token_compress_on);
878 split(vrf_token_result, vrf_name, is_any_of(
":"), token_compress_on);
879 vrf_token_result_size = vrf_token_result.size();
887 if (vrf_token_result_size == 1) {
890 if ((vrf_token_result.at(vrf_token_result_size - 1) ==
891 vrf_token_result.at(vrf_token_result_size - 2)) &&
892 (vn_token_result.at(vn_token_result.size() - 1) ==
893 vrf_token_result.at(vrf_token_result_size - 1))) {
900 std::string node_type) {
911 if (cfg_vn->IsPropertySet(autogen::VirtualNetwork::NETWORK_ID))
912 return cfg_vn->network_id();
914 return cfg_vn->properties().network_id;
918 bool *rpf,
bool *flood_unknown_unicast,
920 bool *mirror_destination) {
923 VirtualNetwork *cfg =
static_cast <VirtualNetwork *
> (node->
GetObject());
924 autogen::VirtualNetworkType properties = cfg->properties();
926 if (properties.rpf ==
"disable") {
930 *flood_unknown_unicast = cfg->flood_unknown_unicast();
931 *mirror_destination = properties.mirror_destination;
938 const std::string &ipam_name,
939 std::vector<VnIpam> *vn_ipam) {
940 for (
unsigned int i = 0; i < subnets.size(); ++i) {
943 std::string dns_server_address = subnets[i].dns_server_address;
944 boost::system::error_code ec;
946 IpAddress::from_string(dns_server_address, ec);
947 if (ec.value() || dns_server.is_unspecified()) {
948 dns_server_address = subnets[i].default_gateway;
952 (
VnIpam(subnets[i].subnet.ip_prefix,
953 subnets[i].subnet.ip_prefix_len,
954 subnets[i].default_gateway,
956 subnets[i].enable_dhcp, ipam_name,
957 subnets[i].dhcp_option_list.dhcp_option,
958 subnets[i].host_routes.route,
959 subnets[i].alloc_unit));
965 using boost::uuids::nil_uuid;
969 VirtualNetwork *cfg =
static_cast <VirtualNetwork *
> (node->
GetObject());
972 uuid acl_uuid = nil_uuid();
973 uuid mirror_cfg_acl_uuid = nil_uuid();
974 uuid qos_config_uuid = nil_uuid();
975 string vrf_name =
"";
976 std::vector<VnIpam> vn_ipam;
978 std::string ipam_name;
980 bool underlay_forwarding =
false;
981 bool vxlan_routing_vn =
false;
982 uuid logical_router_uuid = nil_uuid();
983 uuid health_check_uuid = nil_uuid();
997 AccessControlList *acl_cfg =
static_cast<AccessControlList *
>
1000 autogen::IdPermsType id_perms = acl_cfg->id_perms();
1001 if (acl_cfg->entries().dynamic) {
1002 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
1003 mirror_cfg_acl_uuid);
1005 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
1010 if ((adj_node->
table() ==
agent()->cfg()->cfg_vrf_table()) &&
1012 vrf_name = adj_node->
name();
1015 if (adj_node->
table() ==
agent()->cfg()->cfg_qos_table()) {
1016 autogen::QosConfig *qc =
1017 static_cast<autogen::QosConfig *
>(adj_node->
GetObject());
1018 autogen::IdPermsType id_perms = qc->id_perms();
1019 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
1023 if (adj_node->
table() ==
agent()->cfg()->cfg_slo_table()) {
1024 uuid slo_uuid = nil_uuid();
1025 autogen::SecurityLoggingObject *slo =
1026 static_cast<autogen::SecurityLoggingObject *
>(adj_node->
1028 autogen::IdPermsType id_perms = slo->id_perms();
1029 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
1031 slo_list.push_back(slo_uuid);
1034 if (adj_node->
table() ==
agent()->cfg()->cfg_vn_network_ipam_table()) {
1037 ipam_name = ipam_node->name();
1038 VirtualNetworkNetworkIpam *vnni =
1039 static_cast<VirtualNetworkNetworkIpam *
>
1041 VnSubnetsType subnets;
1043 subnets = vnni->data();
1045 autogen::NetworkIpam *network_ipam =
1046 static_cast<autogen::NetworkIpam *
>(ipam_node->GetObject());
1047 const std::string subnet_method =
1048 boost::to_lower_copy(network_ipam->ipam_subnet_method());
1050 if (subnet_method ==
"flat-subnet") {
1052 ipam_name, &vn_ipam);
1063 if (adj_node->
table() ==
agent()->cfg()->cfg_vn_table()) {
1064 if (
agent()->fabric_vn_name() == adj_node->
name()) {
1065 underlay_forwarding =
true;
1070 "logical-router-virtual-network") == 0) {
1071 autogen::LogicalRouterVirtualNetwork *lr_vn_node =
1072 dynamic_cast<autogen::LogicalRouterVirtualNetwork *
>
1074 autogen::LogicalRouter *lr = NULL;
1079 lr =
dynamic_cast<autogen::LogicalRouter *
>(lr_adj_node->
1083 if (lr_vn_node && lr) {
1084 autogen::IdPermsType id_perms = lr->id_perms();
1086 id_perms.uuid.uuid_lslong,
1087 logical_router_uuid);
1088 autogen::LogicalRouterVirtualNetworkType data =
1090 if (data.logical_router_virtual_network_type ==
1091 "InternalVirtualNetwork")
1093 vxlan_routing_vn =
true;
1098 if (adj_node->
table() ==
1099 agent()->cfg()->cfg_multicast_policy_table()) {
1100 MulticastPolicy *mcast_group =
static_cast<MulticastPolicy *
>
1102 assert(mcast_group);
1103 autogen::IdPermsType id_perms = mcast_group->id_perms();
1104 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
1106 mp_list.push_back(mp_uuid);
1109 if (adj_node->
table() ==
1110 agent()->cfg()->cfg_health_check_table()) {
1111 autogen::ServiceHealthCheck *hc =
1112 static_cast<autogen::ServiceHealthCheck *
> (adj_node->
GetObject());
1114 if (hc->properties().health_check_type.find(
"vn-ip-list") == std::string::npos)
1116 autogen::IdPermsType id_perms = hc->id_perms();
1117 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
1123 std::sort(vn_ipam.begin(), vn_ipam.end());
1127 bool flood_unknown_unicast;
1128 bool mirror_destination;
1129 bool pbb_evpn_enable = cfg->pbb_evpn_enable();
1130 bool pbb_etree_enable = cfg->pbb_etree_enable();
1131 bool layer2_control_word = cfg->layer2_control_word();
1132 bool cfg_igmp_enable = cfg->igmp_enable();
1133 uint32_t vn_max_flows = cfg->properties().max_flows;
1134 bool mac_ip_learning_enable = cfg->mac_ip_learning_enable();
1137 &forwarding_mode, &mirror_destination);
1139 mirror_acl_uuid, mirror_cfg_acl_uuid, vn_ipam,
1140 vn_ipam_data, cfg->properties().vxlan_network_identifier,
1141 GetCfgVnId(cfg), cfg->id_perms().enable, enable_rpf,
1142 flood_unknown_unicast, forwarding_mode,
1143 qos_config_uuid, mirror_destination, pbb_etree_enable,
1144 pbb_evpn_enable, layer2_control_word, slo_list,
1145 underlay_forwarding, vxlan_routing_vn,
1146 logical_router_uuid, mp_list, cfg_igmp_enable,
1147 vn_max_flows, mac_ip_learning_enable,
1152 VirtualNetwork *cfg =
static_cast <VirtualNetwork *
> (node->
GetObject());
1154 autogen::IdPermsType id_perms = cfg->id_perms();
1155 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong, u);
1162 assert(!u.is_nil());
1191 const std::vector<VnIpam> &ipam,
1193 int vxlan_id,
bool admin_state,
bool enable_rpf,
1194 bool flood_unknown_unicast,
bool pbb_etree_enable,
1195 bool pbb_evpn_enable,
bool layer2_control_word) {
1196 using boost::uuids::nil_uuid;
1201 bool mirror_destination =
false;
1203 nil_uuid(), ipam, vn_ipam_data,
1204 vxlan_id, vn_id, admin_state, enable_rpf,
1206 mirror_destination, pbb_etree_enable,
1207 pbb_evpn_enable, layer2_control_word, empty_list,
1208 false,
false, nil_uuid(), empty_list,
false, 0,
1211 req.
data.reset(data);
1218 req.
data.reset(NULL);
1227 req.
data.reset(NULL);
1235 VnListResp *resp =
static_cast<VnListResp *
>(sresp);
1242 data.set_vn_id(
vnid_);
1246 data.set_acl_uuid(
"");
1252 data.set_vrf_name(
"");
1258 data.set_mirror_acl_uuid(
"");
1264 data.set_mirror_cfg_acl_uuid(
"");
1267 std::vector<VnIpamData> vn_subnet_sandesh_list;
1268 const std::vector<VnIpam> &vn_ipam =
GetVnIpam();
1269 for (
unsigned int i = 0; i < vn_ipam.size(); ++i) {
1271 entry.set_ip_prefix(vn_ipam[i].ip_prefix.to_string());
1272 entry.set_prefix_len(vn_ipam[i].plen);
1273 entry.set_gateway(vn_ipam[i].default_gw.to_string());
1274 entry.set_ipam_name(vn_ipam[i].ipam_name);
1275 entry.set_dhcp_enable(vn_ipam[i].dhcp_enable ?
"true" :
"false");
1276 entry.set_dhcp_enable_v6(vn_ipam[i].dhcp_enable_v6 ?
"true" :
"false");
1277 entry.set_dns_server(vn_ipam[i].dns_server.to_string());
1278 vn_subnet_sandesh_list.push_back(entry);
1280 data.set_ipam_data(vn_subnet_sandesh_list);
1282 std::vector<VnIpamHostRoutes> vn_ipam_host_routes_list;
1283 for (VnData::VnIpamDataMap::const_iterator it =
vn_ipam_data_.begin();
1285 VnIpamHostRoutes vn_ipam_host_routes;
1286 vn_ipam_host_routes.ipam_name = it->first;
1287 const std::vector<OperDhcpOptions::HostRoute> &host_routes =
1288 it->second.oper_dhcp_options_.host_routes();
1289 for (uint32_t i = 0; i < host_routes.size(); ++i) {
1290 vn_ipam_host_routes.host_routes.push_back(
1293 vn_ipam_host_routes_list.push_back(vn_ipam_host_routes);
1295 data.set_ipam_host_routes(vn_ipam_host_routes_list);
1297 data.set_layer2_forwarding(
bridging());
1304 std::vector<SecurityLoggingObjectLink>
slo_list;
1305 UuidList::const_iterator sit =
slo_list_.begin();
1307 SecurityLoggingObjectLink slo_entry;
1308 slo_entry.set_slo_uuid(to_string(*sit));
1313 std::vector<VnSandeshData> &list =
1314 const_cast<std::vector<VnSandeshData>&
>(resp->get_vn_list());
1315 std::vector<MulticastPolicyLink>
mp_list;
1316 UuidList::const_iterator mpit =
mp_list_.begin();
1318 MulticastPolicyLink mp_entry;
1319 mp_entry.set_mp_uuid(to_string(*mpit));
1331 list.push_back(data);
1337 VnObjectLogInfo info;
1344 string mirror_acl_uuid;
1345 string mirror_cfg_acl_uuid;
1347 info.set_uuid(vn_uuid);
1350 case AgentLogEvent::ADD:
1351 str.assign(
"Addition ");
1353 case AgentLogEvent::DEL:
1354 str.assign(
"Deletion ");
1355 info.set_event(str);
1356 VN_OBJECT_LOG_LOG(
"AgentVn", SandeshLevel::SYS_INFO, info);
1358 case AgentLogEvent::CHANGE:
1359 str.assign(
"Modification ");
1366 info.set_event(str);
1369 info.set_acl_uuid(acl_uuid);
1373 info.set_mirror_acl_uuid(mirror_acl_uuid);
1375 if (mirror_cfg_acl) {
1377 info.set_mirror_cfg_acl_uuid(mirror_cfg_acl_uuid);
1383 vector<VnObjectLogIpam> ipam_list;
1384 VnObjectLogIpam sandesh_ipam;
1385 vector<VnIpam>::const_iterator it =
ipam_.begin();
1386 while (it !=
ipam_.end()) {
1388 sandesh_ipam.set_ip_prefix(ipam.
ip_prefix.to_string());
1389 sandesh_ipam.set_prefix_len(ipam.
plen);
1390 sandesh_ipam.set_gateway_ip(ipam.
default_gw.to_string());
1391 sandesh_ipam.set_ipam_name(ipam.
ipam_name);
1392 sandesh_ipam.set_dhcp_enable(ipam.
dhcp_enable ?
"true" :
"false");
1393 sandesh_ipam.set_dhcp_enable_v6(ipam.
dhcp_enable_v6 ?
"true" :
"false");
1394 sandesh_ipam.set_dns_server(ipam.
dns_server.to_string());
1395 ipam_list.push_back(sandesh_ipam);
1399 if (ipam_list.size()) {
1400 info.set_ipam_list(ipam_list);
1408 VN_OBJECT_LOG_LOG(
"AgentVn", SandeshLevel::SYS_INFO, info);
1409 VN_OBJECT_TRACE_TRACE(buf, info);
1412 void VnListReq::HandleRequest()
const {
1414 get_vxlan_id(), get_ipam_name()));
1415 sand->DoSandesh(sand);
1419 const std::string &context) {
1459 autogen::NetworkIpam *network_ipam =
1460 static_cast <autogen::NetworkIpam *
> (node->
GetObject());
1461 assert(network_ipam);
1463 bool change =
false;
1466 if (
IpamChanged(it->second, network_ipam->mgmt())) {
1467 it->second = network_ipam->mgmt();
1472 network_ipam->mgmt()));
1486 autogen::VirtualDns *virtual_dns =
1487 static_cast <autogen::VirtualDns *
> (node->
GetObject());
1488 assert(virtual_dns);
1492 it->second = virtual_dns->data();
1495 virtual_dns->data()));
1513 const autogen::IpamType &cur)
const {
1514 if (old.ipam_method != cur.ipam_method ||
1515 old.ipam_dns_method != cur.ipam_dns_method)
1518 if ((old.ipam_dns_server.virtual_dns_server_name !=
1519 cur.ipam_dns_server.virtual_dns_server_name) ||
1520 (old.ipam_dns_server.tenant_dns_server_address.ip_address !=
1521 cur.ipam_dns_server.tenant_dns_server_address.ip_address))
1524 if (old.cidr_block.ip_prefix != cur.cidr_block.ip_prefix ||
1525 old.cidr_block.ip_prefix_len != cur.cidr_block.ip_prefix_len)
1528 if (old.dhcp_option_list.dhcp_option.size() !=
1529 cur.dhcp_option_list.dhcp_option.size())
1532 for (uint32_t i = 0; i < old.dhcp_option_list.dhcp_option.size(); i++) {
1533 if ((old.dhcp_option_list.dhcp_option[i].dhcp_option_name !=
1534 cur.dhcp_option_list.dhcp_option[i].dhcp_option_name) ||
1535 (old.dhcp_option_list.dhcp_option[i].dhcp_option_value !=
1536 cur.dhcp_option_list.dhcp_option[i].dhcp_option_value) ||
1537 (old.dhcp_option_list.dhcp_option[i].dhcp_option_value_bytes !=
1538 cur.dhcp_option_list.dhcp_option[i].dhcp_option_value_bytes))
1542 if (old.host_routes.route.size() != cur.host_routes.route.size())
1545 for (uint32_t i = 0; i < old.host_routes.route.size(); i++) {
1546 if ((old.host_routes.route[i].prefix !=
1547 cur.host_routes.route[i].prefix) ||
1548 (old.host_routes.route[i].next_hop !=
1549 cur.host_routes.route[i].next_hop) ||
1550 (old.host_routes.route[i].next_hop_type !=
1551 cur.host_routes.route[i].next_hop_type) ||
1552 (old.host_routes.route[i].community_attributes.community_attribute !=
1553 cur.host_routes.route[i].community_attributes.community_attribute))
1561 IpamDomainConfigMap::iterator it =
ipam_config_.find(name);
1569 autogen::VirtualDnsType *vdns_type) {
1570 VdnsDomainConfigMap::iterator it =
vdns_config_.find(vdns);
1573 *vdns_type = it->second;
boost::asio::ip::address_v6 Ip6Address
boost::asio::ip::address IpAddress
bool IsIp6SubnetMember(const Ip6Address &ip, const Ip6Address &subnet, uint8_t plen)
std::vector< boost::uuids::uuid > UuidList
static void CfgUuidSet(uint64_t ms_long, uint64_t ls_long, boost::uuids::uuid &u)
class boost::shared_ptr< AgentSandesh > AgentSandeshPtr
const boost::uuids::uuid & GetUuid() const
static Ip4Address GetIp4SubnetAddress(const Ip4Address &prefix, uint16_t plen)
static Ip6Address GetIp6SubnetAddress(const Ip6Address &prefix, uint16_t plen)
IFMapAgentTable * cfg_acl_table() const
IFMapAgentTable * cfg_vm_interface_table() const
SandeshTraceBufferPtr GetOperDBTraceBuf() const
AgentDBEntry * FindActiveEntry(const DBEntry *key)
void UpdateRoutesInVrf(VrfEntry *vrf)
std::string GetString(const std::string &key) const
InterfaceTable * interface_table() const
ConfigManager * config_manager() const
Agent::ForwardingMode TranslateForwardingMode(const std::string &mode) const
DomainConfig * domain_config_table() const
const std::string & linklocal_vrf_name()
VrfTable * vrf_table() const
MirrorCfgTable * mirror_cfg_table() const
const Peer * local_peer() const
AgentQosConfigTable * qos_config_table() const
AclTable * acl_table() const
AgentConfig * cfg() const
const std::string & fabric_vn_name() const
VxLanTable * vxlan_table() const
VxLanNetworkIdentifierMode vxlan_network_identifier_mode() const
PhysicalDeviceVnTable * physical_device_vn_table() const
void set_fabric_vn_uuid(const boost::uuids::uuid &uuid)
void AddNetworkIpamNode(IFMapNode *node)
bool SkipNode(IFMapNode *node)
void AddVirtualDnsNode(IFMapNode *node)
IFMapNode * FindAdjacentIFMapNode(IFMapNode *node, const char *type)
void AddVnNode(IFMapNode *node)
std::unique_ptr< DBRequestKey > KeyPtr
DBTableBase * get_table() const
adjacency_iterator end(DBGraph *graph)
adjacency_iterator begin(DBGraph *graph)
bool Enqueue(DBRequest *req)
const std::string & name() const
void WalkAgain(DBTableWalkRef walk)
DBTableWalkRef AllocWalker(WalkFn walk_fn, WalkCompleteFn walk_complete)
void ReleaseWalker(DBTableWalkRef &walk)
boost::intrusive_ptr< DBTableWalk > DBTableWalkRef
void VDnsAddChange(IFMapNode *node)
bool GetIpam(const std::string &name, autogen::IpamType *ipam)
boost::function< void(IFMapNode *)> Callback
void CallIpamCb(IFMapNode *node)
VdnsDomainConfigMap vdns_config_
std::pair< std::string, autogen::IpamType > IpamDomainConfigPair
void RegisterIpamCb(Callback cb)
bool GetVDns(const std::string &vdns, autogen::VirtualDnsType *vdns_type)
void VDnsDelete(IFMapNode *node)
void CallVdnsCb(IFMapNode *node)
std::pair< std::string, autogen::VirtualDnsType > VdnsDomainConfigPair
void IpamAddChange(IFMapNode *node)
void RegisterVdnsCb(Callback cb)
std::vector< Callback > vdns_callback_
IpamDomainConfigMap ipam_config_
void IpamDelete(IFMapNode *node)
std::vector< Callback > ipam_callback_
bool IpamChanged(const autogen::IpamType &old, const autogen::IpamType &cur) const
Agent::ForwardingMode forwarding_mode() const
const DBGraph * GetGraph() const
void PropogateNodeChange(IFMapNode *node)
const std::string & name() const
IFMapObject * GetObject()
virtual const char * Typename() const =0
void GlobalVrouterConfigChanged()
const boost::uuids::uuid GetMirrorUuid(const std::string &vn_name) const
GlobalVrouter * global_vrouter() const
AgentRouteWalkerManager * agent_route_walk_manager() const
IFMapDependencyManager * dependency_manager()
void set_options(const DhcpOptionsList &options)
void set_host_routes(const HostOptionsList &host_routes)
DomainConfig * domain_config_
void ConfigDelete(IFMapNode *node)
void ConfigAddChange(IFMapNode *node)
OperNetworkIpam(Agent *agent, DomainConfig *domain_config)
void ConfigManagerEnqueue(IFMapNode *node)
virtual ~OperNetworkIpam()
void ConfigManagerEnqueue(IFMapNode *node)
void ConfigAddChange(IFMapNode *node)
DomainConfig * domain_config_
virtual ~OperVirtualDns()
OperVirtualDns(Agent *agent, DomainConfig *domain_config)
void ConfigDelete(IFMapNode *node)
VnData::VnIpamDataMap vn_ipam_data_
bool AddIpamRoutes(Agent *agent, VnIpam *ipam)
bool GetIpamVdnsData(const IpAddress &vm_addr, autogen::IpamType *ipam_type, autogen::VirtualDnsType *vdns_type) const
bool flood_unknown_unicast_
bool ApplyIpam(Agent *agent, VnIpam *ipam, VrfEntry *old_vrf, bool del)
const AgentQosConfig * qos_config() const
bool layer2_control_word_
bool pbb_etree_enable() const
const UuidList & mp_list() const
AclDBEntryRef mirror_cfg_acl_
bool ApplyAllIpam(Agent *agent, VrfEntry *old_vrf, bool del)
bool ChangeHandler(Agent *agent, const DBRequest *req)
void AddHostRoute(const IpAddress &address, bool policy)
void SendObjectLog(SandeshTraceBufferPtr ptr, AgentLogEvent::type event) const
const boost::uuids::uuid & GetUuid() const
void UpdateHostRoute(Agent *agent, const IpAddress &old_address, const IpAddress &new_address, bool policy)
VnEntry(Agent *agent, boost::uuids::uuid id)
boost::uuids::uuid health_check_uuid_
bool UpdateVxlan(Agent *agent, bool op_del)
uint32_t vn_max_flows() const
IpAddress GetGatewayFromIpam(const IpAddress &ip) const
bool underlay_forwarding_
bool Resync(Agent *agent)
IpAddress GetDnsFromIpam(const IpAddress &ip) const
bool layer2_control_word() const
AgentRouteWalkerPtr route_resync_walker_
const std::vector< VnIpam > & GetVnIpam() const
VrfEntry * GetVrf() const
const boost::uuids::uuid & health_check_uuid() const
std::vector< VnIpam > ipam_
AclDBEntryRef mirror_acl_
const string & GetName() const
const AclDBEntry * GetAcl() const
bool UpdateIpam(Agent *agent, std::vector< VnIpam > &new_ipam)
bool GetVnHostRoutes(const std::string &ipam, std::vector< OperDhcpOptions::HostRoute > *routes) const
bool GetIpamData(const IpAddress &vm_addr, std::string *ipam_name, autogen::IpamType *ipam_type) const
bool mac_ip_learning_enable() const
virtual void SetKey(const DBRequestKey *key)
bool CanInstallIpam(const VnIpam *ipam)
const AclDBEntry * GetMirrorAcl() const
virtual string ToString() const
void DelHostRoute(const IpAddress &address)
bool layer3_forwarding() const
AgentQosConfigConstRef qos_config_
bool mac_ip_learning_enable_
const VnIpam * GetIpam(const IpAddress &ip) const
bool GetPrefix(const Ip6Address &ip, Ip6Address *prefix, uint8_t *plen) const
bool cfg_igmp_enable() const
virtual bool IsLess(const DBEntry &rhs) const
std::string GetProject() const
bool GetIpamName(const IpAddress &vm_addr, std::string *ipam_name) const
void DelIpamRoutes(Agent *agent, VnIpam *ipam, VrfEntry *vrf)
const AclDBEntry * GetMirrorCfgAcl() const
virtual KeyPtr GetDBRequestKey() const
Agent::ForwardingMode forwarding_mode() const
boost::uuids::uuid logical_router_uuid_
bool DBEntrySandesh(Sandesh *sresp, std::string &name) const
const UuidList & slo_list() const
const boost::uuids::uuid & logical_router_uuid() const
Agent::ForwardingMode forwarding_mode_
void AddSubnetRoute(VnIpam *ipam)
uint32_t GetAllocUnitFromIpam(const IpAddress &ip) const
bool vxlan_routing_vn() const
bool flood_unknown_unicast() const
void DelSubnetRoute(VnIpam *ipam)
bool UpdateForwardingMode(Agent *agent)
bool HandleIpamChange(Agent *agent, VnIpam *old_ipam, VnIpam *new_ipam)
int GetOperVxlanId() const
Returns a value of the VxLAN ID stored in the Oper DB.
void GlobalVrouterConfigChanged()
void DelVn(const boost::uuids::uuid &vn_uuid)
virtual bool OperDBResync(DBEntry *entry, const DBRequest *req)
VnEntry * Find(const boost::uuids::uuid &vn_uuid)
virtual AgentSandeshPtr GetAgentSandesh(const AgentSandeshArguments *args, const std::string &context)
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)
void BuildVnIpamData(const std::vector< autogen::IpamSubnetType > &subnets, const std::string &ipam_name, std::vector< VnIpam > *vn_ipam)
virtual DBEntry * OperDBAdd(const DBRequest *req)
void CfgForwardingFlags(IFMapNode *node, bool *rpf, bool *flood_unknown_unicast, Agent::ForwardingMode *forwarding_mode, bool *mirror_destination)
static DBTableBase * CreateTable(DB *db, const std::string &name)
IFMapNode * FindTarget(IFMapAgentTable *table, IFMapNode *node, std::string node_type)
bool VnEntryWalk(DBTablePartBase *partition, DBEntryBase *entry)
void VnEntryWalkDone(DBTable::DBTableWalkRef walk_ref, DBTableBase *partition)
void ResyncReq(const boost::uuids::uuid &vn)
virtual bool OperDBDelete(DBEntry *entry, const DBRequest *req)
virtual bool IFNodeToReq(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
DBTable::DBTableWalkRef walk_ref_
virtual bool OperDBOnChange(DBEntry *entry, const DBRequest *req)
VnTable(DB *db, const std::string &name)
virtual bool IFNodeToUuid(IFMapNode *node, boost::uuids::uuid &u)
VnData * BuildData(IFMapNode *node)
int GetCfgVnId(autogen::VirtualNetwork *cfg_vn)
virtual std::unique_ptr< DBEntry > AllocEntry(const DBRequestKey *k) const
virtual bool ProcessConfig(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
static VnTable * vn_table_
const string & GetName() const
virtual bool Delete(DBEntry *entry, const DBRequest *req)
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)
boost::shared_ptr< TraceBuffer< SandeshTrace > > SandeshTraceBufferPtr
static std::string UuidToString(const boost::uuids::uuid &id)
IFMapNode * ifmap_node() const
std::unique_ptr< DBRequestKey > key
std::unique_ptr< DBRequestData > data
bool flood_unknown_unicast_
std::map< std::string, VnIpamLinkData > VnIpamDataMap
std::vector< VnIpam > ipam_
std::pair< std::string, VnIpamLinkData > VnIpamDataPair
boost::uuids::uuid logical_router_uuid_
bool underlay_forwarding_
boost::uuids::uuid health_check_uuid_
bool layer2_control_word_
Agent::ForwardingMode forwarding_mode_
boost::uuids::uuid mirror_acl_id_
boost::uuids::uuid qos_config_uuid_
bool mac_ip_learning_enable_
boost::uuids::uuid mirror_cfg_acl_id_
boost::uuids::uuid acl_id_
VnIpamDataMap vn_ipam_data_
OperDhcpOptions oper_dhcp_options_
bool IsSubnetMember(const IpAddress &ip) const
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)
IpAddress GetSubnetAddress() const
OperDhcpOptions oper_dhcp_options
static bool IsGwHostRouteRequired(const Agent *agent)
bool IsVRFServiceChainingInstance(const string &vn_name, const string &vrf_name)