Line data Source code
1 : /* 2 : * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. 3 : */ 4 : 5 : #ifndef vnsw_agent_hpp 6 : #define vnsw_agent_hpp 7 : 8 : #include <vector> 9 : #include <stdint.h> 10 : #include <string> 11 : #include <net/ethernet.h> 12 : #include <boost/intrusive_ptr.hpp> 13 : #include <base/intrusive_ptr_back_ref.h> 14 : #include <cmn/agent_cmn.h> 15 : #include <base/connection_info.h> 16 : #include "net/mac_address.h" 17 : #include "oper/agent_types.h" 18 : 19 : class Agent; 20 : class AgentParam; 21 : class AgentConfig; 22 : class AgentStats; 23 : class KSync; 24 : class AgentUveBase; 25 : class PktModule; 26 : class VirtualGateway; 27 : class ServicesModule; 28 : class MulticastHandler; 29 : class AgentDBEntry; 30 : class XmppClient; 31 : class OperDB; 32 : class AgentRoute; 33 : class TaskScheduler; 34 : class AgentInit; 35 : class AgentStatsCollector; 36 : class FlowStatsCollector; 37 : class SessionStatsCollector; 38 : class FlowStatsManager; 39 : class MetaDataIpAllocator; 40 : class ResourceManager; 41 : class SecurityLoggingObjectTable; 42 : struct PortConfig; 43 : namespace OVSDB { 44 : class OvsdbClient; 45 : }; 46 : class ConfigManager; 47 : class EventNotifier; 48 : 49 : class Interface; 50 : typedef boost::intrusive_ptr<Interface> InterfaceRef; 51 : typedef boost::intrusive_ptr<const Interface> InterfaceConstRef; 52 : void intrusive_ptr_release(const Interface* p); 53 : void intrusive_ptr_add_ref(const Interface* p); 54 : typedef IntrusivePtrRef<Interface> InterfaceBackRef; 55 : void intrusive_ptr_add_back_ref(const IntrusiveReferrer ref, const Interface* p); 56 : void intrusive_ptr_del_back_ref(const IntrusiveReferrer ref, const Interface* p); 57 : 58 : class VmEntry; 59 : typedef boost::intrusive_ptr<VmEntry> VmEntryRef; 60 : typedef boost::intrusive_ptr<const VmEntry> VmEntryConstRef; 61 : void intrusive_ptr_release(const VmEntry* p); 62 : void intrusive_ptr_add_ref(const VmEntry* p); 63 : typedef IntrusivePtrRef<VmEntry> VmEntryBackRef; 64 : typedef IntrusivePtrRef<const VmEntry> VmEntryConstBackRef; 65 : void intrusive_ptr_add_back_ref(const IntrusiveReferrer ref, const VmEntry* p); 66 : void intrusive_ptr_del_back_ref(const IntrusiveReferrer ref, const VmEntry* p); 67 : 68 : class VnEntry; 69 : typedef boost::intrusive_ptr<VnEntry> VnEntryRef; 70 : typedef boost::intrusive_ptr<const VnEntry> VnEntryConstRef; 71 : void intrusive_ptr_release(const VnEntry* p); 72 : void intrusive_ptr_add_ref(const VnEntry* p); 73 : 74 : class SgEntry; 75 : typedef boost::intrusive_ptr<SgEntry> SgEntryRef; 76 : typedef boost::intrusive_ptr<const SgEntry> SgEntryConstRef; 77 : void intrusive_ptr_release(const SgEntry* p); 78 : void intrusive_ptr_add_ref(const SgEntry* p); 79 : 80 : class TagEntry; 81 : typedef boost::intrusive_ptr<TagEntry> TagEntryRef; 82 : typedef boost::intrusive_ptr<const TagEntry> TagEntryConstRef; 83 : void intrusive_ptr_release(const TagEntry* p); 84 : void intrusive_ptr_add_ref(const TagEntry* p); 85 : 86 : class VrfEntry; 87 : typedef IntrusivePtrRef<VrfEntry> VrfEntryRef; 88 : typedef IntrusivePtrRef<const VrfEntry> VrfEntryConstRef; 89 : void intrusive_ptr_add_back_ref(const IntrusiveReferrer ref, const VrfEntry* p); 90 : void intrusive_ptr_del_back_ref(const IntrusiveReferrer ref, const VrfEntry* p); 91 : void intrusive_ptr_release(const VrfEntry* p); 92 : void intrusive_ptr_add_ref(const VrfEntry* p); 93 : 94 : class MplsLabel; 95 : typedef boost::intrusive_ptr<MplsLabel> MplsLabelRef; 96 : void intrusive_ptr_release(const MplsLabel* p); 97 : void intrusive_ptr_add_ref(const MplsLabel* p); 98 : 99 : class MirrorEntry; 100 : typedef boost::intrusive_ptr<MirrorEntry> MirrorEntryRef; 101 : void intrusive_ptr_release(const MirrorEntry* p); 102 : void intrusive_ptr_add_ref(const MirrorEntry* p); 103 : 104 : class VxLanId; 105 : typedef boost::intrusive_ptr<VxLanId> VxLanIdRef; 106 : void intrusive_ptr_release(const VxLanId* p); 107 : void intrusive_ptr_add_ref(const VxLanId* p); 108 : 109 : class MulticastPolicyEntry; 110 : typedef boost::intrusive_ptr<MulticastPolicyEntry> MulticastPolicyEntryRef; 111 : typedef boost::intrusive_ptr<const MulticastPolicyEntry> MulticastPolicyEntryConstRef; 112 : void intrusive_ptr_release(const MulticastPolicyEntry* p); 113 : void intrusive_ptr_add_ref(const MulticastPolicyEntry* p); 114 : 115 : class InetUnicastRouteEntry; 116 : class Inet4MulticastRouteEntry; 117 : class EvpnRouteEntry; 118 : class BridgeRouteEntry; 119 : class Route; 120 : typedef boost::intrusive_ptr<Route> RouteRef; 121 : void intrusive_ptr_release(const Route* p); 122 : void intrusive_ptr_add_ref(const Route* p); 123 : 124 : class NextHop; 125 : typedef boost::intrusive_ptr<NextHop> NextHopRef; 126 : typedef boost::intrusive_ptr<const NextHop> NextHopConstRef; 127 : void intrusive_ptr_release(const NextHop* p); 128 : void intrusive_ptr_add_ref(const NextHop* p); 129 : 130 : class CryptTunnelEntry; 131 : typedef boost::intrusive_ptr<CryptTunnelEntry> CryptTunnelEntryRef; 132 : typedef boost::intrusive_ptr<const CryptTunnelEntry> CryptTunnelEntryConstRef; 133 : void intrusive_ptr_release(const CryptTunnelEntry* p); 134 : void intrusive_ptr_add_ref(const CryptTunnelEntry* p); 135 : 136 : class AddrBase; 137 : typedef boost::intrusive_ptr<AddrBase> AddrRef; 138 : void intrusive_ptr_release(const AddrBase* p); 139 : void intrusive_ptr_add_ref(const AddrBase* p); 140 : 141 : class AclDBEntry; 142 : typedef boost::intrusive_ptr<AclDBEntry> AclDBEntryRef; 143 : typedef boost::intrusive_ptr<const AclDBEntry> AclDBEntryConstRef; 144 : void intrusive_ptr_release(const AclDBEntry* p); 145 : void intrusive_ptr_add_ref(const AclDBEntry* p); 146 : 147 : class PolicySet; 148 : typedef boost::intrusive_ptr<PolicySet> PolicySetRef; 149 : typedef boost::intrusive_ptr<const AclDBEntry> PolicySetConstRef; 150 : void intrusive_ptr_release(const PolicySet* p); 151 : void intrusive_ptr_add_ref(const PolicySet* p); 152 : 153 : class PhysicalDevice; 154 : typedef boost::intrusive_ptr<PhysicalDevice> PhysicalDeviceRef; 155 : typedef boost::intrusive_ptr<const PhysicalDevice> PhysicalDeviceConstRef; 156 : void intrusive_ptr_release(const PhysicalDevice *p); 157 : void intrusive_ptr_add_ref(const PhysicalDevice *p); 158 : 159 : class PhysicalDeviceVn; 160 : typedef boost::intrusive_ptr<PhysicalDeviceVn> PhysicalDeviceVnRef; 161 : typedef boost::intrusive_ptr<const PhysicalDeviceVn> PhysicalDeviceVnConstRef; 162 : void intrusive_ptr_release(const PhysicalDeviceVn *p); 163 : void intrusive_ptr_add_ref(const PhysicalDeviceVn *p); 164 : 165 : class HealthCheckService; 166 : typedef boost::intrusive_ptr<HealthCheckService> HealthCheckServiceRef; 167 : void intrusive_ptr_release(const HealthCheckService* p); 168 : void intrusive_ptr_add_ref(const HealthCheckService* p); 169 : 170 : class ForwardingClass; 171 : typedef boost::intrusive_ptr<ForwardingClass> ForwardingClassRef; 172 : typedef boost::intrusive_ptr<const ForwardingClass> ForwardingClassConstRef; 173 : void intrusive_ptr_release(const ForwardingClass *p); 174 : void intrusive_ptr_add_ref(const ForwardingClass *p); 175 : 176 : class AgentQosConfig; 177 : typedef boost::intrusive_ptr<AgentQosConfig> AgentQosConfigRef; 178 : typedef boost::intrusive_ptr<const AgentQosConfig> AgentQosConfigConstRef; 179 : void intrusive_ptr_release(const AgentQosConfig *p); 180 : void intrusive_ptr_add_ref(const AgentQosConfig *p); 181 : 182 : class QosQueue; 183 : typedef boost::intrusive_ptr<QosQueue> QosQueueRef; 184 : typedef boost::intrusive_ptr<const QosQueue> QosQueueConstRef; 185 : void intrusive_ptr_release(const QosQueueRef *p); 186 : void intrusive_ptr_add_ref(const QosQueueRef *p); 187 : 188 : class BridgeDomainEntry; 189 : typedef boost::intrusive_ptr<BridgeDomainEntry> BridgeDomainRef; 190 : typedef boost::intrusive_ptr<const BridgeDomainEntry> BridgeDomainConstRef; 191 : void intrusive_ptr_release(const BridgeDomainEntry *p); 192 : void intrusive_ptr_add_ref(const BridgeDomainEntry *p); 193 : 194 : class SecurityLoggingObject; 195 : typedef boost::intrusive_ptr<SecurityLoggingObject> SecurityLoggingObjectRef; 196 : typedef boost::intrusive_ptr<const SecurityLoggingObject> SecurityLoggingObjectConstRef; 197 : void intrusive_ptr_release(const SecurityLoggingObject *p); 198 : void intrusive_ptr_add_ref(const SecurityLoggingObject *p); 199 : 200 : //class SecurityGroup; 201 : typedef std::vector<int> SecurityGroupList; 202 : typedef std::vector<uint64_t> TagList; 203 : typedef std::vector<boost::uuids::uuid> UuidList; 204 : typedef std::vector<std::string> CommunityList; 205 : 206 : class MulticastPolicyEntry; 207 : typedef boost::intrusive_ptr<MulticastPolicyEntry> MulticastPolicyEntryRef; 208 : typedef boost::intrusive_ptr<const MulticastPolicyEntry> MulticastPolicyEntryConstRef; 209 : void intrusive_ptr_release(const MulticastPolicyEntry* p); 210 : void intrusive_ptr_add_ref(const MulticastPolicyEntry* p); 211 : 212 : typedef std::set<std::string> VnListType; 213 : 214 : typedef std::map<std::string, std::string> VrLimitExceeded; 215 : typedef std::pair<std::string, std::string> VrLimitData; 216 : 217 : typedef std::vector<Ip4Address> AddressList; 218 : typedef std::vector<Interface *> InterfaceList; 219 : typedef std::vector<std::string> InterfaceNameList; 220 : 221 : class AgentDBTable; 222 : class InterfaceTable; 223 : class HealthCheckTable; 224 : class NextHopTable; 225 : class CryptTunnelTable; 226 : class VmTable; 227 : class VnTable; 228 : class SgTable; 229 : class TagTable; 230 : class VrfTable; 231 : class MplsTable; 232 : class RouteTable; 233 : class AgentRouteTable; 234 : class InetUnicastAgentRouteTable; 235 : class Inet4MulticastAgentRouteTable; 236 : class EvpnAgentRouteTable; 237 : class BridgeAgentRouteTable; 238 : class AclTable; 239 : class PolicySetTable; 240 : class MirrorTable; 241 : class VrfAssignTable; 242 : class DomainConfig; 243 : class VxLanTable; 244 : class MulticastGroupObject; 245 : class PhysicalDeviceTable; 246 : class PhysicalDeviceVnTable; 247 : class ForwardingClassTable; 248 : class AgentQosConfigTable; 249 : class QosQueueTable; 250 : class MirrorCfgTable; 251 : class IntfMirrorCfgTable; 252 : class BridgeDomainTable; 253 : class MulticastPolicyTable; 254 : 255 : class XmppInit; 256 : class AgentXmppChannel; 257 : class AgentIfMapXmppChannel; 258 : class AgentDnsXmppChannel; 259 : class EventManager; 260 : class TaskTbbKeepAwake; 261 : class IFMapAgentStaleCleaner; 262 : 263 : class ArpProto; 264 : class DhcpProto; 265 : class Dhcpv6Proto; 266 : class DnsProto; 267 : class BfdProto; 268 : class IcmpProto; 269 : class Icmpv6Proto; 270 : class FlowProto; 271 : class IgmpProto; 272 : 273 : class Peer; 274 : class LifetimeManager; 275 : class DiagTable; 276 : class VNController; 277 : class AgentSignal; 278 : class ServiceInstanceTable; 279 : class Agent; 280 : class RestServer; 281 : class PortIpcHandler; 282 : class MacLearningProto; 283 : class MacLearningModule; 284 : 285 : extern void RouterIdDepInit(Agent *agent); 286 : 287 : #define MULTICAST_LABEL_RANGE_START 1024 288 : #define MULTICAST_LABEL_BLOCK_SIZE 2048 289 : 290 : #define MIN_UNICAST_LABEL_RANGE 4098 291 : #define MAX_XMPP_SERVERS 2 292 : #define XMPP_SERVER_PORT 5269 293 : #define XMPP_DNS_SERVER_PORT 53 294 : #define METADATA_IP_ADDR ntohl(inet_addr("169.254.169.254")) 295 : #define METADATA_PORT 8775 296 : #define METADATA_NAT_PORT 80 297 : #define AGENT_INIT_TASKNAME "Agent::Init" 298 : #define INSTANCE_MANAGER_TASK_NAME "Agent::InstanceManager" 299 : #define AGENT_SHUTDOWN_TASKNAME "Agent::Shutdown" 300 : #define AGENT_FLOW_STATS_MANAGER_TASK "Agent::FlowStatsManager" 301 : #define AGENT_SANDESH_TASKNAME "Agent::Sandesh" 302 : #define IPV4_MULTICAST_BASE_ADDRESS "224.0.0.0" 303 : #define IPV6_MULTICAST_BASE_ADDRESS "ff00::" 304 : #define MULTICAST_BASE_ADDRESS_PLEN 8 305 : 306 : #define FLOWS_LIMIT_UNLIMITED uint32_t(0) 307 : 308 : #define VROUTER_SERVER_PORT 20914 309 : 310 : #define kLogFilesCount 10 311 : #define kLogFileSize (2*1024*1024) 312 : /**************************************************************************** 313 : * Definitions related to config/resource backup/restore 314 : ****************************************************************************/ 315 : #define CFG_BACKUP_DIR "/var/lib/contrail/backup" 316 : #define CFG_BACKUP_COUNT 2 317 : #define CFG_BACKUP_IDLE_TIMEOUT (10*1000) 318 : #define CFG_RESTORE_AUDIT_TIMEOUT (15*1000) 319 : 320 : /**************************************************************************** 321 : * Task names 322 : ****************************************************************************/ 323 : #define kTaskFlowEvent "Agent::FlowEvent" 324 : #define kTaskFlowKSync "Agent::FlowKSync" 325 : #define kTaskFlowUpdate "Agent::FlowUpdate" 326 : #define kTaskFlowDelete "Agent::FlowDelete" 327 : #define kTaskFlowMgmt "Agent::FlowMgmt" 328 : #define kTaskFlowAudit "KSync::FlowAudit" 329 : #define kTaskFlowLogging "Agent::FlowLogging" 330 : #define kTaskFlowStatsCollector "Flow::StatsCollector" 331 : #define kTaskSessionStatsCollector "Flow::SessionStatsCollector" 332 : #define kTaskSessionStatsCollectorEvent "Flow::SessionStatsCollectorEvent" 333 : #define kTaskFlowStatsUpdate "Agent::FlowStatsUpdate" 334 : 335 : #define kTaskHealthCheck "Agent::HealthCheck" 336 : #define kTaskCryptTunnel "Agent::CryptTunnel" 337 : 338 : #define kTaskDBExclude "Agent::DBExcludeTask" 339 : #define kTaskConfigManager "Agent::ConfigManager" 340 : #define kTaskHttpRequstHandler "http::RequestHandlerTask" 341 : #define kAgentResourceRestoreTask "Agent::ResoureRestore" 342 : #define kAgentResourceBackUpTask "Agent::ResourceBackup" 343 : #define kTaskMacLearning "Agent::MacLearning" 344 : #define kTaskMacLearningMgmt "Agent::MacLearningMgmt" 345 : #define kTaskMacAging "Agent::MacAging" 346 : 347 : #define kInterfaceDbTablePrefix "db.interface" 348 : #define kVnDbTablePrefix "db.vn" 349 : #define kVmDbTablePrefix "db.vm" 350 : #define kVrfDbTablePrefix "db.vrf.0" 351 : #define kMplsDbTablePrefix "db.mpls" 352 : #define kAclDbTablePrefix "db.acl" 353 : #define kV4UnicastRouteDbTableSuffix "uc.route.0" 354 : #define kV6UnicastRouteDbTableSuffix "uc.route6.0" 355 : #define kL2RouteDbTableSuffix "l2.route.0" 356 : #define kMcastRouteDbTableSuffix "mc.route.0" 357 : #define kEvpnRouteDbTableSuffix "evpn.route.0" 358 : #define kEventNotifierTask "Agent::EventNotifier" 359 : 360 : class Agent { 361 : public: 362 : static const uint32_t kDefaultMaxLinkLocalOpenFds = 16384; 363 : // max open files in the agent, excluding the linklocal bind ports 364 : static const uint32_t kMaxOtherOpenFds = 512; 365 : // max BGP-as-a-server sessions, for which local ports are reserved 366 : static const uint32_t kMaxBgpAsAServerSessions = 512; 367 : // default timeout zero means, this timeout is not used 368 : static const uint32_t kDefaultFlowCacheTimeout = 0; 369 : // default number of flow index-manager events logged per flow 370 : static const uint32_t kDefaultFlowIndexSmLogCount = 0; 371 : // default number of threads for flow setup 372 : static const uint32_t kDefaultFlowThreadCount = 1; 373 : // Log a message if latency in processing flow queue exceeds limit 374 : static const uint32_t kDefaultFlowLatencyLimit = 0; 375 : // Max number of threads 376 : static const uint32_t kMaxTbbThreads = 8; 377 : static const uint32_t kDefaultTbbKeepawakeTimeout = (20000); //time-millisecs 378 : static const uint32_t kDefaultTaskMonitorTimeout = (20000); //time-millisecs 379 : // Default number of tx-buffers on pkt0 interface 380 : static const uint32_t kPkt0TxBufferCount = 1000; 381 : // Default value for cleanup of stale interface entries 382 : static const uint32_t kDefaultStaleInterfaceCleanupTimeout = 60; 383 : 384 : static const uint16_t kDefaultVmiVmVnUveInterval; 385 : static const uint32_t kFlowAddTokens = 50; 386 : static const uint32_t kFlowKSyncTokens = 25; 387 : static const uint32_t kFlowDelTokens = 16; 388 : static const uint32_t kFlowUpdateTokens = 16; 389 : static const uint32_t kMacLearningDefaultTokens = 256; 390 : static const uint8_t kMinAapPrefixLen = 24; 391 : static const uint8_t kInvalidQueueId = 255; 392 : static const int kInvalidCpuId = -1; 393 : static const uint8_t kMaxSessionEndpoints = 5; 394 : static const uint8_t kMaxSessionAggs = 8; 395 : static const uint8_t kMaxSessions = 100; 396 : static const uint16_t kFabricSnatTableSize = 4096; 397 : // kDropNewFlowsRecoveryThreshold is set to 90% of the Max flows for a 398 : // VM this value represents that recovery from the drop new flows will 399 : // happen only when total number of flow fall below this value 400 : static const int kDropNewFlowsRecoveryThreshold = 90; 401 : static const int kDefaultHighWatermark = 80; 402 : static const int kDefaultLowWatermark = 75; 403 : typedef std::vector<Ip4Address> AddressList; 404 : 405 : enum ForwardingMode { 406 : NONE, 407 : L2_L3, 408 : L2, 409 : L3 410 : }; 411 : 412 : enum VxLanNetworkIdentifierMode { 413 : AUTOMATIC, 414 : CONFIGURED 415 : }; 416 : 417 : enum RouteTableType { 418 : INVALID = 0, 419 : INET4_UNICAST, 420 : INET4_MULTICAST, 421 : EVPN, 422 : BRIDGE, 423 : INET6_UNICAST, 424 : INET4_MPLS, 425 : ROUTE_TABLE_MAX 426 : }; 427 : static const uint8_t ROUTE_TABLE_START = (Agent::INVALID + 1); 428 : 429 : typedef void (*FlowStatsReqHandler)(Agent *agent, 430 : uint32_t proto, uint32_t port, 431 : uint64_t timeout); 432 : 433 : typedef void (*PortConfigHandler)(Agent *agent, 434 : uint8_t proto, const PortConfig *); 435 : Agent(); 436 : virtual ~Agent(); 437 : 438 6110 : static Agent *GetInstance() {return singleton_;} 439 1521 : static const std::string &NullString() {return null_string_;} 440 2 : static const std::set<std::string> &NullStringList() {return null_string_list_;} 441 439 : static const MacAddress &vrrp_mac() {return vrrp_mac_;} 442 129 : static const MacAddress &pkt_interface_mac() {return pkt_interface_mac_;} 443 0 : static const std::string &BcastMac() {return bcast_mac_;} 444 48 : static const MacAddress &left_si_mac() {return left_si_mac_;} 445 48 : static const MacAddress &right_si_mac() {return right_si_mac_;} 446 4 : static const std::string &xmpp_dns_server_prefix() { 447 4 : return xmpp_dns_server_connection_name_prefix_; 448 : } 449 174 : static const std::string &xmpp_control_node_prefix() { 450 174 : return xmpp_control_node_connection_name_prefix_; 451 : } 452 : 453 0 : const std::string &program_name() const {return prog_name_;} 454 : const std::string &config_file() const {return config_file_;} 455 28 : const std::string &log_file() const {return log_file_;} 456 98 : const std::string &v4_link_local_subnet() const { 457 98 : return v4_link_local_subnet_; 458 : } 459 95 : const std::string &v6_link_local_subnet() const { 460 95 : return v6_link_local_subnet_; 461 : } 462 101 : const uint16_t v4_link_local_plen() const { return v4_link_local_plen_; } 463 95 : const uint16_t v6_link_local_plen() const { return v6_link_local_plen_; } 464 : 465 : // DB Table accessor methods 466 : IpAddress GetMirrorSourceIp(const IpAddress &dest); 467 2666 : InterfaceTable *interface_table() const {return intf_table_;} 468 2 : void set_interface_table(InterfaceTable *table) { 469 2 : intf_table_ = table; 470 2 : } 471 : 472 116 : MirrorCfgTable *mirror_cfg_table() const {return mirror_cfg_table_;} 473 2 : void set_mirror_cfg_table(MirrorCfgTable *table) { 474 2 : mirror_cfg_table_ = table; 475 2 : } 476 : 477 2410 : NextHopTable *nexthop_table() const {return nh_table_;} 478 2 : void set_nexthop_table(NextHopTable *table) { 479 2 : nh_table_ = table; 480 2 : } 481 : 482 11 : CryptTunnelTable *crypt_tunnel_table() const {return crypt_tunnel_table_;} 483 2 : void set_crypt_tunnel_table(CryptTunnelTable *table) { 484 2 : crypt_tunnel_table_ = table; 485 2 : } 486 : 487 12669 : VrfTable *vrf_table() const { return vrf_table_;} 488 2 : void set_vrf_table(VrfTable *table) { 489 2 : vrf_table_ = table; 490 2 : } 491 : 492 134 : VmTable *vm_table() const { return vm_table_;} 493 2 : void set_vm_table(VmTable *table) { 494 2 : vm_table_ = table; 495 2 : } 496 : 497 543 : VnTable *vn_table() const { return vn_table_;} 498 2 : void set_vn_table(VnTable *table) { 499 2 : vn_table_ = table; 500 2 : } 501 : 502 27 : SgTable *sg_table() const { return sg_table_;} 503 2 : void set_sg_table(SgTable *table) { 504 2 : sg_table_ = table; 505 2 : } 506 : 507 4 : TagTable *tag_table() const { return tag_table_;} 508 2 : void set_tag_table(TagTable *table) { 509 2 : tag_table_ = table; 510 2 : } 511 : 512 1128 : MplsTable *mpls_table() const { return mpls_table_;} 513 2 : void set_mpls_table(MplsTable *table) { 514 2 : mpls_table_ = table; 515 2 : } 516 : 517 394 : AclTable *acl_table() const { return acl_table_;} 518 2 : void set_acl_table(AclTable *table) { 519 2 : acl_table_ = table; 520 2 : } 521 : 522 118 : PolicySetTable* policy_set_table() const { return policy_set_table_;} 523 2 : void set_policy_set_table(PolicySetTable *table) { 524 2 : policy_set_table_ = table; 525 2 : } 526 : 527 122 : MirrorTable *mirror_table() const { return mirror_table_;} 528 2 : void set_mirror_table(MirrorTable *table) { 529 2 : mirror_table_ = table; 530 2 : } 531 : 532 2 : VrfAssignTable *vrf_assign_table() const {return vrf_assign_table_;} 533 2 : void set_vrf_assign_table(VrfAssignTable *table) { 534 2 : vrf_assign_table_ = table; 535 2 : } 536 : 537 52 : VxLanTable *vxlan_table() const { return vxlan_table_;} 538 2 : void set_vxlan_table(VxLanTable *table) { 539 2 : vxlan_table_ = table; 540 2 : } 541 : 542 4 : ForwardingClassTable *forwarding_class_table() const { 543 4 : return forwarding_class_table_; 544 : } 545 2 : void set_forwarding_class_table(ForwardingClassTable *table) { 546 2 : forwarding_class_table_ = table; 547 2 : } 548 : 549 8 : SecurityLoggingObjectTable *slo_table() const { 550 8 : return slo_table_; 551 : } 552 2 : void set_slo_table(SecurityLoggingObjectTable *table) { 553 2 : slo_table_ = table; 554 2 : } 555 : 556 234 : AgentQosConfigTable *qos_config_table() const { 557 234 : return qos_config_table_; 558 : } 559 : 560 2 : void set_qos_config_table(AgentQosConfigTable *qos_config_table) { 561 2 : qos_config_table_ = qos_config_table; 562 2 : } 563 : 564 4 : QosQueueTable *qos_queue_table() const { 565 4 : return qos_queue_table_; 566 : } 567 2 : void set_qos_queue_table(QosQueueTable *table) { 568 2 : qos_queue_table_ = table; 569 2 : } 570 : 571 : DomainConfig *domain_config_table() const; 572 : 573 0 : IntfMirrorCfgTable *interface_mirror_cfg_table() const { 574 0 : return intf_mirror_cfg_table_; 575 : } 576 2 : void set_interface_mirror_cfg_table(IntfMirrorCfgTable *table) { 577 2 : intf_mirror_cfg_table_ = table; 578 2 : } 579 : 580 1639 : InetUnicastAgentRouteTable *fabric_inet4_unicast_table() const { 581 1639 : return uc_rt_table_; 582 : } 583 2 : void set_fabric_inet4_unicast_table(InetUnicastAgentRouteTable * 584 : table) { 585 2 : uc_rt_table_ = table; 586 2 : } 587 : void set_fabric_inet4_unicast_table(RouteTable * table) { 588 : uc_rt_table_ = (InetUnicastAgentRouteTable *)table; 589 : } 590 : 591 2 : InetUnicastAgentRouteTable *fabric_inet4_mpls_table() const { 592 2 : return mpls_rt_table_; 593 : } 594 2 : void set_fabric_inet4_mpls_table(InetUnicastAgentRouteTable * 595 : table) { 596 2 : mpls_rt_table_ = table; 597 2 : } 598 : void set_fabric_inet4_mpls_table(RouteTable * table) { 599 : mpls_rt_table_ = (InetUnicastAgentRouteTable *)table; 600 : } 601 : 602 0 : Inet4MulticastAgentRouteTable *fabric_inet4_multicast_table() const { 603 0 : return mc_rt_table_; 604 : } 605 : void set_fabric_inet4_multicast_table 606 : (Inet4MulticastAgentRouteTable *table) { 607 : mc_rt_table_ = table; 608 : } 609 2 : void set_fabric_inet4_multicast_table(RouteTable *table) { 610 2 : mc_rt_table_ = (Inet4MulticastAgentRouteTable *)table; 611 2 : } 612 : 613 19 : EvpnAgentRouteTable *fabric_evpn_table() const { 614 19 : return evpn_rt_table_; 615 : } 616 2 : void set_fabric_evpn_table(RouteTable *table) { 617 2 : evpn_rt_table_ = (EvpnAgentRouteTable *)table; 618 2 : } 619 : 620 151 : BridgeAgentRouteTable *fabric_l2_unicast_table() const { 621 151 : return l2_rt_table_; 622 : } 623 : void set_fabric_l2_unicast_table(BridgeAgentRouteTable *table) { 624 : l2_rt_table_ = table; 625 : } 626 2 : void set_fabric_l2_unicast_table(RouteTable *table) { 627 2 : l2_rt_table_ = (BridgeAgentRouteTable *)table; 628 2 : } 629 : 630 32 : PhysicalDeviceTable *physical_device_table() const { 631 32 : return physical_device_table_; 632 : } 633 2 : void set_physical_device_table(PhysicalDeviceTable *table) { 634 2 : physical_device_table_ = table; 635 2 : } 636 : 637 204 : PhysicalDeviceVnTable *physical_device_vn_table() const { 638 204 : return physical_device_vn_table_; 639 : } 640 2 : void set_physical_device_vn_table(PhysicalDeviceVnTable *table) { 641 2 : physical_device_vn_table_ = table; 642 2 : } 643 : 644 8 : MulticastPolicyTable *mp_table() const {return mp_table_;} 645 2 : void set_mp_table(MulticastPolicyTable *table) { 646 2 : mp_table_ = table; 647 2 : } 648 : 649 : // VHOST related 650 0 : Ip4Address vhost_prefix() const {return prefix_;} 651 2 : void set_vhost_prefix(const Ip4Address &addr) { 652 2 : prefix_ = addr; 653 2 : } 654 : 655 4 : uint32_t vhost_prefix_len() const {return prefix_len_;} 656 2 : void set_vhost_prefix_len(uint32_t plen) {prefix_len_ = plen;} 657 : 658 177 : AddressList vhost_default_gateway() const {return gateway_list_;} 659 15 : void set_vhost_default_gateway(const AddressList &addr_list) { 660 15 : gateway_list_ = addr_list; 661 15 : } 662 : 663 0 : AddressList ip_fabric_intf_addr_list() const {return ip_fabric_intf_addr_list_;} 664 : void set_ip_fabric_intf_addr_list(const AddressList &addr_list) { 665 : ip_fabric_intf_addr_list_ = addr_list; 666 : } 667 : 668 267 : Ip4Address router_id() const {return router_id_; } 669 0 : IpAddress router_id6() const {return router_id6_;} 670 72 : const Ip4Address *router_ip_ptr() const { 671 72 : return &router_id_; 672 : } 673 46 : void set_router_id(const Ip4Address &addr) { 674 46 : router_id_ = addr; 675 46 : router_id6_ = Ip6Address::v4_mapped(addr); 676 46 : set_router_id_configured(true); 677 46 : } 678 278 : bool router_id_configured() { return router_id_configured_; } 679 58 : void set_router_id_configured(bool value) { 680 58 : router_id_configured_ = value; 681 58 : } 682 : 683 4 : Ip4Address compute_node_ip() const {return compute_node_ip_;} 684 30 : void set_compute_node_ip(const Ip4Address &addr) { 685 30 : compute_node_ip_ = addr; 686 30 : } 687 : 688 1 : void set_dns_list(std::vector<std::string> &dns_list) { 689 1 : dns_list_ = dns_list; 690 1 : } 691 : 692 : AgentSignal *agent_signal() const { return agent_signal_.get(); } 693 : 694 0 : std::vector<string> &GetControllerlist() { 695 0 : return (controller_list_); 696 : } 697 : 698 2 : uint32_t GetControllerlistChksum() { 699 2 : return (controller_chksum_); 700 : } 701 : 702 0 : std::vector<string> &GetDnslist() { 703 0 : return (dns_list_); 704 : } 705 : 706 2 : uint32_t GetDnslistChksum() { 707 2 : return (dns_chksum_); 708 : } 709 : 710 4 : std::vector<string> &GetCollectorlist() { 711 4 : return (collector_list_); 712 : } 713 : 714 : uint32_t GetCollectorlistChksum() { 715 : return (collector_chksum_); 716 : } 717 : 718 22 : Ip4Address loopback_ip() const {return loopback_ip_;} 719 : void set_loopback_ip(const Ip4Address &addr) { 720 : loopback_ip_ = addr; 721 : } 722 : 723 : void set_is_l3mh(bool flag) { 724 : is_l3mh_ = flag; 725 : } 726 : 727 3789 : bool is_l3mh() const { 728 3789 : return is_l3mh_; 729 : } 730 : 731 : // Common XMPP Client for control-node and config clients 732 278 : const std::string &controller_ifmap_xmpp_server(uint8_t idx) const { 733 278 : return xs_addr_[idx]; 734 : } 735 36 : void set_controller_ifmap_xmpp_server(const std::string &addr, uint8_t idx) { 736 36 : xs_addr_[idx] = addr; 737 36 : } 738 8 : void reset_controller_ifmap_xmpp_server(uint8_t idx) { 739 8 : xs_addr_[idx].clear(); 740 8 : xs_port_[idx] = 0; 741 8 : } 742 2 : const bool xmpp_auth_enabled() const { 743 2 : return xs_auth_enable_; 744 : } 745 0 : const std::string &xmpp_server_cert() const { 746 0 : return xs_server_cert_; 747 : } 748 0 : const std::string &xmpp_server_key() const { 749 0 : return xs_server_key_; 750 : } 751 0 : const std::string &xmpp_ca_cert() const { 752 0 : return xs_ca_cert_; 753 : } 754 : 755 2 : const std::string &subcluster_name() const { 756 2 : return subcluster_name_; 757 : } 758 : 759 11 : const uint16_t controller_ifmap_xmpp_port(uint8_t idx) const { 760 11 : return xs_port_[idx]; 761 : } 762 12 : void set_controller_ifmap_xmpp_port(uint16_t port, uint8_t idx) { 763 12 : xs_port_[idx] = port; 764 12 : } 765 : 766 4 : XmppInit *controller_ifmap_xmpp_init(uint8_t idx) const { 767 4 : return xmpp_init_[idx]; 768 : } 769 4 : void set_controller_ifmap_xmpp_init(XmppInit *init, uint8_t idx) { 770 4 : xmpp_init_[idx] = init; 771 4 : } 772 : 773 15 : XmppClient *controller_ifmap_xmpp_client(uint8_t idx) { 774 15 : return xmpp_client_[idx]; 775 : } 776 : 777 5 : void set_controller_ifmap_xmpp_client(XmppClient *client, uint8_t idx) { 778 5 : xmpp_client_[idx] = client; 779 5 : } 780 : 781 : // Config XMPP server specific 782 143 : const int8_t &ifmap_active_xmpp_server_index() const { return xs_idx_; } 783 4 : const std::string &ifmap_active_xmpp_server() const { return xs_cfg_addr_; } 784 24 : void set_ifmap_active_xmpp_server(const std::string &addr, 785 : uint8_t xs_idx) { 786 24 : xs_cfg_addr_ = addr; 787 24 : xs_idx_ = xs_idx; 788 24 : } 789 1 : void reset_ifmap_active_xmpp_server() { 790 1 : xs_cfg_addr_.clear(); 791 1 : xs_idx_ = -1; 792 1 : } 793 : 794 269 : AgentIfMapXmppChannel *ifmap_xmpp_channel(uint8_t idx) const { 795 269 : return ifmap_channel_[idx]; 796 : } 797 23 : void set_ifmap_xmpp_channel(AgentIfMapXmppChannel *channel, 798 : uint8_t idx) { 799 23 : ifmap_channel_[idx] = channel; 800 23 : } 801 : 802 : // Controller XMPP server 803 0 : const uint64_t controller_xmpp_channel_setup_time(uint8_t idx) const { 804 0 : return xs_stime_[idx]; 805 : } 806 1 : void set_controller_xmpp_channel_setup_time(uint64_t time, uint8_t idx) { 807 1 : xs_stime_[idx] = time; 808 1 : } 809 : 810 : boost::shared_ptr<AgentXmppChannel> controller_xmpp_channel_ref(uint8_t idx); 811 2039 : AgentXmppChannel *controller_xmpp_channel(uint8_t idx) const { 812 2039 : return (agent_xmpp_channel_[idx]).get(); 813 : } 814 : 815 : void set_controller_xmpp_channel(AgentXmppChannel *channel, uint8_t idx); 816 : void reset_controller_xmpp_channel(uint8_t idx); 817 : 818 : // Service instance 819 8 : ServiceInstanceTable *service_instance_table() const { 820 8 : return service_instance_table_; 821 : } 822 : 823 2 : void set_service_instance_table(ServiceInstanceTable *table) { 824 2 : service_instance_table_= table; 825 2 : } 826 : 827 : // DNS XMPP Server 828 2 : const bool dns_auth_enabled() const { 829 2 : return dns_auth_enable_; 830 : } 831 : 832 4 : XmppInit *dns_xmpp_init(uint8_t idx) const { 833 4 : return dns_xmpp_init_[idx]; 834 : } 835 4 : void set_dns_xmpp_init(XmppInit *xmpp, uint8_t idx) { 836 4 : dns_xmpp_init_[idx] = xmpp; 837 4 : } 838 : 839 14 : XmppClient *dns_xmpp_client(uint8_t idx) const { 840 14 : return dns_xmpp_client_[idx]; 841 : } 842 4 : void set_dns_xmpp_client(XmppClient *client, uint8_t idx) { 843 4 : dns_xmpp_client_[idx] = client; 844 4 : } 845 : 846 4 : AgentDnsXmppChannel *dns_xmpp_channel(uint8_t idx) const { 847 4 : return dns_xmpp_channel_[idx]; 848 : } 849 4 : void set_dns_xmpp_channel(AgentDnsXmppChannel *chnl, uint8_t idx) { 850 4 : dns_xmpp_channel_[idx] = chnl; 851 4 : } 852 0 : bool is_dns_xmpp_channel(AgentDnsXmppChannel *channel) { 853 0 : if (channel == dns_xmpp_channel_[0] || channel == dns_xmpp_channel_[1]) 854 0 : return true;; 855 0 : return false; 856 : } 857 : 858 : // DNS Server and port 859 144 : const std::string &dns_server(uint8_t idx) const { 860 144 : return dns_addr_[idx]; 861 : } 862 15 : void set_dns_server(const std::string &addr, uint8_t idx) { 863 15 : dns_addr_[idx] = addr; 864 15 : } 865 7 : void reset_dns_server(uint8_t idx) { 866 7 : dns_addr_[idx].clear(); 867 7 : dns_port_[idx] = 0; 868 7 : } 869 : 870 4 : const uint16_t dns_server_port(uint8_t idx) const { 871 4 : return dns_port_[idx]; 872 : } 873 15 : void set_dns_server_port(uint16_t port, uint8_t idx) { 874 15 : dns_port_[idx] = port; 875 15 : } 876 : 877 2 : const std::string &host_name() const { 878 2 : return host_name_; 879 : } 880 11 : const std::string &agent_name() const { 881 11 : return agent_name_; 882 : } 883 : 884 2 : void set_agent_name(const std::string &name) { 885 2 : agent_name_ = name; 886 2 : } 887 : 888 2 : const std::string &instance_id() const { return instance_id_; } 889 2 : void set_instance_id(const std::string &id) { instance_id_ = id; } 890 : 891 : const int &module_type() const { return module_type_; } 892 2 : void set_module_type(int id) { module_type_ = id; } 893 : 894 4 : const std::string &module_name() const { return module_name_; } 895 2 : void set_module_name(const std::string &name) { module_name_ = name; } 896 : 897 33 : AgentXmppChannel* mulitcast_builder() { 898 33 : return cn_mcast_builder_; 899 : }; 900 : void set_cn_mcast_builder(AgentXmppChannel *peer); 901 : 902 : // Fabric related 903 221 : const std::string &fabric_vn_name() const {return fabric_vn_name_; } 904 : 905 2776 : const std::string &fabric_vrf_name() const { return fabric_vrf_name_; } 906 : void set_fabric_vrf_name(const std::string &name) { 907 : fabric_vrf_name_ = name; 908 : } 909 : 910 461 : const std::string &fabric_policy_vrf_name() const { 911 461 : return fabric_policy_vrf_name_; 912 : } 913 : void set_fabric_policy_vrf_name(const std::string &name) { 914 : fabric_policy_vrf_name_ = name; 915 : } 916 : 917 564 : VrfEntry *fabric_vrf() const { return fabric_vrf_; } 918 2 : void set_fabric_vrf(VrfEntry *vrf) { fabric_vrf_ = vrf; } 919 0 : VrfEntry *fabric_policy_vrf() const { return fabric_policy_vrf_; } 920 2 : void set_fabric_policy_vrf(VrfEntry *vrf) { fabric_policy_vrf_ = vrf; } 921 : 922 23 : const std::string &linklocal_vn_name() {return link_local_vn_name_;} 923 173 : const std::string &linklocal_vrf_name() {return link_local_vrf_name_;} 924 : 925 : const std::string &vhost_interface_name() const; 926 0 : void set_vhost_interface_name(const std::string &name) { 927 0 : vhost_interface_name_ = name; 928 0 : } 929 : 930 94 : bool get_vhost_disable_policy() { 931 94 : return vhost_disable_policy_; 932 : } 933 0 : void set_vhost_disable_policy(bool disable_policy) { 934 0 : vhost_disable_policy_ = disable_policy; 935 0 : } 936 : 937 352 : const Interface *vhost_interface() const { 938 352 : return vhost_interface_; 939 : } 940 4 : void set_vhost_interface(const Interface *intrface) { 941 4 : vhost_interface_ = intrface; 942 4 : } 943 : 944 : bool is_vhost_interface_up() const; 945 : 946 48 : const std::string &pkt_interface_name() const { 947 48 : return pkt_interface_name_; 948 : } 949 0 : void set_pkt_interface_name(const std::string &name) { 950 0 : pkt_interface_name_ = name; 951 0 : } 952 : 953 : const std::string &GetHostInterfaceName() const; 954 : 955 58 : process::ConnectionState* connection_state() const { 956 58 : return connection_state_; 957 : } 958 2 : void set_connection_state(process::ConnectionState* state) { 959 2 : connection_state_ = state; 960 2 : } 961 0 : uint16_t metadata_server_port() const {return metadata_server_port_;} 962 2 : void set_metadata_server_port(uint16_t port) { 963 2 : metadata_server_port_ = port; 964 2 : } 965 : 966 0 : void set_vrouter_server_ip(Ip4Address ip) { 967 0 : vrouter_server_ip_ = ip; 968 0 : } 969 0 : const Ip4Address vrouter_server_ip() const { 970 0 : return vrouter_server_ip_; 971 : } 972 0 : void set_vrouter_server_port(uint32_t port) { 973 0 : vrouter_server_port_ = port; 974 0 : } 975 0 : const uint32_t vrouter_server_port() const { 976 0 : return vrouter_server_port_; 977 : } 978 : 979 : // Protocol objects 980 2205 : ArpProto *GetArpProto() const { return arp_proto_; } 981 4 : void SetArpProto(ArpProto *proto) { arp_proto_ = proto; } 982 : 983 359 : DhcpProto *GetDhcpProto() const { return dhcp_proto_; } 984 4 : void SetDhcpProto(DhcpProto *proto) { dhcp_proto_ = proto; } 985 : 986 0 : Dhcpv6Proto *dhcpv6_proto() const { return dhcpv6_proto_; } 987 4 : void set_dhcpv6_proto(Dhcpv6Proto *proto) { dhcpv6_proto_ = proto; } 988 : 989 557 : DnsProto *GetDnsProto() const { return dns_proto_; } 990 4 : void SetDnsProto(DnsProto *proto) { dns_proto_ = proto; } 991 : 992 0 : BfdProto *GetBfdProto() const { return bfd_proto_; } 993 4 : void SetBfdProto(BfdProto *proto) { bfd_proto_ = proto; } 994 : 995 75 : IcmpProto *GetIcmpProto() const { return icmp_proto_; } 996 4 : void SetIcmpProto(IcmpProto *proto) { icmp_proto_ = proto; } 997 : 998 84 : Icmpv6Proto *icmpv6_proto() const { return icmpv6_proto_; } 999 4 : void set_icmpv6_proto(Icmpv6Proto *proto) { icmpv6_proto_ = proto; } 1000 : 1001 0 : FlowProto *GetFlowProto() const { return flow_proto_; } 1002 2 : void SetFlowProto(FlowProto *proto) { flow_proto_ = proto; } 1003 : 1004 1077 : IgmpProto *GetIgmpProto() const { return igmp_proto_; } 1005 4 : void SetIgmpProto(IgmpProto *proto) { igmp_proto_ = proto; } 1006 : 1007 1487 : MacLearningProto* mac_learning_proto() const { 1008 1487 : return mac_learning_proto_; 1009 : } 1010 : 1011 2 : void set_mac_learning_proto(MacLearningProto *mac_learning_proto) { 1012 2 : mac_learning_proto_ = mac_learning_proto; 1013 2 : } 1014 : 1015 840 : MacLearningModule* mac_learning_module() const { 1016 840 : return mac_learning_module_; 1017 : } 1018 : 1019 2 : void set_mac_learning_module(MacLearningModule *mac_learning_module) { 1020 2 : mac_learning_module_ = mac_learning_module; 1021 2 : } 1022 : 1023 : // Peer objects 1024 1665 : const Peer *local_peer() const {return local_peer_.get();} 1025 2173 : const Peer *local_vm_peer() const {return local_vm_peer_.get();} 1026 212 : const Peer *link_local_peer() const {return linklocal_peer_.get();} 1027 104 : const Peer *ecmp_peer() const {return ecmp_peer_.get();} 1028 0 : const Peer *vgw_peer() const {return vgw_peer_.get();} 1029 0 : const Peer *evpn_routing_peer() const {return evpn_routing_peer_.get();} 1030 2 : const Peer *vxlan_bgp_peer() const {return vxlan_bgp_peer_.get();} 1031 174 : const Peer *evpn_peer() const {return evpn_peer_.get();} 1032 172 : const Peer *multicast_peer() const {return multicast_peer_.get();} 1033 22 : const Peer *multicast_tor_peer() const {return multicast_tor_peer_.get();} 1034 0 : const Peer *multicast_tree_builder_peer() const { 1035 0 : return multicast_tree_builder_peer_.get();} 1036 490 : const Peer *mac_vm_binding_peer() const {return mac_vm_binding_peer_.get();} 1037 162 : const Peer *inet_evpn_peer() const {return inet_evpn_peer_.get();} 1038 0 : const Peer *mac_learning_peer() const {return mac_learning_peer_.get();} 1039 281 : const Peer *fabric_rt_export_peer() const { 1040 281 : return fabric_rt_export_peer_.get(); 1041 : } 1042 2 : const Peer *local_vm_export_peer() const { 1043 2 : return local_vm_export_peer_.get(); 1044 : } 1045 : 1046 : // Agent Modules 1047 : AgentConfig *cfg() const; 1048 : void set_cfg(AgentConfig *cfg); 1049 : 1050 : AgentStats *stats() const; 1051 : void set_stats(AgentStats *stats); 1052 : 1053 : KSync *ksync() const; 1054 : void set_ksync(KSync *ksync); 1055 : 1056 : AgentUveBase *uve() const; 1057 : void set_uve(AgentUveBase *uve); 1058 : 1059 : AgentStatsCollector *stats_collector() const; 1060 : void set_stats_collector(AgentStatsCollector *asc); 1061 : 1062 : FlowStatsManager *flow_stats_manager() const; 1063 : void set_flow_stats_manager(FlowStatsManager *fsc); 1064 : 1065 : HealthCheckTable *health_check_table() const; 1066 : void set_health_check_table(HealthCheckTable *table); 1067 : 1068 : BridgeDomainTable *bridge_domain_table() const; 1069 : void set_bridge_domain_table(BridgeDomainTable *table); 1070 : 1071 : MetaDataIpAllocator *metadata_ip_allocator() const; 1072 : void set_metadata_ip_allocator(MetaDataIpAllocator *allocator); 1073 : 1074 : MetaDataIpAllocator *metadata_ip6_allocator() const; 1075 : void set_metadata_ip6_allocator(MetaDataIpAllocator *allocator); 1076 : 1077 : PktModule *pkt() const; 1078 : void set_pkt(PktModule *pkt); 1079 : 1080 : ServicesModule *services() const; 1081 : void set_services(ServicesModule *services); 1082 : 1083 : VirtualGateway *vgw() const; 1084 : void set_vgw(VirtualGateway *vgw); 1085 : 1086 : RestServer *rest_server() const; 1087 : void set_rest_server(RestServer *r); 1088 : 1089 : PortIpcHandler *port_ipc_handler() const; 1090 : void set_port_ipc_handler(PortIpcHandler *r); 1091 : 1092 : OperDB *oper_db() const; 1093 : void set_oper_db(OperDB *oper_db); 1094 : 1095 : VNController *controller() const; 1096 : void set_controller(VNController *val); 1097 : 1098 : ResourceManager *resource_manager() const; 1099 : void set_resource_manager(ResourceManager *resource_manager); 1100 : 1101 : EventNotifier *event_notifier() const; 1102 : void set_event_notifier(EventNotifier *mgr); 1103 : 1104 : // Miscellaneous 1105 538 : EventManager *event_manager() const {return event_mgr_;} 1106 : void set_event_manager(EventManager *evm) { 1107 : event_mgr_ = evm; 1108 : } 1109 : 1110 : DiagTable *diag_table() const; 1111 : void set_diag_table(DiagTable *table); 1112 : 1113 0 : uint16_t mirror_port() const {return mirror_src_udp_port_;} 1114 2 : void set_mirror_port(uint16_t mirr_port) { 1115 2 : mirror_src_udp_port_ = mirr_port; 1116 2 : } 1117 : 1118 : int introspect_port() const { return introspect_port_;} 1119 : 1120 98 : DB *db() const {return db_;} 1121 : 1122 100 : TaskScheduler *task_scheduler() const { return task_scheduler_; } 1123 2 : void set_task_scheduler(TaskScheduler *t) { task_scheduler_ = t; } 1124 : 1125 2 : AgentInit *agent_init() const { return agent_init_; } 1126 2 : void set_agent_init(AgentInit *init) { agent_init_ = init; } 1127 : 1128 : OVSDB::OvsdbClient *ovsdb_client() const { return ovsdb_client_; } 1129 : void set_ovsdb_client(OVSDB::OvsdbClient *client) { ovsdb_client_ = client; } 1130 : 1131 18 : const std::string &fabric_interface_name() const { 1132 18 : return ip_fabric_intf_name_; 1133 : } 1134 : 1135 4 : const std::vector<std::string> &fabric_interface_name_list() const { 1136 4 : return ip_fabric_intf_name_list_; 1137 : } 1138 : 1139 0 : const std::string &crypt_interface_name() const { 1140 0 : return crypt_intf_name_; 1141 : } 1142 : 1143 32 : const Interface *crypt_interface() const { 1144 32 : return crypt_interface_; 1145 : } 1146 0 : void set_crypt_interface(const Interface *interface) { 1147 0 : crypt_interface_ = interface; 1148 0 : } 1149 : 1150 520 : VxLanNetworkIdentifierMode vxlan_network_identifier_mode() const { 1151 520 : return vxlan_network_identifier_mode_; 1152 : } 1153 0 : void set_vxlan_network_identifier_mode(VxLanNetworkIdentifierMode mode) { 1154 0 : vxlan_network_identifier_mode_ = mode; 1155 0 : } 1156 : 1157 93 : bool simulate_evpn_tor() const {return simulate_evpn_tor_;} 1158 : void set_simulate_evpn_tor(bool mode) {simulate_evpn_tor_ = mode;} 1159 : 1160 328 : bool tsn_no_forwarding_enabled() const {return tsn_no_forwarding_enabled_;} 1161 : void set_tsn_no_forwarding_enabled(bool val) { 1162 : tsn_no_forwarding_enabled_ = val; 1163 : } 1164 1245 : bool tsn_enabled() const {return tsn_enabled_;} 1165 4 : void set_tsn_enabled(bool val) {tsn_enabled_ = val;} 1166 214 : bool tor_agent_enabled() const {return tor_agent_enabled_;} 1167 2 : void set_tor_agent_enabled(bool val) {tor_agent_enabled_ = val;} 1168 0 : bool forwarding_enabled() const {return forwarding_enabled_;} 1169 : void set_forwarding_enabled(bool val) {forwarding_enabled_ = val;} 1170 173 : bool server_gateway_mode() const {return server_gateway_mode_;} 1171 0 : bool vcpe_gateway_mode() const {return vcpe_gateway_mode_;} 1172 173 : bool pbb_gateway_mode() const { return pbb_gateway_mode_;} 1173 : 1174 11246 : IFMapAgentParser *ifmap_parser() const {return ifmap_parser_;} 1175 4 : void set_ifmap_parser(IFMapAgentParser *parser) { 1176 4 : ifmap_parser_ = parser; 1177 4 : } 1178 : 1179 6 : IFMapAgentStaleCleaner *ifmap_stale_cleaner() const { 1180 6 : return agent_stale_cleaner_; 1181 : } 1182 4 : void set_ifmap_stale_cleaner(IFMapAgentStaleCleaner *cl) { 1183 4 : agent_stale_cleaner_ = cl; 1184 4 : } 1185 : 1186 : std::string GetUuidStr(boost::uuids::uuid uuid_val) const; 1187 : 1188 2 : bool ksync_sync_mode() const {return ksync_sync_mode_;} 1189 3 : void set_ksync_sync_mode(bool sync_mode) { 1190 3 : ksync_sync_mode_ = sync_mode; 1191 3 : } 1192 : 1193 971 : bool test_mode() const { return test_mode_; } 1194 7 : void set_test_mode(bool test_mode) { test_mode_ = test_mode; } 1195 : 1196 2 : bool xmpp_dns_test_mode() const { return xmpp_dns_test_mode_; } 1197 : void set_xmpp_dns_test_mode(bool xmpp_dns_test_mode) { 1198 : xmpp_dns_test_mode_ = xmpp_dns_test_mode; 1199 : } 1200 : 1201 21 : uint32_t flow_table_size() const { return flow_table_size_; } 1202 : void set_flow_table_size(uint32_t count); 1203 : 1204 8 : uint16_t flow_thread_count() const { return flow_thread_count_; } 1205 4 : bool flow_trace_enable() const { return flow_trace_enable_; } 1206 : 1207 330 : uint32_t max_vm_flows() const { return max_vm_flows_; } 1208 21 : void set_max_vm_flows_perc(uint32_t count) { max_vm_flows_perc_ = count; } 1209 : void update_max_vm_flows(uint32_t flow_table_size); 1210 : 1211 480 : uint32_t global_max_vmi_flows() const { return global_max_vmi_flows_; } 1212 21 : void set_global_max_vmi_flows(uint32_t count) { 1213 21 : global_max_vmi_flows_ = count; 1214 21 : } 1215 : 1216 2 : uint32_t flow_add_tokens() const { return flow_add_tokens_; } 1217 2 : uint32_t flow_ksync_tokens() const { return flow_ksync_tokens_; } 1218 2 : uint32_t flow_del_tokens() const { return flow_del_tokens_; } 1219 2 : uint32_t flow_update_tokens() const { return flow_update_tokens_; } 1220 : 1221 141 : bool init_done() const { return init_done_; } 1222 2 : void set_init_done(bool done) { init_done_ = done; } 1223 : 1224 : ConfigManager *config_manager() const; 1225 : 1226 628 : AgentParam *params() const { return params_; } 1227 : bool isMockMode() const; 1228 : std::string AgentGUID() const; 1229 : bool isXenMode(); 1230 : bool isKvmMode(); 1231 : bool isDockerMode(); 1232 : // Agent param accessor functions 1233 : bool isVmwareMode() const; 1234 : bool isVmwareVcenterMode() const; 1235 : bool vrouter_on_nic_mode() const; 1236 : bool vrouter_on_host_dpdk() const; 1237 : bool vrouter_on_host() const; 1238 : void SetAgentTaskPolicy(); 1239 : void CopyConfig(AgentParam *params); 1240 : void CopyFilteredParams(); 1241 1148 : bool ResourceManagerReady() const { return resource_manager_ready_; } 1242 : void SetResourceManagerReady(); 1243 : 1244 : void Init(AgentParam *param); 1245 : void InitPeers(); 1246 : void InitDone(); 1247 : void InitXenLinkLocalIntf(); 1248 : void InitCollector(); 1249 : void ReConnectCollectors(); 1250 : void ReconfigSignalHandler(boost::system::error_code , int); 1251 : void DebugSignalHandler(boost::system::error_code , int); 1252 : 1253 168 : LifetimeManager *lifetime_manager() { return lifetime_manager_;} 1254 : void CreateLifetimeManager(); 1255 : void ShutdownLifetimeManager(); 1256 : 1257 : // Default concurrency checker. Checks for "Agent::KSync" and "db::DBTable" 1258 : void ConcurrencyCheck(); 1259 : 1260 354 : uint32_t vrouter_max_labels() const { 1261 354 : return vrouter_max_labels_; 1262 : } 1263 7 : void set_vrouter_max_labels(uint32_t max_labels) { 1264 7 : vrouter_max_labels_ = max_labels; 1265 7 : } 1266 : 1267 528 : uint32_t vrouter_max_nexthops() const { 1268 528 : return vrouter_max_nexthops_; 1269 : } 1270 7 : void set_vrouter_max_nexthops(uint32_t max_nexthop) { 1271 7 : vrouter_max_nexthops_ = max_nexthop; 1272 7 : } 1273 : 1274 0 : uint32_t vrouter_max_interfaces() const { 1275 0 : return vrouter_max_interfaces_; 1276 : } 1277 2 : void set_vrouter_max_interfaces(uint32_t max_interfaces) { 1278 2 : vrouter_max_interfaces_ = max_interfaces; 1279 2 : } 1280 : 1281 8 : uint32_t vrouter_max_vrfs() const { 1282 8 : return vrouter_max_vrfs_; 1283 : } 1284 2 : void set_vrouter_max_vrfs(uint32_t max_vrf) { 1285 2 : vrouter_max_vrfs_ = max_vrf; 1286 2 : } 1287 : 1288 0 : uint32_t vrouter_max_mirror_entries() const { 1289 0 : return vrouter_max_mirror_entries_; 1290 : } 1291 2 : void set_vrouter_max_mirror_entries(uint32_t max_mirror_entries) { 1292 2 : vrouter_max_mirror_entries_ = max_mirror_entries; 1293 2 : } 1294 : 1295 : 1296 0 : uint32_t vrouter_max_bridge_entries() const { 1297 0 : return vrouter_max_bridge_entries_; 1298 : } 1299 2 : void set_vrouter_max_bridge_entries(uint32_t bridge_entries) { 1300 2 : vrouter_max_bridge_entries_ = bridge_entries; 1301 2 : } 1302 : 1303 0 : uint32_t vrouter_max_oflow_bridge_entries() const { 1304 0 : return vrouter_max_oflow_bridge_entries_; 1305 : } 1306 2 : void set_vrouter_max_oflow_bridge_entries(uint32_t 1307 : oflow_bridge_entries) { 1308 2 : vrouter_max_oflow_bridge_entries_ = oflow_bridge_entries; 1309 2 : } 1310 : 1311 0 : uint32_t vrouter_max_flow_entries() const { 1312 0 : return vrouter_max_flow_entries_; 1313 : } 1314 2 : void set_vrouter_max_flow_entries(uint32_t value) { 1315 2 : vrouter_max_flow_entries_ = value; 1316 2 : } 1317 : 1318 0 : uint32_t vrouter_max_oflow_entries() const { 1319 0 : return vrouter_max_oflow_entries_; 1320 : } 1321 2 : void set_vrouter_max_oflow_entries(uint32_t value) { 1322 2 : vrouter_max_oflow_entries_ = value; 1323 2 : } 1324 2 : void set_vrouter_build_info(std::string version) { 1325 2 : vrouter_build_info_ = version; 1326 2 : } 1327 0 : std::string vrouter_build_info() const { 1328 0 : return vrouter_build_info_; 1329 : } 1330 : 1331 2 : void set_vrouter_priority_tagging(bool tagging) { 1332 2 : vrouter_priority_tagging_ = tagging; 1333 2 : } 1334 : 1335 0 : bool vrouter_priority_tagging() const { 1336 0 : return vrouter_priority_tagging_; 1337 : } 1338 : Agent::ForwardingMode TranslateForwardingMode(const std::string &mode) const; 1339 : 1340 32 : FlowStatsReqHandler& flow_stats_req_handler() { 1341 32 : return flow_stats_req_handler_; 1342 : } 1343 : 1344 4 : void set_flow_stats_req_handler(FlowStatsReqHandler req) { 1345 4 : flow_stats_req_handler_ = req; 1346 4 : } 1347 : 1348 21 : PortConfigHandler& port_config_handler() { 1349 21 : return port_config_handler_; 1350 : } 1351 : 1352 2 : void set_port_config_handler(PortConfigHandler handler) { 1353 2 : port_config_handler_ = handler; 1354 2 : } 1355 : 1356 : void SetMeasureQueueDelay(bool val); 1357 : bool MeasureQueueDelay(); 1358 : void TaskTrace(const char *file_name, uint32_t line_no, const Task *task, 1359 : const char *description, uint64_t delay); 1360 : 1361 : static uint16_t ProtocolStringToInt(const std::string &str); 1362 : VrouterObjectLimits GetVrouterObjectLimits(); 1363 : void SetXmppDscp(uint8_t val); 1364 : 1365 21 : void set_global_slo_status(bool flag) { 1366 21 : global_slo_status_ = flag; 1367 21 : } 1368 : 1369 41 : bool global_slo_status() const { 1370 41 : return global_slo_status_; 1371 : } 1372 : 1373 0 : void set_fabric_vn_uuid(const boost::uuids::uuid &uuid) { 1374 0 : fabric_vn_uuid_ = uuid; 1375 0 : } 1376 : 1377 0 : const boost::uuids::uuid& fabric_vn_uuid() const { 1378 0 : return fabric_vn_uuid_; 1379 : } 1380 : uint8_t GetInterfaceTransport() const; 1381 0 : void set_inet_labeled_flag(bool flag) { 1382 0 : inet_labeled_enabled_ = flag; 1383 0 : } 1384 : bool get_inet_labeled_flag() { 1385 : return inet_labeled_enabled_;} 1386 : 1387 873 : VrLimitExceeded &get_vr_limits_exceeded_map() { 1388 873 : return vr_limits_exceeded_map_; 1389 : } 1390 : 1391 873 : void set_vr_limits_exceeded_map(VrLimitExceeded &vr_limit_exceed_map) { 1392 873 : vr_limits_exceeded_map_ = vr_limit_exceed_map; 1393 873 : } 1394 : 1395 4 : void set_vr_limit_high_watermark(float watermark) { 1396 4 : vr_limit_high_watermark_ = watermark; 1397 4 : } 1398 : 1399 598 : float vr_limit_high_watermark() { 1400 598 : return vr_limit_high_watermark_; 1401 : } 1402 : 1403 4 : void set_vr_limit_low_watermark(float watermark) { 1404 4 : vr_limit_low_watermark_ = watermark; 1405 4 : } 1406 : 1407 1 : float vr_limit_low_watermark() { 1408 1 : return vr_limit_low_watermark_; 1409 : } 1410 : 1411 : private: 1412 : 1413 : uint32_t GenerateHash(std::vector<std::string> &); 1414 : void InitializeFilteredParams(); 1415 : void InitControllerList(); 1416 : void InitDnsList(); 1417 : 1418 : AgentParam *params_; 1419 : AgentConfig *cfg_; 1420 : AgentStats *stats_; 1421 : KSync *ksync_; 1422 : AgentUveBase *uve_; 1423 : AgentStatsCollector *stats_collector_; 1424 : FlowStatsManager *flow_stats_manager_; 1425 : PktModule *pkt_; 1426 : ServicesModule *services_; 1427 : VirtualGateway *vgw_; 1428 : RestServer *rest_server_; 1429 : PortIpcHandler *port_ipc_handler_; 1430 : OperDB *oper_db_; 1431 : DiagTable *diag_table_; 1432 : VNController *controller_; 1433 : ResourceManager *resource_manager_; 1434 : EventNotifier *event_notifier_; 1435 : 1436 : EventManager *event_mgr_; 1437 : boost::shared_ptr<AgentXmppChannel> agent_xmpp_channel_[MAX_XMPP_SERVERS]; 1438 : AgentIfMapXmppChannel *ifmap_channel_[MAX_XMPP_SERVERS]; 1439 : XmppClient *xmpp_client_[MAX_XMPP_SERVERS]; 1440 : XmppInit *xmpp_init_[MAX_XMPP_SERVERS]; 1441 : AgentDnsXmppChannel *dns_xmpp_channel_[MAX_XMPP_SERVERS]; 1442 : XmppClient *dns_xmpp_client_[MAX_XMPP_SERVERS]; 1443 : XmppInit *dns_xmpp_init_[MAX_XMPP_SERVERS]; 1444 : IFMapAgentStaleCleaner *agent_stale_cleaner_; 1445 : AgentXmppChannel *cn_mcast_builder_; 1446 : uint16_t metadata_server_port_; 1447 : // Host name of node running the daemon 1448 : std::string host_name_; 1449 : // Unique name of the agent. When multiple instances are running, it will 1450 : // use instance-id to make unique name 1451 : std::string agent_name_; 1452 : std::string prog_name_; 1453 : int introspect_port_; 1454 : std::string instance_id_; 1455 : int module_type_; 1456 : std::string module_name_; 1457 : // DB handles 1458 : DB *db_; 1459 : TaskScheduler *task_scheduler_; 1460 : AgentInit *agent_init_; 1461 : VrfEntry *fabric_vrf_; 1462 : VrfEntry *fabric_policy_vrf_; 1463 : InterfaceTable *intf_table_; 1464 : HealthCheckTable *health_check_table_; 1465 : BridgeDomainTable *bridge_domain_table_; 1466 : std::unique_ptr<MetaDataIpAllocator> metadata_ip_allocator_; 1467 : std::unique_ptr<MetaDataIpAllocator> metadata_ip6_allocator_; 1468 : NextHopTable *nh_table_; 1469 : InetUnicastAgentRouteTable *uc_rt_table_; 1470 : InetUnicastAgentRouteTable *mpls_rt_table_; 1471 : Inet4MulticastAgentRouteTable *mc_rt_table_; 1472 : EvpnAgentRouteTable *evpn_rt_table_; 1473 : BridgeAgentRouteTable *l2_rt_table_; 1474 : VrfTable *vrf_table_; 1475 : VmTable *vm_table_; 1476 : VnTable *vn_table_; 1477 : SgTable *sg_table_; 1478 : TagTable *tag_table_; 1479 : MplsTable *mpls_table_; 1480 : AclTable *acl_table_; 1481 : MirrorTable *mirror_table_; 1482 : VrfAssignTable *vrf_assign_table_; 1483 : VxLanTable *vxlan_table_; 1484 : ServiceInstanceTable *service_instance_table_; 1485 : PhysicalDeviceTable *physical_device_table_; 1486 : PhysicalDeviceVnTable *physical_device_vn_table_; 1487 : ForwardingClassTable *forwarding_class_table_; 1488 : SecurityLoggingObjectTable *slo_table_; 1489 : QosQueueTable *qos_queue_table_; 1490 : AgentQosConfigTable *qos_config_table_; 1491 : PolicySetTable *policy_set_table_; 1492 : CryptTunnelTable *crypt_tunnel_table_; 1493 : std::unique_ptr<ConfigManager> config_manager_; 1494 : MulticastPolicyTable *mp_table_; 1495 : 1496 : // Mirror config table 1497 : MirrorCfgTable *mirror_cfg_table_; 1498 : // Interface Mirror config table 1499 : IntfMirrorCfgTable *intf_mirror_cfg_table_; 1500 : 1501 : IpAddress router_id6_; 1502 : Ip4Address router_id_; 1503 : Ip4Address prefix_; 1504 : uint32_t prefix_len_; 1505 : AddressList gateway_list_; 1506 : AddressList ip_fabric_intf_addr_list_; 1507 : 1508 : // IP address on the compute node used by agent to run services such 1509 : // as metadata service. This is different than router_id when vhost0 1510 : // is un-numbered interface in host-os 1511 : // The compute_node_ip_ is used only in adding Flow NAT rules. 1512 : Ip4Address compute_node_ip_; 1513 : std::string xs_cfg_addr_; 1514 : int8_t xs_idx_; 1515 : std::string xs_addr_[MAX_XMPP_SERVERS]; 1516 : uint16_t xs_port_[MAX_XMPP_SERVERS]; 1517 : uint64_t xs_stime_[MAX_XMPP_SERVERS]; 1518 : bool xs_auth_enable_; 1519 : std::string xs_server_cert_; 1520 : std::string xs_server_key_; 1521 : std::string xs_ca_cert_; 1522 : std::string subcluster_name_; 1523 : int8_t xs_dns_idx_; 1524 : std::string dns_addr_[MAX_XMPP_SERVERS]; 1525 : uint16_t dns_port_[MAX_XMPP_SERVERS]; 1526 : bool dns_auth_enable_; 1527 : // Config 1528 : std::vector<std::string>controller_list_; 1529 : uint32_t controller_chksum_; 1530 : std::vector<std::string>dns_list_; 1531 : uint32_t dns_chksum_; 1532 : std::vector<std::string>collector_list_; 1533 : uint32_t collector_chksum_; 1534 : std::string ip_fabric_intf_name_; 1535 : std::string crypt_intf_name_; 1536 : std::string vhost_interface_name_; 1537 : std::string pkt_interface_name_; 1538 : 1539 : ArpProto *arp_proto_; 1540 : DhcpProto *dhcp_proto_; 1541 : DnsProto *dns_proto_; 1542 : BfdProto *bfd_proto_; 1543 : IcmpProto *icmp_proto_; 1544 : Dhcpv6Proto *dhcpv6_proto_; 1545 : Icmpv6Proto *icmpv6_proto_; 1546 : FlowProto *flow_proto_; 1547 : IgmpProto *igmp_proto_; 1548 : MacLearningProto *mac_learning_proto_; 1549 : MacLearningModule *mac_learning_module_; 1550 : 1551 : std::unique_ptr<Peer> local_peer_; 1552 : std::unique_ptr<Peer> local_vm_peer_; 1553 : std::unique_ptr<Peer> linklocal_peer_; 1554 : std::unique_ptr<Peer> ecmp_peer_; 1555 : std::unique_ptr<Peer> vgw_peer_; 1556 : std::unique_ptr<Peer> evpn_routing_peer_; 1557 : std::unique_ptr<Peer> vxlan_bgp_peer_; 1558 : std::unique_ptr<Peer> evpn_peer_; 1559 : std::unique_ptr<Peer> multicast_peer_; 1560 : std::unique_ptr<Peer> multicast_tor_peer_; 1561 : std::unique_ptr<Peer> multicast_tree_builder_peer_; 1562 : std::unique_ptr<Peer> mac_vm_binding_peer_; 1563 : std::unique_ptr<Peer> inet_evpn_peer_; 1564 : std::unique_ptr<Peer> mac_learning_peer_; 1565 : std::unique_ptr<Peer> fabric_rt_export_peer_; 1566 : std::unique_ptr<Peer> local_vm_export_peer_; 1567 : 1568 : std::unique_ptr<AgentSignal> agent_signal_; 1569 : 1570 : IFMapAgentParser *ifmap_parser_; 1571 : bool router_id_configured_; 1572 : 1573 : uint16_t mirror_src_udp_port_; 1574 : LifetimeManager *lifetime_manager_; 1575 : bool ksync_sync_mode_; 1576 : std::string mgmt_ip_; 1577 : static Agent *singleton_; 1578 : VxLanNetworkIdentifierMode vxlan_network_identifier_mode_; 1579 : const Interface *vhost_interface_; 1580 : const Interface *crypt_interface_; 1581 : process::ConnectionState* connection_state_; 1582 : bool vhost_disable_policy_; 1583 : bool test_mode_; 1584 : bool xmpp_dns_test_mode_; 1585 : bool init_done_; 1586 : bool resource_manager_ready_; 1587 : bool simulate_evpn_tor_; 1588 : bool tsn_no_forwarding_enabled_; 1589 : bool tsn_enabled_; 1590 : bool tor_agent_enabled_; 1591 : bool forwarding_enabled_; 1592 : bool server_gateway_mode_; 1593 : bool vcpe_gateway_mode_; 1594 : bool pbb_gateway_mode_; 1595 : bool inet_labeled_enabled_; 1596 : 1597 : // Flow information 1598 : uint32_t flow_table_size_; 1599 : uint16_t flow_thread_count_; 1600 : bool flow_trace_enable_; 1601 : uint32_t max_vm_flows_perc_; 1602 : uint32_t max_vm_flows_; 1603 : uint32_t global_max_vmi_flows_; 1604 : uint32_t flow_add_tokens_; 1605 : uint32_t flow_ksync_tokens_; 1606 : uint32_t flow_del_tokens_; 1607 : uint32_t flow_update_tokens_; 1608 : 1609 : // OVSDB client ptr 1610 : OVSDB::OvsdbClient *ovsdb_client_; 1611 : 1612 : //IP address to be used for sending vrouter sandesh messages 1613 : Ip4Address vrouter_server_ip_; 1614 : //TCP port number to be used for sending vrouter sandesh messages 1615 : uint32_t vrouter_server_port_; 1616 : //Max label space of vrouter 1617 : uint32_t vrouter_max_labels_; 1618 : //Max nexthop supported by vrouter 1619 : uint32_t vrouter_max_nexthops_; 1620 : //Max interface supported by vrouter 1621 : uint32_t vrouter_max_interfaces_; 1622 : //Max VRF supported by vrouter 1623 : uint32_t vrouter_max_vrfs_; 1624 : //Max Mirror entries 1625 : uint32_t vrouter_max_mirror_entries_; 1626 : //Bridge entries that can be porgrammed in vrouter 1627 : uint32_t vrouter_max_bridge_entries_; 1628 : uint32_t vrouter_max_oflow_bridge_entries_; 1629 : //Max Flow entries 1630 : uint32_t vrouter_max_flow_entries_; 1631 : //Max OverFlow entries 1632 : uint32_t vrouter_max_oflow_entries_; 1633 : std::string vrouter_build_info_; 1634 : //Priority tagging status 1635 : bool vrouter_priority_tagging_; 1636 : FlowStatsReqHandler flow_stats_req_handler_; 1637 : PortConfigHandler port_config_handler_; 1638 : 1639 : uint32_t tbb_keepawake_timeout_; 1640 : // Monitor task library and assert if inactivity detected 1641 : uint32_t task_monitor_timeout_msec_; 1642 : // List of TSN who are alive(Relevant for TSN mode only). 1643 : std::vector<std::string> active_tsn_servers_; 1644 : bool global_slo_status_; 1645 : // Constants 1646 : boost::uuids::uuid fabric_vn_uuid_; 1647 : VrLimitExceeded vr_limits_exceeded_map_; 1648 : // Percentage of allowed nexthop and label, alarm is raised once exceeded 1649 : float vr_limit_high_watermark_; 1650 : float vr_limit_low_watermark_; 1651 : // L3MH variables 1652 : Ip4Address loopback_ip_; 1653 : bool is_l3mh_; 1654 : std::vector<std::string> ip_fabric_intf_name_list_; 1655 : public: 1656 : static const std::string config_file_; 1657 : static const std::string log_file_; 1658 : static const std::string null_string_; 1659 : static const std::set<std::string> null_string_list_; 1660 : static std::string fabric_vrf_name_; 1661 : static const std::string fabric_vn_name_; 1662 : static std::string fabric_policy_vrf_name_; 1663 : static const std::string link_local_vrf_name_; 1664 : static const std::string link_local_vn_name_; 1665 : static const MacAddress vrrp_mac_; 1666 : static const MacAddress pkt_interface_mac_; 1667 : static const std::string bcast_mac_; 1668 : static const MacAddress left_si_mac_; 1669 : static const MacAddress right_si_mac_; 1670 : static const std::string xmpp_dns_server_connection_name_prefix_; 1671 : static const std::string xmpp_control_node_connection_name_prefix_; 1672 : static const std::string dpdk_exception_pkt_path_; 1673 : static const std::string vnic_exception_pkt_interface_; 1674 : static const std::string v4_link_local_subnet_; 1675 : static const std::string v6_link_local_subnet_; 1676 : static const uint16_t v4_link_local_plen_ = 16; 1677 : static const uint16_t v6_link_local_plen_ = 10; 1678 : }; 1679 : 1680 : #endif // vnsw_agent_hpp