Use global uip.h buffer definitions in a number of other modules

This commit is contained in:
Simon Duquennoy 2018-10-17 11:57:56 +02:00
parent 86e9790e6e
commit 59852d33f2
4 changed files with 6 additions and 9 deletions

View File

@ -51,7 +51,7 @@ uint16_t
uip_ipchksum(void)
{
/* Assumes proper alignement of uip_buf. */
uint16_t *p = (uint16_t *)&uip_buf[UIP_LLH_LEN];
uint16_t *p = (uint16_t *)UIP_IP_BUF;
register uint16_t sum;
sum = p[0];

View File

@ -77,9 +77,6 @@
#define SERVER_LISTEN_PORT UIP_HTONS(COAP_DEFAULT_PORT)
#define SERVER_LISTEN_SECURE_PORT UIP_HTONS(COAP_DEFAULT_SECURE_PORT)
/* direct access into the buffer */
#define UIP_UDP_BUF ((struct uip_udp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
#ifdef WITH_DTLS
static dtls_handler_t cb;
static dtls_context_t *dtls_context = NULL;

View File

@ -53,7 +53,7 @@
#define LOG_MODULE "ICMPv6"
#define LOG_LEVEL LOG_LEVEL_IPV6
#define UIP_ICMP6_ERROR_BUF ((struct uip_icmp6_error *)&uip_buf[uip_l2_l3_icmp_hdr_len])
#define UIP_ICMP6_ERROR_BUF ((struct uip_icmp6_error *)UIP_ICMP_PAYLOAD)
#define UIP_EXT_BUF ((struct uip_ext_hdr *)&uip_buf[uip_l2_l3_hdr_len])
#define UIP_FIRST_EXT_BUF ((struct uip_ext_hdr *)&uip_buf[UIP_LLIPH_LEN])

View File

@ -95,10 +95,10 @@
*/
/**@{ Pointers to messages just after icmp header */
#define UIP_ND6_RS_BUF ((uip_nd6_rs *)&uip_buf[uip_l2_l3_icmp_hdr_len])
#define UIP_ND6_RA_BUF ((uip_nd6_ra *)&uip_buf[uip_l2_l3_icmp_hdr_len])
#define UIP_ND6_NS_BUF ((uip_nd6_ns *)&uip_buf[uip_l2_l3_icmp_hdr_len])
#define UIP_ND6_NA_BUF ((uip_nd6_na *)&uip_buf[uip_l2_l3_icmp_hdr_len])
#define UIP_ND6_RS_BUF ((uip_nd6_rs *)UIP_ICMP_PAYLOAD)
#define UIP_ND6_RA_BUF ((uip_nd6_ra *)UIP_ICMP_PAYLOAD)
#define UIP_ND6_NS_BUF ((uip_nd6_ns *)UIP_ICMP_PAYLOAD)
#define UIP_ND6_NA_BUF ((uip_nd6_na *)UIP_ICMP_PAYLOAD)
/** @} */
/** Pointer to ND option */
#define UIP_ND6_OPT_HDR_BUF ((uip_nd6_opt_hdr *)&uip_buf[uip_l2_l3_icmp_hdr_len + nd6_opt_offset])