Skip to content

Commit

Permalink
.h files: Rename to make dtls specific
Browse files Browse the repository at this point in the history
Remove include clashes, in particular with files named as global.h
and session.h when used with other projects.

Signed-off-by: Jon Shallow <[email protected]>
  • Loading branch information
mrdeep1 committed Apr 24, 2023
1 parent a5fa982 commit db3484f
Show file tree
Hide file tree
Showing 26 changed files with 53 additions and 53 deletions.
6 changes: 3 additions & 3 deletions ccm.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#include <string.h>

#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 <assert.h>
Expand Down
10 changes: 5 additions & 5 deletions crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
12 changes: 6 additions & 6 deletions dtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#endif
#ifndef WITH_CONTIKI
#include <stdlib.h>
#include "global.h"
#include "dtls_global.h"
#endif /* WITH_CONTIKI */
#ifdef HAVE_INTTYPES_H
#define __STDC_FORMAT_MACROS
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions dtls.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion alert.h → dtls_alert.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*******************************************************************************/

/**
* @file alert.h
* @file dtls_alert.h
* @brief DTLS alert protocol
*/

Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions crypto.h → dtls_crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dtls_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
typedef int in_port_t;
#endif /* WITH_ZEPHYR */

#include "global.h"
#include "dtls_global.h"
#include "dtls_debug.h"
#include "dtls_mutex.h"

Expand Down
4 changes: 2 additions & 2 deletions dtls_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <stdlib.h>

#include "tinydtls.h"
#include "global.h"
#include "session.h"
#include "dtls_global.h"
#include "dtls_session.h"

#ifdef WITH_ZEPHYR
#include <logging/log.h>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion hmac.h → dtls_hmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <sys/types.h>

#include "tinydtls.h"
#include "global.h"
#include "dtls_global.h"

#ifdef WITH_SHA256
#ifdef RIOT_VERSION
Expand Down
2 changes: 1 addition & 1 deletion netq.h → dtls_netq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions peer.h → dtls_peer.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*******************************************************************************/

/**
* @file peer.h
* @file dtls_peer.h
* @brief information about peers in a DTLS session
*/

Expand All @@ -26,11 +26,11 @@
#include <sys/types.h>

#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"
Expand Down
2 changes: 1 addition & 1 deletion session.h → dtls_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <string.h>

#include "tinydtls.h"
#include "global.h"
#include "dtls_global.h"

#ifdef WITH_CONTIKI
#include "ip/uip.h"
Expand Down
6 changes: 3 additions & 3 deletions state.h → dtls_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*******************************************************************************/

/**
* @file state.h
* @file dtls_state.h
* @brief state information for DTLS FSM
*/

Expand All @@ -26,8 +26,8 @@
#include <sys/types.h>
#include <stdint.h>

#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,
Expand Down
2 changes: 1 addition & 1 deletion hmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion netq.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*******************************************************************************/

#include "dtls_debug.h"
#include "netq.h"
#include "dtls_netq.h"
#include "utlist.h"

#ifdef HAVE_ASSERT_H
Expand Down
4 changes: 2 additions & 2 deletions peer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion session.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
*******************************************************************************/

#include "session.h"
#include "dtls_session.h"

#ifdef HAVE_ASSERT_H
#include <assert.h>
Expand Down
4 changes: 2 additions & 2 deletions tests/ccm-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion tests/dtls-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <netdb.h>
#include <signal.h>

#include "global.h"
#include "dtls_global.h"
#include "dtls_debug.h"
#include "dtls_ciphers_util.h"
#include "dtls.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/dtls_ciphers_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <stdio.h>

#include "global.h"
#include "dtls_global.h"

const dtls_cipher_t* init_cipher_suites(const char* arg);

Expand Down
4 changes: 2 additions & 2 deletions tests/unit-tests/test_ccm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion tests/unit-tests/test_ecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "ecc/ecc.h"

#include "tinydtls.h"
#include "crypto.h"
#include "dtls_crypto.h"

#include <stdio.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/unit-tests/test_prf.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "test_prf.h"

#include "tinydtls.h"
#include "crypto.h"
#include "dtls_crypto.h"

#include <stdio.h>

Expand Down

0 comments on commit db3484f

Please sign in to comment.