Use regex.[ch] from msysGit's /git
[cvsps/4msysgit.git] / cbtcommon / tcpsocket.h
blobac606a56196d98b28b4a64b4dbd879545032916a
1 /*
2 * Copyright 2001, 2002, 2003 David Mansfield and Cobite, Inc.
3 * See COPYING file for license information
4 */
6 #ifndef _TCPSOCKET_H
7 #define _TCPSOCKET_H
9 #ifdef __cplusplus
10 extern "C"
12 #endif
14 #ifndef LISTEN_QUEUE_SIZE
15 #define LISTEN_QUEUE_SIZE 5
16 #endif
18 #define REUSE_ADDR 1
19 #define NO_REUSE_ADDR 0
21 int tcp_create_socket(int reuse_addr);
22 int tcp_bind_and_listen(int sockfd, unsigned short tcpport);
23 int tcp_accept_connection(int sockfd);
24 unsigned int tcp_get_client_ip(int fd);
25 int tcp_connect(int sockfd, const char *rem_addr, unsigned short port);
26 int convert_address(long *dest, const char *addr_str);
27 int tcp_get_local_address(int sockfd, unsigned int *, unsigned short *);
29 #ifdef __cplusplus
31 #endif
33 #endif /* TCPSOCKET_H */