diff --git a/include/coap3/coap_debug.h b/include/coap3/coap_debug.h index 6bb7a87c..4d22bb97 100644 --- a/include/coap3/coap_debug.h +++ b/include/coap3/coap_debug.h @@ -202,7 +202,7 @@ char *coap_string_tls_version(char *buffer, size_t bufsize); * * @return The amount written into the buffer. */ -size_t coap_print_addr(const struct coap_address_t *address, +size_t coap_print_addr(const coap_address_t *address, unsigned char *buffer, size_t size); /** @} */ diff --git a/include/coap3/coap_dtls.h b/include/coap3/coap_dtls.h index 651e3bdc..c83dda42 100644 --- a/include/coap3/coap_dtls.h +++ b/include/coap3/coap_dtls.h @@ -20,6 +20,8 @@ * @{ */ +typedef struct coap_dtls_pki_t coap_dtls_pki_t; + #ifndef COAP_DTLS_HINT_LENGTH #define COAP_DTLS_HINT_LENGTH 128 #endif @@ -86,7 +88,7 @@ coap_tls_version_t *coap_get_tls_library_version(void); * @return @c 1 if successful, else @c 0. */ typedef int (*coap_dtls_security_setup_t)(void* tls_session, - struct coap_dtls_pki_t *setup_data); + coap_dtls_pki_t *setup_data); /** * CN Validation callback that can be set up by coap_context_set_pki(). @@ -237,7 +239,7 @@ typedef coap_dtls_key_t *(*coap_dtls_pki_sni_callback_t)(const char *sni, /** * The structure used for defining the PKI setup data to be used. */ -typedef struct coap_dtls_pki_t { +struct coap_dtls_pki_t { uint8_t version; /** Set to COAP_DTLS_PKI_SETUP_VERSION to support this version of the struct */ @@ -295,7 +297,7 @@ typedef struct coap_dtls_pki_t { during the call to coap_new_client_session_pki() */ coap_dtls_key_t pki_key; /**< PKI key definition */ -} coap_dtls_pki_t; +}; /** * The structure that holds the Client PSK information. @@ -322,9 +324,9 @@ typedef struct coap_dtls_cpsk_info_t { * @return New coap_dtls_cpsk_info_t object or @c NULL on error. */ typedef const coap_dtls_cpsk_info_t *(*coap_dtls_ih_callback_t)( - struct coap_str_const_t *hint, - coap_session_t *coap_session, - void *arg); + coap_str_const_t *hint, + coap_session_t *coap_session, + void *arg); #define COAP_DTLS_CPSK_SETUP_VERSION 1 /**< Latest CPSK setup version */ @@ -391,7 +393,7 @@ typedef struct coap_dtls_spsk_info_t { * structure. */ typedef const coap_bin_const_t *(*coap_dtls_id_callback_t)( - struct coap_bin_const_t *identity, + coap_bin_const_t *identity, coap_session_t *coap_session, void *arg); /** diff --git a/man/coap_block.txt.in b/man/coap_block.txt.in index faf00ce6..810931c3 100644 --- a/man/coap_block.txt.in +++ b/man/coap_block.txt.in @@ -118,7 +118,7 @@ of this work (the default if *coap_context_set_block_mode*() is not called). * @param app_ptr The application provided pointer to the * coap_add_data_large_*() functions */ -typedef void (*coap_release_large_data_t)(struct coap_session_t *session, +typedef void (*coap_release_large_data_t)(coap_session_t *session, void *app_ptr); ---- diff --git a/man/coap_encryption.txt.in b/man/coap_encryption.txt.in index 9eb3fc49..f6438f11 100644 --- a/man/coap_encryption.txt.in +++ b/man/coap_encryption.txt.in @@ -188,7 +188,7 @@ these reserved definitions. * @return New coap_dtls_cpsk_info_t object or @c NULL on error. */ typedef const coap_dtls_cpsk_info_t *(*coap_dtls_ih_callback_t)( - struct coap_str_const_t *hint, + coap_str_const_t *hint, coap_session_t *coap_session, void *arg); ---- @@ -311,8 +311,8 @@ these reserved definitions. * @return New coap_bin_const_t Pre-Shared Key object or @c NULL on error. */ typedef const coap_bin_const_t *(*coap_dtls_id_callback_t)( - struct coap_bin_const_t *identity, - struct coap_session_t *coap_session, + coap_bin_const_t *identity, + coap_session_t *coap_session, void *arg); ---- @@ -650,7 +650,7 @@ certificate sets. * @return 1 if successful, else 0 */ typedef int (*coap_dtls_security_setup_t)(void *context, void* session, - struct coap_dtls_pki_t *setup_data); + coap_dtls_pki_t *setup_data); ---- *additional_tls_setup_call_back* points to an application provided callback diff --git a/src/coap_debug.c b/src/coap_debug.c index 54dabd4a..055e6336 100644 --- a/src/coap_debug.c +++ b/src/coap_debug.c @@ -168,7 +168,7 @@ print_readable( const uint8_t *data, size_t len, * Returned size is number of characters, not including NULL terminator. */ size_t -coap_print_addr(const struct coap_address_t *addr, unsigned char *buf, size_t len) { +coap_print_addr(const coap_address_t *addr, unsigned char *buf, size_t len) { #if defined( HAVE_ARPA_INET_H ) || defined( HAVE_WS2TCPIP_H ) const void *addrptr = NULL; in_port_t port; diff --git a/src/coap_gnutls.c b/src/coap_gnutls.c index 48e7932d..f8f22a37 100644 --- a/src/coap_gnutls.c +++ b/src/coap_gnutls.c @@ -420,8 +420,8 @@ void * coap_dtls_new_context(coap_context_t *c_context COAP_UNUSED) { const char *err; int ret; - struct coap_gnutls_context_t *g_context = - (struct coap_gnutls_context_t *) + coap_gnutls_context_t *g_context = + (coap_gnutls_context_t *) gnutls_malloc(sizeof(coap_gnutls_context_t)); if (g_context) { @@ -429,7 +429,7 @@ coap_dtls_new_context(coap_context_t *c_context COAP_UNUSED) { const char *priority; G_CHECK(gnutls_global_init(), "gnutls_global_init"); - memset(g_context, 0, sizeof(struct coap_gnutls_context_t)); + memset(g_context, 0, sizeof(coap_gnutls_context_t)); g_context->alpn_proto.data = gnutls_malloc(4); if (g_context->alpn_proto.data) { memcpy(g_context->alpn_proto.data, "coap", 4); @@ -1985,7 +1985,7 @@ coap_dtls_new_gnutls_env(coap_session_t *c_session, int type) if (!g_env) return NULL; - memset(g_env, 0, sizeof(struct coap_gnutls_env_t)); + memset(g_env, 0, sizeof(coap_gnutls_env_t)); G_CHECK(gnutls_init(&g_env->g_session, flags), "gnutls_init"); @@ -2622,7 +2622,7 @@ void *coap_tls_new_client_session(coap_session_t *c_session, int *connected) { if (!g_env) { return NULL; } - memset(g_env, 0, sizeof(struct coap_gnutls_env_t)); + memset(g_env, 0, sizeof(coap_gnutls_env_t)); *connected = 0; G_CHECK(gnutls_init(&g_env->g_session, flags), "gnutls_init"); @@ -2666,7 +2666,7 @@ void *coap_tls_new_server_session(coap_session_t *c_session, int *connected) { if (!g_env) return NULL; - memset(g_env, 0, sizeof(struct coap_gnutls_env_t)); + memset(g_env, 0, sizeof(coap_gnutls_env_t)); *connected = 0; G_CHECK(gnutls_init(&g_env->g_session, flags), "gnutls_init");