Changeset 158 for uKadecot/trunk/uip/net/ipv4/uip-fw.c
- Timestamp:
- Feb 20, 2016, 10:43:32 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uKadecot/trunk/uip/net/ipv4/uip-fw.c
r157 r158 54 54 */ 55 55 56 #include " uip.h"57 #include " uip_arch.h"58 #include " uip-fw.h"56 #include "net/ip/uip.h" 57 #include "net/ip/uip_arch.h" 58 #include "net/ipv4/uip-fw.h" 59 59 60 60 #include <string.h> /* for memcpy() */ … … 78 78 struct tcpip_hdr { 79 79 /* IP header. */ 80 u 8_t vhl,80 uint8_t vhl, 81 81 tos; 82 u 16_t len,82 uint16_t len, 83 83 ipid, 84 84 ipoffset; 85 u 8_t ttl,85 uint8_t ttl, 86 86 proto; 87 u 16_t ipchksum;88 u 16_t srcipaddr[2],87 uint16_t ipchksum; 88 uint16_t srcipaddr[2], 89 89 destipaddr[2]; 90 90 91 91 /* TCP header. */ 92 u 16_t srcport,92 uint16_t srcport, 93 93 destport; 94 u 8_t seqno[4],94 uint8_t seqno[4], 95 95 ackno[4], 96 96 tcpoffset, 97 97 flags, 98 98 wnd[2]; 99 u 16_t tcpchksum;100 u 8_t urgp[2];101 u 8_t optdata[4];99 uint16_t tcpchksum; 100 uint8_t urgp[2]; 101 uint8_t optdata[4]; 102 102 }; 103 103 104 104 struct icmpip_hdr { 105 105 /* IP header. */ 106 u 8_t vhl,106 uint8_t vhl, 107 107 tos, 108 108 len[2], … … 111 111 ttl, 112 112 proto; 113 u 16_t ipchksum;114 u 16_t srcipaddr[2],113 uint16_t ipchksum; 114 uint16_t srcipaddr[2], 115 115 destipaddr[2]; 116 116 /* ICMP (echo) header. */ 117 u 8_t type, icode;118 u 16_t icmpchksum;119 u 16_t id, seqno;120 u 8_t payload[1];117 uint8_t type, icode; 118 uint16_t icmpchksum; 119 uint16_t id, seqno; 120 uint8_t payload[1]; 121 121 }; 122 122 … … 142 142 */ 143 143 struct fwcache_entry { 144 u 16_t timer;145 146 u 16_t srcipaddr[2];147 u 16_t destipaddr[2];148 u 16_t ipid;149 u 8_t proto;150 u 8_t unused;144 uint16_t timer; 145 146 uint16_t srcipaddr[2]; 147 uint16_t destipaddr[2]; 148 uint16_t ipid; 149 uint8_t proto; 150 uint8_t unused; 151 151 152 152 #if notdef 153 u 16_t payload[2];153 uint16_t payload[2]; 154 154 #endif 155 155 156 156 #if UIP_REASSEMBLY > 0 157 u 16_t len, offset;157 uint16_t len, offset; 158 158 #endif 159 159 }; … … 217 217 /*------------------------------------------------------------------------------*/ 218 218 static unsigned char 219 ipaddr_maskcmp(u 16_t *ipaddr, u16_t *netipaddr, u16_t *netmask)219 ipaddr_maskcmp(uint16_t *ipaddr, uint16_t *netipaddr, uint16_t *netmask) 220 220 { 221 221 return (ipaddr[0] & netmask [0]) == (netipaddr[0] & netmask[0]) && … … 234 234 time_exceeded(void) 235 235 { 236 u 16_t tmp16;236 uint16_t tmp16; 237 237 238 238 /* We don't send out ICMP errors for ICMP messages. */ … … 250 250 /* Calculate the ICMP checksum. */ 251 251 ICMPBUF->icmpchksum = 0; 252 ICMPBUF->icmpchksum = ~uip_chksum((u 16_t *)&(ICMPBUF->type), 36);252 ICMPBUF->icmpchksum = ~uip_chksum((uint16_t *)&(ICMPBUF->type), 36); 253 253 254 254 /* Set the IP destination address to be the source address of the … … 367 367 */ 368 368 /*------------------------------------------------------------------------------*/ 369 u 8_t369 uint8_t 370 370 uip_fw_output(void) 371 371 { … … 415 415 */ 416 416 /*------------------------------------------------------------------------------*/ 417 u 8_t417 uint8_t 418 418 uip_fw_forward(void) 419 419 {
Note:
See TracChangeset
for help on using the changeset viewer.