mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-02 21:02:10 +00:00
Added includeds for bpstruct and epstruct.
Ports should update from using PACK_STRUCT_BEGIN and PACK_STRUCT_END to use these includes. Maybe there should be an PACK_STRUCT_USE_INCLUDES ifdef around these, for ports for which PACK_STRUCT_BEGIN and PACK_STRUCT_END works nicely.
This commit is contained in:
parent
e988d2ee0b
commit
f1c0bbc62b
@ -9,6 +9,8 @@ v2pro/ - Architectural files for the Xilinx Virtex-II PRO device with
|
|||||||
embedded PowerPC 405 Processor. Supports lwIP Raw API only.
|
embedded PowerPC 405 Processor. Supports lwIP Raw API only.
|
||||||
(requires V2PDK - http://www.xilinx.com/ise/vii_pro/kit.htm)
|
(requires V2PDK - http://www.xilinx.com/ise/vii_pro/kit.htm)
|
||||||
|
|
||||||
|
msvc6/ - Architectural files for Microsoft Visual C++ 6.0
|
||||||
|
|
||||||
Each subdirectory (may) also include:
|
Each subdirectory (may) also include:
|
||||||
|
|
||||||
perf.c - Optional file that should be implemented when running
|
perf.c - Optional file that should be implemented when running
|
||||||
|
@ -70,6 +70,7 @@ void icmp_input(struct pbuf *p, struct netif *inp);
|
|||||||
void icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t);
|
void icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t);
|
||||||
void icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t);
|
void icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t);
|
||||||
|
|
||||||
|
#include "arch/bpstruct.h"
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct icmp_echo_hdr {
|
struct icmp_echo_hdr {
|
||||||
PACK_STRUCT_FIELD(u16_t _type_code);
|
PACK_STRUCT_FIELD(u16_t _type_code);
|
||||||
@ -78,7 +79,9 @@ struct icmp_echo_hdr {
|
|||||||
PACK_STRUCT_FIELD(u16_t seqno);
|
PACK_STRUCT_FIELD(u16_t seqno);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
|
#include "arch/epstruct.h"
|
||||||
|
|
||||||
|
#include "arch/bpstruct.h"
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct icmp_dur_hdr {
|
struct icmp_dur_hdr {
|
||||||
PACK_STRUCT_FIELD(u16_t _type_code);
|
PACK_STRUCT_FIELD(u16_t _type_code);
|
||||||
@ -86,7 +89,9 @@ struct icmp_dur_hdr {
|
|||||||
PACK_STRUCT_FIELD(u32_t unused);
|
PACK_STRUCT_FIELD(u32_t unused);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
|
#include "arch/epstruct.h"
|
||||||
|
|
||||||
|
#include "arch/bpstruct.h"
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct icmp_te_hdr {
|
struct icmp_te_hdr {
|
||||||
PACK_STRUCT_FIELD(u16_t _type_code);
|
PACK_STRUCT_FIELD(u16_t _type_code);
|
||||||
@ -94,6 +99,7 @@ struct icmp_te_hdr {
|
|||||||
PACK_STRUCT_FIELD(u32_t unused);
|
PACK_STRUCT_FIELD(u32_t unused);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
|
#include "arch/epstruct.h"
|
||||||
|
|
||||||
#define ICMPH_TYPE(hdr) (NTOHS((hdr)->_type_code) >> 8)
|
#define ICMPH_TYPE(hdr) (NTOHS((hdr)->_type_code) >> 8)
|
||||||
#define ICMPH_CODE(hdr) (NTOHS((hdr)->_type_code) & 0xff)
|
#define ICMPH_CODE(hdr) (NTOHS((hdr)->_type_code) & 0xff)
|
||||||
|
@ -66,6 +66,7 @@ err_t ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
|
|||||||
#endif /* IP_HDRINCL */
|
#endif /* IP_HDRINCL */
|
||||||
#define IP_HDRINCL NULL
|
#define IP_HDRINCL NULL
|
||||||
|
|
||||||
|
#include "arch/bpstruct.h"
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct ip_hdr {
|
struct ip_hdr {
|
||||||
/* version / header length / type of service */
|
/* version / header length / type of service */
|
||||||
@ -89,6 +90,7 @@ struct ip_hdr {
|
|||||||
PACK_STRUCT_FIELD(struct ip_addr dest);
|
PACK_STRUCT_FIELD(struct ip_addr dest);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
|
#include "arch/epstruct.h"
|
||||||
|
|
||||||
#define IPH_V(hdr) (NTOHS((hdr)->_v_hl_tos) >> 12)
|
#define IPH_V(hdr) (NTOHS((hdr)->_v_hl_tos) >> 12)
|
||||||
#define IPH_HL(hdr) ((NTOHS((hdr)->_v_hl_tos) >> 8) & 0x0f)
|
#define IPH_HL(hdr) ((NTOHS((hdr)->_v_hl_tos) >> 8) & 0x0f)
|
||||||
|
@ -38,11 +38,13 @@
|
|||||||
|
|
||||||
#define IP_ADDR_BROADCAST (&ip_addr_broadcast)
|
#define IP_ADDR_BROADCAST (&ip_addr_broadcast)
|
||||||
|
|
||||||
|
#include "arch/bpstruct.h"
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct ip_addr {
|
struct ip_addr {
|
||||||
PACK_STRUCT_FIELD(u32_t addr);
|
PACK_STRUCT_FIELD(u32_t addr);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
|
#include "arch/epstruct.h"
|
||||||
|
|
||||||
extern struct ip_addr ip_addr_broadcast;
|
extern struct ip_addr ip_addr_broadcast;
|
||||||
|
|
||||||
|
@ -151,6 +151,7 @@ void tcp_rexmit (struct tcp_pcb *pcb);
|
|||||||
|
|
||||||
#define TCP_MSL 60000 /* The maximum segment lifetime in microseconds */
|
#define TCP_MSL 60000 /* The maximum segment lifetime in microseconds */
|
||||||
|
|
||||||
|
#include "arch/bpstruct.h"
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct tcp_hdr {
|
struct tcp_hdr {
|
||||||
PACK_STRUCT_FIELD(u16_t src);
|
PACK_STRUCT_FIELD(u16_t src);
|
||||||
@ -163,6 +164,7 @@ struct tcp_hdr {
|
|||||||
PACK_STRUCT_FIELD(u16_t urgp);
|
PACK_STRUCT_FIELD(u16_t urgp);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
|
#include "arch/epstruct.h"
|
||||||
|
|
||||||
#define TCPH_OFFSET(hdr) (NTOHS((hdr)->_offset_flags) >> 8)
|
#define TCPH_OFFSET(hdr) (NTOHS((hdr)->_offset_flags) >> 8)
|
||||||
#define TCPH_FLAGS(hdr) (NTOHS((hdr)->_offset_flags) & 0xff)
|
#define TCPH_FLAGS(hdr) (NTOHS((hdr)->_offset_flags) & 0xff)
|
||||||
|
@ -44,12 +44,15 @@
|
|||||||
#include "lwip/ip_addr.h"
|
#include "lwip/ip_addr.h"
|
||||||
#include "lwip/netif.h"
|
#include "lwip/netif.h"
|
||||||
|
|
||||||
|
#include "arch/bpstruct.h"
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct eth_addr {
|
struct eth_addr {
|
||||||
PACK_STRUCT_FIELD(u8_t addr[6]);
|
PACK_STRUCT_FIELD(u8_t addr[6]);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
|
#include "arch/epstruct.h"
|
||||||
|
|
||||||
|
#include "arch/bpstruct.h"
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct eth_hdr {
|
struct eth_hdr {
|
||||||
PACK_STRUCT_FIELD(struct eth_addr dest);
|
PACK_STRUCT_FIELD(struct eth_addr dest);
|
||||||
@ -57,6 +60,7 @@ struct eth_hdr {
|
|||||||
PACK_STRUCT_FIELD(u16_t type);
|
PACK_STRUCT_FIELD(u16_t type);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
|
#include "arch/epstruct.h"
|
||||||
|
|
||||||
#define ARP_TMR_INTERVAL 10000
|
#define ARP_TMR_INTERVAL 10000
|
||||||
|
|
||||||
|
@ -3,6 +3,11 @@
|
|||||||
* Address Resolution Protocol module for IP over Ethernet
|
* Address Resolution Protocol module for IP over Ethernet
|
||||||
*
|
*
|
||||||
* $Log: etharp.c,v $
|
* $Log: etharp.c,v $
|
||||||
|
* Revision 1.4 2002/11/08 12:54:43 proff_fs
|
||||||
|
* Added includeds for bpstruct and epstruct.
|
||||||
|
* Ports should update from using PACK_STRUCT_BEGIN and PACK_STRUCT_END to use these includes.
|
||||||
|
* Maybe there should be an PACK_STRUCT_USE_INCLUDES ifdef around these, for ports for which PACK_STRUCT_BEGIN and PACK_STRUCT_END works nicely.
|
||||||
|
*
|
||||||
* Revision 1.3 2002/11/06 11:43:21 likewise
|
* Revision 1.3 2002/11/06 11:43:21 likewise
|
||||||
* find_arp_entry() returned 0 instead of ARP_TABLE_SIZE if full pending cache (bug #1625).
|
* find_arp_entry() returned 0 instead of ARP_TABLE_SIZE if full pending cache (bug #1625).
|
||||||
*
|
*
|
||||||
@ -64,6 +69,7 @@
|
|||||||
#define ARP_REPLY 2
|
#define ARP_REPLY 2
|
||||||
|
|
||||||
/* MUST be compiled with "pack structs" or equivalent! */
|
/* MUST be compiled with "pack structs" or equivalent! */
|
||||||
|
#include "arch/bpstruct.h"
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct etharp_hdr {
|
struct etharp_hdr {
|
||||||
PACK_STRUCT_FIELD(struct eth_hdr ethhdr);
|
PACK_STRUCT_FIELD(struct eth_hdr ethhdr);
|
||||||
@ -77,6 +83,7 @@ struct etharp_hdr {
|
|||||||
PACK_STRUCT_FIELD(struct ip_addr dipaddr);
|
PACK_STRUCT_FIELD(struct ip_addr dipaddr);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
|
#include "arch/epstruct.h"
|
||||||
|
|
||||||
#define ARPH_HWLEN(hdr) (NTOHS((hdr)->_hwlen_protolen) >> 8)
|
#define ARPH_HWLEN(hdr) (NTOHS((hdr)->_hwlen_protolen) >> 8)
|
||||||
#define ARPH_PROTOLEN(hdr) (NTOHS((hdr)->_hwlen_protolen) & 0xff)
|
#define ARPH_PROTOLEN(hdr) (NTOHS((hdr)->_hwlen_protolen) & 0xff)
|
||||||
@ -85,12 +92,14 @@ PACK_STRUCT_END
|
|||||||
#define ARPH_HWLEN_SET(hdr, len) (hdr)->_hwlen_protolen = HTONS(ARPH_PROTOLEN(hdr) | ((len) << 8))
|
#define ARPH_HWLEN_SET(hdr, len) (hdr)->_hwlen_protolen = HTONS(ARPH_PROTOLEN(hdr) | ((len) << 8))
|
||||||
#define ARPH_PROTOLEN_SET(hdr, len) (hdr)->_hwlen_protolen = HTONS((len) | (ARPH_HWLEN(hdr) << 8))
|
#define ARPH_PROTOLEN_SET(hdr, len) (hdr)->_hwlen_protolen = HTONS((len) | (ARPH_HWLEN(hdr) << 8))
|
||||||
|
|
||||||
|
#include "arch/bpstruct.h"
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct ethip_hdr {
|
struct ethip_hdr {
|
||||||
PACK_STRUCT_FIELD(struct eth_hdr eth);
|
PACK_STRUCT_FIELD(struct eth_hdr eth);
|
||||||
PACK_STRUCT_FIELD(struct ip_hdr ip);
|
PACK_STRUCT_FIELD(struct ip_hdr ip);
|
||||||
};
|
};
|
||||||
PACK_STRUCT_END
|
PACK_STRUCT_END
|
||||||
|
#include "arch/epstruct.h"
|
||||||
|
|
||||||
enum etharp_state {
|
enum etharp_state {
|
||||||
ETHARP_STATE_EMPTY,
|
ETHARP_STATE_EMPTY,
|
||||||
|
Loading…
Reference in New Issue
Block a user