notls, tinydtls: Add stubs for unused TLS functions.

This commit is contained in:
jcmichelou committed 2017-10-21 16:11:15 +02:00
1 parent 854cc3147f
commit e713e77f54
2 files changed
+42

No files matched your search

+8
View File
@@ -110,6 +110,14 @@ unsigned int coap_dtls_get_overhead(coap_session_t *session UNUSED) {
return 0;
}
void *coap_tls_new_client_session(coap_session_t *session UNUSED) {
return NULL;
}
void *coap_tls_new_server_session(coap_session_t *session UNUSED) {
return NULL;
}
ssize_t coap_tls_write(coap_session_t *session UNUSED,
const uint8_t *data UNUSED,
size_t data_len UNUSED
+34
View File
@@ -434,6 +434,40 @@ unsigned int coap_dtls_get_overhead(coap_session_t *session) {
return 13 + 8 + 8;
}
#ifdef __GNUC__
#define UNUSED __attribute__((unused))
#else /* __GNUC__ */
#define UNUSED
#endif /* __GNUC__ */
int coap_tls_is_supported(void) {
return 0;
}
void *coap_tls_new_client_session(coap_session_t *session UNUSED) {
return NULL;
}
void *coap_tls_new_server_session(coap_session_t *session UNUSED) {
return NULL;
}
ssize_t coap_tls_write(coap_session_t *session UNUSED,
const uint8_t *data UNUSED,
size_t data_len UNUSED
) {
return -1;
}
ssize_t coap_tls_read(coap_session_t *session UNUSED,
uint8_t *data UNUSED,
size_t data_len UNUSED
) {
return -1;
}
#undef UNUSED
#else /* !HAVE_LIBTINYDTLS */
/* make compilers happy that do not like empty modules */