spandsp 3.0.0
private/ssl_fax.h
Go to the documentation of this file.
1/*
2 * The code in this file was derived from sources taken from (1) HylaFAX+ on
3 * 13 June 2022. That source states that it was derived from (2) GitHub user,
4 * "mrwicks", on 9 Oct 2018. That source, itself, was derived from work by
5 * "Amlendra" published at Aticleworld on 21 May 2017 (3). That work, then,
6 * references programs (4) Copyright (c) 2000 Sean Walton and Macmillan
7 * Publishers (The "Linux Socket Programming" book) and are licensed under
8 * the GPL.
9 *
10 * 1. https://hylafax.sourceforge.net
11 * 2. https://github.com/mrwicks/miscellaneous/tree/master/tls_1.2_example
12 * 3. https://aticleworld.com/ssl-server-client-using-openssl-in-c/
13 * 4. http://www.cs.utah.edu/~swalton/listings/sockets/programs/
14 *
15 * It is, therefore, presumed that this work is either under the* public
16 * domain or is licensed under the GPL. A copy of the GPL is as follows...
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 */
30
31/*! \file */
32
33#if !defined(_SPANDSP_PRIVATE_SSLFAX_H_)
34#define _SPANDSP_PRIVATE_SSLFAX_H_
35
36#if defined(SPANDSP_SUPPORT_SSLFAX)
37/*!
38 SSL Fax connection descriptor. This defines the state of a single
39 instance of an SSL Fax connection.
40*/
41struct sslfax_state_s
42{
43 /*! \brief The remote SSL Fax URL, if known, else NULL. */
44 char *url;
45 SSL_CTX *ctx;
46 SSL *ssl;
47 int server;
48 int client;
49 int rcp_count;
50 int ecm_ones;
51 int ecm_bitpos;
52 uint8_t ecm_byte;
53 bool doread;
54 int signal;
55 bool do_underflow;
56 bool cleanup;
57
58 span_get_byte_func_t get_phase;
59
60 /*! \brief The callback function used to get bytes to be transmitted. */
61 span_get_msg_func_t get_msg;
62 /*! \brief The callback function used to put bytes received. */
63 span_put_msg_func_t put_msg;
64 /*! \brief The callback function used to accept HDLC frames. */
65 hdlc_frame_handler_t hdlc_accept;
66 /*! \brief The callback function used for HDLC underflow indication. */
67 hdlc_underflow_handler_t hdlc_tx_underflow;
68 /*! \brief Whether or not the data represents HDLC or not. */
69 /*! \brief A user specified opaque pointer passed to the put, get, and hdlc routines. */
70 void *user_data;
71 bool tx_use_hdlc;
72 bool rx_use_hdlc;
73
74 /*! \brief Error and flow logging control */
75 logging_state_t logging;
76};
77#endif
78
79#endif
80/*- End of file ------------------------------------------------------------*/
int(* span_get_msg_func_t)(void *user_data, uint8_t *msg, int max_len)
Definition async.h:111
int(* span_get_byte_func_t)(void *user_data)
Definition async.h:119
void(* span_put_msg_func_t)(void *user_data, const uint8_t *msg, int len)
Definition async.h:107
struct logging_state_s logging_state_t
Definition logging.h:72