mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-06-16 18:03:44 +08:00
Cleanup hton*/ntoh* function handling and platform abstraction
Let lwip use functions/macros prefixed by lwip_ internally to avoid naming clashes with external #includes. Remove over-complicated #define handling in def.h Make functions easier to override in cc.h. The following is sufficient now (no more LWIP_PLATFORM_BYTESWAP): #define lwip_htons(x) <your_htons> #define lwip_htonl(x) <your_htonl>
This commit is contained in:
@@ -420,15 +420,15 @@ nd6_input(struct pbuf *p, struct netif *inp)
|
||||
}
|
||||
|
||||
/* Re-set invalidation timer. */
|
||||
default_router_list[i].invalidation_timer = htons(ra_hdr->router_lifetime);
|
||||
default_router_list[i].invalidation_timer = lwip_htons(ra_hdr->router_lifetime);
|
||||
|
||||
/* Re-set default timer values. */
|
||||
#if LWIP_ND6_ALLOW_RA_UPDATES
|
||||
if (ra_hdr->retrans_timer > 0) {
|
||||
retrans_timer = htonl(ra_hdr->retrans_timer);
|
||||
retrans_timer = lwip_htonl(ra_hdr->retrans_timer);
|
||||
}
|
||||
if (ra_hdr->reachable_time > 0) {
|
||||
reachable_time = htonl(ra_hdr->reachable_time);
|
||||
reachable_time = lwip_htonl(ra_hdr->reachable_time);
|
||||
}
|
||||
#endif /* LWIP_ND6_ALLOW_RA_UPDATES */
|
||||
|
||||
@@ -479,9 +479,9 @@ nd6_input(struct pbuf *p, struct netif *inp)
|
||||
{
|
||||
struct mtu_option *mtu_opt;
|
||||
mtu_opt = (struct mtu_option *)buffer;
|
||||
if (htonl(mtu_opt->mtu) >= 1280) {
|
||||
if (lwip_htonl(mtu_opt->mtu) >= 1280) {
|
||||
#if LWIP_ND6_ALLOW_RA_UPDATES
|
||||
inp->mtu = (u16_t)htonl(mtu_opt->mtu);
|
||||
inp->mtu = (u16_t)lwip_htonl(mtu_opt->mtu);
|
||||
#endif /* LWIP_ND6_ALLOW_RA_UPDATES */
|
||||
}
|
||||
break;
|
||||
@@ -507,7 +507,7 @@ nd6_input(struct pbuf *p, struct netif *inp)
|
||||
prefix = nd6_new_onlink_prefix(ip6_current_dest_addr(), inp);
|
||||
}
|
||||
if (prefix >= 0) {
|
||||
prefix_list[prefix].invalidation_timer = htonl(prefix_opt->valid_lifetime);
|
||||
prefix_list[prefix].invalidation_timer = lwip_htonl(prefix_opt->valid_lifetime);
|
||||
|
||||
#if LWIP_IPV6_AUTOCONFIG
|
||||
if (prefix_opt->flags & ND6_PREFIX_FLAG_AUTONOMOUS) {
|
||||
@@ -640,7 +640,7 @@ nd6_input(struct pbuf *p, struct netif *inp)
|
||||
}
|
||||
|
||||
/* Change the Path MTU. */
|
||||
pmtu = htonl(icmp6hdr->data);
|
||||
pmtu = lwip_htonl(icmp6hdr->data);
|
||||
destination_cache[i].pmtu = (u16_t)LWIP_MIN(pmtu, 0xFFFF);
|
||||
|
||||
break; /* ICMP6_TYPE_PTB */
|
||||
|
||||
Reference in New Issue
Block a user