Ignore:
Timestamp:
Feb 20, 2016, 10:43:32 PM (8 years ago)
Author:
coas-nagasima
Message:

インクルードのパス指定をContikiに合わせ変更。
整数型の型名をContikiに合わせ変更。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uKadecot/trunk/uip/net/ipv4/uip-fw.c

    r157 r158  
    5454 */
    5555
    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"
    5959
    6060#include <string.h> /* for memcpy() */
     
    7878struct tcpip_hdr {
    7979  /* IP header. */
    80   u8_t vhl,
     80  uint8_t vhl,
    8181    tos;
    82   u16_t len,
     82  uint16_t len,
    8383    ipid,
    8484    ipoffset;
    85   u8_t ttl,
     85  uint8_t ttl,
    8686    proto;
    87   u16_t ipchksum;
    88   u16_t srcipaddr[2],
     87  uint16_t ipchksum;
     88  uint16_t srcipaddr[2],
    8989    destipaddr[2];
    9090 
    9191  /* TCP header. */
    92   u16_t srcport,
     92  uint16_t srcport,
    9393    destport;
    94   u8_t seqno[4],
     94  uint8_t seqno[4],
    9595    ackno[4],
    9696    tcpoffset,
    9797    flags,
    9898    wnd[2];
    99   u16_t tcpchksum;
    100   u8_t urgp[2];
    101   u8_t optdata[4];
     99  uint16_t tcpchksum;
     100  uint8_t urgp[2];
     101  uint8_t optdata[4];
    102102};
    103103
    104104struct icmpip_hdr {
    105105  /* IP header. */
    106   u8_t vhl,
     106  uint8_t vhl,
    107107    tos,
    108108    len[2],
     
    111111    ttl,
    112112    proto;
    113   u16_t ipchksum;
    114   u16_t srcipaddr[2],
     113  uint16_t ipchksum;
     114  uint16_t srcipaddr[2],
    115115    destipaddr[2];
    116116  /* ICMP (echo) header. */
    117   u8_t type, icode;
    118   u16_t icmpchksum;
    119   u16_t id, seqno;
    120   u8_t payload[1];
     117  uint8_t type, icode;
     118  uint16_t icmpchksum;
     119  uint16_t id, seqno;
     120  uint8_t payload[1];
    121121};
    122122
     
    142142 */
    143143struct fwcache_entry {
    144   u16_t timer;
    145  
    146   u16_t srcipaddr[2];
    147   u16_t destipaddr[2];
    148   u16_t ipid;
    149   u8_t proto;
    150   u8_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;
    151151
    152152#if notdef
    153   u16_t payload[2];
     153  uint16_t payload[2];
    154154#endif
    155155
    156156#if UIP_REASSEMBLY > 0
    157   u16_t len, offset;
     157  uint16_t len, offset;
    158158#endif
    159159};
     
    217217/*------------------------------------------------------------------------------*/
    218218static unsigned char
    219 ipaddr_maskcmp(u16_t *ipaddr, u16_t *netipaddr, u16_t *netmask)
     219ipaddr_maskcmp(uint16_t *ipaddr, uint16_t *netipaddr, uint16_t *netmask)
    220220{
    221221  return (ipaddr[0] & netmask [0]) == (netipaddr[0] & netmask[0]) &&
     
    234234time_exceeded(void)
    235235{
    236   u16_t tmp16;
     236  uint16_t tmp16;
    237237
    238238  /* We don't send out ICMP errors for ICMP messages. */
     
    250250  /* Calculate the ICMP checksum. */
    251251  ICMPBUF->icmpchksum = 0;
    252   ICMPBUF->icmpchksum = ~uip_chksum((u16_t *)&(ICMPBUF->type), 36);
     252  ICMPBUF->icmpchksum = ~uip_chksum((uint16_t *)&(ICMPBUF->type), 36);
    253253
    254254  /* Set the IP destination address to be the source address of the
     
    367367 */
    368368/*------------------------------------------------------------------------------*/
    369 u8_t
     369uint8_t
    370370uip_fw_output(void)
    371371{
     
    415415 */
    416416/*------------------------------------------------------------------------------*/
    417 u8_t
     417uint8_t
    418418uip_fw_forward(void)
    419419{
Note: See TracChangeset for help on using the changeset viewer.