Blame libfreerdp/core/tcp.h

Packit 1fb8d4
/**
Packit 1fb8d4
 * FreeRDP: A Remote Desktop Protocol Implementation
Packit 1fb8d4
 * Transmission Control Protocol (TCP)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Copyright 2011 Vic Lee
Packit 1fb8d4
 * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
Packit 1fb8d4
 *
Packit 1fb8d4
 * Licensed under the Apache License, Version 2.0 (the "License");
Packit 1fb8d4
 * you may not use this file except in compliance with the License.
Packit 1fb8d4
 * You may obtain a copy of the License at
Packit 1fb8d4
 *
Packit 1fb8d4
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 1fb8d4
 *
Packit 1fb8d4
 * Unless required by applicable law or agreed to in writing, software
Packit 1fb8d4
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 1fb8d4
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 1fb8d4
 * See the License for the specific language governing permissions and
Packit 1fb8d4
 * limitations under the License.
Packit 1fb8d4
 */
Packit 1fb8d4
Packit 1fb8d4
#ifndef FREERDP_LIB_CORE_TCP_H
Packit 1fb8d4
#define FREERDP_LIB_CORE_TCP_H
Packit 1fb8d4
Packit 1fb8d4
#include <winpr/windows.h>
Packit 1fb8d4
Packit 1fb8d4
#include <freerdp/types.h>
Packit 1fb8d4
#include <freerdp/settings.h>
Packit 1fb8d4
#include <freerdp/freerdp.h>
Packit 1fb8d4
#include <freerdp/api.h>
Packit 1fb8d4
Packit 1fb8d4
#include <winpr/crt.h>
Packit 1fb8d4
#include <winpr/synch.h>
Packit 1fb8d4
#include <winpr/stream.h>
Packit 1fb8d4
#include <winpr/winsock.h>
Packit 1fb8d4
#include <winpr/crypto.h>
Packit 1fb8d4
Packit 1fb8d4
#include <openssl/bio.h>
Packit 1fb8d4
Packit 1fb8d4
#include <freerdp/utils/ringbuffer.h>
Packit 1fb8d4
Packit Service 5a9772
#define BIO_TYPE_TSG 65
Packit Service 5a9772
#define BIO_TYPE_SIMPLE 66
Packit Service 5a9772
#define BIO_TYPE_BUFFERED 67
Packit 1fb8d4
Packit Service 5a9772
#define BIO_C_SET_SOCKET 1101
Packit Service 5a9772
#define BIO_C_GET_SOCKET 1102
Packit Service 5a9772
#define BIO_C_GET_EVENT 1103
Packit Service 5a9772
#define BIO_C_SET_NONBLOCK 1104
Packit Service 5a9772
#define BIO_C_READ_BLOCKED 1105
Packit Service 5a9772
#define BIO_C_WRITE_BLOCKED 1106
Packit Service 5a9772
#define BIO_C_WAIT_READ 1107
Packit Service 5a9772
#define BIO_C_WAIT_WRITE 1108
Packit 1fb8d4
Packit Service 5a9772
#define BIO_set_socket(b, s, c) BIO_ctrl(b, BIO_C_SET_SOCKET, c, s);
Packit Service 5a9772
#define BIO_get_socket(b, c) BIO_ctrl(b, BIO_C_GET_SOCKET, 0, (char*)c)
Packit Service 5a9772
#define BIO_get_event(b, c) BIO_ctrl(b, BIO_C_GET_EVENT, 0, (char*)c)
Packit Service 5a9772
#define BIO_set_nonblock(b, c) BIO_ctrl(b, BIO_C_SET_NONBLOCK, c, NULL)
Packit Service 5a9772
#define BIO_read_blocked(b) BIO_ctrl(b, BIO_C_READ_BLOCKED, 0, NULL)
Packit Service 5a9772
#define BIO_write_blocked(b) BIO_ctrl(b, BIO_C_WRITE_BLOCKED, 0, NULL)
Packit Service 5a9772
#define BIO_wait_read(b, c) BIO_ctrl(b, BIO_C_WAIT_READ, c, NULL)
Packit Service 5a9772
#define BIO_wait_write(b, c) BIO_ctrl(b, BIO_C_WAIT_WRITE, c, NULL)
Packit 1fb8d4
Packit 1fb8d4
FREERDP_LOCAL BIO_METHOD* BIO_s_simple_socket(void);
Packit 1fb8d4
FREERDP_LOCAL BIO_METHOD* BIO_s_buffered_socket(void);
Packit 1fb8d4
Packit Service 5a9772
FREERDP_LOCAL int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings,
Packit 1fb8d4
                                      const char* hostname, int port, int timeout);
Packit 1fb8d4
Packit 1fb8d4
FREERDP_LOCAL char* freerdp_tcp_get_peer_address(SOCKET sockfd);
Packit 1fb8d4
Packit 1fb8d4
FREERDP_LOCAL struct addrinfo* freerdp_tcp_resolve_host(const char* hostname, int port,
Packit Service 5a9772
                                                        int ai_flags);
Packit 1fb8d4
FREERDP_LOCAL char* freerdp_tcp_address_to_string(const struct sockaddr_storage* addr, BOOL* pIPv6);
Packit 1fb8d4
Packit 1fb8d4
#endif /* FREERDP_LIB_CORE_TCP_H */