QSC Post Quantum Cryptographic Library 1.0.0.6c (A6)
A post quantum secure library written in Ansi C
 
Loading...
Searching...
No Matches
socketclient.h
Go to the documentation of this file.
1/* 2025 Quantum Resistant Cryptographic Solutions Corporation
2 * All Rights Reserved.
3 *
4 * NOTICE: This software and all accompanying materials are the exclusive
5 * property of Quantum Resistant Cryptographic Solutions Corporation (QRCS).
6 * The intellectual and technical concepts contained within this implementation
7 * are proprietary to QRCS and its authorized licensors and are protected under
8 * applicable U.S. and international copyright, patent, and trade secret laws.
9 *
10 * CRYPTOGRAPHIC STANDARDS:
11 * - This software includes implementations of cryptographic algorithms such as
12 * SHA3, AES, and others. These algorithms are public domain or standardized
13 * by organizations such as NIST and are NOT the property of QRCS.
14 * - However, all source code, optimizations, and implementations in this library
15 * are original works of QRCS and are protected under this license.
16 *
17 * RESTRICTIONS:
18 * - Redistribution, modification, or unauthorized distribution of this software,
19 * in whole or in part, is strictly prohibited.
20 * - This software is provided for non-commercial, educational, and research
21 * purposes only. Commercial use in any form is expressly forbidden.
22 * - Licensing and authorized distribution are solely at the discretion of QRCS.
23 * - Any use of this software implies acceptance of these restrictions.
24 *
25 * DISCLAIMER:
26 * This software is provided "as is," without warranty of any kind, express or
27 * implied, including but not limited to warranties of merchantability or fitness
28 * for a particular purpose. QRCS disclaims all liability for any direct, indirect,
29 * incidental, or consequential damages resulting from the use or misuse of this software.
30 *
31 * FULL LICENSE:
32 * This software is subject to the **Quantum Resistant Cryptographic Solutions
33 * Proprietary License (QRCS-PL)**. The complete license terms are included
34 * in the LICENSE.txt file distributed with this software.
35 *
36 * Written by: John G. Underhill
37 * Contact: john.underhill@protonmail.com
38 */
39
40#ifndef QSC_SOCKETCLIENT_H
41#define QSC_SOCKETCLIENT_H
42
43#include "common.h"
44#include "ipinfo.h"
45#include "socketbase.h"
46
47QSC_CPLUSPLUS_ENABLED_START
48
84
85/*** Accessors ***/
86
95
104
114QSC_EXPORT_API qsc_socket_exceptions qsc_socket_client_connect_host(qsc_socket* sock, const char* host, const char* service);
115
126
137
146
153
164QSC_EXPORT_API size_t qsc_socket_client_receive(const qsc_socket* sock, char* output, size_t otplen, qsc_socket_receive_flags flag);
165
178QSC_EXPORT_API size_t qsc_socket_client_receive_from(qsc_socket* sock, char* address, uint16_t port, char* output, size_t otplen, qsc_socket_receive_flags flag);
179
190QSC_EXPORT_API size_t qsc_socket_client_send(const qsc_socket* sock, const char* input, size_t inplen, qsc_socket_send_flags flag);
191
204QSC_EXPORT_API size_t qsc_socket_client_send_to(const qsc_socket* sock, const char* address, uint16_t port, const char* input, size_t inplen, qsc_socket_send_flags flag);
205
212
213QSC_CPLUSPLUS_ENABLED_END
214
215#endif
Contains common definitions for the Quantum Secure Cryptographic (QSC) library.
#define QSC_EXPORT_API
API export macro for Microsoft compilers when importing from a DLL.
Definition common.h:520
IP information function definitions.
Socket function definitions.
qsc_socket_exceptions
Socket code enumeration names.
Definition socketbase.h:130
QSC_EXPORT_API size_t qsc_socket_client_receive(const qsc_socket *sock, char *output, size_t otplen, qsc_socket_receive_flags flag)
Receive data from a synchronous connected socket or a bound connectionless socket.
Definition socketclient.c:152
QSC_EXPORT_API qsc_socket_protocols qsc_socket_client_socket_protocol(const qsc_socket *sock)
Get the socket protocol type.
Definition socketclient.c:22
QSC_EXPORT_API qsc_socket_exceptions qsc_socket_client_connect_host(qsc_socket *sock, const char *host, const char *service)
Connect to a remote host using the network host name and service name.
Definition socketclient.c:54
QSC_EXPORT_API qsc_socket_exceptions qsc_socket_client_connect_ipv6(qsc_socket *sock, const qsc_ipinfo_ipv6_address *address, uint16_t port)
Establishes a socket connection to a remote host using IPv6 addressing.
Definition socketclient.c:109
QSC_EXPORT_API size_t qsc_socket_client_send(const qsc_socket *sock, const char *input, size_t inplen, qsc_socket_send_flags flag)
Sends data on a connected socket.
Definition socketclient.c:187
QSC_EXPORT_API void qsc_socket_client_initialize(qsc_socket *sock)
Initialize the server socket.
Definition socketclient.c:133
QSC_EXPORT_API qsc_socket_transports qsc_socket_client_socket_transport(const qsc_socket *sock)
Get the socket transport type.
Definition socketclient.c:38
QSC_EXPORT_API size_t qsc_socket_client_send_to(const qsc_socket *sock, const char *address, uint16_t port, const char *input, size_t inplen, qsc_socket_send_flags flag)
Sends UDP data to a remote host.
Definition socketclient.c:203
QSC_EXPORT_API void qsc_socket_client_shut_down(qsc_socket *sock)
Shut down channels and close the socket.
Definition socketclient.c:221
QSC_EXPORT_API size_t qsc_socket_client_receive_from(qsc_socket *sock, char *address, uint16_t port, char *output, size_t otplen, qsc_socket_receive_flags flag)
Receive UDP data from a remote host.
Definition socketclient.c:169
QSC_EXPORT_API qsc_socket_address_families qsc_socket_client_address_family(const qsc_socket *sock)
Get the sockets address family, IPv4 or IPv6.
Definition socketclient.c:6
QSC_EXPORT_API qsc_socket_exceptions qsc_socket_client_connect_ipv4(qsc_socket *sock, const qsc_ipinfo_ipv4_address *address, uint16_t port)
Establishes a socket connection to a remote host using IPv4 addressing.
Definition socketclient.c:85
qsc_socket_transports
The socket transmission type.
Definition socketflags.h:165
qsc_socket_address_families
The socket address family type.
Definition socketflags.h:68
qsc_socket_receive_flags
The socket receive api flags.
Definition socketflags.h:127
qsc_socket_send_flags
The socket send api flags.
Definition socketflags.h:144
qsc_socket_protocols
The socket IP protocol type.
Definition socketflags.h:108
The IPv4 address structure.
Definition ipinfo.h:150
The IPv6 address structure.
Definition ipinfo.h:309
The socket instance structure.
Definition socket.h:121