mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-30 12:32:37 +00:00
added optional macros PACK_STRUCT_FLD_8() and PACK_STRUCT_FLD_S() to prevent gcc 4 from warning about struct members that do not need packing
This commit is contained in:
parent
7c9b545b30
commit
b0502d1f3b
@ -6,6 +6,11 @@ HISTORY
|
|||||||
|
|
||||||
++ New features:
|
++ New features:
|
||||||
|
|
||||||
|
2013-09-02: Simon Goldschmidt
|
||||||
|
* arch.h and many other files: added optional macros PACK_STRUCT_FLD_8() and
|
||||||
|
PACK_STRUCT_FLD_S() to prevent gcc 4 from warning about struct members that
|
||||||
|
do not need packing
|
||||||
|
|
||||||
2013-08-19: Simon Goldschmidt
|
2013-08-19: Simon Goldschmidt
|
||||||
* netif.h: bug #42998: made NETIF_MAX_HWADDR_LEN overridable for some special
|
* netif.h: bug #42998: made NETIF_MAX_HWADDR_LEN overridable for some special
|
||||||
networks
|
networks
|
||||||
|
@ -152,8 +152,8 @@ PACK_STRUCT_BEGIN
|
|||||||
/** DNS message header */
|
/** DNS message header */
|
||||||
struct dns_hdr {
|
struct dns_hdr {
|
||||||
PACK_STRUCT_FIELD(u16_t id);
|
PACK_STRUCT_FIELD(u16_t id);
|
||||||
PACK_STRUCT_FIELD(u8_t flags1);
|
PACK_STRUCT_FLD_8(u8_t flags1);
|
||||||
PACK_STRUCT_FIELD(u8_t flags2);
|
PACK_STRUCT_FLD_8(u8_t flags2);
|
||||||
PACK_STRUCT_FIELD(u16_t numquestions);
|
PACK_STRUCT_FIELD(u16_t numquestions);
|
||||||
PACK_STRUCT_FIELD(u16_t numanswers);
|
PACK_STRUCT_FIELD(u16_t numanswers);
|
||||||
PACK_STRUCT_FIELD(u16_t numauthrr);
|
PACK_STRUCT_FIELD(u16_t numauthrr);
|
||||||
|
@ -124,10 +124,10 @@ Steve Reynolds
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct igmp_msg {
|
struct igmp_msg {
|
||||||
PACK_STRUCT_FIELD(u8_t igmp_msgtype);
|
PACK_STRUCT_FLD_8(u8_t igmp_msgtype);
|
||||||
PACK_STRUCT_FIELD(u8_t igmp_maxresp);
|
PACK_STRUCT_FLD_8(u8_t igmp_maxresp);
|
||||||
PACK_STRUCT_FIELD(u16_t igmp_checksum);
|
PACK_STRUCT_FIELD(u16_t igmp_checksum);
|
||||||
PACK_STRUCT_FIELD(ip_addr_p_t igmp_group_address);
|
PACK_STRUCT_FLD_S(ip_addr_p_t igmp_group_address);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct eth_addr {
|
struct eth_addr {
|
||||||
PACK_STRUCT_FIELD(u8_t addr[6]);
|
PACK_STRUCT_FLD_8(u8_t addr[6]);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
@ -76,10 +76,10 @@ PACK_STRUCT_END
|
|||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct eth_hdr {
|
struct eth_hdr {
|
||||||
#if ETH_PAD_SIZE
|
#if ETH_PAD_SIZE
|
||||||
PACK_STRUCT_FIELD(u8_t padding[ETH_PAD_SIZE]);
|
PACK_STRUCT_FLD_8(u8_t padding[ETH_PAD_SIZE]);
|
||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_FIELD(struct eth_addr dest);
|
PACK_STRUCT_FLD_S(struct eth_addr dest);
|
||||||
PACK_STRUCT_FIELD(struct eth_addr src);
|
PACK_STRUCT_FLD_S(struct eth_addr src);
|
||||||
PACK_STRUCT_FIELD(u16_t type);
|
PACK_STRUCT_FIELD(u16_t type);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
|
@ -68,6 +68,18 @@ extern "C" {
|
|||||||
#define PACK_STRUCT_FIELD(x) x
|
#define PACK_STRUCT_FIELD(x) x
|
||||||
#endif /* PACK_STRUCT_FIELD */
|
#endif /* PACK_STRUCT_FIELD */
|
||||||
|
|
||||||
|
/* Used for struct fields of u8_t,
|
||||||
|
* where some compilers warn that packing is not necessary */
|
||||||
|
#ifndef PACK_STRUCT_FLD_8
|
||||||
|
#define PACK_STRUCT_FLD_8(x) PACK_STRUCT_FIELD(x)
|
||||||
|
#endif /* PACK_STRUCT_FLD_8 */
|
||||||
|
|
||||||
|
/* Used for struct fields of that are packed structs themself,
|
||||||
|
* where some compilers warn that packing is not necessary */
|
||||||
|
#ifndef PACK_STRUCT_FLD_S
|
||||||
|
#define PACK_STRUCT_FLD_S(x) PACK_STRUCT_FIELD(x)
|
||||||
|
#endif /* PACK_STRUCT_FLD_S */
|
||||||
|
|
||||||
|
|
||||||
#ifndef LWIP_UNUSED_ARG
|
#ifndef LWIP_UNUSED_ARG
|
||||||
#define LWIP_UNUSED_ARG(x) (void)x
|
#define LWIP_UNUSED_ARG(x) (void)x
|
||||||
|
@ -73,20 +73,20 @@ PACK_STRUCT_BEGIN
|
|||||||
/** minimum set of fields of any DHCP message */
|
/** minimum set of fields of any DHCP message */
|
||||||
struct dhcp_msg
|
struct dhcp_msg
|
||||||
{
|
{
|
||||||
PACK_STRUCT_FIELD(u8_t op);
|
PACK_STRUCT_FLD_8(u8_t op);
|
||||||
PACK_STRUCT_FIELD(u8_t htype);
|
PACK_STRUCT_FLD_8(u8_t htype);
|
||||||
PACK_STRUCT_FIELD(u8_t hlen);
|
PACK_STRUCT_FLD_8(u8_t hlen);
|
||||||
PACK_STRUCT_FIELD(u8_t hops);
|
PACK_STRUCT_FLD_8(u8_t hops);
|
||||||
PACK_STRUCT_FIELD(u32_t xid);
|
PACK_STRUCT_FIELD(u32_t xid);
|
||||||
PACK_STRUCT_FIELD(u16_t secs);
|
PACK_STRUCT_FIELD(u16_t secs);
|
||||||
PACK_STRUCT_FIELD(u16_t flags);
|
PACK_STRUCT_FIELD(u16_t flags);
|
||||||
PACK_STRUCT_FIELD(ip_addr_p_t ciaddr);
|
PACK_STRUCT_FLD_S(ip_addr_p_t ciaddr);
|
||||||
PACK_STRUCT_FIELD(ip_addr_p_t yiaddr);
|
PACK_STRUCT_FLD_S(ip_addr_p_t yiaddr);
|
||||||
PACK_STRUCT_FIELD(ip_addr_p_t siaddr);
|
PACK_STRUCT_FLD_S(ip_addr_p_t siaddr);
|
||||||
PACK_STRUCT_FIELD(ip_addr_p_t giaddr);
|
PACK_STRUCT_FLD_S(ip_addr_p_t giaddr);
|
||||||
PACK_STRUCT_FIELD(u8_t chaddr[DHCP_CHADDR_LEN]);
|
PACK_STRUCT_FLD_8(u8_t chaddr[DHCP_CHADDR_LEN]);
|
||||||
PACK_STRUCT_FIELD(u8_t sname[DHCP_SNAME_LEN]);
|
PACK_STRUCT_FLD_8(u8_t sname[DHCP_SNAME_LEN]);
|
||||||
PACK_STRUCT_FIELD(u8_t file[DHCP_FILE_LEN]);
|
PACK_STRUCT_FLD_8(u8_t file[DHCP_FILE_LEN]);
|
||||||
PACK_STRUCT_FIELD(u32_t cookie);
|
PACK_STRUCT_FIELD(u32_t cookie);
|
||||||
#define DHCP_MIN_OPTIONS_LEN 68U
|
#define DHCP_MIN_OPTIONS_LEN 68U
|
||||||
/** make sure user does not configure this too small */
|
/** make sure user does not configure this too small */
|
||||||
@ -98,7 +98,7 @@ struct dhcp_msg
|
|||||||
/** set this to be sufficient for your options in outgoing DHCP msgs */
|
/** set this to be sufficient for your options in outgoing DHCP msgs */
|
||||||
# define DHCP_OPTIONS_LEN DHCP_MIN_OPTIONS_LEN
|
# define DHCP_OPTIONS_LEN DHCP_MIN_OPTIONS_LEN
|
||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_FIELD(u8_t options[DHCP_OPTIONS_LEN]);
|
PACK_STRUCT_FLD_8(u8_t options[DHCP_OPTIONS_LEN]);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
|
@ -81,8 +81,8 @@ enum icmp_te_type {
|
|||||||
*/
|
*/
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct icmp_echo_hdr {
|
struct icmp_echo_hdr {
|
||||||
PACK_STRUCT_FIELD(u8_t type);
|
PACK_STRUCT_FLD_8(u8_t type);
|
||||||
PACK_STRUCT_FIELD(u8_t code);
|
PACK_STRUCT_FLD_8(u8_t code);
|
||||||
PACK_STRUCT_FIELD(u16_t chksum);
|
PACK_STRUCT_FIELD(u16_t chksum);
|
||||||
PACK_STRUCT_FIELD(u16_t id);
|
PACK_STRUCT_FIELD(u16_t id);
|
||||||
PACK_STRUCT_FIELD(u16_t seqno);
|
PACK_STRUCT_FIELD(u16_t seqno);
|
||||||
|
@ -105,8 +105,8 @@ enum icmp6_pp_code {
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct icmp6_hdr {
|
struct icmp6_hdr {
|
||||||
PACK_STRUCT_FIELD(u8_t type);
|
PACK_STRUCT_FLD_8(u8_t type);
|
||||||
PACK_STRUCT_FIELD(u8_t code);
|
PACK_STRUCT_FLD_8(u8_t code);
|
||||||
PACK_STRUCT_FIELD(u16_t chksum);
|
PACK_STRUCT_FIELD(u16_t chksum);
|
||||||
PACK_STRUCT_FIELD(u32_t data);
|
PACK_STRUCT_FIELD(u32_t data);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
@ -121,8 +121,8 @@ PACK_STRUCT_END
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct icmp6_echo_hdr {
|
struct icmp6_echo_hdr {
|
||||||
PACK_STRUCT_FIELD(u8_t type);
|
PACK_STRUCT_FLD_8(u8_t type);
|
||||||
PACK_STRUCT_FIELD(u8_t code);
|
PACK_STRUCT_FLD_8(u8_t code);
|
||||||
PACK_STRUCT_FIELD(u16_t chksum);
|
PACK_STRUCT_FIELD(u16_t chksum);
|
||||||
PACK_STRUCT_FIELD(u16_t id);
|
PACK_STRUCT_FIELD(u16_t id);
|
||||||
PACK_STRUCT_FIELD(u16_t seqno);
|
PACK_STRUCT_FIELD(u16_t seqno);
|
||||||
|
@ -63,9 +63,9 @@ extern "C" {
|
|||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct ip_hdr {
|
struct ip_hdr {
|
||||||
/* version / header length */
|
/* version / header length */
|
||||||
PACK_STRUCT_FIELD(u8_t _v_hl);
|
PACK_STRUCT_FLD_8(u8_t _v_hl);
|
||||||
/* type of service */
|
/* type of service */
|
||||||
PACK_STRUCT_FIELD(u8_t _tos);
|
PACK_STRUCT_FLD_8(u8_t _tos);
|
||||||
/* total length */
|
/* total length */
|
||||||
PACK_STRUCT_FIELD(u16_t _len);
|
PACK_STRUCT_FIELD(u16_t _len);
|
||||||
/* identification */
|
/* identification */
|
||||||
@ -77,14 +77,14 @@ struct ip_hdr {
|
|||||||
#define IP_MF 0x2000U /* more fragments flag */
|
#define IP_MF 0x2000U /* more fragments flag */
|
||||||
#define IP_OFFMASK 0x1fffU /* mask for fragmenting bits */
|
#define IP_OFFMASK 0x1fffU /* mask for fragmenting bits */
|
||||||
/* time to live */
|
/* time to live */
|
||||||
PACK_STRUCT_FIELD(u8_t _ttl);
|
PACK_STRUCT_FLD_8(u8_t _ttl);
|
||||||
/* protocol*/
|
/* protocol*/
|
||||||
PACK_STRUCT_FIELD(u8_t _proto);
|
PACK_STRUCT_FLD_8(u8_t _proto);
|
||||||
/* checksum */
|
/* checksum */
|
||||||
PACK_STRUCT_FIELD(u16_t _chksum);
|
PACK_STRUCT_FIELD(u16_t _chksum);
|
||||||
/* source and destination IP addresses */
|
/* source and destination IP addresses */
|
||||||
PACK_STRUCT_FIELD(ip_addr_p_t src);
|
PACK_STRUCT_FLD_S(ip_addr_p_t src);
|
||||||
PACK_STRUCT_FIELD(ip_addr_p_t dest);
|
PACK_STRUCT_FLD_S(ip_addr_p_t dest);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
|
@ -81,12 +81,12 @@ struct ip6_hdr {
|
|||||||
/* payload length */
|
/* payload length */
|
||||||
PACK_STRUCT_FIELD(u16_t _plen);
|
PACK_STRUCT_FIELD(u16_t _plen);
|
||||||
/* next header */
|
/* next header */
|
||||||
PACK_STRUCT_FIELD(u8_t _nexth);
|
PACK_STRUCT_FLD_8(u8_t _nexth);
|
||||||
/* hop limit */
|
/* hop limit */
|
||||||
PACK_STRUCT_FIELD(u8_t _hoplim);
|
PACK_STRUCT_FLD_8(u8_t _hoplim);
|
||||||
/* source and destination IP addresses */
|
/* source and destination IP addresses */
|
||||||
PACK_STRUCT_FIELD(ip6_addr_p_t src);
|
PACK_STRUCT_FLD_S(ip6_addr_p_t src);
|
||||||
PACK_STRUCT_FIELD(ip6_addr_p_t dest);
|
PACK_STRUCT_FLD_S(ip6_addr_p_t dest);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
@ -105,19 +105,19 @@ PACK_STRUCT_END
|
|||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct ip6_hbh_hdr {
|
struct ip6_hbh_hdr {
|
||||||
/* next header */
|
/* next header */
|
||||||
PACK_STRUCT_FIELD(u8_t _nexth);
|
PACK_STRUCT_FLD_8(u8_t _nexth);
|
||||||
/* header length */
|
/* header length */
|
||||||
PACK_STRUCT_FIELD(u8_t _hlen);
|
PACK_STRUCT_FLD_8(u8_t _hlen);
|
||||||
/* router alert option type */
|
/* router alert option type */
|
||||||
PACK_STRUCT_FIELD(u8_t _ra_opt_type);
|
PACK_STRUCT_FLD_8(u8_t _ra_opt_type);
|
||||||
/* router alert option data len */
|
/* router alert option data len */
|
||||||
PACK_STRUCT_FIELD(u8_t _ra_opt_dlen);
|
PACK_STRUCT_FLD_8(u8_t _ra_opt_dlen);
|
||||||
/* router alert option data */
|
/* router alert option data */
|
||||||
PACK_STRUCT_FIELD(u16_t _ra_opt_data);
|
PACK_STRUCT_FIELD(u16_t _ra_opt_data);
|
||||||
/* PadN option type */
|
/* PadN option type */
|
||||||
PACK_STRUCT_FIELD(u8_t _padn_opt_type);
|
PACK_STRUCT_FLD_8(u8_t _padn_opt_type);
|
||||||
/* PadN option data len */
|
/* PadN option data len */
|
||||||
PACK_STRUCT_FIELD(u8_t _padn_opt_dlen);
|
PACK_STRUCT_FLD_8(u8_t _padn_opt_dlen);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
@ -134,9 +134,9 @@ PACK_STRUCT_END
|
|||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct ip6_frag_hdr {
|
struct ip6_frag_hdr {
|
||||||
/* next header */
|
/* next header */
|
||||||
PACK_STRUCT_FIELD(u8_t _nexth);
|
PACK_STRUCT_FLD_8(u8_t _nexth);
|
||||||
/* reserved */
|
/* reserved */
|
||||||
PACK_STRUCT_FIELD(u8_t reserved);
|
PACK_STRUCT_FLD_8(u8_t reserved);
|
||||||
/* fragment offset */
|
/* fragment offset */
|
||||||
PACK_STRUCT_FIELD(u16_t _fragment_offset);
|
PACK_STRUCT_FIELD(u16_t _fragment_offset);
|
||||||
/* fragmented packet identification */
|
/* fragmented packet identification */
|
||||||
|
@ -78,12 +78,12 @@ struct mld_group {
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct mld_header {
|
struct mld_header {
|
||||||
PACK_STRUCT_FIELD(u8_t type);
|
PACK_STRUCT_FLD_8(u8_t type);
|
||||||
PACK_STRUCT_FIELD(u8_t code);
|
PACK_STRUCT_FLD_8(u8_t code);
|
||||||
PACK_STRUCT_FIELD(u16_t chksum);
|
PACK_STRUCT_FIELD(u16_t chksum);
|
||||||
PACK_STRUCT_FIELD(u16_t max_resp_delay);
|
PACK_STRUCT_FIELD(u16_t max_resp_delay);
|
||||||
PACK_STRUCT_FIELD(u16_t reserved);
|
PACK_STRUCT_FIELD(u16_t reserved);
|
||||||
PACK_STRUCT_FIELD(ip6_addr_p_t multicast_address);
|
PACK_STRUCT_FLD_S(ip6_addr_p_t multicast_address);
|
||||||
/* Options follow. */
|
/* Options follow. */
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
|
@ -132,11 +132,11 @@ struct nd6_q_entry {
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct ns_header {
|
struct ns_header {
|
||||||
PACK_STRUCT_FIELD(u8_t type);
|
PACK_STRUCT_FLD_8(u8_t type);
|
||||||
PACK_STRUCT_FIELD(u8_t code);
|
PACK_STRUCT_FLD_8(u8_t code);
|
||||||
PACK_STRUCT_FIELD(u16_t chksum);
|
PACK_STRUCT_FIELD(u16_t chksum);
|
||||||
PACK_STRUCT_FIELD(u32_t reserved);
|
PACK_STRUCT_FIELD(u32_t reserved);
|
||||||
PACK_STRUCT_FIELD(ip6_addr_p_t target_address);
|
PACK_STRUCT_FLD_S(ip6_addr_p_t target_address);
|
||||||
/* Options follow. */
|
/* Options follow. */
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
@ -150,12 +150,12 @@ PACK_STRUCT_END
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct na_header {
|
struct na_header {
|
||||||
PACK_STRUCT_FIELD(u8_t type);
|
PACK_STRUCT_FLD_8(u8_t type);
|
||||||
PACK_STRUCT_FIELD(u8_t code);
|
PACK_STRUCT_FLD_8(u8_t code);
|
||||||
PACK_STRUCT_FIELD(u16_t chksum);
|
PACK_STRUCT_FIELD(u16_t chksum);
|
||||||
PACK_STRUCT_FIELD(u8_t flags);
|
PACK_STRUCT_FLD_8(u8_t flags);
|
||||||
PACK_STRUCT_FIELD(u8_t reserved[3]);
|
PACK_STRUCT_FLD_8(u8_t reserved[3]);
|
||||||
PACK_STRUCT_FIELD(ip6_addr_p_t target_address);
|
PACK_STRUCT_FLD_S(ip6_addr_p_t target_address);
|
||||||
/* Options follow. */
|
/* Options follow. */
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
@ -172,8 +172,8 @@ PACK_STRUCT_END
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct rs_header {
|
struct rs_header {
|
||||||
PACK_STRUCT_FIELD(u8_t type);
|
PACK_STRUCT_FLD_8(u8_t type);
|
||||||
PACK_STRUCT_FIELD(u8_t code);
|
PACK_STRUCT_FLD_8(u8_t code);
|
||||||
PACK_STRUCT_FIELD(u16_t chksum);
|
PACK_STRUCT_FIELD(u16_t chksum);
|
||||||
PACK_STRUCT_FIELD(u32_t reserved);
|
PACK_STRUCT_FIELD(u32_t reserved);
|
||||||
/* Options follow. */
|
/* Options follow. */
|
||||||
@ -197,11 +197,11 @@ PACK_STRUCT_END
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct ra_header {
|
struct ra_header {
|
||||||
PACK_STRUCT_FIELD(u8_t type);
|
PACK_STRUCT_FLD_8(u8_t type);
|
||||||
PACK_STRUCT_FIELD(u8_t code);
|
PACK_STRUCT_FLD_8(u8_t code);
|
||||||
PACK_STRUCT_FIELD(u16_t chksum);
|
PACK_STRUCT_FIELD(u16_t chksum);
|
||||||
PACK_STRUCT_FIELD(u8_t current_hop_limit);
|
PACK_STRUCT_FLD_8(u8_t current_hop_limit);
|
||||||
PACK_STRUCT_FIELD(u8_t flags);
|
PACK_STRUCT_FLD_8(u8_t flags);
|
||||||
PACK_STRUCT_FIELD(u16_t router_lifetime);
|
PACK_STRUCT_FIELD(u16_t router_lifetime);
|
||||||
PACK_STRUCT_FIELD(u32_t reachable_time);
|
PACK_STRUCT_FIELD(u32_t reachable_time);
|
||||||
PACK_STRUCT_FIELD(u32_t retrans_timer);
|
PACK_STRUCT_FIELD(u32_t retrans_timer);
|
||||||
@ -218,12 +218,12 @@ PACK_STRUCT_END
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct redirect_header {
|
struct redirect_header {
|
||||||
PACK_STRUCT_FIELD(u8_t type);
|
PACK_STRUCT_FLD_8(u8_t type);
|
||||||
PACK_STRUCT_FIELD(u8_t code);
|
PACK_STRUCT_FLD_8(u8_t code);
|
||||||
PACK_STRUCT_FIELD(u16_t chksum);
|
PACK_STRUCT_FIELD(u16_t chksum);
|
||||||
PACK_STRUCT_FIELD(u32_t reserved);
|
PACK_STRUCT_FIELD(u32_t reserved);
|
||||||
PACK_STRUCT_FIELD(ip6_addr_p_t target_address);
|
PACK_STRUCT_FLD_S(ip6_addr_p_t target_address);
|
||||||
PACK_STRUCT_FIELD(ip6_addr_p_t destination_address);
|
PACK_STRUCT_FLD_S(ip6_addr_p_t destination_address);
|
||||||
/* Options follow. */
|
/* Options follow. */
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
@ -239,9 +239,9 @@ PACK_STRUCT_END
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct lladdr_option {
|
struct lladdr_option {
|
||||||
PACK_STRUCT_FIELD(u8_t type);
|
PACK_STRUCT_FLD_8(u8_t type);
|
||||||
PACK_STRUCT_FIELD(u8_t length);
|
PACK_STRUCT_FLD_8(u8_t length);
|
||||||
PACK_STRUCT_FIELD(u8_t addr[NETIF_MAX_HWADDR_LEN]);
|
PACK_STRUCT_FLD_8(u8_t addr[NETIF_MAX_HWADDR_LEN]);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
@ -259,15 +259,15 @@ PACK_STRUCT_END
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct prefix_option {
|
struct prefix_option {
|
||||||
PACK_STRUCT_FIELD(u8_t type);
|
PACK_STRUCT_FLD_8(u8_t type);
|
||||||
PACK_STRUCT_FIELD(u8_t length);
|
PACK_STRUCT_FLD_8(u8_t length);
|
||||||
PACK_STRUCT_FIELD(u8_t prefix_length);
|
PACK_STRUCT_FLD_8(u8_t prefix_length);
|
||||||
PACK_STRUCT_FIELD(u8_t flags);
|
PACK_STRUCT_FLD_8(u8_t flags);
|
||||||
PACK_STRUCT_FIELD(u32_t valid_lifetime);
|
PACK_STRUCT_FIELD(u32_t valid_lifetime);
|
||||||
PACK_STRUCT_FIELD(u32_t preferred_lifetime);
|
PACK_STRUCT_FIELD(u32_t preferred_lifetime);
|
||||||
PACK_STRUCT_FIELD(u8_t reserved2[3]);
|
PACK_STRUCT_FLD_8(u8_t reserved2[3]);
|
||||||
PACK_STRUCT_FIELD(u8_t site_prefix_length);
|
PACK_STRUCT_FLD_8(u8_t site_prefix_length);
|
||||||
PACK_STRUCT_FIELD(ip6_addr_p_t prefix);
|
PACK_STRUCT_FLD_S(ip6_addr_p_t prefix);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
@ -281,11 +281,11 @@ PACK_STRUCT_END
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct redirected_header_option {
|
struct redirected_header_option {
|
||||||
PACK_STRUCT_FIELD(u8_t type);
|
PACK_STRUCT_FLD_8(u8_t type);
|
||||||
PACK_STRUCT_FIELD(u8_t length);
|
PACK_STRUCT_FLD_8(u8_t length);
|
||||||
PACK_STRUCT_FIELD(u8_t reserved[6]);
|
PACK_STRUCT_FLD_8(u8_t reserved[6]);
|
||||||
/* Portion of redirected packet follows. */
|
/* Portion of redirected packet follows. */
|
||||||
/* PACK_STRUCT_FIELD(u8_t redirected[8]); */
|
/* PACK_STRUCT_FLD_8(u8_t redirected[8]); */
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
@ -299,8 +299,8 @@ PACK_STRUCT_END
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct mtu_option {
|
struct mtu_option {
|
||||||
PACK_STRUCT_FIELD(u8_t type);
|
PACK_STRUCT_FLD_8(u8_t type);
|
||||||
PACK_STRUCT_FIELD(u8_t length);
|
PACK_STRUCT_FLD_8(u8_t length);
|
||||||
PACK_STRUCT_FIELD(u16_t reserved);
|
PACK_STRUCT_FIELD(u16_t reserved);
|
||||||
PACK_STRUCT_FIELD(u32_t mtu);
|
PACK_STRUCT_FIELD(u32_t mtu);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
@ -316,12 +316,12 @@ PACK_STRUCT_END
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct route_option {
|
struct route_option {
|
||||||
PACK_STRUCT_FIELD(u8_t type);
|
PACK_STRUCT_FLD_8(u8_t type);
|
||||||
PACK_STRUCT_FIELD(u8_t length);
|
PACK_STRUCT_FLD_8(u8_t length);
|
||||||
PACK_STRUCT_FIELD(u8_t prefix_length);
|
PACK_STRUCT_FLD_8(u8_t prefix_length);
|
||||||
PACK_STRUCT_FIELD(u8_t preference);
|
PACK_STRUCT_FLD_8(u8_t preference);
|
||||||
PACK_STRUCT_FIELD(u32_t route_lifetime);
|
PACK_STRUCT_FIELD(u32_t route_lifetime);
|
||||||
PACK_STRUCT_FIELD(ip6_addr_p_t prefix);
|
PACK_STRUCT_FLD_S(ip6_addr_p_t prefix);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
|
@ -57,7 +57,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct eth_addr {
|
struct eth_addr {
|
||||||
PACK_STRUCT_FIELD(u8_t addr[ETHARP_HWADDR_LEN]);
|
PACK_STRUCT_FLD_8(u8_t addr[ETHARP_HWADDR_LEN]);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
@ -71,10 +71,10 @@ PACK_STRUCT_BEGIN
|
|||||||
/** Ethernet header */
|
/** Ethernet header */
|
||||||
struct eth_hdr {
|
struct eth_hdr {
|
||||||
#if ETH_PAD_SIZE
|
#if ETH_PAD_SIZE
|
||||||
PACK_STRUCT_FIELD(u8_t padding[ETH_PAD_SIZE]);
|
PACK_STRUCT_FLD_8(u8_t padding[ETH_PAD_SIZE]);
|
||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_FIELD(struct eth_addr dest);
|
PACK_STRUCT_FLD_S(struct eth_addr dest);
|
||||||
PACK_STRUCT_FIELD(struct eth_addr src);
|
PACK_STRUCT_FLD_S(struct eth_addr src);
|
||||||
PACK_STRUCT_FIELD(u16_t type);
|
PACK_STRUCT_FIELD(u16_t type);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
@ -115,13 +115,13 @@ PACK_STRUCT_BEGIN
|
|||||||
struct etharp_hdr {
|
struct etharp_hdr {
|
||||||
PACK_STRUCT_FIELD(u16_t hwtype);
|
PACK_STRUCT_FIELD(u16_t hwtype);
|
||||||
PACK_STRUCT_FIELD(u16_t proto);
|
PACK_STRUCT_FIELD(u16_t proto);
|
||||||
PACK_STRUCT_FIELD(u8_t hwlen);
|
PACK_STRUCT_FLD_8(u8_t hwlen);
|
||||||
PACK_STRUCT_FIELD(u8_t protolen);
|
PACK_STRUCT_FLD_8(u8_t protolen);
|
||||||
PACK_STRUCT_FIELD(u16_t opcode);
|
PACK_STRUCT_FIELD(u16_t opcode);
|
||||||
PACK_STRUCT_FIELD(struct eth_addr shwaddr);
|
PACK_STRUCT_FLD_S(struct eth_addr shwaddr);
|
||||||
PACK_STRUCT_FIELD(struct ip_addr2 sipaddr);
|
PACK_STRUCT_FLD_S(struct ip_addr2 sipaddr);
|
||||||
PACK_STRUCT_FIELD(struct eth_addr dhwaddr);
|
PACK_STRUCT_FLD_S(struct eth_addr dhwaddr);
|
||||||
PACK_STRUCT_FIELD(struct ip_addr2 dipaddr);
|
PACK_STRUCT_FLD_S(struct ip_addr2 dipaddr);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
|
@ -81,8 +81,8 @@
|
|||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct pppoehdr {
|
struct pppoehdr {
|
||||||
PACK_STRUCT_FIELD(u8_t vertype);
|
PACK_STRUCT_FLD_8(u8_t vertype);
|
||||||
PACK_STRUCT_FIELD(u8_t code);
|
PACK_STRUCT_FLD_8(u8_t code);
|
||||||
PACK_STRUCT_FIELD(u16_t session);
|
PACK_STRUCT_FIELD(u16_t session);
|
||||||
PACK_STRUCT_FIELD(u16_t plen);
|
PACK_STRUCT_FIELD(u16_t plen);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user