Compile with tinydtls and remove warning message with gcc.

This commit is contained in:
jcmichelou committed 2017-06-19 20:37:11 +02:00
1 parent b389a5f6aa
commit ae13e5127b
8 files changed
+75 -57

No files matched your search

+1 -1
View File
@@ -44,7 +44,7 @@ int coap_dtls_get_log_level(void);
* @return A DTLS context object or NULL on error;
*/
void *
coap_dtls_new_context( coap_context_t *coap_context );
coap_dtls_new_context( struct coap_context_t *coap_context );
/** Releases the storage allocated for @p dtls_context. */
void coap_dtls_free_context( void *dtls_context );
+11 -18
View File
@@ -28,16 +28,8 @@ typedef int coap_fd_t;
#endif
struct coap_packet_t;
typedef struct coap_packet_t coap_packet_t;
struct coap_session_t;
typedef struct coap_session_t coap_session_t;
struct coap_context_t;
typedef struct coap_context_t coap_context_t;
struct coap_pdu_t;
typedef struct coap_pdu_t coap_pdu_t;
typedef uint16_t coap_socket_flags_t;
@@ -83,17 +75,17 @@ coap_socket_bind_udp( coap_socket_t *sock,
void coap_socket_close( coap_socket_t *sock );
ssize_t
coap_socket_send( coap_socket_t *sock, coap_session_t *session,
coap_socket_send( coap_socket_t *sock, struct coap_session_t *session,
const uint8_t *data, size_t data_len );
#ifdef WITH_LWIP
ssize_t
coap_socket_send_pdu( coap_socket_t *sock, coap_session_t *session,
coap_pdu_t *pdu );
coap_socket_send_pdu( coap_socket_t *sock, struct coap_session_t *session,
struct coap_pdu_t *pdu );
#endif
const char *coap_socket_strerror();
const char *coap_socket_strerror( void );
/**
* Function interface for data transmission. This function returns the number of
@@ -107,7 +99,7 @@ const char *coap_socket_strerror();
* @return The number of bytes written on success, or a value
* less than zero on error.
*/
ssize_t coap_network_send( coap_socket_t *sock, const coap_session_t *session, const uint8_t *data, size_t datalen );
ssize_t coap_network_send( coap_socket_t *sock, const struct coap_session_t *session, const uint8_t *data, size_t datalen );
/**
* Function interface for reading data. This function returns the number of
@@ -122,7 +114,7 @@ ssize_t coap_network_send( coap_socket_t *sock, const coap_session_t *session, c
* @return The number of bytes received on success, or a value less than
* zero on error.
*/
ssize_t coap_network_read( coap_socket_t *sock, coap_packet_t **packet );
ssize_t coap_network_read( coap_socket_t *sock, struct coap_packet_t **packet );
#ifndef coap_mcast_interface
# define coap_mcast_interface(Local) 0
@@ -131,17 +123,17 @@ ssize_t coap_network_read( coap_socket_t *sock, coap_packet_t **packet );
/**
* Releases the storage allocated for @p packet.
*/
void coap_free_packet(coap_packet_t *packet);
void coap_free_packet(struct coap_packet_t *packet);
/**
* Given a packet, set msg and msg_len to an address and length of the packet's
* data in memory.
* */
void coap_packet_get_memmapped(coap_packet_t *packet,
void coap_packet_get_memmapped(struct coap_packet_t *packet,
unsigned char **address,
size_t *length);
void coap_packet_set_addr( coap_packet_t *packet, const coap_address_t *src,
void coap_packet_set_addr( struct coap_packet_t *packet, const coap_address_t *src,
const coap_address_t *dst );
#ifdef WITH_LWIP
@@ -149,7 +141,7 @@ void coap_packet_set_addr( coap_packet_t *packet, const coap_address_t *src,
* Get the pbuf of a packet. The caller takes over responsibility for freeing
* the pbuf.
*/
struct pbuf *coap_packet_extract_pbuf(coap_packet_t *packet);
struct pbuf *coap_packet_extract_pbuf(struct coap_packet_t *packet);
#endif
#if defined(WITH_LWIP)
@@ -175,5 +167,6 @@ struct coap_packet_t {
unsigned char payload[]; /**< payload */
};
#endif
typedef struct coap_packet_t coap_packet_t;
#endif /* _COAP_IO_H_ */
+1 -1
View File
@@ -129,7 +129,7 @@ typedef struct coap_context_t {
ssize_t (*network_send)(coap_socket_t *sock, const coap_session_t *session, const uint8_t *data, size_t datalen);
ssize_t (*network_read)(coap_socket_t *sock, coap_packet_t **packet);
ssize_t (*network_read)(coap_socket_t *sock, struct coap_packet_t **packet);
unsigned (*get_client_psk)( const coap_session_t *session, const char *hint, char *identity, unsigned max_identity_len, uint8_t *psk, unsigned max_psk_len );
unsigned (*get_server_psk)( const coap_session_t *session, const char *identity, uint8_t *psk, unsigned max_psk_len );
+10 -10
View File
@@ -14,7 +14,7 @@
#include "pdu.h"
struct coap_endpoint_t;
typedef struct coap_endpoint_t coap_endpoint_t;
struct coap_contex_t;
typedef uint8_t coap_proto_t;
/**
@@ -57,8 +57,8 @@ typedef struct coap_session_t {
coap_address_t remote_addr; /**< remote address and port */
int ifindex; /**< interface index */
coap_socket_t sock; /**< socket object for the session, if any */
coap_endpoint_t *endpoint; /**< session's endpoint */
coap_context_t *context; /**< session's context */
struct coap_endpoint_t *endpoint; /**< session's endpoint */
struct coap_context_t *context; /**< session's context */
void *tls; /**< security parameters */
coap_pdu_queue_t *sendqueue; /**< list of messages waiting to be sent */
char *psk_identity;
@@ -107,7 +107,7 @@ void coap_session_connected( coap_session_t *session );
* @return A new CoAP session or NULL if failed. Call coap_session_release to free.
*/
coap_session_t *coap_new_client_session(
coap_context_t *ctx,
struct coap_context_t *ctx,
const coap_address_t *local_if,
const coap_address_t *server,
coap_proto_t proto
@@ -127,7 +127,7 @@ coap_session_t *coap_new_client_session(
* @return A new CoAP session or NULL if failed. Call coap_session_release to free.
*/
coap_session_t *coap_new_client_session_psk(
coap_context_t *ctx,
struct coap_context_t *ctx,
const coap_address_t *local_if,
const coap_address_t *server,
coap_proto_t proto,
@@ -167,7 +167,7 @@ coap_session_delay_pdu( coap_session_t *session, coap_pdu_t *pdu, int retransmit
*/
typedef struct coap_endpoint_t {
struct coap_endpoint_t *next;
coap_context_t *context; /**< endpoint's context */
struct coap_context_t *context; /**< endpoint's context */
coap_proto_t proto; /**< protocol used on this interface */
coap_socket_t sock; /**< socket object for the interface, if any */
coap_address_t bind_addr; /**< local interface address */
@@ -183,7 +183,7 @@ typedef struct coap_endpoint_t {
* @param proto Protocol used on this endpoint
*/
coap_endpoint_t *coap_new_endpoint( coap_context_t *context, const coap_address_t *listen_addr, coap_proto_t proto );
coap_endpoint_t *coap_new_endpoint( struct coap_context_t *context, const coap_address_t *listen_addr, coap_proto_t proto );
void coap_free_endpoint( coap_endpoint_t *ep );
@@ -203,10 +203,10 @@ const char *coap_endpoint_str( const coap_endpoint_t *endpoint );
* @param packet Received packet.
* @return The CoAP session.
*/
coap_session_t *coap_endpoint_get_session( coap_endpoint_t *endpoint, const coap_packet_t *packet );
coap_session_t *coap_endpoint_get_session( coap_endpoint_t *endpoint, const struct coap_packet_t *packet );
coap_session_t *coap_endpoint_new_dtls_session( coap_endpoint_t *endpoint, const coap_packet_t *packet );
coap_session_t *coap_endpoint_new_dtls_session( coap_endpoint_t *endpoint, const struct coap_packet_t *packet );
coap_session_t *coap_session_get_by_peer( coap_context_t *ctx, const coap_address_t *remote_addr, int ifindex );
coap_session_t *coap_session_get_by_peer( struct coap_context_t *ctx, const struct coap_address_t *remote_addr, int ifindex );
#endif /* _SESSION_H */