Macros | |
#define | htonl(x) lwip_htonl(x) |
#define | htons(x) lwip_htons(x) |
#define | LWIP_MAKE_U16(a, b) ((a << 8) | b) |
#define | LWIP_MAX(x, y) (((x) > (y)) ? (x) : (y)) |
#define | LWIP_MIN(x, y) (((x) < (y)) ? (x) : (y)) |
#define | LWIP_PLATFORM_BYTESWAP 0 |
#define | ntohl(x) lwip_ntohl(x) |
#define | ntohs(x) lwip_ntohs(x) |
#define | NULL ((void *)0) |
#define | PP_HTONL(x) |
#define | PP_HTONS(x) ((((x) & 0xff) << 8) | (((x) & 0xff00) >> 8)) |
#define | PP_NTOHL(x) PP_HTONL(x) |
#define | PP_NTOHS(x) PP_HTONS(x) |
Functions | |
u32_t | lwip_htonl (u32_t x) |
Convert an u32_t from host- to network byte order. More... | |
u16_t | lwip_htons (u16_t x) |
These are reference implementations of the byte swapping functions. More... | |
u32_t | lwip_ntohl (u32_t x) |
Convert an u32_t from network- to host byte order. More... | |
u16_t | lwip_ntohs (u16_t x) |
Convert an u16_t from network- to host byte order. More... | |
#define htonl | ( | x | ) | lwip_htonl(x) |
Referenced by ipaddr_aton(), tcp_create_segment(), tcp_keepalive(), tcp_output_alloc_header(), tcp_output_segment(), tcp_rst(), and tcp_send_empty_ack().
#define htons | ( | x | ) | lwip_htons(x) |
#define LWIP_MAKE_U16 | ( | a, | |
b | |||
) | ((a << 8) | b) |
#define LWIP_MAX | ( | x, | |
y | |||
) | (((x) > (y)) ? (x) : (y)) |
#define LWIP_MIN | ( | x, | |
y | |||
) | (((x) < (y)) ? (x) : (y)) |
Referenced by pbuf_alloc(), tcp_eff_send_mss(), tcp_output(), tcp_pbuf_prealloc(), tcp_slowtmr(), tcp_update_rcv_ann_wnd(), and tcp_write().
#define LWIP_PLATFORM_BYTESWAP 0 |
#define ntohl | ( | x | ) | lwip_ntohl(x) |
Referenced by tcp_enqueue_flags(), tcp_input(), tcp_output(), tcp_output_segment(), tcp_parseopt(), tcp_process(), tcp_receive(), tcp_rexmit(), tcp_rexmit_fast(), and tcp_write().
#define ntohs | ( | x | ) | lwip_ntohs(x) |
Referenced by ip_frag(), ip_input(), ip_reass(), ip_reass_chain_frag_into_datagram_and_validate(), tcp_input(), and udp_input().
#define NULL ((void *)0) |
Referenced by arp_timer(), configure_console(), etharp_arp_input(), etharp_find_addr(), etharp_find_entry(), etharp_free_entry(), etharp_output(), etharp_query(), etharp_raw(), etharp_update_arp_entry(), ethernet_configure_interface(), ethernetif_init(), ethernetif_input(), fs_open(), gmac_low_level_output(), gmac_rx_populate_queue(), http_accept(), http_close_conn(), http_poll(), http_recv(), icmp_input(), icmp_send_response(), if(), inet_chksum_pbuf(), inet_chksum_pseudo(), inet_chksum_pseudo_partial(), ip_frag(), ip_input(), ip_output(), ip_output_if(), ip_reass(), ip_reass_chain_frag_into_datagram_and_validate(), ip_reass_dequeue_datagram(), ip_reass_enqueue_new_datagram(), ip_reass_free_complete_datagram(), ip_reass_remove_oldest_datagram(), ip_reass_timer(), ip_reass_tmr(), ip_route(), ipaddr_ntoa_r(), mem_free(), mem_malloc(), mem_trim(), memp_free(), memp_init(), netif_add(), netif_find(), netif_init(), netif_remove(), netif_set_default(), netif_set_ipaddr(), pbuf_alloc(), pbuf_cat(), pbuf_clen(), pbuf_coalesce(), pbuf_copy(), pbuf_copy_partial(), pbuf_dechain(), pbuf_free(), pbuf_free_ooseq(), pbuf_get_at(), pbuf_header(), pbuf_memcmp(), pbuf_realloc(), pbuf_ref(), pbuf_strstr(), pbuf_take(), stdio_serial_init(), sys_timeouts_init(), tcp_abandon(), tcp_alloc(), tcp_bind(), tcp_close_shutdown(), tcp_connect(), tcp_create_segment(), tcp_eff_send_mss(), tcp_enqueue_flags(), tcp_fasttmr(), tcp_input(), tcp_keepalive(), tcp_kill_prio(), tcp_kill_timewait(), tcp_listen_input(), tcp_listen_with_backlog(), tcp_new_port(), tcp_oos_insert_segment(), tcp_output(), tcp_output_alloc_header(), tcp_output_segment(), tcp_pbuf_prealloc(), tcp_pcb_purge(), tcp_pcb_remove(), tcp_process(), tcp_process_refused_data(), tcp_receive(), tcp_recv_null(), tcp_rexmit(), tcp_rexmit_fast(), tcp_rexmit_rto(), tcp_rst(), tcp_seg_copy(), tcp_seg_free(), tcp_segs_free(), tcp_send_empty_ack(), tcp_send_fin(), tcp_shutdown(), tcp_slowtmr(), tcp_timer_needed(), tcp_write(), tcp_write_checks(), tcp_zero_window_probe(), tcpip_tcp_timer(), udp_bind(), udp_connect(), udp_input(), udp_new(), udp_new_port(), and udp_remove().
#define PP_HTONL | ( | x | ) |
#define PP_HTONS | ( | x | ) | ((((x) & 0xff) << 8) | (((x) & 0xff00) >> 8)) |
Referenced by etharp_arp_input(), etharp_raw(), etharp_send_ip(), ethernet_input(), icmp_input(), ip_input(), and tcp_rst().
#define PP_NTOHL | ( | x | ) | PP_HTONL(x) |
#define PP_NTOHS | ( | x | ) | PP_HTONS(x) |
Referenced by ip_reass().
Convert an u32_t from host- to network byte order.
n | u32_t in host byte order |
Referenced by ip4_addr_netmask_valid(), and lwip_ntohl().
These are reference implementations of the byte swapping functions.
Again with the aim of being simple, correct and fully portable. Byte swapping is the second thing you would want to optimize. You will need to port it to your architecture and in your cc.h:
#define LWIP_PLATFORM_BYTESWAP 1 #define LWIP_PLATFORM_HTONS(x) <your_htons> #define LWIP_PLATFORM_HTONL(x) <your_htonl>
Note ntohs() and ntohl() are merely references to the htonx counterparts. Convert an u16_t from host- to network byte order.
n | u16_t in host byte order |
Referenced by lwip_ntohs().
Convert an u32_t from network- to host byte order.
n | u32_t in network byte order |
References lwip_htonl().
Convert an u16_t from network- to host byte order.
n | u16_t in network byte order |
References lwip_htons().