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