/[lwip]/lwip/src/include/ipv4/lwip/inet.h
ViewVC logotype

Diff of /lwip/src/include/ipv4/lwip/inet.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by likewise, Wed Jan 8 10:09:42 2003 UTC revision 1.3 by jani, Fri Feb 21 16:43:46 2003 UTC
# Line 43  u16_t inet_chksum_pbuf(struct pbuf *p); Line 43  u16_t inet_chksum_pbuf(struct pbuf *p);
43  u16_t inet_chksum_pseudo(struct pbuf *p,  u16_t inet_chksum_pseudo(struct pbuf *p,
44                           struct ip_addr *src, struct ip_addr *dest,                           struct ip_addr *src, struct ip_addr *dest,
45                           u8_t proto, u16_t proto_len);                           u8_t proto, u16_t proto_len);
   
 #ifdef HTONS  
 #undef HTONS  
 #endif /* HTONS */  
 #ifdef NTOHS  
 #undef NTOHS  
 #endif /* NTOHS */  
 #ifdef HTONL  
 #undef HTONL  
 #endif /* HTONL */  
 #ifdef NTOHL  
 #undef NTOHL  
 #endif /* NTOHL */  
   
46  #ifdef htons  #ifdef htons
47  #undef htons  #undef htons
48  #endif /* htons */  #endif /* htons */
# Line 70  u16_t inet_chksum_pseudo(struct pbuf *p, Line 56  u16_t inet_chksum_pseudo(struct pbuf *p,
56  #undef ntohl  #undef ntohl
57  #endif /* ntohl */  #endif /* ntohl */
58    
59    #if BYTE_ORDER == BIG_ENDIAN
60    #define htons(x) (x)
61  #ifndef HTONS  #define ntohs(x) (x)
62  #   if BYTE_ORDER == BIG_ENDIAN  #define htonl(x) (x)
63  #      define HTONS(n) (n)  #define ntohl(x) (x)
64  #   else /* BYTE_ORDER == BIG_ENDIAN */  #else
65  #      define HTONS(n) (((((u16_t)(n) & 0xff)) << 8) | (((u16_t)(n) & 0xff00) >> 8))  u16_t htons(u16_t x);
66  #   endif /* BYTE_ORDER == BIG_ENDIAN */  u16_t ntohs(u16_t x);
67  #endif /* HTONS */  u32_t htonl(u32_t x);
68    u32_t ntohl(u32_t x);
69  #define htons HTONS  #endif
 #define NTOHS HTONS  
 #define ntohs htons  
   
   
 #ifndef HTONL  
 #   if BYTE_ORDER == BIG_ENDIAN  
 #      define HTONL(n) (n)  
 #   else /* BYTE_ORDER == BIG_ENDIAN */  
 #      define HTONL(n) (((((u32_t)(n) & 0xff)) << 24) | \  
                         ((((u32_t)(n) & 0xff00)) << 8) | \  
                         ((((u32_t)(n) & 0xff0000)) >> 8) | \  
                         ((((u32_t)(n) & 0xff000000)) >> 24))  
 #   endif /* BYTE_ORDER == BIG_ENDIAN */  
 #endif /* HTONL */  
   
   
 #define htonl HTONL  
 #define NTOHL HTONL  
 #define ntohl htonl  
70    
71  #endif /* __LWIP_INET_H__ */  #endif /* __LWIP_INET_H__ */
72    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26