summaryrefslogtreecommitdiffstats
path: root/plugins/netutils.c
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-08-08 16:49:32 (GMT)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-08-08 16:49:32 (GMT)
commit930650812a19245a8d45853064e8fe32d87f71f2 (patch)
tree17146c824e305cf399257ce4dbd546e5e0f63183 /plugins/netutils.c
parent45b8e6933cb118565efd8807ca8d80ed8e7422f4 (diff)
downloadmonitoring-plugins-930650812a19245a8d45853064e8fe32d87f71f2.tar.gz
cleanups from pedantic complier warnings
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@666 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/netutils.c')
-rw-r--r--plugins/netutils.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/plugins/netutils.c b/plugins/netutils.c
index 92fd142..58b3fb4 100644
--- a/plugins/netutils.c
+++ b/plugins/netutils.c
@@ -53,8 +53,8 @@ socket_timeout_alarm_handler (int sig)
53/* connects to a host on a specified TCP port, sends a string, 53/* connects to a host on a specified TCP port, sends a string,
54 and gets a response */ 54 and gets a response */
55int 55int
56process_tcp_request (char *server_address, int server_port, 56process_tcp_request (const char *server_address, int server_port,
57 char *send_buffer, char *recv_buffer, int recv_size) 57 const char *send_buffer, char *recv_buffer, int recv_size)
58{ 58{
59 int result; 59 int result;
60 60
@@ -68,8 +68,8 @@ process_tcp_request (char *server_address, int server_port,
68/* connects to a host on a specified UDP port, sends a string, and gets a 68/* connects to a host on a specified UDP port, sends a string, and gets a
69 response */ 69 response */
70int 70int
71process_udp_request (char *server_address, int server_port, 71process_udp_request (const char *server_address, int server_port,
72 char *send_buffer, char *recv_buffer, int recv_size) 72 const char *send_buffer, char *recv_buffer, int recv_size)
73{ 73{
74 int result; 74 int result;
75 75
@@ -85,8 +85,8 @@ process_udp_request (char *server_address, int server_port,
85 response. loops on select-recv until timeout or eof to get all of a 85 response. loops on select-recv until timeout or eof to get all of a
86 multi-packet answer */ 86 multi-packet answer */
87int 87int
88process_tcp_request2 (char *server_address, int server_port, 88process_tcp_request2 (const char *server_address, int server_port,
89 char *send_buffer, char *recv_buffer, int recv_size) 89 const char *send_buffer, char *recv_buffer, int recv_size)
90{ 90{
91 91
92 int result; 92 int result;
@@ -163,8 +163,8 @@ process_tcp_request2 (char *server_address, int server_port,
163/* connects to a host on a specified port, sends a string, and gets a 163/* connects to a host on a specified port, sends a string, and gets a
164 response */ 164 response */
165int 165int
166process_request (char *server_address, int server_port, int proto, 166process_request (const char *server_address, int server_port, int proto,
167 char *send_buffer, char *recv_buffer, int recv_size) 167 const char *send_buffer, char *recv_buffer, int recv_size)
168{ 168{
169 int result; 169 int result;
170 int send_result; 170 int send_result;
@@ -223,7 +223,7 @@ process_request (char *server_address, int server_port, int proto,
223 223
224/* opens a connection to a remote host/tcp port */ 224/* opens a connection to a remote host/tcp port */
225int 225int
226my_tcp_connect (char *host_name, int port, int *sd) 226my_tcp_connect (const char *host_name, int port, int *sd)
227{ 227{
228 int result; 228 int result;
229 229
@@ -235,7 +235,7 @@ my_tcp_connect (char *host_name, int port, int *sd)
235 235
236/* opens a connection to a remote host/udp port */ 236/* opens a connection to a remote host/udp port */
237int 237int
238my_udp_connect (char *host_name, int port, int *sd) 238my_udp_connect (const char *host_name, int port, int *sd)
239{ 239{
240 int result; 240 int result;
241 241
@@ -247,7 +247,7 @@ my_udp_connect (char *host_name, int port, int *sd)
247 247
248/* opens a tcp or udp connection to a remote host */ 248/* opens a tcp or udp connection to a remote host */
249int 249int
250my_connect (char *host_name, int port, int *sd, int proto) 250my_connect (const char *host_name, int port, int *sd, int proto)
251{ 251{
252 struct addrinfo hints; 252 struct addrinfo hints;
253 struct addrinfo *res; 253 struct addrinfo *res;
@@ -315,7 +315,7 @@ my_connect (char *host_name, int port, int *sd, int proto)
315} 315}
316 316
317int 317int
318is_host (char *address) 318is_host (const char *address)
319{ 319{
320 if (is_addr (address) || is_hostname (address)) 320 if (is_addr (address) || is_hostname (address))
321 return (TRUE); 321 return (TRUE);
@@ -324,7 +324,7 @@ is_host (char *address)
324} 324}
325 325
326int 326int
327is_addr (char *address) 327is_addr (const char *address)
328{ 328{
329#ifdef USE_IPV6 329#ifdef USE_IPV6
330 if (is_inet_addr (address) && address_family != AF_INET6) 330 if (is_inet_addr (address) && address_family != AF_INET6)
@@ -342,7 +342,7 @@ is_addr (char *address)
342} 342}
343 343
344int 344int
345resolve_host_or_addr (char *address, int family) 345resolve_host_or_addr (const char *address, int family)
346{ 346{
347 struct addrinfo hints; 347 struct addrinfo hints;
348 struct addrinfo *res; 348 struct addrinfo *res;
@@ -361,21 +361,21 @@ resolve_host_or_addr (char *address, int family)
361} 361}
362 362
363int 363int
364is_inet_addr (char *address) 364is_inet_addr (const char *address)
365{ 365{
366 return resolve_host_or_addr (address, AF_INET); 366 return resolve_host_or_addr (address, AF_INET);
367} 367}
368 368
369#ifdef USE_IPV6 369#ifdef USE_IPV6
370int 370int
371is_inet6_addr (char *address) 371is_inet6_addr (const char *address)
372{ 372{
373 return resolve_host_or_addr (address, AF_INET6); 373 return resolve_host_or_addr (address, AF_INET6);
374} 374}
375#endif 375#endif
376 376
377int 377int
378is_hostname (char *s1) 378is_hostname (const char *s1)
379{ 379{
380#ifdef USE_IPV6 380#ifdef USE_IPV6
381 return resolve_host_or_addr (s1, address_family); 381 return resolve_host_or_addr (s1, address_family);