Quantum Secure Tunneling Protocol 1.0.0.0a (A1)
A three-party quantum secure encrypted tunneling protocol
server.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 QSTP_SERVER_H
41#define QSTP_SERVER_H
42
43#include "qstp.h"
44#include "../../QSC/QSC/rcs.h"
45#include "../../QSC/QSC/socketserver.h"
46
60
65#define QSTP_SERVER_PAUSE_INTERVAL 100
66
78
92
101
110
118
136 const qstp_server_signature_key* kset,
137 void (*receive_callback)(qstp_connection_state*, const char*, size_t),
138 void (*disconnect_callback)(qstp_connection_state*));
139
157 const qstp_server_signature_key* kset,
158 void (*receive_callback)(qstp_connection_state*, const char*, size_t),
159 void (*disconnect_callback)(qstp_connection_state*));
160
161#endif
#define QSTP_EXPORT_API
The api export prefix.
Definition common.h:99
QSTP support header.
#define QSTP_CERTIFICATE_ISSUER_SIZE
The maximum length of the certificate issuer string (including terminator).
Definition qstp.h:488
qstp_errors
The QSTP error values.
Definition qstp.h:875
QSTP_EXPORT_API qstp_errors qstp_server_start_ipv4(qsc_socket *source, const qstp_server_signature_key *kset, void(*receive_callback)(qstp_connection_state *, const char *, size_t), void(*disconnect_callback)(qstp_connection_state *))
Start the IPv4 multi-threaded server.
Definition server.c:402
QSTP_EXPORT_API qstp_errors qstp_server_start_ipv6(qsc_socket *source, const qstp_server_signature_key *kset, void(*receive_callback)(qstp_connection_state *, const char *, size_t), void(*disconnect_callback)(qstp_connection_state *))
Start the IPv6 multi-threaded server.
Definition server.c:451
QSTP_EXPORT_API void qstp_server_key_generate(qstp_server_signature_key *kset, const char issuer[QSTP_CERTIFICATE_ISSUER_SIZE], uint32_t exp)
Generate a new signature key for the server.
Definition server.c:338
QSTP_EXPORT_API void qstp_server_pause(void)
Pause the server, suspending new connection joins.
Definition server.c:362
QSTP_EXPORT_API bool qstp_server_expiration_check(const qstp_server_signature_key *kset)
Check the expiration status of a server key.
Definition server.c:327
QSTP_EXPORT_API void qstp_server_quit(void)
Quit the server, closing all active connections.
Definition server.c:367
QSTP_EXPORT_API void qstp_server_resume(void)
Resume the server listener function from a paused state.
Definition server.c:397
The QSTP socket connection state structure.
Definition qstp.h:1081
The QSTP server key structure.
Definition qstp.h:1013