summaryrefslogtreecommitdiff
path: root/plugins/Ping/src/rawping.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Ping/src/rawping.cpp')
-rw-r--r--plugins/Ping/src/rawping.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/Ping/src/rawping.cpp b/plugins/Ping/src/rawping.cpp
index c5b2c0c2e8..7e66a7450e 100644
--- a/plugins/Ping/src/rawping.cpp
+++ b/plugins/Ping/src/rawping.cpp
@@ -95,7 +95,7 @@ extern int raw_ping(char *host, int timeout)
}
else {
// Not a recognized hostname either!
- if (options.logging) CallService(PLUG "/Log", (WPARAM)L"rawping error: unrecognised host", 0);
+ if (options.logging) CallService(MODULENAME "/Log", (WPARAM)L"rawping error: unrecognised host", 0);
return -1;
}
}
@@ -119,7 +119,7 @@ extern int raw_ping(char *host, int timeout)
// send packet
int bwrote = sendto(sd, (char*)packet, sizeof(ICMPHeader), 0, (sockaddr*)&dest, sizeof(dest));
if (bwrote == SOCKET_ERROR) {
- if (options.logging) CallService(PLUG "/Log", (WPARAM)L"rawping error: unable to send", 0);
+ if (options.logging) CallService(MODULENAME "/Log", (WPARAM)L"rawping error: unable to send", 0);
return -1;
}
@@ -151,39 +151,39 @@ extern int raw_ping(char *host, int timeout)
if (bread == SOCKET_ERROR) {
if (WSAGetLastError() != WSAETIMEDOUT) {
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"rawping error: socket error...cycling", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"rawping error: socket error...cycling", 0);
}
continue;
}
if (reply_header->proto != ICMP_PROTO) {
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"rawping error: packet not ICMP...cycling", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"rawping error: packet not ICMP...cycling", 0);
continue;
}
if (reply_header->tos != 0) {
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"rawping error: TOS not 0...cycling", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"rawping error: TOS not 0...cycling", 0);
continue;
}
reply = (ICMPHeader *)(recv_buff + reply_header->h_len * 4);
if ((unsigned)bread < reply_header->h_len * 4 + sizeof(ICMPHeader)) {
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"rawping error: short header", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"rawping error: short header", 0);
continue;
}
if (reply->id != (USHORT)GetCurrentProcessId()) {
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"rawping error: wrong ID...cycling", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"rawping error: wrong ID...cycling", 0);
continue;
}
if (reply->type != PT_ICMP_ECHO_REPLY && reply->type != PT_ICMP_SOURCE_QUENCH) {
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"rawping error: wrong type...cycling", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"rawping error: wrong type...cycling", 0);
continue;
}
@@ -191,14 +191,14 @@ extern int raw_ping(char *host, int timeout)
//if(reply->seq > seq_no) return -1;
if (reply->seq != seq_no) {
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"rawping error: wrong sequence number...cycling", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"rawping error: wrong sequence number...cycling", 0);
continue;
}
if (reply->type == PT_ICMP_SOURCE_QUENCH) {
char buff[1024];
mir_snprintf(buff, Translate("Host %s requests that you reduce the amount of traffic you are sending."), host);
- MessageBoxA(nullptr, buff, Translate(PLUG " Warning"), MB_OK | MB_ICONWARNING);
+ MessageBoxA(nullptr, buff, Translate(MODULENAME " Warning"), MB_OK | MB_ICONWARNING);
}
if (use_hi_res) {
@@ -210,7 +210,7 @@ extern int raw_ping(char *host, int timeout)
return current_time - send_time;
}
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"rawping error: timeout", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"rawping error: timeout", 0);
return -1;
}