mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-06 06:39:46 +00:00
lowpan6_ble.c: fixed whitespace & indentation
This commit is contained in:
parent
10209ee788
commit
69eaafecca
@ -110,10 +110,13 @@ void ble_addr_to_eui64(uint8_t *dst, uint8_t *src, uint8_t public_addr)
|
|||||||
dst[3] = 0xFF;
|
dst[3] = 0xFF;
|
||||||
dst[4] = 0xFE;
|
dst[4] = 0xFE;
|
||||||
memcpy(&dst[5], &src[3], 3);
|
memcpy(&dst[5], &src[3], 3);
|
||||||
#if LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS
|
#if LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS
|
||||||
if(public_addr) dst[0] &= ~0x02;
|
if(public_addr) {
|
||||||
else dst[0] |= 0x02;
|
dst[0] &= ~0x02;
|
||||||
#endif
|
} else {
|
||||||
|
dst[0] |= 0x02;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/** convert EUI64 address to Bluetooth MAC addr
|
/** convert EUI64 address to Bluetooth MAC addr
|
||||||
@ -140,7 +143,7 @@ void eui64_to_ble_addr(uint8_t *dst, uint8_t *src)
|
|||||||
static s8_t
|
static s8_t
|
||||||
rfc7668_context_lookup(const ip6_addr_t *ip6addr)
|
rfc7668_context_lookup(const ip6_addr_t *ip6addr)
|
||||||
{
|
{
|
||||||
#if LWIP_RFC7668_NUM_CONTEXTS > 0
|
#if LWIP_RFC7668_NUM_CONTEXTS > 0
|
||||||
s8_t i;
|
s8_t i;
|
||||||
/* iterate over all possible context addresses */
|
/* iterate over all possible context addresses */
|
||||||
for (i = 0; i < LWIP_RFC7668_NUM_CONTEXTS; i++) {
|
for (i = 0; i < LWIP_RFC7668_NUM_CONTEXTS; i++) {
|
||||||
@ -149,7 +152,7 @@ rfc7668_context_lookup(const ip6_addr_t *ip6addr)
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* no address found, return -1 */
|
/* no address found, return -1 */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -461,7 +464,7 @@ rfc7668_frag(struct netif *netif, struct pbuf *p, const ip6_addr_t * src, const
|
|||||||
err_t
|
err_t
|
||||||
rfc7668_set_context(u8_t idx, const ip6_addr_t * context)
|
rfc7668_set_context(u8_t idx, const ip6_addr_t * context)
|
||||||
{
|
{
|
||||||
#if LWIP_RFC7668_NUM_CONTEXTS > 0
|
#if LWIP_RFC7668_NUM_CONTEXTS > 0
|
||||||
/* check if the ID is possible */
|
/* check if the ID is possible */
|
||||||
if (idx >= LWIP_RFC7668_NUM_CONTEXTS) {
|
if (idx >= LWIP_RFC7668_NUM_CONTEXTS) {
|
||||||
return ERR_ARG;
|
return ERR_ARG;
|
||||||
@ -469,9 +472,9 @@ rfc7668_set_context(u8_t idx, const ip6_addr_t * context)
|
|||||||
/* copy IPv6 address to context storage */
|
/* copy IPv6 address to context storage */
|
||||||
ip6_addr_set(&rfc7668_context[idx], context);
|
ip6_addr_set(&rfc7668_context[idx], context);
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
#else
|
#else
|
||||||
return ERR_VAL;
|
return ERR_VAL;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -528,7 +531,7 @@ rfc7668_decompress(struct pbuf * p, const ip6_addr_t * src, const ip6_addr_t * d
|
|||||||
ip6hdr = (struct ip6_hdr *)q->payload;
|
ip6hdr = (struct ip6_hdr *)q->payload;
|
||||||
|
|
||||||
/* output the full compressed packet, if set in @see rfc7668_opt.h */
|
/* output the full compressed packet, if set in @see rfc7668_opt.h */
|
||||||
#if LWIP_RFC7668_IP_COMPRESSED_DEBUG
|
#if LWIP_RFC7668_IP_COMPRESSED_DEBUG
|
||||||
LWIP_DEBUGF(LWIP_RFC7668_DEBUG|LWIP_RFC7668_IP_COMPRESSED_DEBUG,("IP6 payload(compressed): \n"));
|
LWIP_DEBUGF(LWIP_RFC7668_DEBUG|LWIP_RFC7668_IP_COMPRESSED_DEBUG,("IP6 payload(compressed): \n"));
|
||||||
for(j = 0; j<p->len;j++)
|
for(j = 0; j<p->len;j++)
|
||||||
{
|
{
|
||||||
@ -537,7 +540,7 @@ rfc7668_decompress(struct pbuf * p, const ip6_addr_t * src, const ip6_addr_t * d
|
|||||||
}
|
}
|
||||||
LWIP_DEBUGF(LWIP_RFC7668_DEBUG|LWIP_RFC7668_IP_COMPRESSED_DEBUG,("\np->len: %d",p->len));
|
LWIP_DEBUGF(LWIP_RFC7668_DEBUG|LWIP_RFC7668_IP_COMPRESSED_DEBUG,("\np->len: %d",p->len));
|
||||||
printf("\np->len: %d\n",p->len);
|
printf("\np->len: %d\n",p->len);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* offset for inline IP headers (RFC 6282 ch3)*/
|
/* offset for inline IP headers (RFC 6282 ch3)*/
|
||||||
lowpan6_offset = 2;
|
lowpan6_offset = 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user