diff options
Diffstat (limited to 'plugins/netutils.c')
| -rw-r--r-- | plugins/netutils.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/plugins/netutils.c b/plugins/netutils.c index 92fd1420..58b3fb48 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 */ |
| 55 | int | 55 | int |
| 56 | process_tcp_request (char *server_address, int server_port, | 56 | process_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 */ |
| 70 | int | 70 | int |
| 71 | process_udp_request (char *server_address, int server_port, | 71 | process_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 */ |
| 87 | int | 87 | int |
| 88 | process_tcp_request2 (char *server_address, int server_port, | 88 | process_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 */ |
| 165 | int | 165 | int |
| 166 | process_request (char *server_address, int server_port, int proto, | 166 | process_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 */ |
| 225 | int | 225 | int |
| 226 | my_tcp_connect (char *host_name, int port, int *sd) | 226 | my_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 */ |
| 237 | int | 237 | int |
| 238 | my_udp_connect (char *host_name, int port, int *sd) | 238 | my_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 */ |
| 249 | int | 249 | int |
| 250 | my_connect (char *host_name, int port, int *sd, int proto) | 250 | my_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 | ||
| 317 | int | 317 | int |
| 318 | is_host (char *address) | 318 | is_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 | ||
| 326 | int | 326 | int |
| 327 | is_addr (char *address) | 327 | is_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 | ||
| 344 | int | 344 | int |
| 345 | resolve_host_or_addr (char *address, int family) | 345 | resolve_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 | ||
| 363 | int | 363 | int |
| 364 | is_inet_addr (char *address) | 364 | is_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 |
| 370 | int | 370 | int |
| 371 | is_inet6_addr (char *address) | 371 | is_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 | ||
| 377 | int | 377 | int |
| 378 | is_hostname (char *s1) | 378 | is_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); |
