From 150af09621ac59dd4f510cc0003e9fc4defe1d3c Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Mon, 24 Apr 2023 12:59:58 +0100 Subject: [PATCH] .h files: Rename to make dtls specific Remove include clashes, in particular with files named as global.h and session.h when used with other projects. Signed-off-by: Jon Shallow --- ccm.c | 6 +++--- crypto.c | 10 +++++----- dtls.c | 12 ++++++------ dtls.h | 12 ++++++------ alert.h => dtls_alert.h | 2 +- ccm.h => dtls_ccm.h | 0 crypto.h => dtls_crypto.h | 10 +++++----- dtls_debug.c | 2 +- dtls_debug.h | 4 ++-- global.h => dtls_global.h | 0 hmac.h => dtls_hmac.h | 2 +- netq.h => dtls_netq.h | 2 +- numeric.h => dtls_numeric.h | 0 peer.h => dtls_peer.h | 10 +++++----- session.h => dtls_session.h | 2 +- state.h => dtls_state.h | 6 +++--- hmac.c | 2 +- netq.c | 2 +- peer.c | 4 ++-- session.c | 2 +- tests/ccm-test.c | 4 ++-- tests/dtls-client.c | 2 +- tests/dtls_ciphers_util.h | 2 +- tests/unit-tests/test_ccm.c | 4 ++-- tests/unit-tests/test_ecc.c | 2 +- tests/unit-tests/test_prf.c | 2 +- 26 files changed, 53 insertions(+), 53 deletions(-) rename alert.h => dtls_alert.h (99%) rename ccm.h => dtls_ccm.h (100%) rename crypto.h => dtls_crypto.h (99%) rename global.h => dtls_global.h (100%) rename hmac.h => dtls_hmac.h (99%) rename netq.h => dtls_netq.h (99%) rename numeric.h => dtls_numeric.h (100%) rename peer.h => dtls_peer.h (97%) rename session.h => dtls_session.h (99%) rename state.h => dtls_state.h (96%) diff --git a/ccm.c b/ccm.c index e0bb77c7..d6962895 100644 --- a/ccm.c +++ b/ccm.c @@ -18,9 +18,9 @@ #include #include "tinydtls.h" -#include "global.h" -#include "numeric.h" -#include "ccm.h" +#include "dtls_global.h" +#include "dtls_numeric.h" +#include "dtls_ccm.h" #ifdef HAVE_ASSERT_H # include diff --git a/crypto.c b/crypto.c index be65a440..2a85432f 100644 --- a/crypto.c +++ b/crypto.c @@ -25,15 +25,15 @@ #define assert(x) #endif -#include "global.h" +#include "dtls_global.h" #include "dtls_debug.h" -#include "numeric.h" +#include "dtls_numeric.h" #include "dtls.h" -#include "crypto.h" -#include "ccm.h" +#include "dtls_crypto.h" +#include "dtls_ccm.h" #include "ecc/ecc.h" #include "dtls_prng.h" -#include "netq.h" +#include "dtls_netq.h" #include "dtls_mutex.h" diff --git a/dtls.c b/dtls.c index 83b1e489..9e87b2e2 100644 --- a/dtls.c +++ b/dtls.c @@ -27,7 +27,7 @@ #endif #ifndef WITH_CONTIKI #include -#include "global.h" +#include "dtls_global.h" #endif /* WITH_CONTIKI */ #ifdef HAVE_INTTYPES_H #define __STDC_FORMAT_MACROS @@ -47,17 +47,17 @@ #endif /* DTLS_PEERS_NOHASH */ #include "dtls_debug.h" -#include "numeric.h" -#include "netq.h" +#include "dtls_numeric.h" +#include "dtls_netq.h" #include "dtls.h" -#include "alert.h" -#include "session.h" +#include "dtls_alert.h" +#include "dtls_session.h" #include "dtls_prng.h" #include "dtls_mutex.h" #ifdef WITH_SHA256 -# include "hmac.h" +# include "dtls_hmac.h" #endif /* WITH_SHA256 */ #ifdef WITH_ZEPHYR diff --git a/dtls.h b/dtls.h index 05f3385c..ebcaa5f6 100644 --- a/dtls.h +++ b/dtls.h @@ -28,16 +28,16 @@ #include "tinydtls.h" -#include "state.h" -#include "peer.h" +#include "dtls_state.h" +#include "dtls_peer.h" #include "uthash.h" -#include "alert.h" -#include "crypto.h" -#include "hmac.h" +#include "dtls_alert.h" +#include "dtls_crypto.h" +#include "dtls_hmac.h" -#include "global.h" +#include "dtls_global.h" #include "dtls_time.h" #ifndef DTLSv12 diff --git a/alert.h b/dtls_alert.h similarity index 99% rename from alert.h rename to dtls_alert.h index 081e898b..6e9e848b 100644 --- a/alert.h +++ b/dtls_alert.h @@ -16,7 +16,7 @@ *******************************************************************************/ /** - * @file alert.h + * @file dtls_alert.h * @brief DTLS alert protocol */ diff --git a/ccm.h b/dtls_ccm.h similarity index 100% rename from ccm.h rename to dtls_ccm.h diff --git a/crypto.h b/dtls_crypto.h similarity index 99% rename from crypto.h rename to dtls_crypto.h index 68096e10..7678348d 100644 --- a/crypto.h +++ b/dtls_crypto.h @@ -24,11 +24,11 @@ #include "aes/rijndael.h" #include "tinydtls.h" -#include "global.h" -#include "state.h" -#include "numeric.h" -#include "hmac.h" -#include "ccm.h" +#include "dtls_global.h" +#include "dtls_state.h" +#include "dtls_numeric.h" +#include "dtls_hmac.h" +#include "dtls_ccm.h" /* TLS_PSK_WITH_AES_128_CCM_8 */ #define DTLS_MAC_KEY_LENGTH 0 diff --git a/dtls_debug.c b/dtls_debug.c index ad014669..3b7e50fd 100644 --- a/dtls_debug.c +++ b/dtls_debug.c @@ -41,7 +41,7 @@ typedef int in_port_t; #endif /* WITH_ZEPHYR */ -#include "global.h" +#include "dtls_global.h" #include "dtls_debug.h" #include "dtls_mutex.h" diff --git a/dtls_debug.h b/dtls_debug.h index 5b58acbc..4c199c77 100644 --- a/dtls_debug.h +++ b/dtls_debug.h @@ -21,8 +21,8 @@ #include #include "tinydtls.h" -#include "global.h" -#include "session.h" +#include "dtls_global.h" +#include "dtls_session.h" #ifdef WITH_ZEPHYR #include diff --git a/global.h b/dtls_global.h similarity index 100% rename from global.h rename to dtls_global.h diff --git a/hmac.h b/dtls_hmac.h similarity index 99% rename from hmac.h rename to dtls_hmac.h index 67ceaa7a..8c8bbaae 100644 --- a/hmac.h +++ b/dtls_hmac.h @@ -21,7 +21,7 @@ #include #include "tinydtls.h" -#include "global.h" +#include "dtls_global.h" #ifdef WITH_SHA256 #ifdef RIOT_VERSION diff --git a/netq.h b/dtls_netq.h similarity index 99% rename from netq.h rename to dtls_netq.h index 61876ccf..1cb1700e 100644 --- a/netq.h +++ b/dtls_netq.h @@ -19,7 +19,7 @@ #define _DTLS_NETQ_H_ #include "tinydtls.h" -#include "global.h" +#include "dtls_global.h" #include "dtls.h" #include "dtls_time.h" diff --git a/numeric.h b/dtls_numeric.h similarity index 100% rename from numeric.h rename to dtls_numeric.h diff --git a/peer.h b/dtls_peer.h similarity index 97% rename from peer.h rename to dtls_peer.h index bd327fa7..632b93bc 100644 --- a/peer.h +++ b/dtls_peer.h @@ -16,7 +16,7 @@ *******************************************************************************/ /** - * @file peer.h + * @file dtls_peer.h * @brief information about peers in a DTLS session */ @@ -26,11 +26,11 @@ #include #include "tinydtls.h" -#include "global.h" -#include "session.h" +#include "dtls_global.h" +#include "dtls_session.h" -#include "state.h" -#include "crypto.h" +#include "dtls_state.h" +#include "dtls_crypto.h" #ifndef DTLS_PEERS_NOHASH #include "uthash.h" diff --git a/session.h b/dtls_session.h similarity index 99% rename from session.h rename to dtls_session.h index 3aa48c53..97ec286f 100644 --- a/session.h +++ b/dtls_session.h @@ -18,7 +18,7 @@ #define _DTLS_SESSION_H_ #include "tinydtls.h" -#include "global.h" +#include "dtls_global.h" #ifdef WITH_CONTIKI #include "ip/uip.h" diff --git a/state.h b/dtls_state.h similarity index 96% rename from state.h rename to dtls_state.h index aaa129b9..57452cd9 100644 --- a/state.h +++ b/dtls_state.h @@ -16,7 +16,7 @@ *******************************************************************************/ /** - * @file state.h + * @file dtls_state.h * @brief state information for DTLS FSM */ @@ -26,8 +26,8 @@ #include #include -#include "global.h" -#include "hmac.h" +#include "dtls_global.h" +#include "dtls_hmac.h" typedef enum { DTLS_STATE_INIT = 0, DTLS_STATE_WAIT_CLIENTHELLO, DTLS_STATE_WAIT_CLIENTCERTIFICATE, diff --git a/hmac.c b/hmac.c index 93db779c..9ceaae63 100644 --- a/hmac.c +++ b/hmac.c @@ -25,7 +25,7 @@ #endif /* HAVE_ASSERT_H && !assert */ #include "dtls_debug.h" -#include "hmac.h" +#include "dtls_hmac.h" void dtls_hmac_update(dtls_hmac_context_t *ctx, diff --git a/netq.c b/netq.c index a6d17a15..567892ed 100644 --- a/netq.c +++ b/netq.c @@ -16,7 +16,7 @@ *******************************************************************************/ #include "dtls_debug.h" -#include "netq.h" +#include "dtls_netq.h" #include "utlist.h" #ifdef HAVE_ASSERT_H diff --git a/peer.c b/peer.c index bf06fae3..e66a6013 100644 --- a/peer.c +++ b/peer.c @@ -15,8 +15,8 @@ * *******************************************************************************/ -#include "global.h" -#include "peer.h" +#include "dtls_global.h" +#include "dtls_peer.h" #include "dtls_debug.h" #if !(defined (WITH_CONTIKI)) && !(defined (RIOT_VERSION)) diff --git a/session.c b/session.c index 346eae5c..7d699d1a 100644 --- a/session.c +++ b/session.c @@ -16,7 +16,7 @@ #include -#include "session.h" +#include "dtls_session.h" #ifdef HAVE_ASSERT_H #include diff --git a/tests/ccm-test.c b/tests/ccm-test.c index 7e2e7f87..b505db98 100644 --- a/tests/ccm-test.c +++ b/tests/ccm-test.c @@ -13,8 +13,8 @@ //#include "dtls_debug.h" #include "tinydtls.h" -#include "numeric.h" -#include "ccm.h" +#include "dtls_numeric.h" +#include "dtls_ccm.h" #include "ccm-testdata.c" diff --git a/tests/dtls-client.c b/tests/dtls-client.c index e4d5ba7a..fccabe7f 100644 --- a/tests/dtls-client.c +++ b/tests/dtls-client.c @@ -33,7 +33,7 @@ #include #include -#include "global.h" +#include "dtls_global.h" #include "dtls_debug.h" #include "dtls_ciphers_util.h" #include "dtls.h" diff --git a/tests/dtls_ciphers_util.h b/tests/dtls_ciphers_util.h index 80f4c63f..d3ff4276 100644 --- a/tests/dtls_ciphers_util.h +++ b/tests/dtls_ciphers_util.h @@ -17,7 +17,7 @@ #include -#include "global.h" +#include "dtls_global.h" const dtls_cipher_t* init_cipher_suites(const char* arg); diff --git a/tests/unit-tests/test_ccm.c b/tests/unit-tests/test_ccm.c index f54df8f9..eab73bf7 100644 --- a/tests/unit-tests/test_ccm.c +++ b/tests/unit-tests/test_ccm.c @@ -16,8 +16,8 @@ #include "test_ccm.h" #include "tinydtls.h" -#include "ccm.h" -#include "crypto.h" +#include "dtls_ccm.h" +#include "dtls_crypto.h" #include "../ccm-testdata.c" #include diff --git a/tests/unit-tests/test_ecc.c b/tests/unit-tests/test_ecc.c index a2dc99fe..b57b4ed5 100644 --- a/tests/unit-tests/test_ecc.c +++ b/tests/unit-tests/test_ecc.c @@ -18,7 +18,7 @@ #include "ecc/ecc.h" #include "tinydtls.h" -#include "crypto.h" +#include "dtls_crypto.h" #include diff --git a/tests/unit-tests/test_prf.c b/tests/unit-tests/test_prf.c index 1fb53f12..3efc3a66 100644 --- a/tests/unit-tests/test_prf.c +++ b/tests/unit-tests/test_prf.c @@ -17,7 +17,7 @@ #include "test_prf.h" #include "tinydtls.h" -#include "crypto.h" +#include "dtls_crypto.h" #include