QSMP: Quantum Secure Messaging Protocol 1.3.0.0a (A3)
A quantum secure encrypted tunneling protocol
|
QSMP Server functions. More...
Go to the source code of this file.
Macros | |
#define | QSMP_SERVER_PAUSE_INTERVAL 100 |
The pause interval used by the server pause function. | |
Functions | |
QSMP_EXPORT_API void | qsmp_server_broadcast (const uint8_t *message, size_t msglen) |
Broadcast a message to all connected hosts. | |
QSMP_EXPORT_API void | qsmp_server_pause (void) |
Pause the server. | |
QSMP_EXPORT_API void | qsmp_server_quit (void) |
Quit the server. | |
QSMP_EXPORT_API void | qsmp_server_resume (void) |
Resume the server listener. | |
QSMP_EXPORT_API qsmp_errors | qsmp_server_start_ipv4 (qsc_socket *source, const qsmp_server_signature_key *kset, void(*receive_callback)(qsmp_connection_state *, const uint8_t *, size_t), void(*disconnect_callback)(qsmp_connection_state *)) |
Start the IPv4 multi-threaded server. | |
QSMP_EXPORT_API qsmp_errors | qsmp_server_start_ipv6 (qsc_socket *source, const qsmp_server_signature_key *kset, void(*receive_callback)(qsmp_connection_state *, const uint8_t *, size_t), void(*disconnect_callback)(qsmp_connection_state *)) |
Start the IPv6 multi-threaded server. | |
QSMP Server functions.
This header declares the functions used to implement the server component of the Quantum Secure Messaging Protocol (QSMP). The server functions manage client connections, broadcast messages, and control the server lifecycle through operations such as pausing, resuming, and quitting. QSMP employs a multi-threaded server design that supports both IPv4 and IPv6 connections.
The functions provided in this header include:
#define QSMP_SERVER_PAUSE_INTERVAL 100 |
The pause interval used by the server pause function.
This macro defines the time interval (in milliseconds) that the server will pause before resuming operations or processing new connection requests.
QSMP_EXPORT_API void qsmp_server_broadcast | ( | const uint8_t * | message, |
size_t | msglen ) |
Broadcast a message to all connected hosts.
This function iterates over all active connections managed by the server and transmits the specified message to each connected host. It is useful for disseminating announcements or control messages across the network.
message | [const] A pointer to the message data to be broadcast. |
msglen | The length (in bytes) of the message. |
QSMP_EXPORT_API void qsmp_server_pause | ( | void | ) |
Pause the server.
This function temporarily suspends the acceptance of new client connections. While paused, the server continues to service existing connections but does not allow any new joins until it is resumed.
QSMP_EXPORT_API void qsmp_server_quit | ( | void | ) |
Quit the server.
This function gracefully shuts down the server by closing all active client connections and terminating the server's listener. It is used to perform a complete shutdown of the server operations.
QSMP_EXPORT_API void qsmp_server_resume | ( | void | ) |
Resume the server listener.
This function resumes the server's listener functionality after it has been paused. Once resumed, the server will once again accept new incoming client connections.
QSMP_EXPORT_API qsmp_errors qsmp_server_start_ipv4 | ( | qsc_socket * | source, |
const qsmp_server_signature_key * | kset, | ||
void(* | receive_callback )(qsmp_connection_state *, const uint8_t *, size_t), | ||
void(* | disconnect_callback )(qsmp_connection_state *) ) |
Start the IPv4 multi-threaded server.
This function initializes and starts the QSMP server for IPv4 connections using a multi-threaded architecture. It listens on the provided socket and uses the specified QSMP private key for secure key exchange and authentication. Two callback functions are provided:
source | A pointer to the listener socket used by the server. |
kset | [const] A pointer to the QSMP server private signature key used for key exchange. |
receive_callback | A pointer to the function that processes incoming client data. |
disconnect_callback | A pointer to the function that handles client disconnect events. |
QSMP_EXPORT_API qsmp_errors qsmp_server_start_ipv6 | ( | qsc_socket * | source, |
const qsmp_server_signature_key * | kset, | ||
void(* | receive_callback )(qsmp_connection_state *, const uint8_t *, size_t), | ||
void(* | disconnect_callback )(qsmp_connection_state *) ) |
Start the IPv6 multi-threaded server.
This function initializes and starts the QSMP server for IPv6 connections using a multi-threaded design. It listens on the provided IPv6 socket and employs the specified QSMP private key for secure communications. The server uses two callback functions to process incoming client data and handle disconnect events.
source | A pointer to the listener socket used by the server. |
kset | [const] A pointer to the QSMP server private signature key used for key exchange and authentication. |
receive_callback | A pointer to the function that processes incoming client data. |
disconnect_callback | A pointer to the function that handles client disconnect events. |