|
SATP: Symmetric Authenticated Tunneling Protocol 1.0.0.0a (A1)
A quantum secure symmetric pre-shared key tunneling protocol
|
SATP Server functions. More...
Go to the source code of this file.
Macros | |
| #define | SATP_SERVER_PAUSE_INTERVAL 100 |
| The pause interval used by the server pause function. | |
Functions | |
| SATP_EXPORT_API void | satp_server_broadcast (const uint8_t *message, size_t msglen) |
| Broadcast a message to all connected hosts. | |
| SATP_EXPORT_API void | satp_server_passphrase_generate (char *passphrase, size_t length) |
| Generate a readable pseudo-random passphrase. | |
| SATP_EXPORT_API void | satp_server_passphrase_hash_generate (uint8_t *phash, char *passphrase, size_t passlen) |
| Generate the passphrase hash. | |
| SATP_EXPORT_API bool | satp_server_passphrase_hash_verify (const uint8_t *phash, char *passphrase, size_t passlen) |
| Verify a passphrase against the hash. | |
| SATP_EXPORT_API void | satp_server_pause (void) |
| Pause the server. | |
| SATP_EXPORT_API void | satp_server_quit (void) |
| Quit the server. | |
| SATP_EXPORT_API void | satp_server_resume (void) |
| Resume the server listener. | |
| SATP_EXPORT_API satp_errors | satp_server_start_ipv4 (const satp_server_key *skey, void(*receive_callback)(satp_connection_state *, const uint8_t *, size_t), void(*disconnect_callback)(satp_connection_state *), bool(*authentication_callback)(satp_connection_state *, const uint8_t *, size_t)) |
| Start the IPv4 multi-threaded server. | |
| SATP_EXPORT_API satp_errors | satp_server_start_ipv6 (const satp_server_key *skey, void(*receive_callback)(satp_connection_state *, const uint8_t *, size_t), void(*disconnect_callback)(satp_connection_state *), bool(*authentication_callback)(satp_connection_state *, const uint8_t *, size_t)) |
| Start the IPv6 multi-threaded server. | |
SATP Server functions.
This header declares the functions used to implement the server component of the Symmetric Authenticated Tunneling Protocol (SATP). The server functions manage client connections, broadcast messages, and control the server lifecycle through operations such as pausing, resuming, and quitting. SATP employs a multi-threaded server design that supports both IPv4 and IPv6 connections.
The functions provided in this header include:
| #define SATP_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.
| SATP_EXPORT_API void satp_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. |
| SATP_EXPORT_API void satp_server_passphrase_generate | ( | char * | passphrase, |
| size_t | length ) |
Generate a readable pseudo-random passphrase.
| passphrase | A pointer to the passphrase array. |
| length | The passphrase length. |
| SATP_EXPORT_API void satp_server_passphrase_hash_generate | ( | uint8_t * | phash, |
| char * | passphrase, | ||
| size_t | passlen ) |
Generate the passphrase hash.
| phash | A pointer to the passphrase hash. |
| passphrase | [const] A pointer to the passphrase. |
| passlen | The passphrase length. |
| SATP_EXPORT_API bool satp_server_passphrase_hash_verify | ( | const uint8_t * | phash, |
| char * | passphrase, | ||
| size_t | passlen ) |
Verify a passphrase against the hash.
| phash | [const] A pointer to the passphrase hash. |
| passphrase | [const] A pointer to the passphrase. |
| passlen | The passphrase length. |
| SATP_EXPORT_API void satp_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.
| SATP_EXPORT_API void satp_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.
| SATP_EXPORT_API void satp_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.
| SATP_EXPORT_API satp_errors satp_server_start_ipv4 | ( | const satp_server_key * | skey, |
| void(* | receive_callback )(satp_connection_state *, const uint8_t *, size_t), | ||
| void(* | disconnect_callback )(satp_connection_state *), | ||
| bool(* | authentication_callback )(satp_connection_state *, const uint8_t *, size_t) ) |
Start the IPv4 multi-threaded server.
This function initializes and starts the SATP server for IPv4 connections using a multi-threaded architecture. It listens on the provided socket and uses the specified SATP private key for secure key exchange and authentication. Two callback functions are provided:
| skey | [const] A pointer to the SATP 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. |
| authentication_callback | A pointer to the function that handles client authentication events. |
| SATP_EXPORT_API satp_errors satp_server_start_ipv6 | ( | const satp_server_key * | skey, |
| void(* | receive_callback )(satp_connection_state *, const uint8_t *, size_t), | ||
| void(* | disconnect_callback )(satp_connection_state *), | ||
| bool(* | authentication_callback )(satp_connection_state *, const uint8_t *, size_t) ) |
Start the IPv6 multi-threaded server.
This function initializes and starts the SATP server for IPv6 connections using a multi-threaded design. It listens on the provided IPv6 socket and employs the specified SATP private key for secure communications. The server uses two callback functions to process incoming client data and handle disconnect events.
| kset | [const] A pointer to the SATP 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. |
| authentication_callback | A pointer to the function that handles client authentication events. |