mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-23 06:35:57 +00:00
Replace several occurences of stdint types by lwIPs portability typedefs
Fixes bug #55405: Usage of uint8_t instead of ui8_t in TCP code
This commit is contained in:
parent
d504e27142
commit
ea14b774c8
|
@ -73,11 +73,11 @@ get_monotonic_time(struct timespec *ts)
|
||||||
{
|
{
|
||||||
#ifdef LWIP_UNIX_MACH
|
#ifdef LWIP_UNIX_MACH
|
||||||
/* darwin impl (no CLOCK_MONOTONIC) */
|
/* darwin impl (no CLOCK_MONOTONIC) */
|
||||||
uint64_t t = mach_absolute_time();
|
u64_t t = mach_absolute_time();
|
||||||
mach_timebase_info_data_t timebase_info = {0, 0};
|
mach_timebase_info_data_t timebase_info = {0, 0};
|
||||||
mach_timebase_info(&timebase_info);
|
mach_timebase_info(&timebase_info);
|
||||||
uint64_t nano = (t * timebase_info.numer) / (timebase_info.denom);
|
u64_t nano = (t * timebase_info.numer) / (timebase_info.denom);
|
||||||
uint64_t sec = nano/1000000000L;
|
u64_t sec = nano/1000000000L;
|
||||||
nano -= sec * 1000000000L;
|
nano -= sec * 1000000000L;
|
||||||
ts->tv_sec = sec;
|
ts->tv_sec = sec;
|
||||||
ts->tv_nsec = nano;
|
ts->tv_nsec = nano;
|
||||||
|
|
|
@ -100,10 +100,10 @@ struct altcp_tls_config {
|
||||||
mbedtls_ctr_drbg_context ctr_drbg;
|
mbedtls_ctr_drbg_context ctr_drbg;
|
||||||
mbedtls_x509_crt *cert;
|
mbedtls_x509_crt *cert;
|
||||||
mbedtls_pk_context *pkey;
|
mbedtls_pk_context *pkey;
|
||||||
uint8_t cert_count;
|
u8_t cert_count;
|
||||||
uint8_t cert_max;
|
u8_t cert_max;
|
||||||
uint8_t pkey_count;
|
u8_t pkey_count;
|
||||||
uint8_t pkey_max;
|
u8_t pkey_max;
|
||||||
mbedtls_x509_crt *ca;
|
mbedtls_x509_crt *ca;
|
||||||
#if defined(MBEDTLS_SSL_CACHE_C) && ALTCP_MBEDTLS_USE_SESSION_CACHE
|
#if defined(MBEDTLS_SSL_CACHE_C) && ALTCP_MBEDTLS_USE_SESSION_CACHE
|
||||||
/** Inter-connection cache for fast connection startup */
|
/** Inter-connection cache for fast connection startup */
|
||||||
|
@ -661,7 +661,7 @@ altcp_mbedtls_debug(void *ctx, int level, const char *file, int line, const char
|
||||||
* ATTENTION: Server certificate and private key have to be added outside this function!
|
* ATTENTION: Server certificate and private key have to be added outside this function!
|
||||||
*/
|
*/
|
||||||
static struct altcp_tls_config *
|
static struct altcp_tls_config *
|
||||||
altcp_tls_create_config(int is_server, uint8_t cert_count, uint8_t pkey_count, int have_ca)
|
altcp_tls_create_config(int is_server, u8_t cert_count, u8_t pkey_count, int have_ca)
|
||||||
{
|
{
|
||||||
size_t sz;
|
size_t sz;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -756,7 +756,7 @@ altcp_tls_create_config(int is_server, uint8_t cert_count, uint8_t pkey_count, i
|
||||||
return conf;
|
return conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct altcp_tls_config *altcp_tls_create_config_server(uint8_t cert_count)
|
struct altcp_tls_config *altcp_tls_create_config_server(u8_t cert_count)
|
||||||
{
|
{
|
||||||
struct altcp_tls_config *conf = altcp_tls_create_config(1, cert_count, cert_count, 0);
|
struct altcp_tls_config *conf = altcp_tls_create_config(1, cert_count, cert_count, 0);
|
||||||
if (conf == NULL) {
|
if (conf == NULL) {
|
||||||
|
|
|
@ -2594,7 +2594,7 @@ tcp_ext_arg_alloc_id(void)
|
||||||
* @param callbacks callback table (const since it is referenced, not copied!)
|
* @param callbacks callback table (const since it is referenced, not copied!)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
tcp_ext_arg_set_callbacks(struct tcp_pcb *pcb, uint8_t id, const struct tcp_ext_arg_callbacks * const callbacks)
|
tcp_ext_arg_set_callbacks(struct tcp_pcb *pcb, u8_t id, const struct tcp_ext_arg_callbacks * const callbacks)
|
||||||
{
|
{
|
||||||
LWIP_ASSERT("pcb != NULL", pcb != NULL);
|
LWIP_ASSERT("pcb != NULL", pcb != NULL);
|
||||||
LWIP_ASSERT("id < LWIP_TCP_PCB_NUM_EXT_ARGS", id < LWIP_TCP_PCB_NUM_EXT_ARGS);
|
LWIP_ASSERT("id < LWIP_TCP_PCB_NUM_EXT_ARGS", id < LWIP_TCP_PCB_NUM_EXT_ARGS);
|
||||||
|
@ -2613,7 +2613,7 @@ tcp_ext_arg_set_callbacks(struct tcp_pcb *pcb, uint8_t id, const struct tcp_ext_
|
||||||
* @param id ext_args index to set (allocated via @ref tcp_ext_arg_alloc_id)
|
* @param id ext_args index to set (allocated via @ref tcp_ext_arg_alloc_id)
|
||||||
* @param arg data pointer to set
|
* @param arg data pointer to set
|
||||||
*/
|
*/
|
||||||
void tcp_ext_arg_set(struct tcp_pcb *pcb, uint8_t id, void *arg)
|
void tcp_ext_arg_set(struct tcp_pcb *pcb, u8_t id, void *arg)
|
||||||
{
|
{
|
||||||
LWIP_ASSERT("pcb != NULL", pcb != NULL);
|
LWIP_ASSERT("pcb != NULL", pcb != NULL);
|
||||||
LWIP_ASSERT("id < LWIP_TCP_PCB_NUM_EXT_ARGS", id < LWIP_TCP_PCB_NUM_EXT_ARGS);
|
LWIP_ASSERT("id < LWIP_TCP_PCB_NUM_EXT_ARGS", id < LWIP_TCP_PCB_NUM_EXT_ARGS);
|
||||||
|
@ -2631,7 +2631,7 @@ void tcp_ext_arg_set(struct tcp_pcb *pcb, uint8_t id, void *arg)
|
||||||
* @param id ext_args index to set (allocated via @ref tcp_ext_arg_alloc_id)
|
* @param id ext_args index to set (allocated via @ref tcp_ext_arg_alloc_id)
|
||||||
* @return data pointer at the given index
|
* @return data pointer at the given index
|
||||||
*/
|
*/
|
||||||
void *tcp_ext_arg_get(const struct tcp_pcb *pcb, uint8_t id)
|
void *tcp_ext_arg_get(const struct tcp_pcb *pcb, u8_t id)
|
||||||
{
|
{
|
||||||
LWIP_ASSERT("pcb != NULL", pcb != NULL);
|
LWIP_ASSERT("pcb != NULL", pcb != NULL);
|
||||||
LWIP_ASSERT("id < LWIP_TCP_PCB_NUM_EXT_ARGS", id < LWIP_TCP_PCB_NUM_EXT_ARGS);
|
LWIP_ASSERT("id < LWIP_TCP_PCB_NUM_EXT_ARGS", id < LWIP_TCP_PCB_NUM_EXT_ARGS);
|
||||||
|
|
|
@ -63,7 +63,7 @@ struct altcp_tls_config;
|
||||||
/** @ingroup altcp_tls
|
/** @ingroup altcp_tls
|
||||||
* Create an ALTCP_TLS server configuration handle prepared for multiple certificates
|
* Create an ALTCP_TLS server configuration handle prepared for multiple certificates
|
||||||
*/
|
*/
|
||||||
struct altcp_tls_config *altcp_tls_create_config_server(uint8_t cert_count);
|
struct altcp_tls_config *altcp_tls_create_config_server(u8_t cert_count);
|
||||||
|
|
||||||
/** @ingroup altcp_tls
|
/** @ingroup altcp_tls
|
||||||
* Add a certificate to an ALTCP_TLS server configuration handle
|
* Add a certificate to an ALTCP_TLS server configuration handle
|
||||||
|
|
|
@ -486,9 +486,9 @@ err_t tcp_tcp_get_tcp_addrinfo(struct tcp_pcb *pcb, int local, ip_add
|
||||||
|
|
||||||
#if LWIP_TCP_PCB_NUM_EXT_ARGS
|
#if LWIP_TCP_PCB_NUM_EXT_ARGS
|
||||||
u8_t tcp_ext_arg_alloc_id(void);
|
u8_t tcp_ext_arg_alloc_id(void);
|
||||||
void tcp_ext_arg_set_callbacks(struct tcp_pcb *pcb, uint8_t id, const struct tcp_ext_arg_callbacks * const callbacks);
|
void tcp_ext_arg_set_callbacks(struct tcp_pcb *pcb, u8_t id, const struct tcp_ext_arg_callbacks * const callbacks);
|
||||||
void tcp_ext_arg_set(struct tcp_pcb *pcb, uint8_t id, void *arg);
|
void tcp_ext_arg_set(struct tcp_pcb *pcb, u8_t id, void *arg);
|
||||||
void *tcp_ext_arg_get(const struct tcp_pcb *pcb, uint8_t id);
|
void *tcp_ext_arg_get(const struct tcp_pcb *pcb, u8_t id);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -66,8 +66,8 @@ err_t rfc7668_if_init(struct netif *netif);
|
||||||
err_t tcpip_rfc7668_input(struct pbuf *p, struct netif *inp);
|
err_t tcpip_rfc7668_input(struct pbuf *p, struct netif *inp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void ble_addr_to_eui64(uint8_t *dst, const uint8_t *src, int public_addr);
|
void ble_addr_to_eui64(u8_t *dst, const u8_t *src, int public_addr);
|
||||||
void eui64_to_ble_addr(uint8_t *dst, const uint8_t *src);
|
void eui64_to_ble_addr(u8_t *dst, const u8_t *src);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -679,7 +679,7 @@ lowpan6_input(struct pbuf *p, struct netif *netif)
|
||||||
/* check for duplicate */
|
/* check for duplicate */
|
||||||
lrh = lowpan6_data.reass_list;
|
lrh = lowpan6_data.reass_list;
|
||||||
while (lrh != NULL) {
|
while (lrh != NULL) {
|
||||||
uint8_t discard = 0;
|
u8_t discard = 0;
|
||||||
lrh_next = lrh->next_packet;
|
lrh_next = lrh->next_packet;
|
||||||
if ((lrh->sender_addr.addr_len == src.addr_len) &&
|
if ((lrh->sender_addr.addr_len == src.addr_len) &&
|
||||||
(memcmp(lrh->sender_addr.addr, src.addr, src.addr_len) == 0)) {
|
(memcmp(lrh->sender_addr.addr, src.addr, src.addr_len) == 0)) {
|
||||||
|
|
|
@ -107,7 +107,7 @@ static struct lowpan6_link_addr rfc7668_peer_addr;
|
||||||
* @see LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS
|
* @see LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ble_addr_to_eui64(uint8_t *dst, const uint8_t *src, int public_addr)
|
ble_addr_to_eui64(u8_t *dst, const u8_t *src, int public_addr)
|
||||||
{
|
{
|
||||||
/* according to RFC7668 ch 3.2.2. */
|
/* according to RFC7668 ch 3.2.2. */
|
||||||
memcpy(dst, src, 3);
|
memcpy(dst, src, 3);
|
||||||
|
@ -136,7 +136,7 @@ ble_addr_to_eui64(uint8_t *dst, const uint8_t *src, int public_addr)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
eui64_to_ble_addr(uint8_t *dst, const uint8_t *src)
|
eui64_to_ble_addr(u8_t *dst, const u8_t *src)
|
||||||
{
|
{
|
||||||
/* according to RFC7668 ch 3.2.2. */
|
/* according to RFC7668 ch 3.2.2. */
|
||||||
memcpy(dst,src,3);
|
memcpy(dst,src,3);
|
||||||
|
@ -386,7 +386,7 @@ rfc7668_input(struct pbuf * p, struct netif *netif)
|
||||||
if ((i%4)==0) {
|
if ((i%4)==0) {
|
||||||
LWIP_DEBUGF(LWIP_RFC7668_IP_UNCOMPRESSED_DEBUG, ("\n"));
|
LWIP_DEBUGF(LWIP_RFC7668_IP_UNCOMPRESSED_DEBUG, ("\n"));
|
||||||
}
|
}
|
||||||
LWIP_DEBUGF(LWIP_RFC7668_IP_UNCOMPRESSED_DEBUG, ("%2X ", *((uint8_t *)p->payload+i)));
|
LWIP_DEBUGF(LWIP_RFC7668_IP_UNCOMPRESSED_DEBUG, ("%2X ", *((u8_t *)p->payload+i)));
|
||||||
}
|
}
|
||||||
LWIP_DEBUGF(LWIP_RFC7668_IP_UNCOMPRESSED_DEBUG, ("\np->len: %d\n", p->len));
|
LWIP_DEBUGF(LWIP_RFC7668_IP_UNCOMPRESSED_DEBUG, ("\np->len: %d\n", p->len));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user