├── api └── __init__.py ├── docs ├── bc_s.png ├── bdwn.png ├── doc.png ├── open.png ├── closed.png ├── nav_f.png ├── nav_g.png ├── nav_h.png ├── tab_a.png ├── tab_b.png ├── tab_h.png ├── tab_s.png ├── doxygen.png ├── splitbar.png ├── sync_off.png ├── sync_on.png ├── classHMWork.png ├── folderopen.png ├── classHMAuxBase.png ├── classHMAuxOOB.png ├── classHMLogAPI.png ├── classHMLogBase.png ├── classHMLogText.png ├── classHMStorage.png ├── folderclosed.png ├── search │ ├── close.png │ ├── mag_sel.png │ ├── search_l.png │ ├── search_m.png │ ├── search_r.png │ ├── classes_0.js │ ├── classes_2.js │ ├── classes_5.js │ ├── all_14.js │ ├── functions_14.js │ ├── enums_0.js │ ├── classes_3.js │ ├── all_3.js │ ├── functions_3.js │ ├── searchdata.js │ ├── all_12.js │ ├── classes_4.js │ ├── functions_12.js │ ├── nomatches.html │ ├── functions_10.js │ ├── functions_9.js │ ├── all_a.js │ ├── functions_a.js │ ├── functions_8.js │ ├── all_10.js │ ├── all_8.js │ ├── functions_2.js │ ├── all_d.js │ ├── functions_d.js │ ├── all_2.js │ ├── all_0.html │ ├── all_1.html │ ├── all_10.html │ ├── all_11.html │ ├── all_12.html │ ├── all_13.html │ ├── all_14.html │ ├── all_2.html │ ├── all_3.html │ ├── all_4.html │ ├── all_5.html │ ├── all_6.html │ ├── all_7.html │ ├── all_8.html │ ├── all_9.html │ ├── all_a.html │ ├── all_b.html │ ├── all_c.html │ ├── all_d.html │ ├── all_e.html │ ├── all_f.html │ ├── enums_0.html │ ├── classes_0.html │ ├── classes_1.html │ ├── classes_2.html │ ├── classes_3.html │ ├── classes_4.html │ ├── classes_5.html │ ├── functions_0.html │ ├── functions_1.html │ ├── functions_2.html │ ├── functions_3.html │ ├── functions_4.html │ ├── functions_5.html │ ├── functions_6.html │ ├── functions_7.html │ ├── functions_8.html │ ├── functions_9.html │ ├── functions_a.html │ ├── functions_b.html │ ├── functions_c.html │ ├── functions_d.html │ ├── functions_e.html │ ├── functions_f.html │ ├── variables_0.html │ ├── functions_10.html │ ├── functions_11.html │ ├── functions_12.html │ ├── functions_13.html │ ├── functions_14.html │ ├── functions_6.js │ ├── all_b.js │ ├── functions_b.js │ ├── all_13.js │ ├── functions_13.js │ ├── all_4.js │ ├── functions_4.js │ └── all_0.js ├── classHMAuxLoadFB.png ├── classHMEventLoop.png ├── classHMLogStdout.png ├── classHMLogSyslog.png ├── classHMStorageHost.png ├── classHMWorkAuxFetch.png ├── classHMEventLoopQueue.png ├── classHMWorkDNSLookup.png ├── classHMConfigParserBase.png ├── classHMConfigParserYAML.png ├── classHMEventLoopLibEvent.png ├── classHMStorageHostGroup.png ├── classHMStorageHostText.png ├── classHMWorkAuxFetchCurl.png ├── classHMWorkDNSLookupAres.png ├── classHMWorkHealthCheck.png ├── classHMCommandListenerBase.png ├── classHMControlLinuxSocket.png ├── classHMWorkHealthCheckCurl.png ├── classHMWorkHealthCheckDNS.png ├── classHMWorkHealthCheckNone.png ├── classHMWorkHealthCheckTCP.png ├── classHMStorageHostGroupMDBM.png ├── classHMWorkDNSLookupLibEvent.png └── classHMWorkHealthCheckLibEvent.png ├── tests ├── lsan.supp ├── logTests │ ├── CMakeLists.txt │ └── TestHMLogTest.h ├── configParserTests │ ├── CMakeLists.txt │ ├── TestHMConfigParserBase.h │ └── TestHMPubSubConfigParserYaml.h ├── shared │ ├── common.h │ └── common.cpp ├── workTests │ ├── CMakeLists.txt │ ├── TestHMWork.h │ ├── TestHMWorkAresTest.h │ └── TestHMWorkHealthCheck.h ├── storeTests │ ├── CMakeLists.txt │ ├── TestHMStorage.h │ ├── TestHMStorageHost.h │ ├── TestHMStorageText.h │ └── TestHMStorageHostGroup.h ├── coreTests │ ├── TestHMRemoteCache.h │ ├── TestHMPubSubDataPacking.h │ ├── TestHMRemoteHostCache.h │ ├── TestHMDataCheckListAres.h │ ├── TestHMHash.h │ ├── TestHMTimeStamp.h │ ├── CMakeLists.txt │ ├── TestHMIPAddress.h │ ├── TestHMRemoteResult.h │ ├── TestHMWorkQueue.h │ ├── TestHMState.h │ ├── TestHMEventQueue.h │ ├── TestHMDNSResult.h │ ├── TestHMAuxInfo.h │ └── TestHMRemoteCache.cpp ├── externalIO │ ├── TestHMCommandListenerUtils.h │ ├── TestHMControlTLSSocket9.h │ ├── TestHMControlTLSSocket7.h │ ├── TestHMControlLinuxSocket2.h │ ├── TestHMControlTCPSocket2.h │ ├── TestHMControlLinuxSocket6.h │ ├── TestHMControlTLSSocket2.h │ ├── TestHMControlLinuxSocket3.h │ ├── TestHMControlTCPSocket6.h │ ├── TestHMControlTCPSocket3.h │ ├── TestHMControlTLSSocket3.h │ ├── TestHMControlTLSSocket8.h │ ├── TestHMControlTLSSocket6.h │ ├── TestHMControlLinuxSocket1.h │ ├── TestHMControlTCPSocket4.h │ ├── TestHMControlTCPSocket1.h │ ├── TestHMControlLinuxSocket4.h │ ├── TestHMControlTLSSocket4.h │ ├── CMakeLists.txt │ ├── TestHMControlTLSSocket1.h │ ├── TestHMControlLinuxSocket5.h │ ├── certs │ │ └── cert.sh │ ├── TestHMControlTCPSocket5.h │ └── TestHMControlLinuxSocket.h └── CMakeLists.txt ├── proto └── netchasm │ ├── threadinfo.proto │ ├── hashinfo.proto │ ├── ipaddress.proto │ ├── datahostcheck.proto │ ├── hostgroupinfo.proto │ ├── generalparams.proto │ ├── hostschdinfo.proto │ ├── hostresults.proto │ ├── auxinfo.proto │ ├── datahostgroup.proto │ └── datacheckresult.proto ├── src ├── NetCHASMDaemon │ └── CMakeLists.txt ├── hm_reload │ ├── hm_reload.1 │ └── CMakeLists.txt ├── hm_remote │ └── CMakeLists.txt ├── hm_command │ └── CMakeLists.txt ├── hm_staticdns │ ├── CMakeLists.txt │ └── hm_staticdns.1 ├── internal │ ├── HMPublisherDefault.cpp │ ├── HMLogAPI.cpp │ ├── HMPublisherProto.cpp │ ├── HMWorkHealthCheckNone.cpp │ ├── HMResultPublisher.cpp │ ├── HMLogStdout.cpp │ └── HMWorkHealthMultiWork.cpp └── api │ ├── HMNetCHASMAPI.cpp │ └── CMakeLists.txt ├── include ├── internal │ ├── HMOpenSSL.h │ ├── HMPubSubDataPacking.h │ ├── HMPubSubConfigParser.h │ ├── HMPublisherDefault.h │ ├── HMUtilitySpinLock.h │ ├── HMLogStdout.h │ ├── HMLogAPI.h │ ├── HMPublisherProto.h │ ├── HMControlTCPSocket.h │ ├── HMWorkDNSLookupStatic.h │ ├── HMLogSyslog.h │ ├── HMWorkHealthCheckNone.h │ ├── HMWorkHealthMultiWork.h │ ├── HMConfigParserYaml.h │ └── HMControlLinuxSocket.h └── NetCHASM │ └── HMNetCHASMAPI.h ├── ISSUE_TEMPLATE.md ├── pubsub-config-sample.yaml └── Contributing.md /api/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/bc_s.png -------------------------------------------------------------------------------- /docs/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/bdwn.png -------------------------------------------------------------------------------- /docs/doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/doc.png -------------------------------------------------------------------------------- /docs/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/open.png -------------------------------------------------------------------------------- /tests/lsan.supp: -------------------------------------------------------------------------------- 1 | leak:TlsData::getEntry 2 | leak:TlsData::getMLockEntry 3 | -------------------------------------------------------------------------------- /docs/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/closed.png -------------------------------------------------------------------------------- /docs/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/nav_f.png -------------------------------------------------------------------------------- /docs/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/nav_g.png -------------------------------------------------------------------------------- /docs/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/nav_h.png -------------------------------------------------------------------------------- /docs/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/tab_a.png -------------------------------------------------------------------------------- /docs/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/tab_b.png -------------------------------------------------------------------------------- /docs/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/tab_h.png -------------------------------------------------------------------------------- /docs/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/tab_s.png -------------------------------------------------------------------------------- /docs/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/doxygen.png -------------------------------------------------------------------------------- /docs/splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/splitbar.png -------------------------------------------------------------------------------- /docs/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/sync_off.png -------------------------------------------------------------------------------- /docs/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/sync_on.png -------------------------------------------------------------------------------- /docs/classHMWork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMWork.png -------------------------------------------------------------------------------- /docs/folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/folderopen.png -------------------------------------------------------------------------------- /docs/classHMAuxBase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMAuxBase.png -------------------------------------------------------------------------------- /docs/classHMAuxOOB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMAuxOOB.png -------------------------------------------------------------------------------- /docs/classHMLogAPI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMLogAPI.png -------------------------------------------------------------------------------- /docs/classHMLogBase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMLogBase.png -------------------------------------------------------------------------------- /docs/classHMLogText.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMLogText.png -------------------------------------------------------------------------------- /docs/classHMStorage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMStorage.png -------------------------------------------------------------------------------- /docs/folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/folderclosed.png -------------------------------------------------------------------------------- /docs/search/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/search/close.png -------------------------------------------------------------------------------- /docs/search/mag_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/search/mag_sel.png -------------------------------------------------------------------------------- /docs/classHMAuxLoadFB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMAuxLoadFB.png -------------------------------------------------------------------------------- /docs/classHMEventLoop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMEventLoop.png -------------------------------------------------------------------------------- /docs/classHMLogStdout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMLogStdout.png -------------------------------------------------------------------------------- /docs/classHMLogSyslog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMLogSyslog.png -------------------------------------------------------------------------------- /docs/search/search_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/search/search_l.png -------------------------------------------------------------------------------- /docs/search/search_m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/search/search_m.png -------------------------------------------------------------------------------- /docs/search/search_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/search/search_r.png -------------------------------------------------------------------------------- /docs/classHMStorageHost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMStorageHost.png -------------------------------------------------------------------------------- /docs/classHMWorkAuxFetch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMWorkAuxFetch.png -------------------------------------------------------------------------------- /docs/classHMEventLoopQueue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMEventLoopQueue.png -------------------------------------------------------------------------------- /docs/classHMWorkDNSLookup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMWorkDNSLookup.png -------------------------------------------------------------------------------- /docs/classHMConfigParserBase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMConfigParserBase.png -------------------------------------------------------------------------------- /docs/classHMConfigParserYAML.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMConfigParserYAML.png -------------------------------------------------------------------------------- /docs/classHMEventLoopLibEvent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMEventLoopLibEvent.png -------------------------------------------------------------------------------- /docs/classHMStorageHostGroup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMStorageHostGroup.png -------------------------------------------------------------------------------- /docs/classHMStorageHostText.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMStorageHostText.png -------------------------------------------------------------------------------- /docs/classHMWorkAuxFetchCurl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMWorkAuxFetchCurl.png -------------------------------------------------------------------------------- /docs/classHMWorkDNSLookupAres.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMWorkDNSLookupAres.png -------------------------------------------------------------------------------- /docs/classHMWorkHealthCheck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMWorkHealthCheck.png -------------------------------------------------------------------------------- /docs/classHMCommandListenerBase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMCommandListenerBase.png -------------------------------------------------------------------------------- /docs/classHMControlLinuxSocket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMControlLinuxSocket.png -------------------------------------------------------------------------------- /docs/classHMWorkHealthCheckCurl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMWorkHealthCheckCurl.png -------------------------------------------------------------------------------- /docs/classHMWorkHealthCheckDNS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMWorkHealthCheckDNS.png -------------------------------------------------------------------------------- /docs/classHMWorkHealthCheckNone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMWorkHealthCheckNone.png -------------------------------------------------------------------------------- /docs/classHMWorkHealthCheckTCP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMWorkHealthCheckTCP.png -------------------------------------------------------------------------------- /docs/classHMStorageHostGroupMDBM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMStorageHostGroupMDBM.png -------------------------------------------------------------------------------- /docs/classHMWorkDNSLookupLibEvent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMWorkDNSLookupLibEvent.png -------------------------------------------------------------------------------- /docs/search/classes_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['dnstimeout',['DNSTimeout',['../classDNSTimeout.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/classHMWorkHealthCheckLibEvent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/NetCHASM/master/docs/classHMWorkHealthCheckLibEvent.png -------------------------------------------------------------------------------- /docs/search/classes_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['logentry',['LogEntry',['../structHMLogBase_1_1LogEntry.html',1,'HMLogBase']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/classes_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['timeout',['Timeout',['../classHMEventLoopQueue_1_1Timeout.html',1,'HMEventLoopQueue']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/all_14.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['_7ehmhashmd5',['~HMHashMD5',['../classHMHashMD5.html#aab5bf23d116c6d307e8ea8d0342d12e3',1,'HMHashMD5']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/functions_14.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['_7ehmhashmd5',['~HMHashMD5',['../classHMHashMD5.html#aab5bf23d116c6d307e8ea8d0342d12e3',1,'HMHashMD5']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /proto/netchasm/threadinfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package netchasm; 3 | message ThreadInfo { 4 | uint64 numThreads = 1; 5 | uint64 numIdleThreads = 2; 6 | } 7 | -------------------------------------------------------------------------------- /docs/search/enums_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['timeouttype',['TimeoutType',['../classHMEventLoopQueue.html#a6d735f813535247ab4c5f6051516f444',1,'HMEventLoopQueue']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/classes_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['mdbmhandle',['MDBMHandle',['../classMDBMHandle.html',1,'']]], 4 | ['mdbmpool',['MDBMPool',['../classMDBMPool.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /proto/netchasm/hashinfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package netchasm; 3 | 4 | message HashHGPair { 5 | string hostgroupname = 1; 6 | int32 size = 2; 7 | bytes hash = 3; 8 | } 9 | 10 | message HashInfo { 11 | repeated HashHGPair items = 1; 12 | } 13 | -------------------------------------------------------------------------------- /tests/logTests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(ExternalProject) 2 | project(netchasm) 3 | 4 | file(GLOB SOURCES "./*.cpp") 5 | add_executable(logtests ${SOURCES} ../shared/common.cpp ../CppUnitTestRunner.cc) 6 | set_property(TARGET logtests PROPERTY CXX_STANDARD 14) 7 | 8 | add_test(logtests logtests) 9 | -------------------------------------------------------------------------------- /proto/netchasm/ipaddress.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package netchasm; 3 | message IPAddress { 4 | uint32 type = 1; 5 | uint32 addr0 = 2; 6 | uint32 addr1 = 3; 7 | uint32 addr2 = 4; 8 | uint32 addr3 = 5; 9 | } 10 | 11 | message IPAddresses { 12 | repeated IPAddress addresses = 1; 13 | } 14 | -------------------------------------------------------------------------------- /proto/netchasm/datahostcheck.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "netchasm/ipaddress.proto"; 3 | package netchasm; 4 | message DataHostCheck { 5 | uint32 dualstack = 1; 6 | uint32 checkType = 2; 7 | uint32 port = 3; 8 | string checkInfo = 4; 9 | IPAddress sourceAddress = 5; 10 | uint32 TOSValue = 6; 11 | uint32 dnsType = 7; 12 | } 13 | -------------------------------------------------------------------------------- /proto/netchasm/hostgroupinfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "netchasm/datacheckresult.proto"; 3 | import "netchasm/datahostgroup.proto"; 4 | 5 | package netchasm; 6 | message HostGroupCheckResult { 7 | string hostname = 1; 8 | DataCheckResult hostResults = 2; 9 | } 10 | 11 | message HostGroupInfo { 12 | DataHostGroup hostGroup = 1; 13 | repeated HostGroupCheckResult groupCheckResult = 2; 14 | } 15 | -------------------------------------------------------------------------------- /docs/search/all_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['emptyquery',['emptyQuery',['../classHMDataCheckParams.html#a162b3ccfb926cf79dcc3e12c6cc39cbf',1,'HMDataCheckParams']]], 4 | ['errorcallback',['errorCallback',['../classHMWorkHealthCheckLibEvent.html#ad235416c334437d59356e767e2ab01c9',1,'HMWorkHealthCheckLibEvent']]], 5 | ['errormsg',['errorMsg',['../classHMWorkHealthCheckTCP.html#a55f5a0f505509e1079093f30d933953c',1,'HMWorkHealthCheckTCP']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /proto/netchasm/generalparams.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package netchasm; 3 | 4 | message FixedUint { 5 | fixed64 data = 1; 6 | } 7 | 8 | message Uint { 9 | uint64 data = 1; 10 | } 11 | 12 | message Bool { 13 | bool data = 1; 14 | } 15 | 16 | message Int { 17 | int64 data = 1; 18 | } 19 | 20 | message List { 21 | repeated string items = 1; 22 | } 23 | 24 | message ListInt64 { 25 | repeated int64 items = 1; 26 | } 27 | -------------------------------------------------------------------------------- /docs/search/functions_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['emptyquery',['emptyQuery',['../classHMDataCheckParams.html#a162b3ccfb926cf79dcc3e12c6cc39cbf',1,'HMDataCheckParams']]], 4 | ['errorcallback',['errorCallback',['../classHMWorkHealthCheckLibEvent.html#ad235416c334437d59356e767e2ab01c9',1,'HMWorkHealthCheckLibEvent']]], 5 | ['errormsg',['errorMsg',['../classHMWorkHealthCheckTCP.html#a55f5a0f505509e1079093f30d933953c',1,'HMWorkHealthCheckTCP']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/searchdata.js: -------------------------------------------------------------------------------- 1 | var indexSectionsWithContent = 2 | { 3 | 0: "acdefghilmnopqrstuvw~", 4 | 1: "dhlmst", 5 | 2: "acdefghilmnopqrstuvw~", 6 | 3: "m", 7 | 4: "t" 8 | }; 9 | 10 | var indexSectionNames = 11 | { 12 | 0: "all", 13 | 1: "classes", 14 | 2: "functions", 15 | 3: "variables", 16 | 4: "enums" 17 | }; 18 | 19 | var indexSectionLabels = 20 | { 21 | 0: "All", 22 | 1: "Classes", 23 | 2: "Functions", 24 | 3: "Variables", 25 | 4: "Enumerations" 26 | }; 27 | 28 | -------------------------------------------------------------------------------- /tests/configParserTests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(ExternalProject) 2 | project(netchasm) 3 | 4 | list(APPEND SOURCES "TestHMConfigParserBase.cpp" "TestHMConfigParserYaml.cpp") 5 | 6 | 7 | if(NOT SKIP-KAFKA) 8 | list(APPEND SOURCES "TestHMPubSubConfigParserYaml.cpp") 9 | endif() 10 | 11 | add_executable(configparsertests ${SOURCES} ../shared/common.cpp ../CppUnitTestRunner.cc) 12 | set_property(TARGET configparsertests PROPERTY CXX_STANDARD 14) 13 | 14 | add_test(configparser configparsertests) 15 | -------------------------------------------------------------------------------- /docs/search/all_12.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['validateconfigs',['validateConfigs',['../classHMState.html#a17888a318b6e952eaa19fa1f2ec2944e',1,'HMState::validateConfigs()'],['../classHMStorageAPI.html#aa9aef6060f2ec9a14e433ccebfde6274',1,'HMStorageAPI::validateConfigs()']]], 4 | ['validatedbversion',['validateDBVersion',['../classHMStorage.html#aa0d71beb6677222128b0aadd1eb3ccbc',1,'HMStorage']]], 5 | ['validatehash',['validateHash',['../classHMStorageAPI.html#abfcf53cf62bb5846c8ba6046a59cddc2',1,'HMStorageAPI']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/classes_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['serstruct',['SerStruct',['../structHMDataCheckResult_1_1SerStruct.html',1,'HMDataCheckResult::SerStruct'],['../structHMConfigInfo_1_1SerStruct.html',1,'HMConfigInfo::SerStruct'],['../structHMAuxLoadFB_1_1SerStruct.html',1,'HMAuxLoadFB::SerStruct'],['../structHMDataHostGroup_1_1SerStruct.html',1,'HMDataHostGroup::SerStruct'],['../structHMDataHostCheck_1_1SerStruct.html',1,'HMDataHostCheck::SerStruct'],['../structHMAuxOOB_1_1SerStruct.html',1,'HMAuxOOB::SerStruct']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /tests/shared/common.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_COMMON_H_ 4 | #define TEST_COMMON_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "HMLogStdout.h" 11 | 12 | extern HMLogBase* ylog; 13 | 14 | void setupCommon(); 15 | void teardownCommon(); 16 | 17 | #endif // TEST_COMMON_H_ 18 | -------------------------------------------------------------------------------- /docs/search/functions_12.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['validateconfigs',['validateConfigs',['../classHMState.html#a17888a318b6e952eaa19fa1f2ec2944e',1,'HMState::validateConfigs()'],['../classHMStorageAPI.html#aa9aef6060f2ec9a14e433ccebfde6274',1,'HMStorageAPI::validateConfigs()']]], 4 | ['validatedbversion',['validateDBVersion',['../classHMStorage.html#aa0d71beb6677222128b0aadd1eb3ccbc',1,'HMStorage']]], 5 | ['validatehash',['validateHash',['../classHMStorageAPI.html#abfcf53cf62bb5846c8ba6046a59cddc2',1,'HMStorageAPI']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/nomatches.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
No Matches
10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/search/functions_10.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['tostring',['toString',['../classHMIPAddress.html#a380f4a52750d7979112b46d71caeb9de',1,'HMIPAddress::toString()'],['../classHMAPIIPAddress.html#a1c36238c824cd1e7b3929741fa7c8583',1,'HMAPIIPAddress::toString()']]], 4 | ['transfer',['transfer',['../classHMAuxBase.html#acd838d225519edd00ba678ed30cdeb74',1,'HMAuxBase::transfer()'],['../classHMAuxLoadFB.html#af0df86efd41e8325f36affacd9c59ab1',1,'HMAuxLoadFB::transfer()'],['../classHMAuxOOB.html#aa5d9934fbf0b54704abb3ecbf0a195cd',1,'HMAuxOOB::transfer()']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /tests/workTests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(ExternalProject) 2 | project(netchasm) 3 | 4 | list(APPEND SOURCES "TestHMWork.cpp" "TestHMWorkAuxFetch.cpp" "TestHMWorkDNSLookup.cpp" "TestHMWorkHealthCheck.cpp" "TestHMWorkRemoteCheck.cpp" "TestHMWorkRemoteHostCheck.cpp") 5 | if(NOT SKIP-ARES) 6 | list(APPEND SOURCES "TestHMWorkAresTest.cpp") 7 | endif() 8 | 9 | add_executable(worktests ${SOURCES} ../shared/common.cpp ../shared/TestStorage.cpp ../CppUnitTestRunner.cc) 10 | set_property(TARGET worktests PROPERTY CXX_STANDARD 14) 11 | 12 | add_test(worktests worktests) 13 | -------------------------------------------------------------------------------- /src/NetCHASMDaemon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(netchasm) 2 | 3 | set(CPP_FLAGS "-Wall -Wextra -Wchkp -Wfloat-equal") 4 | 5 | message( NetCHASMDaemon ) 6 | add_executable( NetCHASMDaemon NetCHASMDaemon.cpp) 7 | set_property(TARGET NetCHASMDaemon PROPERTY CXX_STANDARD 14) 8 | set_target_properties(NetCHASMDaemon PROPERTIES COMPILE_FLAGS "${CPP_FLAGS}") 9 | set_target_properties(NetCHASMDaemon PROPERTIES LINK_FLAGS "${CPP_FLAGS}") 10 | target_link_libraries (NetCHASMDaemon netchasm_core) 11 | install(TARGETS NetCHASMDaemon RUNTIME COMPONENT DIST DESTINATION ${CMAKE_INSTALL_BINDIR}) 12 | 13 | -------------------------------------------------------------------------------- /tests/shared/common.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #include "common.h" 4 | 5 | using namespace std; 6 | 7 | void setupCommon() 8 | { 9 | string logPath = "HM.log"; 10 | HM_LOG_LEVEL logLevel = HM_LOG_DEBUG3; 11 | hlog = new HMLogStdout(); 12 | hlog->initLogging(logPath, logLevel, true); 13 | } 14 | 15 | void teardownCommon() 16 | { 17 | hlog->shutDownLogging(); 18 | delete hlog; 19 | hlog = nullptr; 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/storeTests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(ExternalProject) 2 | project(netchasm) 3 | 4 | list(APPEND SOURCES "TestHMStorage.cpp" "TestHMStorageHost.cpp" "TestHMStorageHostGroup.cpp" "TestHMStorageText.cpp") 5 | if(NOT SKIP-MDBM) 6 | list(APPEND SOURCES "TestHMStorageHostGroupMDBM.cpp") 7 | endif() 8 | 9 | add_executable(storetests ${SOURCES} ../shared/common.cpp ../shared/TestStorage.cpp ../shared/TestStorageHost.cpp ../shared/TestStorageHostGroup.cpp ../CppUnitTestRunner.cc) 10 | set_property(TARGET storetests PROPERTY CXX_STANDARD 14) 11 | 12 | add_test(storetests storetests) 13 | -------------------------------------------------------------------------------- /src/hm_reload/hm_reload.1: -------------------------------------------------------------------------------- 1 | .TH hm_reload 1 "01 October 2019" "version 1.2" 2 | .SH NAME 3 | hm_reload - Tool to reload NetCHASM daemon 4 | .SH SYNOPSIS 5 | .B hm_reload [OPTIONS] 6 | .SH DESCRIPTION 7 | This tool helps reload the NetCHASM daemon 8 | .SH OPTIONS 9 | .BI " -s " 10 | SOCKET-PATH 11 | .PP 12 | Override the UNIX socket path for communicating with Daemon. The default path is /home/y/var/run/netchasm/controlsocket 13 | 14 | .SH OPTIONS 15 | .BI " -m " 16 | MASTER-CONFIG-PATH 17 | .PP 18 | Set the master config path to be passed along with the reload signal 19 | 20 | -------------------------------------------------------------------------------- /docs/search/functions_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['mdbmclear',['mdbmClear',['../classMDBMHandle.html#a0b084e6c80723fe26e747c41ba7b8834',1,'MDBMHandle']]], 4 | ['mdbmfetch',['mdbmFetch',['../classMDBMHandle.html#ae44912529e97fef70cd91ec3cbfc2a04',1,'MDBMHandle']]], 5 | ['mdbmremove',['mdbmRemove',['../classMDBMHandle.html#a50d9f1abcb4a41a2f6ffeb72eb51d181',1,'MDBMHandle']]], 6 | ['mdbmstore',['mdbmStore',['../classMDBMHandle.html#a571a21b1b7ba675a69ae4c0399d14b24',1,'MDBMHandle']]], 7 | ['monitorthreads',['monitorThreads',['../classHMThreadPool.html#ac2fffe3ff62f38d912bebcdd2785dcf4',1,'HMThreadPool']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /src/hm_reload/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(netchasm) 2 | 3 | set(CPP_FLAGS "-Wall -Wextra -Wchkp -Wfloat-equal") 4 | 5 | message( hm_reload ) 6 | add_executable( hm_reload hm_reload.cpp) 7 | set_property(TARGET hm_reload PROPERTY CXX_STANDARD 14) 8 | set_target_properties(hm_reload PROPERTIES COMPILE_FLAGS "${CPP_FLAGS}") 9 | set_target_properties(hm_reload PROPERTIES LINK_FLAGS "${CPP_FLAGS}") 10 | target_link_libraries (hm_reload netchasm) 11 | install(TARGETS hm_reload RUNTIME COMPONENT DIST DESTINATION ${CMAKE_INSTALL_BINDIR}) 12 | install(FILES hm_reload.1 COMPONENT DIST DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) 13 | -------------------------------------------------------------------------------- /src/hm_remote/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(netchasm) 2 | 3 | set(CPP_FLAGS "-Wall -Wextra -Wchkp -Wfloat-equal") 4 | 5 | message( hm_remote ) 6 | add_executable( hm_remote hm_remote.cpp) 7 | set_property(TARGET hm_remote PROPERTY CXX_STANDARD 14) 8 | set_target_properties(hm_remote PROPERTIES COMPILE_FLAGS "${CPP_FLAGS}") 9 | set_target_properties(hm_remote PROPERTIES LINK_FLAGS "${CPP_FLAGS}") 10 | target_link_libraries (hm_remote netchasm) 11 | install(TARGETS hm_remote RUNTIME COMPONENT DIST DESTINATION ${CMAKE_INSTALL_BINDIR}) 12 | install(FILES hm_remote.1 COMPONENT DIST DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) 13 | -------------------------------------------------------------------------------- /docs/search/all_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['nextchecktime',['nextCheckTime',['../classHMDataCheckList.html#a069ed6eb69fe0844391f5f62de7baa3e',1,'HMDataCheckList::nextCheckTime()'],['../classHMDataCheckParams.html#aa7343d4311b72f48a40eeed7f7de8af8',1,'HMDataCheckParams::nextCheckTime()']]], 4 | ['nextquerytime',['nextQueryTime',['../classHMDNSCache.html#a0c9107f0ef18192d85ef9f9f6b449a13',1,'HMDNSCache::nextQueryTime()'],['../classHMDNSResult.html#adaa1b56981b4b2c73e8292de82f67984',1,'HMDNSResult::nextQueryTime()']]], 5 | ['now',['now',['../classHMTimeStamp.html#a32f6daafb8b59ab43c73c6b69338c7ac',1,'HMTimeStamp']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/functions_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['nextchecktime',['nextCheckTime',['../classHMDataCheckList.html#a069ed6eb69fe0844391f5f62de7baa3e',1,'HMDataCheckList::nextCheckTime()'],['../classHMDataCheckParams.html#aa7343d4311b72f48a40eeed7f7de8af8',1,'HMDataCheckParams::nextCheckTime()']]], 4 | ['nextquerytime',['nextQueryTime',['../classHMDNSCache.html#a0c9107f0ef18192d85ef9f9f6b449a13',1,'HMDNSCache::nextQueryTime()'],['../classHMDNSResult.html#adaa1b56981b4b2c73e8292de82f67984',1,'HMDNSResult::nextQueryTime()']]], 5 | ['now',['now',['../classHMTimeStamp.html#a32f6daafb8b59ab43c73c6b69338c7ac',1,'HMTimeStamp']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /src/hm_command/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(netchasm) 2 | 3 | set(CPP_FLAGS "-Wall -Wextra -Wchkp -Wfloat-equal") 4 | 5 | message( hm_command ) 6 | add_executable( hm_command hm_command.cpp) 7 | set_property(TARGET hm_command PROPERTY CXX_STANDARD 14) 8 | set_target_properties(hm_command PROPERTIES COMPILE_FLAGS "${CPP_FLAGS}") 9 | set_target_properties(hm_command PROPERTIES LINK_FLAGS "${CPP_FLAGS}") 10 | target_link_libraries (hm_command netchasm) 11 | install(TARGETS hm_command RUNTIME COMPONENT DIST DESTINATION ${CMAKE_INSTALL_BINDIR}) 12 | install(FILES hm_command.1 COMPONENT DIST DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) 13 | -------------------------------------------------------------------------------- /proto/netchasm/hostschdinfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "netchasm/ipaddress.proto"; 4 | 5 | package netchasm; 6 | 7 | message HostSchedInfo 8 | { 9 | IPAddress address = 1; 10 | uint64 lastCheckTime = 2; 11 | uint64 nextCheckTime = 3; 12 | uint32 state = 4; 13 | } 14 | 15 | message DNSSchedInfo 16 | { 17 | bool hasv4 = 1; 18 | bool hasv6 = 2; 19 | uint64 v4LastCheckTime = 3; 20 | uint64 v4NextCheckTime = 4; 21 | uint32 v4State = 5; 22 | uint64 v6LastCheckTime = 6; 23 | uint64 v6NextCheckTime = 7; 24 | uint32 v6State = 8; 25 | repeated HostSchedInfo hostSchedInfo = 9; 26 | } 27 | -------------------------------------------------------------------------------- /src/hm_staticdns/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(netchasm) 2 | 3 | set(CPP_FLAGS "-Wall -Wextra -Wchkp -Wfloat-equal") 4 | 5 | message( hm_staticdns ) 6 | add_executable( hm_staticdns hm_staticdns.cpp) 7 | set_property(TARGET hm_staticdns PROPERTY CXX_STANDARD 14) 8 | set_target_properties(hm_staticdns PROPERTIES COMPILE_FLAGS "${CPP_FLAGS}") 9 | set_target_properties(hm_staticdns PROPERTIES LINK_FLAGS "${CPP_FLAGS}") 10 | target_link_libraries (hm_staticdns netchasm) 11 | install(TARGETS hm_staticdns RUNTIME COMPONENT DIST DESTINATION ${CMAKE_INSTALL_BINDIR}) 12 | install(FILES hm_staticdns.1 COMPONENT DIST DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) 13 | -------------------------------------------------------------------------------- /src/internal/HMPublisherDefault.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | 4 | #include "HMPublisherBase.h" 5 | #include "HMPublisherDefault.h" 6 | #include "HMLogBase.h" 7 | 8 | using namespace std; 9 | 10 | 11 | void 12 | HMPublisherDefault::publish(const string& hostName, const HMDataCheckResult& dataCheckResult, const int mark, set& hostGroups) const 13 | { 14 | // Code to handle result publishing 15 | (void)hostName; 16 | (void)dataCheckResult; 17 | (void)mark; 18 | (void)hostGroups; 19 | } 20 | -------------------------------------------------------------------------------- /src/internal/HMLogAPI.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "HMLogAPI.h" 10 | #include "HMConstants.h" 11 | 12 | using namespace std; 13 | 14 | void 15 | HMLogAPI::writeLog(LogEntry *entry) 16 | { 17 | if (entry->length > 0 && entry->level <= m_logLevel) 18 | { 19 | lock_guard lg(m_mutex); 20 | m_lastLogMessages.push_back(string(entry->entry)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /docs/search/functions_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['libeventdnscallback',['libEventDNSCallback',['../classHMWorkDNSLookupLibEvent.html#a9caacfa92431fa80c238e02876e6fc8f',1,'HMWorkDNSLookupLibEvent']]], 4 | ['loadallconfigs',['loadAllConfigs',['../classHMState.html#a56518918e78ffa43ee87888563c0bcc2',1,'HMState']]], 5 | ['loaddaemonstate',['loadDaemonState',['../classHMStateManager.html#abe677fc26cbce8a01e618d0b0c1dbd77',1,'HMStateManager']]], 6 | ['lock',['lock',['../classMDBMHandle.html#a27a73ad0253aabb226f4fbe05fcd34e3',1,'MDBMHandle::lock()'],['../classHMUtilitySpinLock.html#a8bf401f935907f99a6b0ea59d6d10d2d',1,'HMUtilitySpinLock::lock()']]], 7 | ['log',['log',['../classHMLogBase.html#ac34968a6bfbd2de317f2845d31c5186c',1,'HMLogBase']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /include/internal/HMOpenSSL.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef INCLUDE_INTERNAL_HMOPENSSL_H_ 4 | #define INCLUDE_INTERNAL_HMOPENSSL_H_ 5 | 6 | //! Setup locks for openssl versions < 1.1.0 7 | /* 8 | Manage locking for openssl versions 1.0.*. 9 | /return return 1 on success, 0 otherwise. 10 | */ 11 | int thread_setup(void); 12 | 13 | //! Clean up the locks setup for openssl. 14 | /* 15 | Clean up the locks established for older openssl versions(1.0.*). 16 | /return return 1 on success, 0 otherwise. 17 | */ 18 | int thread_cleanup(void); 19 | 20 | #endif /* INCLUDE_INTERNAL_HMOPENSSL_H_ */ 21 | -------------------------------------------------------------------------------- /proto/netchasm/hostresults.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "netchasm/datacheckresult.proto"; 3 | 4 | package netchasm; 5 | message DataCheckParam { 6 | uint32 numCheckRetries = 1; 7 | uint32 checkRetryDelay = 2; 8 | uint32 measurementOptions = 3; 9 | uint32 smoothingWindow = 4; 10 | uint32 groupThreshold = 5; 11 | uint32 slowThreshold = 6; 12 | uint32 maxFlaps = 7; 13 | uint64 checkTimeout = 8; 14 | uint64 checkTTL = 9; 15 | uint32 flapThreshold = 10; 16 | uint32 passthroughInfo = 11; 17 | } 18 | 19 | message CheckParamsCheckResult { 20 | DataCheckParam checkParam = 1; 21 | DataCheckResult checkResult = 2; 22 | } 23 | 24 | message HostResult { 25 | repeated CheckParamsCheckResult hostResults = 1; 26 | } 27 | -------------------------------------------------------------------------------- /docs/search/all_10.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['timeout',['Timeout',['../classHMEventLoopQueue_1_1Timeout.html',1,'HMEventLoopQueue']]], 4 | ['timeouttype',['TimeoutType',['../classHMEventLoopQueue.html#a6d735f813535247ab4c5f6051516f444',1,'HMEventLoopQueue']]], 5 | ['tostring',['toString',['../classHMIPAddress.html#a380f4a52750d7979112b46d71caeb9de',1,'HMIPAddress::toString()'],['../classHMAPIIPAddress.html#a1c36238c824cd1e7b3929741fa7c8583',1,'HMAPIIPAddress::toString()']]], 6 | ['transfer',['transfer',['../classHMAuxBase.html#acd838d225519edd00ba678ed30cdeb74',1,'HMAuxBase::transfer()'],['../classHMAuxLoadFB.html#af0df86efd41e8325f36affacd9c59ab1',1,'HMAuxLoadFB::transfer()'],['../classHMAuxOOB.html#aa5d9934fbf0b54704abb3ecbf0a195cd',1,'HMAuxOOB::transfer()']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /src/internal/HMPublisherProto.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | 4 | #include "HMPublisherBase.h" 5 | #include "HMPublisherProto.h" 6 | #include "HMPubSubDataPacking.h" 7 | #include "HMLogBase.h" 8 | 9 | using namespace std; 10 | 11 | 12 | void 13 | HMPublisherProto::publish(const string& hostName, const HMDataCheckResult& dataCheckResult, const int mark, set& hostGroups) const 14 | { 15 | HMPubSubDataPacking dataPacking; 16 | uint64_t buflen; 17 | unique_ptr data = dataPacking.packPublishResults(hostName, mark, hostGroups, dataCheckResult, buflen); 18 | publish(data.get(), buflen); 19 | } 20 | -------------------------------------------------------------------------------- /proto/netchasm/auxinfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "netchasm/ipaddress.proto"; 4 | 5 | package netchasm; 6 | message OOB { 7 | uint32 type = 1; 8 | uint32 shed = 2; 9 | uint32 ts = 3; 10 | uint32 forceDown = 4; 11 | string host = 5; 12 | string resource = 6; 13 | } 14 | 15 | message LFB { 16 | uint32 type = 1; 17 | uint64 ts = 2; 18 | int64 load = 3; 19 | int64 target = 4; 20 | int64 max = 5; 21 | string host = 6; 22 | string resource = 7; 23 | string datacenter = 8; 24 | } 25 | 26 | message AuxInfo { 27 | string host = 1; 28 | IPAddress address = 2; 29 | uint64 ttl = 3; 30 | uint64 updatetime = 4; 31 | repeated OOB oob = 5; 32 | repeated LFB lfb = 6; 33 | } 34 | 35 | message AuxResults { 36 | repeated AuxInfo auxInfos = 1; 37 | } 38 | -------------------------------------------------------------------------------- /docs/search/all_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['libeventdnscallback',['libEventDNSCallback',['../classHMWorkDNSLookupLibEvent.html#a9caacfa92431fa80c238e02876e6fc8f',1,'HMWorkDNSLookupLibEvent']]], 4 | ['loadallconfigs',['loadAllConfigs',['../classHMState.html#a56518918e78ffa43ee87888563c0bcc2',1,'HMState']]], 5 | ['loaddaemonstate',['loadDaemonState',['../classHMStateManager.html#abe677fc26cbce8a01e618d0b0c1dbd77',1,'HMStateManager']]], 6 | ['lock',['lock',['../classMDBMHandle.html#a27a73ad0253aabb226f4fbe05fcd34e3',1,'MDBMHandle::lock()'],['../classHMUtilitySpinLock.html#a8bf401f935907f99a6b0ea59d6d10d2d',1,'HMUtilitySpinLock::lock()']]], 7 | ['log',['log',['../classHMLogBase.html#ac34968a6bfbd2de317f2845d31c5186c',1,'HMLogBase']]], 8 | ['logentry',['LogEntry',['../structHMLogBase_1_1LogEntry.html',1,'HMLogBase']]] 9 | ]; 10 | -------------------------------------------------------------------------------- /tests/coreTests/TestHMRemoteCache.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMRemoteCache_H_ 4 | #define TEST_HMRemoteCache_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #define TESTNAME Test_HMRemoteCache 11 | 12 | class TESTNAME: public CppUnit::TestFixture { 13 | 14 | CPPUNIT_TEST_SUITE(TESTNAME); 15 | CPPUNIT_TEST(test_basic_cache); 16 | CPPUNIT_TEST(test_basic_cache1); 17 | CPPUNIT_TEST_SUITE_END(); 18 | 19 | public: 20 | void setUp(); 21 | void tearDown(); 22 | void test_basic_cache(); 23 | void test_basic_cache1(); 24 | protected: 25 | 26 | }; 27 | 28 | #endif /* TEST_HMRemoteCache_H_ */ 29 | 30 | -------------------------------------------------------------------------------- /tests/coreTests/TestHMPubSubDataPacking.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMPUBSUBDATAPACKING_H_ 4 | #define TEST_HMPUBSUBDATAPACKING_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMWorkQueue.h" 10 | 11 | #define TESTNAME Test_HMPubSubDataPacking 12 | 13 | class TESTNAME : public CppUnit::TestFixture 14 | { 15 | 16 | CPPUNIT_TEST_SUITE(TESTNAME); 17 | CPPUNIT_TEST(test_protobuf_packing); 18 | CPPUNIT_TEST_SUITE_END(); 19 | 20 | 21 | public: 22 | 23 | void setUp(); 24 | void tearDown(); 25 | void test_protobuf_packing(); 26 | protected: 27 | 28 | }; 29 | 30 | #endif /* TEST_HMPUBSUBDATAPACKING_H_ */ 31 | -------------------------------------------------------------------------------- /tests/coreTests/TestHMRemoteHostCache.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMRemoteHostCache_H_ 4 | #define TEST_HMRemoteHostCache_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #define TESTNAME Test_HMRemoteHostCache 11 | 12 | class TESTNAME: public CppUnit::TestFixture { 13 | 14 | CPPUNIT_TEST_SUITE(TESTNAME); 15 | CPPUNIT_TEST(test_basic_cache); 16 | CPPUNIT_TEST(test_basic_cache1); 17 | CPPUNIT_TEST_SUITE_END(); 18 | 19 | public: 20 | void setUp(); 21 | void tearDown(); 22 | void test_basic_cache(); 23 | void test_basic_cache1(); 24 | protected: 25 | 26 | }; 27 | 28 | #endif /* TEST_HMRemoteHostCache_H_ */ 29 | 30 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMCommandListenerUtils.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_STORETESTS_TESTHMSTORAGE_H_ 4 | #define TESTS_STORETESTS_TESTHMSTORAGE_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMCommandListenerUtils 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_handlerThreads); 19 | CPPUNIT_TEST_SUITE_END(); 20 | 21 | 22 | public: 23 | void setUp(); 24 | void tearDown(); 25 | 26 | protected: 27 | void test_handlerThreads(); 28 | }; 29 | #endif /* TESTS_STORETESTS_TESTHMSTORAGE_H_ */ 30 | -------------------------------------------------------------------------------- /tests/coreTests/TestHMDataCheckListAres.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMDataCheckListAres_H_ 4 | #define TEST_HMDataCheckListAres_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMWorkQueue.h" 10 | 11 | #define TESTNAME Test_HMDataCheckListAres 12 | 13 | class TESTNAME : public CppUnit::TestFixture 14 | { 15 | 16 | CPPUNIT_TEST_SUITE(TESTNAME); 17 | CPPUNIT_TEST(test_basic_healthPlugins_dnsvc); 18 | CPPUNIT_TEST_SUITE_END(); 19 | 20 | 21 | public: 22 | 23 | void setUp(); 24 | void tearDown(); 25 | void test_basic_healthPlugins_dnsvc(); 26 | protected: 27 | 28 | }; 29 | 30 | #endif /* TEST_HMDataCheckListAres_H_ */ 31 | 32 | -------------------------------------------------------------------------------- /include/internal/HMPubSubDataPacking.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef HMPUBSUBDATAPACKING_H_ 4 | #define HMPUBSUBDATAPACKING_H_ 5 | 6 | #include 7 | 8 | #include "HMDataPacking.h" 9 | 10 | class HMPubSubDataPacking 11 | { 12 | public: 13 | std::unique_ptr packPublishResults(const std::string& hostName, const int mark, const std::set& hostGroups, const HMDataCheckResult& dataCheckresult, uint64_t& dataSize) const ; 14 | bool unpackPublishResults(std::unique_ptr& data, uint64_t& dataSize, uint8_t& publisherVersion, std::string& hostName, int& mark, std::set& hostGroups, HMDataCheckResult& dataCheckresult) const; 15 | 16 | private: 17 | HMDataPacking m_dataPacking; 18 | }; 19 | 20 | #endif /* HMPUBSUBDATAPACKING_H_ */ 21 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(shared) 2 | 3 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wextra -Wchkp -Wfloat-equal -fprofile-arcs -ftest-coverage") 4 | 5 | if(ASAN) 6 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan") 7 | endif(ASAN) 8 | 9 | if(NOT SKIP-ARES) 10 | ADD_DEFINITIONS(-DUSE_ARES) 11 | endif() 12 | 13 | execute_process ( 14 | COMMAND export CPPUNITTESTENVARGS = LSAN_OPTIONS=suppressions=$(LSANSUPPRESSIONSFILE) ASAN_OPTIONS=fast_unwind_on_malloc=0:detect_stack_use_after_return=true:check_initialization_order=true 15 | ) 16 | link_libraries (pthread) 17 | link_libraries (cppunit) 18 | link_libraries (netchasm) 19 | 20 | add_subdirectory(configParserTests) 21 | add_subdirectory(coreTests) 22 | add_subdirectory(externalIO) 23 | add_subdirectory(logTests) 24 | add_subdirectory(storeTests) 25 | add_subdirectory(workTests) 26 | 27 | -------------------------------------------------------------------------------- /tests/coreTests/TestHMHash.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMHASH_H_ 4 | #define TEST_HMHASH_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "HMState.h" 11 | #include "HMConstants.h" 12 | #include "HMHashMD5.h" 13 | 14 | #define TESTNAME Test_HMHASH 15 | 16 | class TESTNAME : public CppUnit::TestFixture 17 | { 18 | 19 | CPPUNIT_TEST_SUITE(TESTNAME); 20 | CPPUNIT_TEST(TestHash_match); 21 | CPPUNIT_TEST(TestHash_mismatch); 22 | CPPUNIT_TEST_SUITE_END(); 23 | 24 | 25 | public: 26 | void setUp(); 27 | void tearDown(); 28 | 29 | protected: 30 | void TestHash_match(); 31 | void TestHash_mismatch(); 32 | }; 33 | 34 | #endif // TEST_HMHASH_H_ 35 | 36 | -------------------------------------------------------------------------------- /tests/coreTests/TestHMTimeStamp.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTTIMESTAMP_H_ 4 | #define TESTTIMESTAMP_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMTimeStamp.h" 10 | 11 | #define TESTNAME Test_TimeStamp 12 | 13 | class TESTNAME : public CppUnit::TestFixture { 14 | 15 | CPPUNIT_TEST_SUITE(TESTNAME); 16 | CPPUNIT_TEST(test_timestamp1); 17 | CPPUNIT_TEST(test_timestamp2); 18 | CPPUNIT_TEST(test_timestamp3); 19 | CPPUNIT_TEST_SUITE_END(); 20 | 21 | 22 | public: 23 | void setUp(); 24 | void tearDown(); 25 | 26 | protected: 27 | void test_timestamp1(); 28 | void test_timestamp2(); 29 | void test_timestamp3(); 30 | }; 31 | 32 | #endif /* TESTTIMESTAMP_H_ */ 33 | -------------------------------------------------------------------------------- /docs/search/functions_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['daemonise',['daemonise',['../classHMGuardian.html#a99dfab42152cd22b4c3731aab340bfe5',1,'HMGuardian']]], 4 | ['deserialize',['deserialize',['../classHMAuxBase.html#afd56a07e5f7db2d324bfe2cfbabcd89e',1,'HMAuxBase::deserialize()'],['../classHMDataCheckResult.html#a2d50a71f9e056100465afb21ca9d3197',1,'HMDataCheckResult::deserialize()'],['../classHMDataHostCheck.html#a66be75d8daa16b9a31c8315b6cde4192',1,'HMDataHostCheck::deserialize()'],['../classHMDataHostGroup.html#a7bda4def8387f0b904bbe0adc5b2e16b',1,'HMDataHostGroup::deserialize()']]], 5 | ['dnslookup',['dnsLookup',['../classHMWorkDNSLookup.html#aa7104a24bc981d0f674441a27ed3d2d3',1,'HMWorkDNSLookup::dnsLookup()'],['../classHMWorkDNSLookupAres.html#a612c9edbbf3312edaac96b6a0544a734',1,'HMWorkDNSLookupAres::dnsLookup()'],['../classHMWorkDNSLookupLibEvent.html#abf1242741fd8e51ee0900357ea67d2a5',1,'HMWorkDNSLookupLibEvent::dnsLookup()']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /proto/netchasm/datahostgroup.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "netchasm/ipaddress.proto"; 3 | package netchasm; 4 | message DataHostGroup { 5 | uint32 measurementOptions = 1; 6 | uint32 dualstack = 2; 7 | uint32 checkType = 3; 8 | uint32 port = 4; 9 | uint32 numCheckRetries = 5; 10 | uint32 checkRetryDelay = 6; 11 | uint32 smoothingWindow = 7; 12 | uint32 groupThreshold = 8; 13 | uint32 slowThreshold = 9; 14 | uint32 maxFlaps = 10; 15 | uint64 checkTimeout = 11; 16 | uint64 checkTTL = 12; 17 | uint32 flapThreshold = 13; 18 | uint32 passthroughInfo = 14; 19 | string checkInfo = 15; 20 | uint32 remoteCheckType = 16; 21 | string remoteCheck = 17; 22 | uint32 distributedFallback = 18; 23 | IPAddress sourceAddress = 19; 24 | uint32 TOSValue = 20; 25 | uint32 dnsType = 21; 26 | repeated string hosts = 22; 27 | repeated string hostgroups = 23; 28 | } 29 | -------------------------------------------------------------------------------- /tests/storeTests/TestHMStorage.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_STORETESTS_TESTHMSTORAGE_H_ 4 | #define TESTS_STORETESTS_TESTHMSTORAGE_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "HMStorage.h" 11 | 12 | #define TESTNAME Test_HMStorage 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_HMStorage_Construction); 19 | CPPUNIT_TEST(test_HMStorage_OpenClose); 20 | CPPUNIT_TEST_SUITE_END(); 21 | 22 | 23 | public: 24 | void setUp(); 25 | void tearDown(); 26 | 27 | protected: 28 | void test_HMStorage_Construction(); 29 | void test_HMStorage_OpenClose(); 30 | 31 | }; 32 | #endif /* TESTS_STORETESTS_TESTHMSTORAGE_H_ */ 33 | -------------------------------------------------------------------------------- /src/hm_staticdns/hm_staticdns.1: -------------------------------------------------------------------------------- 1 | .TH hm_staticdns 1 "01 October 2019" "version 1.2" 2 | .SH NAME 3 | hm_staticdns - Tool to manipulate static DNS entries for hosts to NetCHASM daemon 4 | .SH SYNOPSIS 5 | .B hm_staticdns [OPTIONS] COMMAND 6 | .SH DESCRIPTION 7 | This tool interacts with the NetCHASM daemon to add, remove and retrieve DNS entries for host for static DNS feature 8 | .SH OPTIONS 9 | .BI " -s " 10 | SOCKET-PATH 11 | .PP 12 | Override the UNIX socket path for communicating with Daemon. The default path is /home/y/var/run/netchasm/controlsocket 13 | 14 | .SH COMMAND 15 | 16 | .BI " getdnsaddresses" 17 | HOST 18 | .PP 19 | Returns static DNS addresses for the HOST 20 | 21 | .BI " removednsaddresses" 22 | HOST [IP-ADDRESS1] [IP-ADDRESS2] . . . 23 | .PP 24 | Remove addresses from static DNS for a HOST 25 | 26 | .BI " adddnsaddresses" 27 | HOST [IP-ADDRESS1] [IP-ADDRESS2] . . . 28 | .PP 29 | Add addresses to static DNS for a HOST 30 | -------------------------------------------------------------------------------- /docs/search/all_d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['queryneeded',['queryNeeded',['../classHMDNSCache.html#ad6188645c19105fcde20674358c3d4ad',1,'HMDNSCache::queryNeeded()'],['../classHMDNSResult.html#a7f80261c11bc4cb4e8a86a0502ab3c81',1,'HMDNSResult::queryNeeded()']]], 4 | ['queuecheck',['queueCheck',['../classHMDataCheckList.html#a4c5f06861390e7d11929bdbc8e05851a',1,'HMDataCheckList']]], 5 | ['queuednslookups',['queueDNSLookups',['../classHMDNSCache.html#a82a67cfa1cdc3f2264179d488799a786',1,'HMDNSCache']]], 6 | ['queuednsquery',['queueDNSQuery',['../classHMDNSCache.html#aa2c2f2c81e5d5dddd90449ec77a5c2a7',1,'HMDNSCache']]], 7 | ['queuequerry',['queueQuerry',['../classHMDataCheckParams.html#a87a1651013546e30b1b18716eabe03b0',1,'HMDataCheckParams']]], 8 | ['queuequery',['queueQuery',['../classHMDNSResult.html#ae2a8df86a67b2d899f9e13ec59588afb',1,'HMDNSResult']]], 9 | ['queuesize',['queueSize',['../classHMWorkQueue.html#a1aa8a1c2214b0b7f24b2767ec338ddac',1,'HMWorkQueue']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /include/internal/HMPubSubConfigParser.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef HMPUBSUBCONFIGPARSER_H_ 4 | #define HMPUBSUBCONFIGPARSER_H_ 5 | 6 | #include 7 | #include 8 | 9 | #include "HMConfigParserBase.h" 10 | 11 | #define IS_FOLDER 0x4 12 | #define IS_FILE 0x8 13 | 14 | class HMPubSubConfigParser 15 | { 16 | public: 17 | HMPubSubConfigParser() {} 18 | 19 | //! Main parse config function. 20 | /*! 21 | The function used to parse a config file. 22 | \param fileName the file to parse. 23 | \param state the state data structure to fill from the config information. 24 | \return the number of config parsing errors. Zero means a successful load. 25 | */ 26 | uint32_t parseConfig(const std::string& fileName, HMState& state); 27 | }; 28 | 29 | #endif /* HMPUBSUBCONFIGPARSER_H_ */ 30 | 31 | -------------------------------------------------------------------------------- /docs/search/functions_d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['queryneeded',['queryNeeded',['../classHMDNSCache.html#ad6188645c19105fcde20674358c3d4ad',1,'HMDNSCache::queryNeeded()'],['../classHMDNSResult.html#a7f80261c11bc4cb4e8a86a0502ab3c81',1,'HMDNSResult::queryNeeded()']]], 4 | ['queuecheck',['queueCheck',['../classHMDataCheckList.html#a4c5f06861390e7d11929bdbc8e05851a',1,'HMDataCheckList']]], 5 | ['queuednslookups',['queueDNSLookups',['../classHMDNSCache.html#a82a67cfa1cdc3f2264179d488799a786',1,'HMDNSCache']]], 6 | ['queuednsquery',['queueDNSQuery',['../classHMDNSCache.html#aa2c2f2c81e5d5dddd90449ec77a5c2a7',1,'HMDNSCache']]], 7 | ['queuequerry',['queueQuerry',['../classHMDataCheckParams.html#a87a1651013546e30b1b18716eabe03b0',1,'HMDataCheckParams']]], 8 | ['queuequery',['queueQuery',['../classHMDNSResult.html#ae2a8df86a67b2d899f9e13ec59588afb',1,'HMDNSResult']]], 9 | ['queuesize',['queueSize',['../classHMWorkQueue.html#a1aa8a1c2214b0b7f24b2767ec338ddac',1,'HMWorkQueue']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /docs/search/all_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['daemonise',['daemonise',['../classHMGuardian.html#a99dfab42152cd22b4c3731aab340bfe5',1,'HMGuardian']]], 4 | ['deserialize',['deserialize',['../classHMAuxBase.html#afd56a07e5f7db2d324bfe2cfbabcd89e',1,'HMAuxBase::deserialize()'],['../classHMDataCheckResult.html#a2d50a71f9e056100465afb21ca9d3197',1,'HMDataCheckResult::deserialize()'],['../classHMDataHostCheck.html#a66be75d8daa16b9a31c8315b6cde4192',1,'HMDataHostCheck::deserialize()'],['../classHMDataHostGroup.html#a7bda4def8387f0b904bbe0adc5b2e16b',1,'HMDataHostGroup::deserialize()']]], 5 | ['dnslookup',['dnsLookup',['../classHMWorkDNSLookup.html#aa7104a24bc981d0f674441a27ed3d2d3',1,'HMWorkDNSLookup::dnsLookup()'],['../classHMWorkDNSLookupAres.html#a612c9edbbf3312edaac96b6a0544a734',1,'HMWorkDNSLookupAres::dnsLookup()'],['../classHMWorkDNSLookupLibEvent.html#abf1242741fd8e51ee0900357ea67d2a5',1,'HMWorkDNSLookupLibEvent::dnsLookup()']]], 6 | ['dnstimeout',['DNSTimeout',['../classDNSTimeout.html',1,'']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /tests/coreTests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(ExternalProject) 2 | project(netchasm) 3 | 4 | list(APPEND SOURCES "TestHMDataCheckList.cpp" "TestHMDataCheckParams.cpp" "TestHMDataHostCheck.cpp" "TestHMDNSCache.cpp" 5 | "TestHMDNSResult.cpp" "TestHMEventQueue.cpp" "TestHMHash.cpp" "TestHMIPAddress.cpp" "TestHMPubSubDataPacking.cpp" 6 | "TestHMThreadPool.cpp" "TestHMTimeStamp.cpp" "TestHMWorkQueue.cpp" "TestHMRemoteCache.cpp" "TestHMRemoteResult.cpp" 7 | "TestHMRemoteHostCache.cpp" "TestHMState.cpp") 8 | 9 | if(NOT SKIP-MDBM) 10 | list(APPEND SOURCES "TestHMStateManager.cpp") 11 | endif() 12 | 13 | if(NOT SKIP-RAPIDXML) 14 | list(APPEND SOURCES "TestHMAuxInfo.cpp") 15 | endif() 16 | 17 | 18 | if(NOT SKIP-ARES) 19 | list(APPEND SOURCES "TestHMDataCheckListAres.cpp") 20 | endif() 21 | 22 | add_executable(coretests ${SOURCES} ../shared/common.cpp ../shared/TestStorageHostGroup.cpp ../CppUnitTestRunner.cc) 23 | set_property(TARGET coretests PROPERTY CXX_STANDARD 14) 24 | 25 | add_test(coretests coretests) 26 | 27 | -------------------------------------------------------------------------------- /tests/coreTests/TestHMIPAddress.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTHMIPADDRESS_H_ 4 | #define TESTHMIPADDRESS_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #define TESTNAME Test_HMIPAddress 11 | 12 | class TESTNAME : public CppUnit::TestFixture { 13 | 14 | CPPUNIT_TEST_SUITE(TESTNAME); 15 | CPPUNIT_TEST(test_v4_sets); 16 | CPPUNIT_TEST(test_v6_sets); 17 | CPPUNIT_TEST(test_comparisonsv4); 18 | CPPUNIT_TEST(test_comparisonsv6); 19 | CPPUNIT_TEST(test_printing); 20 | CPPUNIT_TEST_SUITE_END(); 21 | 22 | 23 | public: 24 | void setUp(); 25 | void tearDown(); 26 | 27 | protected: 28 | void test_v4_sets(); 29 | void test_v6_sets(); 30 | void test_comparisonsv4(); 31 | void test_comparisonsv6(); 32 | void test_printing(); 33 | }; 34 | 35 | #endif /* TESTHMIPADDRESS_H_ */ 36 | -------------------------------------------------------------------------------- /tests/coreTests/TestHMRemoteResult.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMRemoteResult_H_ 4 | #define TEST_HMRemoteResult_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMRemoteResult.h" 10 | 11 | 12 | #define TESTNAME Test_HMRemoteResult 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_next_query); 19 | CPPUNIT_TEST(test_next_query1); 20 | CPPUNIT_TEST(test_next_query2); 21 | CPPUNIT_TEST(test_queue_query); 22 | CPPUNIT_TEST_SUITE_END(); 23 | 24 | 25 | public: 26 | void setUp(); 27 | void tearDown(); 28 | void test_next_query(); 29 | void test_next_query1(); 30 | void test_next_query2(); 31 | void test_queue_query(); 32 | protected: 33 | }; 34 | 35 | #endif /* TEST_HMRemoteResult_H_ */ 36 | 37 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlTLSSocket9.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_HMCONTROLTLSSOCKET9_H_ 4 | #define TESTS_HMCONTROLTLSSOCKET9_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlTLSSocket9 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr1); 19 | CPPUNIT_TEST_SUITE_END(); 20 | 21 | 22 | public: 23 | void setUp(); 24 | void tearDown(); 25 | 26 | protected: 27 | void test_cmdlstnr1(); 28 | HMStateManager *sm; 29 | std::thread sm_thr; 30 | HMAPIIPAddress server; 31 | uint16_t port; 32 | std::string certfile; 33 | std::string keyfile; 34 | std::string caFile; 35 | }; 36 | #endif /* TESTS_HMCONTROLTLSSOCKET6_H_ */ 37 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlTLSSocket7.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_HMCONTROLTLSSOCKET7_H_ 4 | #define TESTS_HMCONTROLTLSSOCKET7_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlTLSSocket7 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr1); 19 | CPPUNIT_TEST(test_cmdlstnr2); 20 | CPPUNIT_TEST(test_cmdlstnr3); 21 | CPPUNIT_TEST(test_cmdlstnr4); 22 | CPPUNIT_TEST_SUITE_END(); 23 | 24 | 25 | public: 26 | void setUp(); 27 | void tearDown(); 28 | 29 | protected: 30 | void test_cmdlstnr1(); 31 | void test_cmdlstnr2(); 32 | void test_cmdlstnr3(); 33 | void test_cmdlstnr4(); 34 | }; 35 | #endif /* TESTS_HMCONTROLTLSSOCKET7_H_ */ 36 | -------------------------------------------------------------------------------- /include/internal/HMPublisherDefault.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef HMPUBLISHERDEFAULT_H_ 4 | #define HMPUBLISHERDEFAULT_H_ 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "HMPublisherBase.h" 10 | 11 | class HMPublisherDefault : public HMPublisherBase 12 | { 13 | public: 14 | ~HMPublisherDefault() {} 15 | //! This function is called to publish the check information to the publisher. 16 | /* 17 | This function is called to publish the check information to the publisher. 18 | \param host name; 19 | \param check result of the host. 20 | \param mark value used 0 Otherwise 21 | \param hostgroups associated with the check 22 | */ 23 | void publish(const std::string& hostName, const HMDataCheckResult& dataCheckResult, const int mark, std::set& hostGroups) const; 24 | }; 25 | 26 | #endif /* HMPUBLISHERDEFAULT_H_ */ 27 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlLinuxSocket2.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_HMCONTROLLINUXSOCKET2_H_ 4 | #define TESTS_HMCONTROLLINUXSOCKET2_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlLinuxSocket2 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr1); 19 | CPPUNIT_TEST(test_cmdlstnr2); 20 | CPPUNIT_TEST(test_cmdlstnr3); 21 | CPPUNIT_TEST_SUITE_END(); 22 | 23 | 24 | public: 25 | void setUp(); 26 | void tearDown(); 27 | 28 | protected: 29 | void test_cmdlstnr1(); 30 | void test_cmdlstnr2(); 31 | void test_cmdlstnr3(); 32 | HMStateManager *sm; 33 | std::thread sm_thr; 34 | HMTimeStamp now; 35 | }; 36 | #endif /* TESTS_HMCONTROLLINUXSOCKET2_H_ */ 37 | -------------------------------------------------------------------------------- /tests/storeTests/TestHMStorageHost.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_STORETESTS_TESTHMSTORAGEHOST_H_ 4 | #define TESTS_STORETESTS_TESTHMSTORAGEHOST_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "HMStorageHost.h" 11 | #include "TestStorageHost.h" 12 | #define TESTNAME Test_HMStorageHost 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_HMStorageHost_ReadOnly); 19 | CPPUNIT_TEST(test_HMStorageHost_ReadWrite); 20 | //CPPUNIT_TEST(test_HMStorageHost_Restore); 21 | CPPUNIT_TEST_SUITE_END(); 22 | 23 | 24 | public: 25 | void setUp(); 26 | void tearDown(); 27 | 28 | protected: 29 | void test_HMStorageHost_ReadOnly(); 30 | void test_HMStorageHost_ReadWrite(); 31 | void test_HMStorageHost_Restore(); 32 | }; 33 | 34 | #endif /* TESTS_STORETESTS_TESTHMSTORAGEHOST_H_ */ 35 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlTCPSocket2.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_HMCONTROLTCPSOCKET2_H_ 4 | #define TESTS_HMCONTROLTCPSOCKET2_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlTCPSocket2 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr1); 19 | CPPUNIT_TEST(test_cmdlstnr2); 20 | CPPUNIT_TEST(test_cmdlstnr3); 21 | CPPUNIT_TEST_SUITE_END(); 22 | 23 | 24 | public: 25 | void setUp(); 26 | void tearDown(); 27 | 28 | protected: 29 | void test_cmdlstnr1(); 30 | void test_cmdlstnr2(); 31 | void test_cmdlstnr3(); 32 | HMStateManager *sm; 33 | std::thread sm_thr; 34 | HMTimeStamp now; 35 | HMAPIIPAddress server; 36 | uint16_t port; 37 | }; 38 | #endif /* TESTS_HMCONTROLTCPSOCKET2_H_ */ 39 | -------------------------------------------------------------------------------- /docs/search/all_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_10.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_11.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_12.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_13.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_14.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_e.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/all_f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /tests/logTests/TestHMLogTest.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMLOGTEST_H_ 4 | #define TEST_HMLOGTEST_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMLogText.h" 10 | #include "HMLogBase.h" 11 | 12 | #define TESTNAME Test_HMLogTest 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_logbase); 19 | CPPUNIT_TEST(test_syslog_level); 20 | CPPUNIT_TEST(test_syslog_called); 21 | CPPUNIT_TEST(test_syslog_notcalled); 22 | CPPUNIT_TEST_SUITE_END(); 23 | 24 | 25 | public: 26 | 27 | void setUp(); 28 | void tearDown(); 29 | void test_logbase(); 30 | void test_syslog_level(); 31 | void test_syslog_called(); 32 | void test_syslog_notcalled(); 33 | protected: 34 | 35 | }; 36 | 37 | void vsyslog(int priority, const char *format, va_list ap); 38 | 39 | #endif /* TEST_HMLOGTEST_H_ */ 40 | 41 | -------------------------------------------------------------------------------- /docs/search/enums_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/classes_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/classes_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/classes_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/classes_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/classes_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/classes_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_e.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/variables_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /tests/coreTests/TestHMWorkQueue.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMWorkQueue_H_ 4 | #define TEST_HMWorkQueue_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMWorkQueue.h" 10 | 11 | #define TESTNAME Test_HMWorkQueue 12 | 13 | class TESTNAME : public CppUnit::TestFixture 14 | { 15 | 16 | CPPUNIT_TEST_SUITE(TESTNAME); 17 | CPPUNIT_TEST(test_basic_workqueue); 18 | CPPUNIT_TEST(test_workqueue); 19 | CPPUNIT_TEST(test_notify_workqueue); 20 | CPPUNIT_TEST(test_shutdown_workqueue); 21 | CPPUNIT_TEST(test_multi_insert); 22 | CPPUNIT_TEST_SUITE_END(); 23 | 24 | 25 | public: 26 | 27 | void setUp(); 28 | void tearDown(); 29 | void test_basic_workqueue(); 30 | void test_workqueue(); 31 | void test_notify_workqueue(); 32 | void test_shutdown_workqueue(); 33 | void test_multi_insert(); 34 | protected: 35 | 36 | }; 37 | 38 | #endif /* TEST_HMWorkQueue_H_ */ 39 | 40 | -------------------------------------------------------------------------------- /docs/search/functions_10.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_11.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_12.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_13.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/search/functions_14.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /tests/storeTests/TestHMStorageText.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_STORETESTS_TESTHMSTORAGETEXT_H_ 4 | #define TESTS_STORETESTS_TESTHMSTORAGETEXT_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "HMStorageHostText.h" 11 | #include "HMAuxCache.h" 12 | 13 | #define TESTNAME Test_HMStorageText 14 | 15 | class TESTNAME : public CppUnit::TestFixture 16 | { 17 | 18 | CPPUNIT_TEST_SUITE(TESTNAME); 19 | //CPPUNIT_TEST(test_HMStorageText_StoreRetrieve); 20 | CPPUNIT_TEST(test_HMStorageText_ConfigStoreRetrieve); 21 | CPPUNIT_TEST(test_HMStorageText_AuxStoreRetrieve); 22 | CPPUNIT_TEST_SUITE_END(); 23 | 24 | public: 25 | void setUp(); 26 | void tearDown(); 27 | 28 | protected: 29 | void test_HMStorageText_StoreRetrieve(); 30 | void test_HMStorageText_ConfigStoreRetrieve(); 31 | void test_HMStorageText_AuxStoreRetrieve(); 32 | }; 33 | 34 | #endif /* TESTS_STORETESTS_TESTHMSTORAGETEXT_H_ */ 35 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlLinuxSocket6.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTS_HMCONTROLLINUXSOCKET6_H_ 2 | #define TESTS_HMCONTROLLINUXSOCKET6_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "HMStateManager.h" 8 | 9 | 10 | #define TESTNAME Test_HMControlLinuxSocket6 11 | 12 | class TESTNAME : public CppUnit::TestFixture 13 | { 14 | 15 | CPPUNIT_TEST_SUITE(TESTNAME); 16 | CPPUNIT_TEST(test_cmdlstnr1); 17 | CPPUNIT_TEST(test_cmdlstnr2); 18 | CPPUNIT_TEST(test_cmdlstnr3); 19 | CPPUNIT_TEST(test_cmdlstnr4); 20 | CPPUNIT_TEST(test_cmdlstnr5); 21 | CPPUNIT_TEST(test_cmdlstnr6); 22 | CPPUNIT_TEST(test_cmdlstnr7); 23 | CPPUNIT_TEST_SUITE_END(); 24 | 25 | 26 | public: 27 | void setUp(); 28 | void tearDown(); 29 | 30 | protected: 31 | void test_cmdlstnr1(); 32 | void test_cmdlstnr2(); 33 | void test_cmdlstnr3(); 34 | void test_cmdlstnr4(); 35 | void test_cmdlstnr5(); 36 | void test_cmdlstnr6(); 37 | void test_cmdlstnr7(); 38 | HMStateManager *sm; 39 | std::thread sm_thr; 40 | }; 41 | #endif /* TESTS_HMCONTROLLINUXSOCKET6_H_ */ 42 | -------------------------------------------------------------------------------- /include/internal/HMUtilitySpinLock.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef INCLUDE_HMUTILITYSPINLOCK_H_ 4 | #define INCLUDE_HMUTILITYSPINLOCK_H_ 5 | 6 | #include 7 | 8 | //! A simple implementation of a spin lock. 9 | class HMUtilitySpinLock 10 | { 11 | std::atomic_flag locked = ATOMIC_FLAG_INIT; 12 | 13 | //! Lock the spin lock. 14 | public: void lock() 15 | { 16 | while (locked.test_and_set(std::memory_order_acquire)) 17 | { ; } 18 | } 19 | //! Unlock the spin lock. 20 | void unlock() 21 | { 22 | locked.clear(std::memory_order_release); 23 | } 24 | }; 25 | 26 | //! Simple template to automatically lock and unlock within a standard lock guard. 27 | template class HMLockGuard 28 | { 29 | public: 30 | HMLockGuard(Lock &lock): 31 | m_lock(lock) 32 | { 33 | m_lock.lock(); 34 | } 35 | 36 | ~HMLockGuard() 37 | { 38 | m_lock.unlock(); 39 | } 40 | 41 | private: 42 | Lock &m_lock; 43 | }; 44 | 45 | #endif /* INCLUDE_HMUTILITYSPINLOCK_H_ */ 46 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlTLSSocket2.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_HMCONTROLTLSSOCKET2_H_ 4 | #define TESTS_HMCONTROLTLSSOCKET2_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlTLSSocket2 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr1); 19 | CPPUNIT_TEST(test_cmdlstnr2); 20 | CPPUNIT_TEST(test_cmdlstnr3); 21 | CPPUNIT_TEST_SUITE_END(); 22 | 23 | 24 | public: 25 | void setUp(); 26 | void tearDown(); 27 | 28 | protected: 29 | void test_cmdlstnr1(); 30 | void test_cmdlstnr2(); 31 | void test_cmdlstnr3(); 32 | HMStateManager *sm; 33 | std::thread sm_thr; 34 | HMTimeStamp now; 35 | HMAPIIPAddress server; 36 | uint16_t port; 37 | std::string certfile; 38 | std::string keyfile; 39 | std::string caFile; 40 | }; 41 | #endif /* TESTS_HMCONTROLTLSSOCKET2_H_ */ 42 | -------------------------------------------------------------------------------- /include/internal/HMLogStdout.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef HMLOGSTDOUT_H_ 4 | #define HMLOGSTDOUT_H_ 5 | 6 | #include 7 | 8 | #include "HMLogBase.h" 9 | 10 | 11 | 12 | class HMLogStdout : public HMLogBase 13 | { 14 | private: 15 | //! Internal log open. 16 | /*! 17 | Internal log open function. Opens the log during the init. 18 | \param the log file name and/or location. 19 | \return true if the log was opened correctly. 20 | */ 21 | bool openLog(std::string); 22 | 23 | //! Internal log close. 24 | /*! 25 | Internal log close function. Closes the log during shutdown. 26 | */ 27 | void closeLog(); 28 | 29 | //! Internal write log function. 30 | /*! 31 | Internal write log function. 32 | Writes the log entry in the derived classes. 33 | \param the log entry to write. 34 | */ 35 | void writeLog(LogEntry *entry); 36 | 37 | //! Called when the log needs to handle a log rotation. 38 | void rotate(); 39 | }; 40 | 41 | #endif /* HMLOGSTDOUT_H_ */ 42 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlLinuxSocket3.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_HMCONTROLLINUXSOCKET3_H_ 4 | #define TESTS_HMCONTROLLINUXSOCKET3_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlLinuxSocket3 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr1); 19 | CPPUNIT_TEST(test_cmdlstnr2); 20 | CPPUNIT_TEST(test_cmdlstnr3); 21 | CPPUNIT_TEST(test_cmdlstnr4); 22 | CPPUNIT_TEST(test_cmdlstnr5); 23 | CPPUNIT_TEST_SUITE_END(); 24 | 25 | 26 | public: 27 | void setUp(); 28 | void tearDown(); 29 | 30 | protected: 31 | void test_cmdlstnr1(); 32 | void test_cmdlstnr2(); 33 | void test_cmdlstnr3(); 34 | void test_cmdlstnr4(); 35 | void test_cmdlstnr5(); 36 | HMStateManager *sm; 37 | std::thread sm_thr; 38 | int sock_fd; 39 | }; 40 | #endif /* TESTS_HMCONTROLLINUXSOCKET3_H_ */ 41 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlTCPSocket6.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTS_HMCONTROLTCPSOCKET6_H_ 2 | #define TESTS_HMCONTROLTCPSOCKET6_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "HMStateManager.h" 8 | 9 | 10 | #define TESTNAME Test_HMControlTCPSocket6 11 | 12 | class TESTNAME : public CppUnit::TestFixture 13 | { 14 | 15 | CPPUNIT_TEST_SUITE(TESTNAME); 16 | CPPUNIT_TEST(test_cmdlstnr1); 17 | CPPUNIT_TEST(test_cmdlstnr2); 18 | CPPUNIT_TEST(test_cmdlstnr3); 19 | CPPUNIT_TEST(test_cmdlstnr4); 20 | CPPUNIT_TEST(test_cmdlstnr5); 21 | CPPUNIT_TEST(test_cmdlstnr6); 22 | CPPUNIT_TEST(test_cmdlstnr7); 23 | CPPUNIT_TEST_SUITE_END(); 24 | 25 | 26 | public: 27 | void setUp(); 28 | void tearDown(); 29 | 30 | protected: 31 | void test_cmdlstnr1(); 32 | void test_cmdlstnr2(); 33 | void test_cmdlstnr3(); 34 | void test_cmdlstnr4(); 35 | void test_cmdlstnr5(); 36 | void test_cmdlstnr6(); 37 | void test_cmdlstnr7(); 38 | HMStateManager *sm; 39 | std::thread sm_thr; 40 | HMAPIIPAddress server; 41 | uint16_t port; 42 | }; 43 | #endif /* TESTS_HMCONTROLTCPSOCKET6_H_ */ 44 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlTCPSocket3.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_HMCONTROLTCPSOCKET3_H_ 4 | #define TESTS_HMCONTROLTCPSOCKET3_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlTCPSocket3 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr1); 19 | CPPUNIT_TEST(test_cmdlstnr2); 20 | CPPUNIT_TEST(test_cmdlstnr3); 21 | CPPUNIT_TEST(test_cmdlstnr4); 22 | CPPUNIT_TEST_SUITE_END(); 23 | 24 | 25 | public: 26 | void setUp(); 27 | void tearDown(); 28 | 29 | protected: 30 | void test_cmdlstnr1(); 31 | void test_cmdlstnr2(); 32 | void test_cmdlstnr3(); 33 | void test_cmdlstnr4(); 34 | HMStateManager *sm; 35 | std::thread sm_thr; 36 | HMAPIIPAddress serverv4; 37 | uint16_t portv4; 38 | HMAPIIPAddress serverv6; 39 | uint16_t portv6; 40 | }; 41 | #endif /* TESTS_HMCONTROLTCPSOCKET3_H_ */ 42 | -------------------------------------------------------------------------------- /docs/search/functions_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['handlednstimeout',['handleDNSTimeout',['../classHMEventLoopLibEvent.html#a10cb53b6ede05039d98c76de5de2aed1',1,'HMEventLoopLibEvent']]], 4 | ['handlehealthchecktimeout',['handleHealthCheckTimeout',['../classHMEventLoopLibEvent.html#a14f0b41f95610c9800d05bdfc11dd73f',1,'HMEventLoopLibEvent']]], 5 | ['hashhostgroupmap',['HashHostGroupMap',['../classHMState.html#aff5265d8252d91b49752ab859d8a899e',1,'HMState']]], 6 | ['healthcheck',['healthCheck',['../classHMStateManager.html#a9ff43a271bb7baee7df4121979a1a937',1,'HMStateManager::healthCheck()'],['../classHMWorkHealthCheck.html#a32aaa43ccd2d481d4e3b5b639923e6ad',1,'HMWorkHealthCheck::healthCheck()'],['../classHMWorkHealthCheckCurl.html#af6810e6f3efcd46bf2b48e7c1dc1f50a',1,'HMWorkHealthCheckCurl::healthCheck()'],['../classHMWorkHealthCheckDNS.html#a3d419822f08ddc6ded3329fd312652d1',1,'HMWorkHealthCheckDNS::healthCheck()'],['../classHMWorkHealthCheckLibEvent.html#a61cd00e0042303d2c5dcdeb81bb44198',1,'HMWorkHealthCheckLibEvent::healthCheck()'],['../classHMWorkHealthCheckNone.html#a5a0b29e1fdee32b0e8bdb5fbf5ce5a6a',1,'HMWorkHealthCheckNone::healthCheck()'],['../classHMWorkHealthCheckTCP.html#af0ae1e69dab3ff61561b89289e65e9c6',1,'HMWorkHealthCheckTCP::healthCheck()']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /src/api/HMNetCHASMAPI.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #include "HMNetCHASMAPI.h" 4 | #include "HMStateManager.h" 5 | 6 | using namespace std; 7 | 8 | shared_ptr 9 | HMNetCHASMAPI::createHealthCheckInstance(string loglevel, const string masterConfig) 10 | { 11 | HM_LOG_LEVEL level = HMLogBase::parseLogLevel(loglevel); 12 | HM_LOG_LEVEL logLevel = (level == HM_ERROR)?HM_LOG_ERROR:level; 13 | shared_ptr api = make_shared(); 14 | if (api) 15 | { 16 | api->m_monitor = make_shared(); 17 | if (api->m_monitor) 18 | { 19 | api->m_thread = thread([api, logLevel, masterConfig]() 20 | { 21 | api->m_monitor->healthCheck(masterConfig, logLevel); 22 | }); 23 | return api; 24 | } 25 | } 26 | return nullptr; 27 | } 28 | 29 | bool HMNetCHASMAPI::isAlive() 30 | { 31 | return m_monitor->isActive(); 32 | } 33 | 34 | void HMNetCHASMAPI::stopHealthCheckInstance() 35 | { 36 | if(m_monitor) 37 | { 38 | m_monitor->shutdown(); 39 | m_thread.join(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/configParserTests/TestHMConfigParserBase.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMCONFIGPARSERBASE_H_ 4 | #define TEST_HMCONFIGPARSERBASE_H_ 5 | 6 | #include "HMStateManager.h" 7 | #include "HMConfigParserBase.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #define TESTNAME TestHMConfigParserBase 14 | 15 | class TestConfigParser : public HMConfigParserBase 16 | { 17 | public: 18 | ~TestConfigParser() {} 19 | uint32_t parseConfig(const std::string& fileName, HMState& state, HMConfigParams& configParam) { return 0; } 20 | bool writeConfigs(HMState& state, std::string outFile) 21 | { 22 | return true; 23 | } 24 | 25 | }; 26 | 27 | class TESTNAME : public CppUnit::TestFixture 28 | { 29 | 30 | CPPUNIT_TEST_SUITE(TESTNAME); 31 | CPPUNIT_TEST(test_parseDirectory); 32 | CPPUNIT_TEST_SUITE_END(); 33 | 34 | 35 | public: 36 | void setUp(); 37 | void tearDown(); 38 | 39 | protected: 40 | void test_parseDirectory(); 41 | 42 | HMStateManager* parse; 43 | }; 44 | 45 | #endif // TEST_HMCONFIGPARSERBASE_H_ 46 | -------------------------------------------------------------------------------- /tests/coreTests/TestHMState.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMState_H_ 4 | #define TEST_HMState_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMWorkQueue.h" 10 | 11 | #define TESTNAME Test_HMState 12 | 13 | class TESTNAME : public CppUnit::TestFixture 14 | { 15 | 16 | CPPUNIT_TEST_SUITE(TESTNAME); 17 | CPPUNIT_TEST(test_allchecks); 18 | CPPUNIT_TEST(test_allchecks1); 19 | CPPUNIT_TEST(test_allcheckResults); 20 | CPPUNIT_TEST(test_allcheckResults1); 21 | CPPUNIT_TEST(test_allcheckResults2); 22 | CPPUNIT_TEST(test_allcheckResults3); 23 | CPPUNIT_TEST(test_allcheckResults4); 24 | 25 | CPPUNIT_TEST_SUITE_END(); 26 | 27 | 28 | public: 29 | 30 | void setUp(); 31 | void tearDown(); 32 | void test_allchecks(); 33 | void test_allchecks1(); 34 | void test_allcheckResults(); 35 | void test_allcheckResults1(); 36 | void test_allcheckResults2(); 37 | void test_allcheckResults3(); 38 | void test_allcheckResults4(); 39 | 40 | protected: 41 | 42 | }; 43 | 44 | #endif /* TEST_HMStateManager_H_ */ 45 | 46 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlTLSSocket3.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_HMCONTROLTLSSOCKET3_H_ 4 | #define TESTS_HMCONTROLTLSSOCKET3_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlTLSSocket3 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr1); 19 | CPPUNIT_TEST(test_cmdlstnr2); 20 | CPPUNIT_TEST(test_cmdlstnr3); 21 | CPPUNIT_TEST(test_cmdlstnr4); 22 | CPPUNIT_TEST_SUITE_END(); 23 | 24 | 25 | public: 26 | void setUp(); 27 | void tearDown(); 28 | 29 | protected: 30 | void test_cmdlstnr1(); 31 | void test_cmdlstnr2(); 32 | void test_cmdlstnr3(); 33 | void test_cmdlstnr4(); 34 | HMStateManager *sm; 35 | std::thread sm_thr; 36 | HMAPIIPAddress serverv4; 37 | uint16_t portv4; 38 | HMAPIIPAddress serverv6; 39 | uint16_t portv6; 40 | std::string certfile; 41 | std::string keyfile; 42 | std::string caFile; 43 | }; 44 | #endif /* TESTS_HMCONTROLTLSSOCKET3_H_ */ 45 | -------------------------------------------------------------------------------- /include/internal/HMLogAPI.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef HMLOGAPI_H_ 4 | #define HMLOGAPI_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "HMLogBase.h" 12 | 13 | class HMLogAPI : public HMLogBase 14 | { 15 | public: 16 | HMLogAPI() {} 17 | 18 | private: 19 | //! Internal log open. 20 | /*! 21 | Internal log open function. Opens the log during the init. 22 | \param the log file name and/or location. 23 | \return true if the log was opened correctly. 24 | */ 25 | bool openLog(std::string) { return true; }; 26 | 27 | //! Internal log close. 28 | /*! 29 | Internal log close function. Closes the log during shutdown. 30 | */ 31 | void closeLog() {}; 32 | 33 | //! Internal write log function. 34 | /*! 35 | Internal write log function. 36 | Writes the log entry in the derived classes. 37 | \param the log entry to write. 38 | */ 39 | void writeLog(LogEntry *entry); 40 | 41 | //! Called when the log needs to handle a log rotation. 42 | void rotate() {} 43 | 44 | }; 45 | 46 | #endif /* HMLOGAPI_H_ */ 47 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlTLSSocket8.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTS_HMCONTROLTLSSOCKET8_H_ 2 | #define TESTS_HMCONTROLTLSSOCKET8_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "HMStateManager.h" 8 | 9 | 10 | #define TESTNAME Test_HMControlTLSSocket8 11 | 12 | class TESTNAME : public CppUnit::TestFixture 13 | { 14 | 15 | CPPUNIT_TEST_SUITE(TESTNAME); 16 | CPPUNIT_TEST(test_cmdlstnr1); 17 | CPPUNIT_TEST(test_cmdlstnr2); 18 | CPPUNIT_TEST(test_cmdlstnr3); 19 | CPPUNIT_TEST(test_cmdlstnr4); 20 | CPPUNIT_TEST(test_cmdlstnr5); 21 | CPPUNIT_TEST(test_cmdlstnr6); 22 | CPPUNIT_TEST(test_cmdlstnr7); 23 | CPPUNIT_TEST_SUITE_END(); 24 | 25 | 26 | public: 27 | void setUp(); 28 | void tearDown(); 29 | 30 | protected: 31 | void test_cmdlstnr1(); 32 | void test_cmdlstnr2(); 33 | void test_cmdlstnr3(); 34 | void test_cmdlstnr4(); 35 | void test_cmdlstnr5(); 36 | void test_cmdlstnr6(); 37 | void test_cmdlstnr7(); 38 | HMStateManager *sm; 39 | std::thread sm_thr; 40 | HMTimeStamp now; 41 | HMAPIIPAddress server; 42 | uint16_t port; 43 | std::string certfile; 44 | std::string keyfile; 45 | std::string caFile; 46 | }; 47 | #endif /* TESTS_HMCONTROLTLSSOCKET8_H_ */ 48 | -------------------------------------------------------------------------------- /src/api/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(netchasm) 2 | 3 | file(GLOB SOURCES "./*.cpp") 4 | set(CPP_FLAGS "-Wall -Wextra -Wchkp -Wfloat-equal -Wl,--copy-dt-needed-entries -Wl,--as-needed -Wl,--no-undefined") 5 | set(COV_FLAGS "-fprofile-arcs -ftest-coverage") 6 | set(ASAN_FLAGS "-fsanitize=address -fno-omit-frame-pointer -static-libasan") 7 | 8 | add_library(netchasm SHARED ${SOURCES}) 9 | add_dependencies(netchasm netchasm_core) 10 | set_target_properties(netchasm PROPERTIES SOVERSION "${MAJOR_VERSION}") 11 | set_target_properties(netchasm PROPERTIES COMPILE_FLAGS "${CPP_FLAGS} ") 12 | set_target_properties(netchasm PROPERTIES LINK_FLAGS "${CPP_FLAGS}") 13 | 14 | if(COV) 15 | set_target_properties(netchasm PROPERTIES COMPILE_FLAGS "${COV_FLAGS}") 16 | set_target_properties(netchasm PROPERTIES LINK_FLAGS "${COV_FLAGS}") 17 | endif(COV) 18 | 19 | set_property(TARGET netchasm PROPERTY POSITION_INDEPENDENT_CODE ON) 20 | set_property(TARGET netchasm PROPERTY CXX_STANDARD 14) 21 | 22 | target_link_libraries (netchasm PUBLIC netchasm_core) 23 | 24 | install(TARGETS netchasm LIBRARY COMPONENT DEVEL DESTINATION ${CMAKE_INSTALL_LIBDIR}) 25 | install(TARGETS netchasm LIBRARY COMPONENT DIST DESTINATION ${CMAKE_INSTALL_LIBDIR}) 26 | install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/NetCHASM COMPONENT DEVEL DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) 27 | -------------------------------------------------------------------------------- /src/internal/HMWorkHealthCheckNone.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #include "HMWorkHealthCheckNone.h" 4 | #include "HMWork.h" 5 | #include "HMTimeStamp.h" 6 | #include "HMConstants.h" 7 | #include "HMLogBase.h" 8 | 9 | // LCOV_EXCL_START; Tested in functional testing 10 | 11 | using namespace std; 12 | 13 | HM_WORK_STATUS 14 | HMWorkHealthCheckNone::healthCheck() 15 | { 16 | if (m_hostCheck.getCheckType() == HM_CHECK_NONE || m_hostCheck.getCheckType() == HM_CHECK_DEFAULT) 17 | { 18 | 19 | HMLog(HM_LOG_DEBUG3, "[NONECHECK] Checking %s at %s for check type None ", 20 | m_hostname.c_str(), 21 | m_ipAddress.toString().c_str()); 22 | 23 | m_start = HMTimeStamp::now(); 24 | m_response = HM_RESPONSE_CONNECTED; 25 | m_reason = HM_REASON_SUCCESS; 26 | m_end= HMTimeStamp::now(); 27 | return HM_WORK_COMPLETE; 28 | } 29 | else 30 | { 31 | HMLog(HM_LOG_ERROR, "[NONECHECK] Invalid Check type %d accepts only check type - none", 32 | printCheckType(m_hostCheck.getCheckType()).c_str()); 33 | 34 | return HM_WORK_COMPLETE; 35 | } 36 | } 37 | // LCOV_EXCL_STOP; Tested in functional testing 38 | -------------------------------------------------------------------------------- /docs/search/all_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['openbackend',['openBackend',['../classHMState.html#af6d450642c0b68ba136ac69e12bb711d',1,'HMState::openBackend()'],['../classHMStorage.html#a76ae4d8138722b0f89a2d4e70cb4e048',1,'HMStorage::openBackend()'],['../classHMStorageHost.html#a6c3af7dacaa4d838d7b1313d8ba8b7fb',1,'HMStorageHost::openBackend()'],['../classHMStorageHostGroup.html#a131cd932bab69a3c2f0c02019ded0cad',1,'HMStorageHostGroup::openBackend()'],['../classHMStorageHostGroupMDBM.html#affcfca3fb7a5dd347b372e2551255202',1,'HMStorageHostGroupMDBM::openBackend()'],['../classHMStorageHostText.html#aca282d3b17c5b7b42366cad2f21a6059',1,'HMStorageHostText::openBackend()']]], 4 | ['openlog',['openLog',['../classHMLogAPI.html#a427fa794d3d9562b083ec725ee7761a9',1,'HMLogAPI::openLog()'],['../classHMLogBase.html#a1209b8126102219376199867df536fca',1,'HMLogBase::openLog()'],['../classHMLogStdout.html#aa8911e57a46dec9afbae1314e4dee3d8',1,'HMLogStdout::openLog()'],['../classHMLogSyslog.html#a9e4b0ad0537f5e73af6c027e3f23c818',1,'HMLogSyslog::openLog()'],['../classHMLogText.html#ac4bbc1f0933a26f3b4ee81fc5029b157',1,'HMLogText::openLog()']]], 5 | ['openstore',['openStore',['../classHMStorage.html#acbd92c666745b97ca1c1e52ad016a6ed',1,'HMStorage::openStore()'],['../classHMStorage.html#adf21a358fcb646a2b9d13db005b59890',1,'HMStorage::openStore(bool readonly)']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /tests/coreTests/TestHMEventQueue.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TestEventQueue_H_ 4 | #define TestEventQueue_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMWorkDNSLookup.h" 10 | #include "HMStateManager.h" 11 | #include "HMDNSCache.h" 12 | #include "HMEventLoopQueue.h" 13 | 14 | 15 | #define TESTNAME TestEventQueue 16 | 17 | class TESTNAME : public CppUnit::TestFixture 18 | { 19 | 20 | CPPUNIT_TEST_SUITE(TESTNAME); 21 | CPPUNIT_TEST(test_basic_DNS_eventqueue); 22 | CPPUNIT_TEST(test_basic_HC_eventqueue); 23 | CPPUNIT_TEST(test_ordering_HC_eventqueue); 24 | CPPUNIT_TEST(test_delay_HC_eventqueue); 25 | CPPUNIT_TEST_SUITE_END(); 26 | 27 | 28 | public: 29 | std::shared_ptr m_currentState; 30 | HMStateManager m_state; 31 | HMEventLoopQueue* m_eventQueue; 32 | std::thread* m_eventThread; 33 | void setUp(); 34 | void tearDown(); 35 | 36 | protected: 37 | void test_basic_DNS_eventqueue(); 38 | void test_basic_HC_eventqueue(); 39 | void test_ordering_HC_eventqueue(); 40 | void test_delay_HC_eventqueue(); 41 | }; 42 | 43 | #endif /* TestEventQueue_H_ */ 44 | 45 | -------------------------------------------------------------------------------- /docs/search/functions_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['openbackend',['openBackend',['../classHMState.html#af6d450642c0b68ba136ac69e12bb711d',1,'HMState::openBackend()'],['../classHMStorage.html#a76ae4d8138722b0f89a2d4e70cb4e048',1,'HMStorage::openBackend()'],['../classHMStorageHost.html#a6c3af7dacaa4d838d7b1313d8ba8b7fb',1,'HMStorageHost::openBackend()'],['../classHMStorageHostGroup.html#a131cd932bab69a3c2f0c02019ded0cad',1,'HMStorageHostGroup::openBackend()'],['../classHMStorageHostGroupMDBM.html#affcfca3fb7a5dd347b372e2551255202',1,'HMStorageHostGroupMDBM::openBackend()'],['../classHMStorageHostText.html#aca282d3b17c5b7b42366cad2f21a6059',1,'HMStorageHostText::openBackend()']]], 4 | ['openlog',['openLog',['../classHMLogAPI.html#a427fa794d3d9562b083ec725ee7761a9',1,'HMLogAPI::openLog()'],['../classHMLogBase.html#a1209b8126102219376199867df536fca',1,'HMLogBase::openLog()'],['../classHMLogStdout.html#aa8911e57a46dec9afbae1314e4dee3d8',1,'HMLogStdout::openLog()'],['../classHMLogSyslog.html#a9e4b0ad0537f5e73af6c027e3f23c818',1,'HMLogSyslog::openLog()'],['../classHMLogText.html#ac4bbc1f0933a26f3b4ee81fc5029b157',1,'HMLogText::openLog()']]], 5 | ['openstore',['openStore',['../classHMStorage.html#acbd92c666745b97ca1c1e52ad016a6ed',1,'HMStorage::openStore()'],['../classHMStorage.html#adf21a358fcb646a2b9d13db005b59890',1,'HMStorage::openStore(bool readonly)']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /tests/coreTests/TestHMDNSResult.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMDNSResult_H_ 4 | #define TEST_HMDNSResult_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMWorkDNSLookup.h" 10 | #include "HMStateManager.h" 11 | #include "HMDNSCache.h" 12 | #include "HMEventLoopQueue.h" 13 | 14 | 15 | #define TESTNAME Test_HMDNSResult 16 | 17 | class TESTNAME : public CppUnit::TestFixture 18 | { 19 | 20 | CPPUNIT_TEST_SUITE(TESTNAME); 21 | CPPUNIT_TEST(test_get_address); 22 | CPPUNIT_TEST(test_get_addresses); 23 | CPPUNIT_TEST(test_next_query); 24 | CPPUNIT_TEST(test_next_query1); 25 | CPPUNIT_TEST(test_next_query2); 26 | CPPUNIT_TEST(test_queue_query); 27 | CPPUNIT_TEST(test_get_exp_addresses); 28 | CPPUNIT_TEST_SUITE_END(); 29 | 30 | 31 | public: 32 | void setUp(); 33 | void tearDown(); 34 | void test_get_address(); 35 | void test_get_addresses(); 36 | void test_next_query(); 37 | void test_next_query1(); 38 | void test_next_query2(); 39 | void test_queue_query(); 40 | void test_get_exp_addresses(); 41 | protected: 42 | }; 43 | 44 | #endif /* TEST_HMEventQueue_H_ */ 45 | 46 | -------------------------------------------------------------------------------- /tests/coreTests/TestHMAuxInfo.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_CORETESTS_TESTHMAUXINFO_H_ 4 | #define TESTS_CORETESTS_TESTHMAUXINFO_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #define TESTNAME Test_HMAuxInfo 11 | 12 | class TESTNAME : public CppUnit::TestFixture 13 | { 14 | CPPUNIT_TEST_SUITE(TESTNAME); 15 | CPPUNIT_TEST(test_HMAuxInfo_MalformedXML); 16 | CPPUNIT_TEST(test_HMAuxInfo_NewLFB); 17 | CPPUNIT_TEST(test_HMAuxInfo_OOB); 18 | CPPUNIT_TEST(test_parse_HMAuxInfo_NewLFB); 19 | CPPUNIT_TEST(test_parse_HMAuxInfo_OOB); 20 | CPPUNIT_TEST(test_neg_HMAuxInfo_OOB); 21 | CPPUNIT_TEST(test_neg_HMAuxInfo_NewLFB); 22 | CPPUNIT_TEST_SUITE_END(); 23 | 24 | 25 | public: 26 | void setUp(); 27 | void tearDown(); 28 | 29 | protected: 30 | void test_HMAuxInfo_core(); 31 | void test_HMAuxInfo_MalformedXML(); 32 | void test_HMAuxInfo_NewLFB(); 33 | void test_HMAuxInfo_OOB(); 34 | void test_parse_HMAuxInfo_NewLFB(); 35 | void test_parse_HMAuxInfo_OOB(); 36 | void test_neg_HMAuxInfo_OOB(); 37 | void test_neg_HMAuxInfo_NewLFB(); 38 | }; 39 | 40 | #endif /* TESTS_CORETESTS_TESTHMAUXINFO_H_ */ 41 | -------------------------------------------------------------------------------- /tests/storeTests/TestHMStorageHostGroup.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_STORETESTS_TESTHMSTORAGEHOSTGROUP_H_ 4 | #define TESTS_STORETESTS_TESTHMSTORAGEHOSTGROUP_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "HMStorageHostGroup.h" 12 | 13 | #define TESTNAME Test_HMStorageHostGroup 14 | 15 | class TESTNAME : public CppUnit::TestFixture 16 | { 17 | 18 | CPPUNIT_TEST_SUITE(TESTNAME); 19 | CPPUNIT_TEST(test_HMStorageHostGroup_ReadOnly); 20 | CPPUNIT_TEST(test_HMStorageHostGroup_ReadWrite); 21 | CPPUNIT_TEST(test_HMStorageHostGroup_Restore); 22 | CPPUNIT_TEST(test_HMStorageHostGroup_InternalFunctions); 23 | CPPUNIT_TEST_SUITE_END(); 24 | 25 | 26 | public: 27 | void setUp(); 28 | void tearDown(); 29 | 30 | protected: 31 | void test_HMStorageHostGroup_Construction(); 32 | void test_HMStorageHostGroup_ReadOnly(); 33 | void test_HMStorageHostGroup_ReadWrite(); 34 | void test_HMStorageHostGroup_Restore(); 35 | void test_HMStorageHostGroup_InternalFunctions(); 36 | void test_HMStorageHostGroup_ZeroIp(); 37 | }; 38 | 39 | #endif /* TESTS_STORETESTS_TESTHMSTORAGEHOSTGROUP_H_ */ 40 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlTLSSocket6.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_HMCONTROLTLSSOCKET6_H_ 4 | #define TESTS_HMCONTROLTLSSOCKET6_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlTLSSocket6 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr1); 19 | CPPUNIT_TEST(test_cmdlstnr2); 20 | CPPUNIT_TEST(test_cmdlstnr3); 21 | CPPUNIT_TEST(test_cmdlstnr4); 22 | CPPUNIT_TEST(test_cmdlstnr5); 23 | CPPUNIT_TEST(test_cmdlstnr6); 24 | CPPUNIT_TEST_SUITE_END(); 25 | 26 | 27 | public: 28 | void setUp(); 29 | void tearDown(); 30 | 31 | protected: 32 | void test_cmdlstnr1(); 33 | void test_cmdlstnr2(); 34 | void test_cmdlstnr3(); 35 | void test_cmdlstnr4(); 36 | void test_cmdlstnr5(); 37 | void test_cmdlstnr6(); 38 | HMStateManager *sm; 39 | std::thread sm_thr; 40 | HMAPIIPAddress server; 41 | uint16_t port; 42 | std::string certfile; 43 | std::string keyfile; 44 | std::string caFile; 45 | }; 46 | #endif /* TESTS_HMCONTROLTLSSOCKET6_H_ */ 47 | -------------------------------------------------------------------------------- /src/internal/HMResultPublisher.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | 4 | #include 5 | 6 | #include "HMPublisherBase.h" 7 | #include "HMResultPublisher.h" 8 | 9 | using namespace std; 10 | bool HMResultPublisher::registerPublisher(std::string name, unique_ptr& publisher) 11 | { 12 | auto it = m_publishers.insert(make_pair(name, std::move(publisher))); 13 | return it.second; 14 | } 15 | 16 | bool HMResultPublisher::unregisterPublisher(std::string& name) 17 | { 18 | m_publishers.erase(name); 19 | return true; 20 | 21 | } 22 | 23 | bool HMResultPublisher::publishResult(const string& hostName, const HMDataCheckResult& dataCheckResult, const int mark, set& hostGroups, bool changed) const 24 | { 25 | for(auto& it: m_publishers) 26 | { 27 | it.second->publishResult(hostName, dataCheckResult, mark, hostGroups, changed); 28 | } 29 | return true; 30 | } 31 | 32 | size_t HMResultPublisher::publishersCount() 33 | { 34 | return m_publishers.size(); 35 | } 36 | 37 | HMPublisherBase* HMResultPublisher::getpublisher(std::string name) 38 | { 39 | auto it = m_publishers.find(name); 40 | if(it!=m_publishers.end()) 41 | { 42 | return it->second.get(); 43 | } 44 | return nullptr; 45 | } 46 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlLinuxSocket1.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_HMCONTROLLINUXSOCKET1_H_ 4 | #define TESTS_HMCONTROLLINUXSOCKET1_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlLinuxSocket1 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr6); 19 | CPPUNIT_TEST(test_cmdlstnr7); 20 | CPPUNIT_TEST(test_cmdlstnr8); 21 | CPPUNIT_TEST(test_cmdlstnr9); 22 | CPPUNIT_TEST(test_cmdlstnr10); 23 | CPPUNIT_TEST(test_cmdlstnr11); 24 | CPPUNIT_TEST(test_cmdlstnr12); 25 | CPPUNIT_TEST(test_cmdlstnr13); 26 | CPPUNIT_TEST_SUITE_END(); 27 | 28 | 29 | public: 30 | void setUp(); 31 | void tearDown(); 32 | 33 | protected: 34 | void test_cmdlstnr6(); 35 | void test_cmdlstnr7(); 36 | void test_cmdlstnr8(); 37 | void test_cmdlstnr9(); 38 | void test_cmdlstnr10(); 39 | void test_cmdlstnr11(); 40 | void test_cmdlstnr12(); 41 | void test_cmdlstnr13(); 42 | HMStateManager *sm; 43 | std::thread sm_thr; 44 | }; 45 | #endif /* TESTS_HMCONTROLLINUXSOCKET1_H_ */ 46 | -------------------------------------------------------------------------------- /include/internal/HMPublisherProto.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef HMPUBLISHER_H_ 4 | #define HMPUBLISHERPROTO_H_ 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "HMPublisherBase.h" 10 | 11 | class HMPublisherProto : public HMPublisherBase 12 | { 13 | public: 14 | ~HMPublisherProto() {} 15 | //! This function is called to publish the check information to the publisher. 16 | /* 17 | This function is called to publish the check information to the publisher. 18 | \param host name; 19 | \param check result of the host. 20 | \param mark value used 0 Otherwise 21 | \param hostgroups associated with the check 22 | */ 23 | void publish(const std::string& hostName, const HMDataCheckResult& dataCheckResult, const int mark, std::set& hostGroups) const; 24 | protected: 25 | //! This function is called to publish the check information to the publisher. 26 | /* 27 | This function is called to publish the check information to the publisher. 28 | \param pointer to data; 29 | \param size of data. 30 | */ 31 | virtual void publish(char* data, const size_t datalen) const = 0; 32 | }; 33 | 34 | #endif /* HMPUBLISHERPROTO_H_ */ 35 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Expected Behavior 4 | 5 | 6 | 7 | ## Current Behavior 8 | 9 | 10 | 11 | ## Possible Solution 12 | 13 | 14 | 15 | ## Steps to Reproduce (for bugs) 16 | 17 | 18 | 1. 19 | 2. 20 | 3. 21 | 4. 22 | 23 | ## Context 24 | 25 | 26 | 27 | 28 | ## Your Environment 29 | 30 | * Version used: 31 | * Environment name and version (e.g. Chrome 39, node.js 5.4): 32 | * Operating System and version (desktop or mobile): 33 | * Link to your project: 34 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlTCPSocket4.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMCONTROLTCPSOCKET4_H_ 4 | #define TEST_HMCONTROLTCPSOCKET4_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlTCPSocket4 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr1); 19 | CPPUNIT_TEST(test_cmdlstnr2); 20 | CPPUNIT_TEST(test_cmdlstnr3); 21 | CPPUNIT_TEST(test_cmdlstnr4); 22 | CPPUNIT_TEST(test_cmdlstnr5); 23 | CPPUNIT_TEST_SUITE_END(); 24 | 25 | 26 | public: 27 | void setUp(); 28 | void tearDown(); 29 | 30 | protected: 31 | void test_cmdlstnr1(); 32 | void test_cmdlstnr2(); 33 | void test_cmdlstnr3(); 34 | void test_cmdlstnr4(); 35 | void test_cmdlstnr5(); 36 | HMStateManager *sm; 37 | std::thread sm_thr; 38 | HMTimeStamp now; 39 | std::string host1 = "test.hm.com"; 40 | std::string host2 = "test2.hm.com"; 41 | std::string host3 = "test3.hm.com"; 42 | HMAPIIPAddress server; 43 | uint16_t port; 44 | HMHash hash; 45 | HMHash hash1; 46 | }; 47 | #endif /* TEST_HMCONTROLTCPSOCKET4_H_ */ 48 | -------------------------------------------------------------------------------- /include/internal/HMControlTCPSocket.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef HMCOMMANDLISTENERTCP_H_ 4 | #define HMCOMMANDLISTENERTCP_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "HMControlBase.h" 11 | #include "HMConstants.h" 12 | #include "HMSocketUtilTCP.h" 13 | 14 | class HMStateManager; 15 | //! Class to handle tcp socket based external communications 16 | class HMControlTCPSocket : public HMCommandListenerBase 17 | { 18 | public: 19 | 20 | HMControlTCPSocket(bool ipv6, HMStateManager& stateManager); 21 | ~HMControlTCPSocket(); 22 | 23 | HMControlTCPSocket& operator=(const HMControlTCPSocket&) = delete; // Disallow copying 24 | HMControlTCPSocket(const HMControlTCPSocket&) = delete; 25 | 26 | //! Function to initialize sockets 27 | void init(); 28 | //! Function to handle connections 29 | void run(); 30 | //! Shutdown listeners 31 | void listernerShutDown(); 32 | /*! 33 | Handle client communications 34 | \param pointer of client socket. 35 | */ 36 | void handleClient(int clientSock); 37 | //! Handle client connections 38 | void handleConnections(); 39 | 40 | private: 41 | int m_socket; 42 | bool m_ipv6; 43 | }; 44 | 45 | #endif /* HMCOMMANDLISTENER_H_ */ 46 | -------------------------------------------------------------------------------- /proto/netchasm/datacheckresult.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "netchasm/ipaddress.proto"; 3 | 4 | package netchasm; 5 | message DataCheckResult { 6 | IPAddress address = 1; 7 | uint64 start = 2; 8 | uint64 end = 3; 9 | uint32 responseTime = 4; 10 | uint32 totalResponseTime = 5; 11 | uint32 minResponseTime = 6; 12 | uint32 maxResponseTime = 7; 13 | uint32 smoothedResponseTime = 8; 14 | uint64 sumResponseTime = 9; 15 | uint32 numChecks = 10; 16 | uint32 numResponses = 11; 17 | uint32 numConnectFailures = 12; 18 | uint32 numFailures = 13; 19 | uint32 numTimeouts = 14; 20 | uint32 numFlaps = 15; 21 | uint32 status = 16; 22 | uint32 response = 17; 23 | uint32 reason = 18; 24 | uint32 numFailedChecks = 19; 25 | uint32 numSlowResponses = 20; 26 | uint32 port = 21; 27 | uint64 changeTime = 22; 28 | bool forceHostDown = 23; 29 | uint64 queueCheckTime = 24; 30 | uint64 checkTime = 25; 31 | uint32 softReason = 26; 32 | string hostname = 27; 33 | } 34 | 35 | message DataCheckResults { 36 | repeated DataCheckResult results = 1; 37 | } 38 | 39 | message PublishResults { 40 | uint32 publisherVersion = 1; 41 | string hostName = 2; 42 | int32 mark = 3; 43 | repeated string hostGroups = 4; 44 | DataCheckResult results = 5; 45 | } -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlTCPSocket1.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_HMCONTROLTCPSOCKET1_H_ 4 | #define TESTS_HMCONTROLTCPSOCKET1_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlTCPSocket1 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr6); 19 | CPPUNIT_TEST(test_cmdlstnr7); 20 | CPPUNIT_TEST(test_cmdlstnr8); 21 | CPPUNIT_TEST(test_cmdlstnr9); 22 | CPPUNIT_TEST(test_cmdlstnr10); 23 | CPPUNIT_TEST(test_cmdlstnr11); 24 | CPPUNIT_TEST(test_cmdlstnr12); 25 | CPPUNIT_TEST(test_cmdlstnr13); 26 | CPPUNIT_TEST_SUITE_END(); 27 | 28 | 29 | public: 30 | void setUp(); 31 | void tearDown(); 32 | 33 | protected: 34 | void test_cmdlstnr6(); 35 | void test_cmdlstnr7(); 36 | void test_cmdlstnr8(); 37 | void test_cmdlstnr9(); 38 | void test_cmdlstnr10(); 39 | void test_cmdlstnr11(); 40 | void test_cmdlstnr12(); 41 | void test_cmdlstnr13(); 42 | HMStateManager *sm; 43 | std::thread sm_thr; 44 | HMAPIIPAddress server; 45 | uint16_t port; 46 | }; 47 | #endif /* TESTS_HMCONTROLTCPSOCKET1_H_ */ 48 | -------------------------------------------------------------------------------- /pubsub-config-sample.yaml: -------------------------------------------------------------------------------- 1 | # Sample pubsub Configuration 2 | - name: kafka1 3 | type: kafka 4 | onchange: true 5 | parameters: 6 | topic: topic1 7 | brokerlist: 8 | - 192.168.1.1:9092 9 | - 192.168.1.1:9093 10 | 11 | - name: kafka2 12 | type: kafka 13 | hostgroups: 14 | - hg1 15 | - hg2 16 | parameters: 17 | topic: topic2 18 | brokerlist: 19 | - 192.168.1.1:9092 20 | 21 | 22 | # pubsub options 23 | 24 | 25 | # name: 26 | # 27 | # Specifies the name of the publisher. It should be a unique for each publisher 28 | 29 | 30 | # type: 31 | # values: kafka 32 | # 33 | # Specifies the type of publisher. We can have multiple published of same type. 34 | 35 | # onchange: 36 | # default: true 37 | # 38 | # Publish results only when the host status changes. 39 | 40 | # hostgroups: 41 | # - hostgroup1 42 | # - hostgroup2 43 | # 44 | # Pubish results only for specified hostgroups. By default all hosts group results are published. 45 | 46 | # parameters: 47 | # 48 | # Specify publisher configuration parameters based the publisher type. 49 | 50 | ## Kafka Publisher parameters 51 | # topic: 52 | # 53 | # The kafka topic the results should be published to. 54 | 55 | # brokerlist: array of 56 | # 57 | # The kafka publisher brokers 58 | 59 | ## End of Kafka publisher parameters 60 | 61 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlLinuxSocket4.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMCONTROLLINUXSOCKET4_H_ 4 | #define TEST_HMCONTROLLINUXSOCKET4_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlLinuxSocket4 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr1); 19 | CPPUNIT_TEST(test_cmdlstnr2); 20 | CPPUNIT_TEST(test_cmdlstnr3); 21 | CPPUNIT_TEST(test_cmdlstnr4); 22 | CPPUNIT_TEST(test_cmdlstnr5); 23 | CPPUNIT_TEST(test_cmdlstnr6); 24 | CPPUNIT_TEST_SUITE_END(); 25 | 26 | 27 | public: 28 | void setUp(); 29 | void tearDown(); 30 | 31 | protected: 32 | void test_cmdlstnr1(); 33 | void test_cmdlstnr2(); 34 | void test_cmdlstnr3(); 35 | void test_cmdlstnr4(); 36 | void test_cmdlstnr5(); 37 | void test_cmdlstnr6(); 38 | HMStateManager *sm; 39 | std::thread sm_thr; 40 | HMTimeStamp now; 41 | std::string host1 = "test.hm.com"; 42 | std::string host2 = "test2.hm.com"; 43 | std::string host3 = "test3.hm.com"; 44 | HMHash hash; 45 | HMHash hash1; 46 | 47 | }; 48 | #endif /* TEST_HMCONTROLLINUXSOCKET4_H_ */ 49 | -------------------------------------------------------------------------------- /include/internal/HMWorkDNSLookupStatic.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #include "HMDNSCache.h" 4 | #include "HMWorkDNSLookup.h" 5 | 6 | // LCOV_EXCL_START; Tested in functional testing 7 | 8 | #ifndef HMWORKDNSLOOKUPSTATIC_H_ 9 | #define HMWORKDNSLOOKUPSTATIC_H_ 10 | 11 | class HMWorkDNSLookupStatic : public HMWorkDNSLookup 12 | { 13 | 14 | public: 15 | 16 | HMWorkDNSLookupStatic(const std::string& hostname, const HMIPAddress& ip, const HMDataHostCheck& hostcheck, const HMDNSLookup& dnsHostCheck) : 17 | HMWorkDNSLookup(hostname, ip, hostcheck, dnsHostCheck) {}; 18 | 19 | //! Called to init and setup the work order. 20 | /*! 21 | Called to init and setup the work order. 22 | \param the work state to use for the work order. 23 | */ 24 | void init(HMWorkState& state); 25 | 26 | //! Main function to actually conduct the DNS resolution. 27 | /*! 28 | Main function to actually conduct the DNS resolution. 29 | Should set the the hostname/IP Addresses and result codes. 30 | \return the appropriate HM_WORK_STATUS (IDLE or COMPLETE for done or IN PROGRESS if it needs a continuation) 31 | */ 32 | HM_WORK_STATUS dnsLookup(); 33 | 34 | private: 35 | 36 | }; 37 | 38 | #endif /* HMWORKDNSLOOKUPSTATIC_H_ */ 39 | // LCOV_EXCL_STOP; Tested in functional testing 40 | -------------------------------------------------------------------------------- /tests/configParserTests/TestHMPubSubConfigParserYaml.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMPUBSUBCONFIGPARSEYAML_H_ 4 | #define TEST_HMPUBSUBCONFIGPARSEYAML_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "HMStateManager.h" 11 | #include "HMPubSubConfigParser.h" 12 | 13 | #define TESTNAME Test_PubSubConfigParseYaml 14 | 15 | class TESTNAME : public CppUnit::TestFixture 16 | { 17 | 18 | CPPUNIT_TEST_SUITE(TESTNAME); 19 | CPPUNIT_TEST(test_config1_tests); 20 | CPPUNIT_TEST(test_config2_tests); 21 | CPPUNIT_TEST(test_config3_tests); 22 | CPPUNIT_TEST_SUITE_END(); 23 | 24 | 25 | public: 26 | void setUp(); 27 | void tearDown(); 28 | 29 | protected: 30 | void test_config1_tests(); 31 | void test_config2_tests(); 32 | void test_config3_tests(); 33 | const std::string singleKafka = "./singlekafka.yaml"; 34 | const std::string multipleKafka = "./multiplekafka.yaml"; 35 | const std::string noType = "./notype.yaml"; 36 | const std::string invalidType = "./invalidtype.yaml"; 37 | const std::string noBrokerKakfa = "./noBrokerKafka.yaml"; 38 | const std::string noTopicKafka = "./noTopic.yaml"; 39 | 40 | HMState currentState; 41 | }; 42 | 43 | #endif /* TEST_HMPUBSUBCONFIGPARSEYAML_H_ */ 44 | -------------------------------------------------------------------------------- /tests/workTests/TestHMWork.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMWORK_H_ 4 | #define TEST_HMWORK_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "HMWork.h" 11 | 12 | #define TESTNAME Test_HMWork 13 | 14 | // Minimal required functionality to test base class 15 | class TestHMWork : public HMWork 16 | { 17 | public: 18 | TestHMWork() : 19 | HMWork() {}; 20 | 21 | TestHMWork(const std::string& hostname, const HMIPAddress& ip, const HMDataHostCheck& hostcheck) : 22 | HMWork(hostname, ip, hostcheck) {}; 23 | HM_WORK_TYPE getWorkType() { return HM_WORK_HEALTHCHECK; } 24 | HM_WORK_STATUS processWork() {return HM_WORK_COMPLETE;} 25 | void init(HMWorkState& state) {} 26 | 27 | const HMStateManager* getStateManager() {return m_stateManager;} 28 | 29 | }; 30 | 31 | class TESTNAME : public CppUnit::TestFixture 32 | { 33 | 34 | CPPUNIT_TEST_SUITE(TESTNAME); 35 | CPPUNIT_TEST(test_HMWork_Construction); 36 | CPPUNIT_TEST(test_HMWork_updateState); 37 | CPPUNIT_TEST_SUITE_END(); 38 | 39 | 40 | public: 41 | void setUp(); 42 | void tearDown(); 43 | 44 | protected: 45 | void test_HMWork_Construction(); 46 | void test_HMWork_updateState(); 47 | }; 48 | 49 | #endif // TEST_MDBMSTORE_H_ 50 | 51 | -------------------------------------------------------------------------------- /include/internal/HMLogSyslog.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef HMLOGSYSLOG_H_ 4 | #define HMLOGSYSLOG_H_ 5 | 6 | #include 7 | #include 8 | 9 | #include "HMLogBase.h" 10 | 11 | class HMLogSyslog : public HMLogBase 12 | { 13 | 14 | private: 15 | //! Internal log open. 16 | /*! 17 | Internal log open function. Opens the log during the init. 18 | \param the log file name and/or location. 19 | \return true if the log was opened correctly. 20 | */ 21 | bool openLog(std::string); 22 | 23 | //! Internal log close. 24 | /*! 25 | Internal log close function. Closes the log during shutdown. 26 | */ 27 | void closeLog(); 28 | 29 | //! Internal write log function. 30 | /*! 31 | Internal write log function. 32 | Writes the log entry in the derived classes. 33 | \param the log entry to write. 34 | */ 35 | void writeLog(LogEntry* entry); 36 | 37 | //! Called when the log needs to handle a log rotation. 38 | void rotate(); 39 | 40 | //! Convert the HM_LOG_LEVEL to sys log level code. 41 | /*! 42 | Convert the HM_LOG_LEVEL to sys log level code. 43 | \param HM_LOG_LOEVEL. 44 | \return sys log level. 45 | */ 46 | int getSyslogLevel(HM_LOG_LEVEL level); 47 | }; 48 | 49 | #endif /* HMLOGSYSLOG_H_ */ 50 | -------------------------------------------------------------------------------- /include/internal/HMWorkHealthCheckNone.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef HMWORKHEALTHCHECKNONE_H_ 4 | #define HMWORKHEALTHCHECKNONE_H_ 5 | 6 | #include "HMWorkHealthCheck.h" 7 | 8 | // LCOV_EXCL_START; Tested in functional testing 9 | //! Health Check Implementation to check none. ie always up. 10 | class HMWorkHealthCheckNone : public HMWorkHealthCheck 11 | { 12 | public: 13 | HMWorkHealthCheckNone(const std::string& hostname, const HMIPAddress& ip, const HMDataHostCheck& hostcheck) : 14 | HMWorkHealthCheck(hostname, ip, hostcheck) {}; 15 | 16 | //! Main function to actually conduct the health check. 17 | /*! 18 | Main function to actually conduct the health check. 19 | Should set the start, end and response codes. 20 | \return the appropriate HM_WORK_STATUS (IDLE or COMPLETE for done or IN PROGRESS if it needs a continuation) 21 | */ 22 | HM_WORK_STATUS healthCheck(); 23 | 24 | //! Called to init and setup the work order. 25 | /*! 26 | Called to init and setup the work order. 27 | \param the work state to use for the work order. 28 | */ 29 | void init(HMWorkState& state) 30 | { 31 | // To suppress compiler warning 32 | (void)state; 33 | }; 34 | 35 | }; 36 | 37 | #endif /* HMWORKHEALTHCHECKNONE_H_ */ 38 | // LCOV_EXCL_STOP; Tested in functional testing 39 | -------------------------------------------------------------------------------- /src/internal/HMLogStdout.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "HMLogStdout.h" 12 | 13 | using namespace std; 14 | 15 | bool 16 | HMLogStdout::openLog(string logFile) 17 | { 18 | (void)logFile; 19 | return true; 20 | } 21 | 22 | void 23 | HMLogStdout::closeLog() { } 24 | 25 | void 26 | HMLogStdout::writeLog(LogEntry *entry) 27 | { 28 | char buf[DATE_LENGTH + MAX_LOG_PRINT + DEFAULT_MAX_BUFFER] = {}; 29 | int bufsize; 30 | 31 | if (entry->length > 0 && entry->level <= m_logLevel) 32 | { 33 | // deal with long log lines in a slower manner 34 | if (entry->length > DEFAULT_MAX_BUFFER) 35 | { 36 | char* tbuf; 37 | bufsize = asprintf(&tbuf, "%s %s\n", PRINT_LOG_LEVEL[entry->level], entry->entry); 38 | write(fileno(stdout), tbuf, bufsize); 39 | free(tbuf); 40 | } 41 | else 42 | { 43 | bufsize = snprintf(buf, 44 | DATE_LENGTH + MAX_LOG_PRINT + DEFAULT_MAX_BUFFER + 3, "%s %s\n", PRINT_LOG_LEVEL[entry->level], entry->entry); 45 | write(fileno(stdout), buf, bufsize); 46 | } 47 | } 48 | } 49 | 50 | void 51 | HMLogStdout::rotate() {} 52 | 53 | -------------------------------------------------------------------------------- /docs/search/all_13.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['wakeuptracker',['wakeupTracker',['../classHMEventLoop.html#a9d90da9eafde3ddbd4107657b41d14e7',1,'HMEventLoop::wakeupTracker()'],['../classHMEventLoopLibEvent.html#aa127187b72c5383d1650122c9859ba14',1,'HMEventLoopLibEvent::wakeupTracker()'],['../classHMEventLoopQueue.html#a46e9cca6e34e787bf9d24b8877b93a46',1,'HMEventLoopQueue::wakeupTracker()']]], 4 | ['writeauxxml',['writeAuxXML',['../classHMStorageAPI.html#abc7019edb306f7f11122a62b3dbaca32',1,'HMStorageAPI']]], 5 | ['writeconfigs',['writeConfigs',['../classHMConfigParserBase.html#ae4731e3c25723942e6e81a378a50587c',1,'HMConfigParserBase::writeConfigs()'],['../classHMConfigParserYAML.html#a50c4ebeb8f34cec134892df70decd64c',1,'HMConfigParserYAML::writeConfigs()'],['../classHMState.html#aa72b998aeba6fb0689b4b2992c60b86c',1,'HMState::writeConfigs()'],['../classHMStorageAPI.html#a698fb76aa69a778e31ced084ced35f1b',1,'HMStorageAPI::writeConfigs()']]], 6 | ['writelog',['writeLog',['../classHMLogAPI.html#a30086d70113af597b90d0dc0022d0687',1,'HMLogAPI::writeLog()'],['../classHMLogBase.html#a202732177b7a32a8683d91cdbbcdbf33',1,'HMLogBase::writeLog()'],['../classHMLogStdout.html#a8d2e7230de69514a14b88e2935a8cbca',1,'HMLogStdout::writeLog()'],['../classHMLogSyslog.html#ae2c9bab897e8eb5832e07004d474a7b9',1,'HMLogSyslog::writeLog()'],['../classHMLogText.html#a78d79355a45c00706bbf8b6780c00209',1,'HMLogText::writeLog()']]], 7 | ['writexml',['writeXML',['../classHMStorageAPI.html#a485a7159e09447116e73eea73dc6a4de',1,'HMStorageAPI']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /Contributing.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | First, thanks for taking the time to contribute to our project! The following information provides a guide for making contributions. 3 | 4 | ## Code of Conduct 5 | 6 | By participating in this project, you agree to abide by the [Oath Code of Conduct](Code-of-Conduct.md). Everyone is welcome to submit a pull request or open an issue to improve the documentation, add improvements, or report bugs. 7 | 8 | ## How to Ask a Question 9 | 10 | If you simply have a question that needs an answer, [create an issue](https://help.github.com/articles/creating-an-issue/), and label it as a question. 11 | 12 | ## How To Contribute 13 | 14 | ### Report a Bug or Request a Feature 15 | 16 | If you encounter any bugs while using this software, or want to request a new feature or enhancement, feel free to [create an issue](https://help.github.com/articles/creating-an-issue/) to report it, make sure you add a label to indicate what type of issue it is. 17 | 18 | ### Contribute Code 19 | Pull requests are welcome for bug fixes. If you want to implement something new, please [request a feature first](#report-a-bug-or-request-a-feature) so we can discuss it. 20 | 21 | #### Creating a Pull Request 22 | Please follow [best practices](https://github.com/trein/dev-best-practices/wiki/Git-Commit-Best-Practices) for creating git commits. 23 | 24 | When your code is ready to be submitted, you can [submit a pull request](https://help.github.com/articles/creating-a-pull-request/) to begin the code review process. 25 | -------------------------------------------------------------------------------- /docs/search/functions_13.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['wakeuptracker',['wakeupTracker',['../classHMEventLoop.html#a9d90da9eafde3ddbd4107657b41d14e7',1,'HMEventLoop::wakeupTracker()'],['../classHMEventLoopLibEvent.html#aa127187b72c5383d1650122c9859ba14',1,'HMEventLoopLibEvent::wakeupTracker()'],['../classHMEventLoopQueue.html#a46e9cca6e34e787bf9d24b8877b93a46',1,'HMEventLoopQueue::wakeupTracker()']]], 4 | ['writeauxxml',['writeAuxXML',['../classHMStorageAPI.html#abc7019edb306f7f11122a62b3dbaca32',1,'HMStorageAPI']]], 5 | ['writeconfigs',['writeConfigs',['../classHMConfigParserBase.html#ae4731e3c25723942e6e81a378a50587c',1,'HMConfigParserBase::writeConfigs()'],['../classHMConfigParserYAML.html#a50c4ebeb8f34cec134892df70decd64c',1,'HMConfigParserYAML::writeConfigs()'],['../classHMState.html#aa72b998aeba6fb0689b4b2992c60b86c',1,'HMState::writeConfigs()'],['../classHMStorageAPI.html#a698fb76aa69a778e31ced084ced35f1b',1,'HMStorageAPI::writeConfigs()']]], 6 | ['writelog',['writeLog',['../classHMLogAPI.html#a30086d70113af597b90d0dc0022d0687',1,'HMLogAPI::writeLog()'],['../classHMLogBase.html#a202732177b7a32a8683d91cdbbcdbf33',1,'HMLogBase::writeLog()'],['../classHMLogStdout.html#a8d2e7230de69514a14b88e2935a8cbca',1,'HMLogStdout::writeLog()'],['../classHMLogSyslog.html#ae2c9bab897e8eb5832e07004d474a7b9',1,'HMLogSyslog::writeLog()'],['../classHMLogText.html#a78d79355a45c00706bbf8b6780c00209',1,'HMLogText::writeLog()']]], 7 | ['writexml',['writeXML',['../classHMStorageAPI.html#a485a7159e09447116e73eea73dc6a4de',1,'HMStorageAPI']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlTLSSocket4.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMCONTROLTLSSOCKET4_H_ 4 | #define TEST_HMCONTROLTLsSOCKET4_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlTLSSocket4 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr1); 19 | CPPUNIT_TEST(test_cmdlstnr2); 20 | CPPUNIT_TEST(test_cmdlstnr3); 21 | CPPUNIT_TEST(test_cmdlstnr4); 22 | CPPUNIT_TEST(test_cmdlstnr5); 23 | CPPUNIT_TEST_SUITE_END(); 24 | 25 | 26 | public: 27 | void setUp(); 28 | void tearDown(); 29 | 30 | protected: 31 | void test_cmdlstnr1(); 32 | void test_cmdlstnr2(); 33 | void test_cmdlstnr3(); 34 | void test_cmdlstnr4(); 35 | void test_cmdlstnr5(); 36 | HMStateManager *sm; 37 | std::thread sm_thr; 38 | HMTimeStamp now; 39 | std::string host1 = "test.hm.com"; 40 | std::string host2 = "test2.hm.com"; 41 | std::string host3 = "test3.hm.com"; 42 | HMAPIIPAddress server; 43 | uint16_t port; 44 | std::string certfile; 45 | std::string keyfile; 46 | std::string caFile; 47 | HMHash hash; 48 | HMHash hash1; 49 | }; 50 | #endif /* TEST_HMCONTROLTLSSOCKET4_H_ */ 51 | -------------------------------------------------------------------------------- /tests/workTests/TestHMWorkAresTest.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TEST_HMWORKARESTEST_H_ 4 | #define TEST_HMWORKARESTEST_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "HMWork.h" 11 | 12 | #define TESTNAME Test_HMWorkAresTest 13 | 14 | // Minimal required functionality to test base class 15 | class TestHMWork : public HMWork 16 | { 17 | public: 18 | TestHMWork() : 19 | HMWork() {}; 20 | 21 | TestHMWork(const std::string& hostname, const HMIPAddress& ip, const HMDataHostCheck& hostcheck) : 22 | HMWork(hostname, ip, hostcheck) {}; 23 | HM_WORK_TYPE getWorkType() { return HM_WORK_HEALTHCHECK; } 24 | HM_WORK_STATUS processWork() {return HM_WORK_COMPLETE;} 25 | void init(HMWorkState& state) {} 26 | 27 | const HMStateManager* getStateManager() {return m_stateManager;} 28 | 29 | }; 30 | 31 | class TESTNAME : public CppUnit::TestFixture 32 | { 33 | 34 | CPPUNIT_TEST_SUITE(TESTNAME); 35 | CPPUNIT_TEST(test_HMWorkState_Construction); 36 | CPPUNIT_TEST(test_HMWorkReloadState); 37 | CPPUNIT_TEST_SUITE_END(); 38 | 39 | 40 | public: 41 | void setUp(); 42 | void tearDown(); 43 | 44 | protected: 45 | void test_HMWorkState_Construction(); 46 | void test_HMWorkReloadState(); 47 | }; 48 | 49 | #endif // TEST_HMWORKARESTEST_H_ 50 | 51 | -------------------------------------------------------------------------------- /tests/externalIO/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(ExternalProject) 2 | project(netchasm) 3 | add_custom_target( 4 | CertGenerator 5 | COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/certs/cert.sh ${CMAKE_CURRENT_SOURCE_DIR}/certs 6 | ) 7 | 8 | add_definitions(-DCERT_FOLDER="${CMAKE_CURRENT_BINARY_DIR}") 9 | if(NOT SKIP-MDBM) 10 | list(APPEND SOURCES "TestHMCommandListenerUtils.cpp" "TestHMControlLinuxSocket.cpp" "TestHMControlLinuxSocket1.cpp" "TestHMControlLinuxSocket2.cpp" 11 | "TestHMControlLinuxSocket3.cpp" "TestHMControlLinuxSocket4.cpp" "TestHMControlLinuxSocket5.cpp" "TestHMControlLinuxSocket6.cpp" 12 | "TestHMControlTCPSocket.cpp" "TestHMControlTCPSocket2.cpp" "TestHMControlTCPSocket5.cpp" "TestHMControlTCPSocket6.cpp" 13 | "TestHMControlTLSSocket.cpp" "TestHMControlTLSSocket2.cpp" "TestHMControlTLSSocket5.cpp" "TestHMControlTLSSocket6.cpp" 14 | "TestHMControlTLSSocket7.cpp" "TestHMControlTLSSocket8.cpp" "TestHMControlTLSSocket9.cpp" 15 | "TestHMTCPConnectionHandler1.cpp" "TestHMTLSConnectionHandler1.cpp") 16 | if(NOT SKIP-IPV6) 17 | list(APPEND SOURCES "TestHMControlTCPSocket1.cpp" "TestHMControlTCPSocket3.cpp" "TestHMControlTCPSocket4.cpp" 18 | "TestHMControlTLSSocket1.cpp" "TestHMControlTLSSocket3.cpp" "TestHMControlTLSSocket4.cpp") 19 | endif() 20 | 21 | endif() 22 | add_executable(externalio ${SOURCES} ../shared/common.cpp ../CppUnitTestRunner.cc) 23 | set_property(TARGET externalio PROPERTY CXX_STANDARD 14) 24 | add_dependencies(externalio CertGenerator) 25 | add_test(externalio externalio) 26 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlTLSSocket1.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_HMCONTROLTLSSOCKET1_H_ 4 | #define TESTS_HMCONTROLTLSSOCKET1_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlTLSSocket1 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr6); 19 | CPPUNIT_TEST(test_cmdlstnr7); 20 | CPPUNIT_TEST(test_cmdlstnr8); 21 | CPPUNIT_TEST(test_cmdlstnr9); 22 | CPPUNIT_TEST(test_cmdlstnr10); 23 | CPPUNIT_TEST(test_cmdlstnr11); 24 | CPPUNIT_TEST(test_cmdlstnr12); 25 | CPPUNIT_TEST(test_cmdlstnr13); 26 | CPPUNIT_TEST_SUITE_END(); 27 | 28 | 29 | public: 30 | void setUp(); 31 | void tearDown(); 32 | 33 | protected: 34 | void test_cmdlstnr6(); 35 | void test_cmdlstnr7(); 36 | void test_cmdlstnr8(); 37 | void test_cmdlstnr9(); 38 | void test_cmdlstnr10(); 39 | void test_cmdlstnr11(); 40 | void test_cmdlstnr12(); 41 | void test_cmdlstnr13(); 42 | HMStateManager *sm; 43 | std::thread sm_thr; 44 | HMAPIIPAddress server; 45 | uint16_t port; 46 | std::string certfile; 47 | std::string keyfile; 48 | std::string caFile; 49 | 50 | }; 51 | #endif /* TESTS_HMCONTROLTLSSOCKET1_H_ */ 52 | -------------------------------------------------------------------------------- /include/internal/HMWorkHealthMultiWork.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef HMWORKHEALTHMULTIWORK_H_ 4 | #define HMWORKHEALTHMULTIWORK_H_ 5 | 6 | #include 7 | #include 8 | 9 | #include "HMWorkHealthCheck.h" 10 | 11 | // LCOV_EXCL_START; Tested in functional testing 12 | 13 | //! Class to implement queuing up of multiple health checks. 14 | class HMWorkHealhMultiWork : public HMWorkHealthCheck 15 | { 16 | public: 17 | HMWorkHealhMultiWork(const std::string& hostname, const HMIPAddress& ip, const HMDataHostCheck& hostcheck) : 18 | HMWorkHealthCheck(hostname, ip, hostcheck) {}; 19 | 20 | 21 | //! Main function to actually conduct the health check. 22 | /*! 23 | Main function to actually conduct the health check. 24 | Should set the start, end and response codes. 25 | \return the appropriate HM_WORK_STATUS (IDLE or COMPLETE for done or IN PROGRESS if it needs a continuation) 26 | */ 27 | HM_WORK_STATUS healthCheck(); 28 | 29 | //! Called to init and setup the work order. 30 | /*! 31 | Called to init and setup the work order. 32 | \param the work state to use for the work order. 33 | */ 34 | void init(HMWorkState& state) 35 | { 36 | // To suppress compiler warning 37 | (void)state; 38 | }; 39 | 40 | }; 41 | 42 | #endif /* HMWORKHEALTHMULTIWORK_H_ */ 43 | // LCOV_EXCL_STOP; Tested in functional testing 44 | -------------------------------------------------------------------------------- /docs/search/all_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['fetchaux',['fetchAux',['../classHMWorkAuxFetch.html#a7de051da625d7ea4769b6911d5c5f1c9',1,'HMWorkAuxFetch::fetchAux()'],['../classHMWorkAuxFetchCurl.html#ad5c04809a7b09fa43f4d61e19dffc93a',1,'HMWorkAuxFetchCurl::fetchAux()']]], 4 | ['final',['final',['../classHMHashMD5.html#a2d5b2f0d737833797cd96565307f94e0',1,'HMHashMD5']]], 5 | ['finishquery',['finishQuery',['../classHMDNSCache.html#a77a590d11d83ca526a8f9da30fac631e',1,'HMDNSCache::finishQuery()'],['../classHMDNSResult.html#aaa24be895f83f33fef130b2e581ec03d',1,'HMDNSResult::finishQuery()']]], 6 | ['flush',['flush',['../classHMLogTextFileHandle.html#ac7a9fd184ff1124eda4458bff3db5c7c',1,'HMLogTextFileHandle']]], 7 | ['flushbuffer',['flushBuffer',['../classHMLogBase.html#a3ffe7df4234b3f705a2c1e72c2cd119a',1,'HMLogBase']]], 8 | ['forcednscheck',['forceDNSCheck',['../classHMState.html#a61e8c03c6b11afb85872d479b4cda5b5',1,'HMState::forceDNSCheck(const std::string &hostGroup, HMWorkQueue &workQueue)'],['../classHMState.html#ac809a65e032e4d9ca0d821dab05f6d70',1,'HMState::forceDNSCheck(const std::string &hostGroup, const std::string &hostName, HMWorkQueue &workQueue)']]], 9 | ['forcehealthcheck',['forceHealthCheck',['../classHMState.html#adf953d294f5928f75792c4bfd5bce698',1,'HMState::forceHealthCheck(const std::string &hostGroup, HMWorkQueue &workQueue)'],['../classHMState.html#ad8dcff170bf06fbccc17e9c0ac129331',1,'HMState::forceHealthCheck(const std::string &hostGroup, const std::string &hostName, HMWorkQueue &workQueue)']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /docs/search/functions_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['fetchaux',['fetchAux',['../classHMWorkAuxFetch.html#a7de051da625d7ea4769b6911d5c5f1c9',1,'HMWorkAuxFetch::fetchAux()'],['../classHMWorkAuxFetchCurl.html#ad5c04809a7b09fa43f4d61e19dffc93a',1,'HMWorkAuxFetchCurl::fetchAux()']]], 4 | ['final',['final',['../classHMHashMD5.html#a2d5b2f0d737833797cd96565307f94e0',1,'HMHashMD5']]], 5 | ['finishquery',['finishQuery',['../classHMDNSCache.html#a77a590d11d83ca526a8f9da30fac631e',1,'HMDNSCache::finishQuery()'],['../classHMDNSResult.html#aaa24be895f83f33fef130b2e581ec03d',1,'HMDNSResult::finishQuery()']]], 6 | ['flush',['flush',['../classHMLogTextFileHandle.html#ac7a9fd184ff1124eda4458bff3db5c7c',1,'HMLogTextFileHandle']]], 7 | ['flushbuffer',['flushBuffer',['../classHMLogBase.html#a3ffe7df4234b3f705a2c1e72c2cd119a',1,'HMLogBase']]], 8 | ['forcednscheck',['forceDNSCheck',['../classHMState.html#a61e8c03c6b11afb85872d479b4cda5b5',1,'HMState::forceDNSCheck(const std::string &hostGroup, HMWorkQueue &workQueue)'],['../classHMState.html#ac809a65e032e4d9ca0d821dab05f6d70',1,'HMState::forceDNSCheck(const std::string &hostGroup, const std::string &hostName, HMWorkQueue &workQueue)']]], 9 | ['forcehealthcheck',['forceHealthCheck',['../classHMState.html#adf953d294f5928f75792c4bfd5bce698',1,'HMState::forceHealthCheck(const std::string &hostGroup, HMWorkQueue &workQueue)'],['../classHMState.html#ad8dcff170bf06fbccc17e9c0ac129331',1,'HMState::forceHealthCheck(const std::string &hostGroup, const std::string &hostName, HMWorkQueue &workQueue)']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /include/internal/HMConfigParserYaml.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef HMCONFIGPARSERYAML_H_ 4 | #define HMCONFIGPARSERYAML_H_ 5 | 6 | #include 7 | #include 8 | 9 | #include "HMConfigParserBase.h" 10 | 11 | #define IS_FOLDER 0x4 12 | #define IS_FILE 0x8 13 | 14 | class HMConfigParserYAML : public HMConfigParserBase 15 | { 16 | public: 17 | HMConfigParserYAML() : 18 | m_loadCount(0) {}; 19 | 20 | //! Main parse config function. 21 | /*! 22 | The function used to parse a config file. 23 | \param fileName the file to parse. 24 | \param state the state data structure to fill from the config information. 25 | \param class to fill info of config outside of Host-Groups 26 | \return the number of config parsing errors. Zero means a successful load. 27 | */ 28 | uint32_t parseConfig(const std::string& fileName, HMState& state, HMConfigParams& configParams); 29 | 30 | //! Write the internal config state back to disk. 31 | /*! 32 | Write the internal config state back to disk. 33 | \param path the path to disk to write the config. 34 | \param state the config state to write back out to the disk. 35 | \return bool true if the configs were stored without an error. 36 | */ 37 | 38 | bool writeConfigs(HMState& state, std::string outFile); 39 | 40 | private: 41 | uint32_t m_loadCount; 42 | }; 43 | 44 | #endif /* HMCONFIGPARSERYAML_H_ */ 45 | 46 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlLinuxSocket5.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_HMCONTROLLINUXSOCKET5_H_ 4 | #define TESTS_HMCONTROLLINUXSOCKET5_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlLinuxSocket5 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr1); 19 | CPPUNIT_TEST(test_cmdlstnr2); 20 | CPPUNIT_TEST(test_cmdlstnr3); 21 | CPPUNIT_TEST(test_cmdlstnr4); 22 | CPPUNIT_TEST(test_cmdlstnr5); 23 | CPPUNIT_TEST(test_cmdlstnr6); 24 | CPPUNIT_TEST(test_cmdlstnr7); 25 | CPPUNIT_TEST(test_cmdlstnr8); 26 | CPPUNIT_TEST(test_cmdlstnr9); 27 | CPPUNIT_TEST(test_cmdlstnr10); 28 | CPPUNIT_TEST_SUITE_END(); 29 | 30 | 31 | public: 32 | void setUp(); 33 | void tearDown(); 34 | 35 | protected: 36 | void test_cmdlstnr1(); 37 | void test_cmdlstnr2(); 38 | void test_cmdlstnr3(); 39 | void test_cmdlstnr4(); 40 | void test_cmdlstnr5(); 41 | void test_cmdlstnr6(); 42 | void test_cmdlstnr7(); 43 | void test_cmdlstnr8(); 44 | void test_cmdlstnr9(); 45 | void test_cmdlstnr10(); 46 | HMStateManager *sm; 47 | std::thread sm_thr; 48 | HMHash hash; 49 | HMHash hash1; 50 | HMHash hash2; 51 | }; 52 | #endif /* TESTS_HMCONTROLLINUXSOCKET5_H_ */ 53 | -------------------------------------------------------------------------------- /include/NetCHASM/HMNetCHASMAPI.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef HMNETCHASMAPI_H_ 4 | #define HMNETCHASMAPI_H_ 5 | 6 | #include 7 | #include 8 | 9 | class HMStateManager; 10 | class HMNetCHASMAPI 11 | { 12 | public: 13 | HMNetCHASMAPI() {} 14 | ~HMNetCHASMAPI() {} 15 | 16 | //! Factory function to create a scheduler instance. 17 | /*! 18 | Function to create a scheduler instance. The instance is started as a separate thread. The instance returns a shared pointer of the instance. 19 | \param the log level. 20 | \param path to the master file. 21 | \return shared pointer of instance if successful else a nullptr. 22 | */ 23 | static std::shared_ptr createHealthCheckInstance(std::string loglevel, const std::string masterConfig); 24 | 25 | //! Function to check if the scheduler is still running. 26 | /*! 27 | Function to check if the scheduler is still running. 28 | \return true is still running else false if stopped. 29 | */ 30 | bool isAlive(); 31 | 32 | //! Function to stop scheduler and stop background thread running the scheduler. 33 | /*! 34 | Function to stop scheduler and stop background thread running the scheduler. 35 | */ 36 | void stopHealthCheckInstance(); 37 | 38 | private: 39 | std::thread m_thread; 40 | std::shared_ptr m_monitor = nullptr; 41 | }; 42 | 43 | 44 | #endif /* HMNETCHASMAPI_H_ */ 45 | -------------------------------------------------------------------------------- /tests/externalIO/certs/cert.sh: -------------------------------------------------------------------------------- 1 | rm -rf demoCA 2 | rm *.csr 3 | rm *.key 4 | rm *.crt 5 | mkdir -p demoCA 6 | mkdir -p demoCA/certs 7 | mkdir -p demoCA/crl 8 | mkdir -p demoCA/newcerts 9 | touch demoCA/index.txt 10 | touch demoCA/serial 11 | echo "1000" > demoCA/serial 12 | echo 123456 > pass.txt 13 | LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/oath/openssl/1.1.1/lib 14 | export LD_LIBRARY_PATH 15 | cnfFile=$1/openssl.cnf 16 | openssl req -new -x509 -batch -passout file:pass.txt -keyout ca.key -out ca.crt -config ${cnfFile} 17 | openssl genrsa -aes128 -passout file:pass.txt -out server.key 1024 18 | openssl rsa -passin file:pass.txt -in server.key -out server.key 19 | openssl req -new -batch -key server.key -out server.csr -config ${cnfFile} -subj "/CN=healthmon_server.com" 20 | openssl ca -batch -passin file:pass.txt -in server.csr -out server.crt -cert ca.crt -keyfile ca.key -config ${cnfFile} 21 | openssl genrsa -aes128 -passout file:pass.txt -out client.key 1024 22 | openssl rsa -passin file:pass.txt -in client.key -out client.key 23 | openssl genrsa -aes128 -passout file:pass.txt -out client_mismatch.key 1024 24 | openssl rsa -passin file:pass.txt -in client_mismatch.key -out client_mismatch.key 25 | openssl req -new -batch -key client.key -out client.csr -config ${cnfFile} -subj "/CN=healthmon_client.com" 26 | openssl req -new -batch -key client.key -out client_self.csr -config ${cnfFile} -subj "/CN=healthmon_client_self.com" 27 | openssl ca -batch -passin file:pass.txt -in client.csr -out client.crt -cert ca.crt -keyfile ca.key -config ${cnfFile} 28 | openssl x509 -req -in client_self.csr -signkey client.key -out client_self.crt 29 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlTCPSocket5.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_HMCONTROLTCPSOCKET5_H_ 4 | #define TESTS_HMCONTROLTCPSOCKET5_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlTCPSocket5 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr1); 19 | CPPUNIT_TEST(test_cmdlstnr2); 20 | CPPUNIT_TEST(test_cmdlstnr3); 21 | CPPUNIT_TEST(test_cmdlstnr4); 22 | CPPUNIT_TEST(test_cmdlstnr5); 23 | CPPUNIT_TEST(test_cmdlstnr6); 24 | CPPUNIT_TEST(test_cmdlstnr7); 25 | CPPUNIT_TEST(test_cmdlstnr8); 26 | CPPUNIT_TEST(test_cmdlstnr9); 27 | CPPUNIT_TEST(test_cmdlstnr10); 28 | CPPUNIT_TEST_SUITE_END(); 29 | 30 | 31 | public: 32 | void setUp(); 33 | void tearDown(); 34 | 35 | protected: 36 | void test_cmdlstnr1(); 37 | void test_cmdlstnr2(); 38 | void test_cmdlstnr3(); 39 | void test_cmdlstnr4(); 40 | void test_cmdlstnr5(); 41 | void test_cmdlstnr6(); 42 | void test_cmdlstnr7(); 43 | void test_cmdlstnr8(); 44 | void test_cmdlstnr9(); 45 | void test_cmdlstnr10(); 46 | HMStateManager *sm; 47 | std::thread sm_thr; 48 | HMAPIIPAddress server; 49 | uint16_t port; 50 | HMHash hash; 51 | HMHash hash1; 52 | HMHash hash2; 53 | }; 54 | #endif /* TESTS_HMCONTROLTCPSOCKET5_H_ */ 55 | -------------------------------------------------------------------------------- /tests/coreTests/TestHMRemoteCache.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #include "TestHMRemoteCache.h" 4 | 5 | #include "HMRemoteHostGroupCache.h" 6 | 7 | 8 | #include "common.h" 9 | #include 10 | #include 11 | 12 | using namespace std; 13 | CPPUNIT_TEST_SUITE_REGISTRATION(TESTNAME); 14 | 15 | void TESTNAME::setUp() 16 | { 17 | setupCommon(); 18 | } 19 | 20 | void TESTNAME::tearDown() 21 | { 22 | teardownCommon(); 23 | } 24 | 25 | /* 26 | * This test create entry into DNS Cache with specified ttl. after starting query we 27 | * verify the query needed status and the next querytime. 28 | */ 29 | void TESTNAME::test_basic_cache() 30 | { 31 | HMRemoteHostGroupCache hmremote; 32 | string hostgroupname = "Dummy.hm.com"; 33 | hmremote.insertRemoteEntry(hostgroupname, 1000, 1000); 34 | hmremote.startRemoteCheck(hostgroupname); 35 | CPPUNIT_ASSERT_EQUAL(HM_SCHEDULE_IGNORE, 36 | hmremote.checkNeeded(hostgroupname)); 37 | sleep(2); 38 | } 39 | 40 | /* 41 | * This test create entry into DNS Cache. We update the results with IPV4 address and 42 | * check the get addresses function of the DNS Cache. 43 | */ 44 | void TESTNAME::test_basic_cache1() 45 | { 46 | HMRemoteHostGroupCache hmremote; 47 | string hostgroupname = "Dummy.hm.com"; 48 | hmremote.insertRemoteEntry(hostgroupname, 10000,10000); 49 | hmremote.finishCheck(hostgroupname, true); 50 | CPPUNIT_ASSERT_EQUAL(HM_SCHEDULE_IGNORE, 51 | hmremote.checkNeeded(hostgroupname)); 52 | } 53 | 54 | -------------------------------------------------------------------------------- /tests/workTests/TestHMWorkHealthCheck.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_WORKTESTS_TESTHMWORKHEALTHCHECK_H_ 4 | #define TESTS_WORKTESTS_TESTHMWORKHEALTHCHECK_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "HMWorkHealthCheck.h" 12 | #include "HMStateManager.h" 13 | 14 | #define TESTNAME Test_HMWorkHealthCheck 15 | 16 | class TestHMWorkHealthCheck : public HMWorkHealthCheck 17 | { 18 | public: 19 | TestHMWorkHealthCheck(const std::string& hostname, const HMIPAddress& ip, const HMDataHostCheck& hostcheck) : 20 | HMWorkHealthCheck(hostname, ip, hostcheck) {responseTime = 0;}; 21 | 22 | HM_WORK_STATUS healthCheck(); 23 | void init(HMWorkState& state) {}; 24 | 25 | int responseTime; 26 | }; 27 | 28 | class TESTNAME : public CppUnit::TestFixture 29 | { 30 | CPPUNIT_TEST_SUITE(TESTNAME); 31 | CPPUNIT_TEST(test_HMWorkHealthCheck_IPV4); 32 | CPPUNIT_TEST(test_HMWorkHealthCheck_IPV6); 33 | CPPUNIT_TEST_SUITE_END(); 34 | 35 | public: 36 | void setUp(); 37 | void tearDown(); 38 | 39 | TestHMWorkHealthCheck* healthCheck; 40 | 41 | std::shared_ptr m_currentState; 42 | HMStateManager m_state; 43 | HMEventLoopQueue* m_eventQueue; 44 | std::thread* m_eventThread; 45 | 46 | 47 | protected: 48 | void test_HMWorkHealthCheck_IPV4(); 49 | void test_HMWorkHealthCheck_IPV6(); 50 | }; 51 | #endif /* TESTS_WORKTESTS_TESTHMWORKHEALTHCHECK_H_ */ 52 | -------------------------------------------------------------------------------- /include/internal/HMControlLinuxSocket.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef HMCOMMANDLINUXLISTENER_H_ 4 | #define HMCOMMANDLINUXLISTENER_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "HMControlBase.h" 11 | #include "HMConstants.h" 12 | 13 | //! Default location of the Linux Control Socket 14 | const std::string HM_DEFAULT_USD_PATH = "/home/y/var/run/netchasm/controlsocket"; 15 | 16 | class HMStateManager; 17 | //! Class to handle linux socket based external communications 18 | class HMControlLinuxSocket : public HMCommandListenerBase 19 | { 20 | public: 21 | 22 | HMControlLinuxSocket(std::string socketPath, HMStateManager& stateManager); 23 | ~HMControlLinuxSocket(); 24 | 25 | HMControlLinuxSocket& operator=(const HMControlLinuxSocket&) = delete; // Disallow copying 26 | HMControlLinuxSocket(const HMControlLinuxSocket&) = delete; 27 | 28 | //! Function to initialize sockets 29 | void init(); 30 | //! Function to handle connections 31 | void run(); 32 | //! Shutdown listeners 33 | void listernerShutDown(); 34 | /*! 35 | Handle client communications 36 | \param pointer of client socket. 37 | */ 38 | void handleClient(int clientSock); 39 | //! Handle client connections 40 | void handleConnections(); 41 | 42 | private: 43 | int m_socket; 44 | std::string m_socketPath; 45 | //! unlink socket path 46 | void unlinkSocket(std::string& socketPath); 47 | }; 48 | 49 | #endif /* HMCOMMANDLINUXLISTENER_H_ */ 50 | -------------------------------------------------------------------------------- /tests/externalIO/TestHMControlLinuxSocket.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #ifndef TESTS_HMCONTROLLINUXSOCKET_H_ 4 | #define TESTS_HMCONTROLLINUXSOCKET_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "HMStateManager.h" 10 | 11 | 12 | #define TESTNAME Test_HMControlLinuxSocket 13 | 14 | class TESTNAME : public CppUnit::TestFixture 15 | { 16 | 17 | CPPUNIT_TEST_SUITE(TESTNAME); 18 | CPPUNIT_TEST(test_cmdlstnr1); 19 | CPPUNIT_TEST(test_cmdlstnr2); 20 | CPPUNIT_TEST(test_cmdlstnr3); 21 | CPPUNIT_TEST(test_cmdlstnr4); 22 | CPPUNIT_TEST(test_cmdlstnr5); 23 | CPPUNIT_TEST(test_cmdlstnr6); 24 | CPPUNIT_TEST(test_cmdlstnr7); 25 | CPPUNIT_TEST(test_cmdlstnr8); 26 | CPPUNIT_TEST(test_cmdlstnr9); 27 | CPPUNIT_TEST(test_cmdlstnr10); 28 | CPPUNIT_TEST(test_cmdlstnr11); 29 | CPPUNIT_TEST(test_cmdlstnr12); 30 | CPPUNIT_TEST_SUITE_END(); 31 | 32 | 33 | public: 34 | void setUp(); 35 | void tearDown(); 36 | 37 | protected: 38 | void test_cmdlstnr1(); 39 | void test_cmdlstnr2(); 40 | void test_cmdlstnr3(); 41 | void test_cmdlstnr4(); 42 | void test_cmdlstnr5(); 43 | void test_cmdlstnr6(); 44 | void test_cmdlstnr7(); 45 | void test_cmdlstnr8(); 46 | void test_cmdlstnr9(); 47 | void test_cmdlstnr10(); 48 | void test_cmdlstnr11(); 49 | void test_cmdlstnr12(); 50 | HMStateManager *sm; 51 | std::thread sm_thr; 52 | }; 53 | #endif /* TESTS_STORETESTS_TESTHMSTORAGE_H_ */ 54 | -------------------------------------------------------------------------------- /src/internal/HMWorkHealthMultiWork.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oath Inc. 2 | // Licensed under the terms of the Apache 2.0 license. See LICENSE file in the root of the distribution for licensing details. 3 | #include "curl/curl.h" 4 | 5 | #include "HMWorkMarkFetchCurl.h" 6 | #include "HMWorkHealthMultiWork.h" 7 | #include "HMWork.h" 8 | #include "HMTimeStamp.h" 9 | #include "HMConstants.h" 10 | #include "HMLogBase.h" 11 | #include "HMStateManager.h" 12 | 13 | // LCOV_EXCL_START; Tested in functional testing 14 | 15 | using namespace std; 16 | 17 | HM_WORK_STATUS 18 | HMWorkHealhMultiWork::healthCheck() 19 | { 20 | unique_ptr healthCheck; 21 | set values; 22 | HMLog(HM_LOG_DEBUG, 23 | "[MultiQueueCheck] Preparing to schedule child Curl Mark checks for host %s ip %s", 24 | m_hostname.c_str(), m_ipAddress.toString().c_str()); 25 | m_stateManager->m_hostMark.getSocketOptionValues(m_hostname, m_ipAddress, 26 | m_hostCheck, values); 27 | for (int value : values) 28 | { 29 | HMLog(HM_LOG_DEBUG, 30 | "[MultiQueueCheck] Scheduling Curl Mark check check for host %s ip %s with mark %d", 31 | m_hostname.c_str(), m_ipAddress.toString().c_str(), value); 32 | healthCheck = make_unique( 33 | HMWorkMarkFetchCurl(m_hostname, m_ipAddress, m_hostCheck)); 34 | healthCheck->setMark(value); 35 | healthCheck->setReschedule(false); 36 | healthCheck->setStoreResults(false); 37 | m_stateManager->m_workQueue.insertWork(healthCheck); 38 | } 39 | return HM_WORK_COMPLETE; 40 | } 41 | // LCOV_EXCL_STOP; Tested in functional testing 42 | -------------------------------------------------------------------------------- /docs/search/all_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['adddnstimeout',['addDNSTimeout',['../classHMEventLoop.html#af5f5972487472ae6ac5b43b3ba2da6fc',1,'HMEventLoop::addDNSTimeout()'],['../classHMEventLoopLibEvent.html#ac265e9df5982c0ff3d04d78202cb326e',1,'HMEventLoopLibEvent::addDNSTimeout()'],['../classHMEventLoopQueue.html#a4d1dd85e9ba8d2e1404387aff7c47e8e',1,'HMEventLoopQueue::addDNSTimeout()']]], 4 | ['addhealthchecktimeout',['addHealthCheckTimeout',['../classHMEventLoop.html#acd68b7b9dd3038170b5e3085400057dc',1,'HMEventLoop::addHealthCheckTimeout()'],['../classHMEventLoopLibEvent.html#a01ebc8723e485dbf51b200e35d6d9177',1,'HMEventLoopLibEvent::addHealthCheckTimeout()'],['../classHMEventLoopQueue.html#a26b81d8c1176adca4780da3d08c19b1a',1,'HMEventLoopQueue::addHealthCheckTimeout()']]], 5 | ['addhost',['addHost',['../classHMDataHostGroup.html#ab17f1c10382e4760a9acf2ea26f958c6',1,'HMDataHostGroup']]], 6 | ['addhostgroup',['addHostGroup',['../classHMDataCheckList.html#a0bb03836397675203edc6ff530ea1f64',1,'HMDataCheckList::addHostGroup()'],['../classHMDataCheckParams.html#af7377cf4eb87277ddc460f24ba9b8fc7',1,'HMDataCheckParams::addHostGroup()']]], 7 | ['addip',['addIP',['../classHMWorkDNSLookupAres.html#a456f879ecf52f6b5507b0ec49ecc36ba',1,'HMWorkDNSLookupAres::addIP()'],['../classHMWorkDNSLookupLibEvent.html#a2005f082c94d6d554d655d10d217ed91',1,'HMWorkDNSLookupLibEvent::addIP()']]], 8 | ['addr4',['addr4',['../classHMIPAddress.html#a9bb83f15b93ccd682448fdf188b84c37',1,'HMIPAddress']]], 9 | ['addr6',['addr6',['../classHMIPAddress.html#a031539ce3d4da6bf05e10cdea551fb08',1,'HMIPAddress']]], 10 | ['addwork',['addWork',['../classHMWorkQueue.html#a4424e4f349d5f51717cc0aa13172576b',1,'HMWorkQueue']]] 11 | ]; 12 | --------------------------------------------------------------------------------