CUBRID Engine  latest
wintcp.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 
20 /*
21  * wintcp.h - Definitions for the Winsock TCP interface
22  */
23 
24 #ifndef _WINTCP_H_
25 #define _WINTCP_H_
26 
27 #ident "$Id$"
28 
29 #include "config.h"
30 #include "connection_defs.h"
31 
32 #if defined(WINDOWS)
33 #include <winsock2.h>
34 #endif
35 
37 {
43 };
44 
45 #if defined (ENABLE_UNUSED_FUNCTION)
46 extern int css_get_wsa_error (void);
47 #endif
48 
49 extern int css_windows_startup (void);
50 extern void css_windows_shutdown (void);
51 extern int css_gethostname (char *name, size_t namelen);
52 
53 extern SOCKET css_tcp_client_open (const char *hostname, int port);
54 extern SOCKET css_tcp_client_open_with_retry (const char *hostname, int port, bool willretry);
55 extern void css_shutdown_socket (SOCKET fd);
56 #if defined (ENABLE_UNUSED_FUNCTION)
57 extern int css_fd_down (SOCKET fd);
58 #endif
59 extern unsigned int css_gethostid (void);
60 extern bool css_tcp_setup_server_datagram (char *pathname, SOCKET * sockfd);
61 extern bool css_tcp_listen_server_datagram (SOCKET sockfd, SOCKET * newfd);
62 extern bool css_tcp_master_datagram (char *pathname, SOCKET * sockfd);
63 extern SOCKET css_open_new_socket_from_master (SOCKET fd, unsigned short *rid);
64 extern bool css_transfer_fd (SOCKET server_fd, SOCKET client_fd, unsigned short rid, CSS_SERVER_REQUEST request);
65 extern int css_tcp_master_open (int port, SOCKET * sockfd);
66 extern SOCKET css_master_accept (SOCKET sockfd);
67 extern int css_open_server_connection_socket (void);
68 extern void css_close_server_connection_socket (void);
69 extern SOCKET css_server_accept (SOCKET sockfd);
70 extern int css_get_max_socket_fds (void);
71 
72 extern int css_get_peer_name (SOCKET sockfd, char *hostname, size_t len);
73 extern int css_get_sock_name (SOCKET sockfd, char *hostname, size_t len);
74 extern int css_hostname_to_ip (const char *host, unsigned char *ip_addr);
75 #endif /* _WINTCP_H_ */
bool css_tcp_listen_server_datagram(SOCKET sockfd, SOCKET *newfd)
Definition: tcp.c:930
int css_gethostname(char *name, size_t namelen)
Definition: tcp.c:114
int css_tcp_master_open(int port, SOCKET *sockfd)
Definition: tcp.c:663
bool css_tcp_setup_server_datagram(char *pathname, SOCKET *sockfd)
Definition: wintcp.c:447
int SOCKET
Definition: porting.h:482
void css_shutdown_socket(SOCKET fd)
Definition: tcp.c:1179
int css_windows_startup(void)
Definition: wintcp.c:94
int css_open_server_connection_socket(void)
Definition: tcp.c:1228
SOCKET css_tcp_client_open_with_retry(const char *hostname, int port, bool willretry)
Definition: tcp.c:414
void css_close_server_connection_socket(void)
Definition: tcp.c:1242
int css_get_sock_name(SOCKET sockfd, char *hostname, size_t len)
Definition: tcp.c:1618
SOCKET css_master_accept(SOCKET sockfd)
Definition: tcp.c:836
int css_hostname_to_ip(const char *host, unsigned char *ip_addr)
Definition: tcp.c:227
CSS_ER_WINSOCK
Definition: wintcp.h:36
int css_get_max_socket_fds(void)
Definition: tcp.c:1315
bool css_tcp_master_datagram(char *pathname, SOCKET *sockfd)
Definition: tcp.c:967
int css_get_peer_name(SOCKET sockfd, char *hostname, size_t len)
Definition: tcp.c:1592
bool css_transfer_fd(SOCKET server_fd, SOCKET client_fd, unsigned short rid, CSS_SERVER_REQUEST request)
Definition: tcp.c:1122
SOCKET css_open_new_socket_from_master(SOCKET fd, unsigned short *rid)
Definition: tcp.c:1059
SOCKET css_tcp_client_open(const char *hostname, int port)
Definition: tcp.c:182
SOCKET css_server_accept(SOCKET sockfd)
Definition: tcp.c:1256
unsigned int css_gethostid(void)
Definition: tcp.c:1209
enum css_server_request CSS_SERVER_REQUEST
static char * host
void css_windows_shutdown(void)
Definition: wintcp.c:140