1/* Copyright (c) 2003, 2011, Oracle and/or its affiliates.
2 Copyright (c) 2012, Monty Program Ab
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; version 2 of the License.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
16
17#ifndef VIO_PRIV_INCLUDED
18#define VIO_PRIV_INCLUDED
19
20/* Structures and functions private to the vio package */
21
22#define DONT_MAP_VIO
23#include <my_global.h>
24#include <mysql_com.h>
25#include <my_sys.h>
26#include <m_string.h>
27#include <violite.h>
28
29#ifdef _WIN32
30size_t vio_read_pipe(Vio *vio, uchar * buf, size_t size);
31size_t vio_write_pipe(Vio *vio, const uchar * buf, size_t size);
32my_bool vio_is_connected_pipe(Vio *vio);
33int vio_close_pipe(Vio * vio);
34int cancel_io(HANDLE handle, DWORD thread_id);
35int vio_shutdown_pipe(Vio *vio,int how);
36#endif
37
38#ifdef HAVE_SMEM
39size_t vio_read_shared_memory(Vio *vio, uchar * buf, size_t size);
40size_t vio_write_shared_memory(Vio *vio, const uchar * buf, size_t size);
41my_bool vio_is_connected_shared_memory(Vio *vio);
42int vio_close_shared_memory(Vio * vio);
43my_bool vio_shared_memory_has_data(Vio *vio);
44int vio_shutdown_shared_memory(Vio *vio, int how);
45#endif
46
47int vio_socket_shutdown(Vio *vio, int how);
48my_bool vio_buff_has_data(Vio *vio);
49int vio_socket_io_wait(Vio *vio, enum enum_vio_io_event event);
50int vio_socket_timeout(Vio *vio, uint which, my_bool old_mode);
51
52#ifdef HAVE_OPENSSL
53#include "my_net.h" /* needed because of struct in_addr */
54
55size_t vio_ssl_read(Vio *vio,uchar* buf, size_t size);
56size_t vio_ssl_write(Vio *vio,const uchar* buf, size_t size);
57
58/* When the workday is over... */
59int vio_ssl_close(Vio *vio);
60void vio_ssl_delete(Vio *vio);
61int vio_ssl_blocking(Vio *vio, my_bool set_blocking_mode, my_bool *old_mode);
62my_bool vio_ssl_has_data(Vio *vio);
63
64#endif /* HAVE_OPENSSL */
65#endif /* VIO_PRIV_INCLUDED */
66