diff options
| author | Cy Schubert <cy@FreeBSD.org> | 2025-04-25 14:41:24 +0000 |
|---|---|---|
| committer | Cy Schubert <cy@FreeBSD.org> | 2025-04-25 14:41:24 +0000 |
| commit | 44bab727dfe28451b777dc9e47db4f748b709182 (patch) | |
| tree | b8abab888105843c7f120357a1e010bfd6d5ef8c /util/net_help.h | |
| parent | 0a6d797cf6eb751d7eb613900cd19803e05d905f (diff) | |
Diffstat (limited to 'util/net_help.h')
| -rw-r--r-- | util/net_help.h | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/util/net_help.h b/util/net_help.h index 28245ea0c1ee..278e370a268d 100644 --- a/util/net_help.h +++ b/util/net_help.h @@ -290,6 +290,18 @@ int sockaddr_cmp_addr(struct sockaddr_storage* addr1, socklen_t len1, struct sockaddr_storage* addr2, socklen_t len2); /** + * Compare two sockaddrs. Imposes an ordering on the addresses. + * Compares address and port. It also compares scope_id for ip6. + * @param addr1: address 1. + * @param len1: lengths of addr1. + * @param addr2: address 2. + * @param len2: lengths of addr2. + * @return: 0 if addr1 == addr2. -1 if addr1 is smaller, +1 if larger. + */ +int sockaddr_cmp_scopeid(struct sockaddr_storage* addr1, socklen_t len1, + struct sockaddr_storage* addr2, socklen_t len2); + +/** * Checkout address family. * @param addr: the sockaddr to examine. * @param len: the length of addr. @@ -476,14 +488,23 @@ int listen_sslctx_setup(void* ctxt); */ void listen_sslctx_setup_2(void* ctxt); -/** +/** * create SSL listen context * @param key: private key file. * @param pem: public key cert. * @param verifypem: if nonNULL, verifylocation file. + * @param tls_ciphers: if non empty string, tls ciphers to use. + * @param tls_ciphersuites: if non empty string, tls ciphersuites to use. + * @param set_ticket_keys_cb: if the callback for configured ticket keys needs + * to be set. + * @param is_dot: if the TLS connection is for DoT to set the appropriate ALPN. + * @param is_doh: if the TLS connection is for DoH to set the appropriate ALPN. * return SSL_CTX* or NULL on failure (logged). */ -void* listen_sslctx_create(char* key, char* pem, char* verifypem); +void* listen_sslctx_create(const char* key, const char* pem, + const char* verifypem, const char* tls_ciphers, + const char* tls_ciphersuites, int set_ticket_keys_cb, + int is_dot, int is_doh); /** * create SSL connect context @@ -541,12 +562,10 @@ void ub_openssl_lock_delete(void); /** * setup TLS session ticket - * @param sslctx: the SSL_CTX to use (from connect_sslctx_create()) * @param tls_session_ticket_keys: TLS ticket secret filenames * @return false on failure (alloc failure). */ -int listen_sslctx_setup_ticket_keys(void* sslctx, - struct config_strlist* tls_session_ticket_keys); +int listen_sslctx_setup_ticket_keys(struct config_strlist* tls_session_ticket_keys); /** Free memory used for TLS session ticket keys */ void listen_sslctx_delete_ticket_keys(void); |
