@@ -5,6 +5,7 @@ set(${MODULE_PREFIX}_SRCS
RestfulFunc.h
RestfulFuncImpl.cpp
HttpProbeImpl.cpp
+ PingImpl.cpp
)
add_library(${MODULE_NAME} SHARED ${${MODULE_PREFIX}_SRCS})
@@ -4,7 +4,7 @@
//
-#include "publicFunExport.h"
+#include "RestfulFunc.h"
#include<sys/socket.h>
#include<sys/types.h>
#include<netinet/in.h>
@@ -127,7 +127,7 @@ u_short api_checksum16(u_short *buffer, int size)
return (u_short)(~cksum);
}
-int Ping(const std::string& dst_ip)
+int PingTest(const std::string& dst_ip)
{
int ret = FAILURE;
int sd = 0;
@@ -30,4 +30,13 @@
*/
RESTFULFUNC_API int HttpProbe(const std::string& url, std::string& out_msg, uint32_t wait_max_secs = (uint32_t)-1);
+
+/*!
+ * @brief Ping protocols
+ * @param[in]
+ * @param[out]
+ * @return : 0: ping connect succ; 1: ping failed
+ */
+RESTFULFUNC_API int PingTest(const std::string& dst_ip);
#endif //_OTHER_RESFULFUNCEXPORT_HEADER_
@@ -1,10 +1,10 @@
#define CATCH_CONFIG_MAIN
#include <catch2.hpp>
TEST_CASE("Test ping protocols implement", "[normal]")
- REQUIRE(Ping("55.14.131.137") == 0);
+ REQUIRE(PingTest("55.14.131.137") == 0);
@@ -49,11 +49,4 @@ public:
void Destory();
};
-/*!
- * @brief Ping protocols
- * @param[in]
- * @param[out]
- * @return : 0: ping connect succ; 1: ping failed
- */
-PUBLIC_API int Ping(const std::string& dst_ip);
#endif //_OTHER_PUBLICFUNCEXPORT_HEADER_