/[monit]/monit/net.c
ViewVC logotype

Diff of /monit/net.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.32 by hauk, Fri Aug 22 13:57:42 2003 UTC revision 1.33 by hauk, Wed Sep 3 23:28:38 2003 UTC
# Line 140  static int do_connect(int s, const struc Line 140  static int do_connect(int s, const struc
140   * @param protocol The socket protocol to use   * @param protocol The socket protocol to use
141   * @return TRUE if the connect succeeded otherwise FALSE.   * @return TRUE if the connect succeeded otherwise FALSE.
142   */   */
143  int check_connect(char *hostname, int port, int protocol) {  int check_connect(const char *hostname, int port, int protocol) {
144    
145    int socket;    int socket;
146    int rv= TRUE;    int rv= TRUE;
# Line 165  int check_connect(char *hostname, int po Line 165  int check_connect(char *hostname, int po
165   * @param hostname The host to check   * @param hostname The host to check
166   * @return TRUE if hostname resolves, otherwise FALSE   * @return TRUE if hostname resolves, otherwise FALSE
167   */   */
168  int check_host(char *hostname) {  int check_host(const char *hostname) {
169        
170    struct hostent *hp;    struct hostent *hp;
171    
# Line 237  int check_udp_socket(int socket) { Line 237  int check_udp_socket(int socket) {
237   * @param timeout If not connected within timeout seconds abort and return -1   * @param timeout If not connected within timeout seconds abort and return -1
238   * @return The socket or -1 if an error occured.   * @return The socket or -1 if an error occured.
239   */   */
240  int create_socket(char *hostname, int port, int protocol, int timeout) {  int create_socket(const char *hostname, int port, int protocol, int timeout) {
241    
242    int s;    int s;
243    struct hostent *hp;    struct hostent *hp;
# Line 308  int create_generic_socket(Port_T p) { Line 308  int create_generic_socket(Port_T p) {
308   * @param timeout If not connected within timeout seconds abort and return -1   * @param timeout If not connected within timeout seconds abort and return -1
309   * @return The socket or -1 if an error occured.   * @return The socket or -1 if an error occured.
310   */   */
311  int create_unix_socket(char *pathname, int timeout) {  int create_unix_socket(const char *pathname, int timeout) {
312    
313    int s;    int s;
314    struct sockaddr_un unixsocket;    struct sockaddr_un unixsocket;
# Line 352  int create_unix_socket(char *pathname, i Line 352  int create_unix_socket(char *pathname, i
352   * @param bindAddr the local address the server will bind to   * @param bindAddr the local address the server will bind to
353   * @return The socket ready for accept, or -1 if an error occured.   * @return The socket ready for accept, or -1 if an error occured.
354   */   */
355  int create_server_socket(int port, int backlog, char *bindAddr) {  int create_server_socket(int port, int backlog, const char *bindAddr) {
356        
357    int s;    int s;
358    int flag= 1;    int flag= 1;
# Line 516  int can_write(int socket, int timeout) { Line 516  int can_write(int socket, int timeout) {
516   * @param size Number of bytes to send   * @param size Number of bytes to send
517   * @return The number of bytes sent or -1 if an error occured.   * @return The number of bytes sent or -1 if an error occured.
518   */   */
519  int sock_write(int socket, void *buffer, int size) {  int sock_write(int socket, const void *buffer, int size) {
520    
521    ssize_t n= 0;    ssize_t n= 0;
522        

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26