Ignore:
Timestamp:
Nov 18, 2016, 2:58:30 PM (8 years ago)
Author:
coas-nagasima
Message:

uIPを更新
プロジェクトファイルを更新

Location:
uKadecot/trunk/uip/net/ipv4
Files:
7 edited

Legend:

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

    r158 r262  
    8686    proto;
    8787  uint16_t ipchksum;
    88   uint16_t srcipaddr[2],
    89     destipaddr[2];
     88  uip_ipaddr_t srcipaddr, destipaddr;
    9089 
    9190  /* TCP header. */
     
    112111    proto;
    113112  uint16_t ipchksum;
    114   uint16_t srcipaddr[2],
    115     destipaddr[2];
     113  uip_ipaddr_t srcipaddr, destipaddr;
    116114  /* ICMP (echo) header. */
    117115  uint8_t type, icode;
     
    144142  uint16_t timer;
    145143 
    146   uint16_t srcipaddr[2];
    147   uint16_t destipaddr[2];
     144  uip_ipaddr_t srcipaddr;
     145  uip_ipaddr_t destipaddr;
    148146  uint16_t ipid;
    149147  uint8_t proto;
     
    217215/*------------------------------------------------------------------------------*/
    218216static unsigned char
    219 ipaddr_maskcmp(uint16_t *ipaddr, uint16_t *netipaddr, uint16_t *netmask)
    220 {
    221   return (ipaddr[0] & netmask [0]) == (netipaddr[0] & netmask[0]) &&
    222     (ipaddr[1] & netmask[1]) == (netipaddr[1] & netmask[1]);
     217ipaddr_maskcmp(uip_ipaddr_t *ipaddr,
     218               uip_ipaddr_t *netipaddr,
     219               uip_ipaddr_t *netmask)
     220{
     221  return (ipaddr->u16[0] & netmask->u16[0]) == (netipaddr->u16[0] & netmask->u16[0]) &&
     222    (ipaddr->u16[1] & netmask->u16[1]) == (netipaddr->u16[1] & netmask->u16[1]);
    223223}
    224224/*------------------------------------------------------------------------------*/
     
    254254  /* Set the IP destination address to be the source address of the
    255255     original packet. */
    256   tmp16= BUF->destipaddr[0];
    257   BUF->destipaddr[0] = BUF->srcipaddr[0];
    258   BUF->srcipaddr[0] = tmp16;
    259   tmp16 = BUF->destipaddr[1];
    260   BUF->destipaddr[1] = BUF->srcipaddr[1];
    261   BUF->srcipaddr[1] = tmp16;
     256  uip_ipaddr_copy(&BUF->destipaddr, &BUF->srcipaddr);
    262257
    263258  /* Set our IP address as the source address. */
    264   BUF->srcipaddr[0] = uip_hostaddr[0];
    265   BUF->srcipaddr[1] = uip_hostaddr[1];
     259  uip_ipaddr_copy(&BUF->srcipaddr, &uip_hostaddr);
    266260
    267261  /* The size of the ICMP time exceeded packet is 36 + the size of the
     
    269263  uip_len = 56;
    270264  ICMPBUF->len[0] = 0;
    271   ICMPBUF->len[1] = uip_len;
     265  ICMPBUF->len[1] = (uint8_t)uip_len;
    272266
    273267  /* Fill in the other fields in the IP header. */
     
    313307  fw->timer = FW_TIME;
    314308  fw->ipid = BUF->ipid;
    315   fw->srcipaddr[0] = BUF->srcipaddr[0];
    316   fw->srcipaddr[1] = BUF->srcipaddr[1];
    317   fw->destipaddr[0] = BUF->destipaddr[0];
    318   fw->destipaddr[1] = BUF->destipaddr[1];
     309  uip_ipaddr_copy(&fw->srcipaddr, &BUF->srcipaddr);
     310  uip_ipaddr_copy(&fw->destipaddr, &BUF->destipaddr);
    319311  fw->proto = BUF->proto;
    320312#if notdef
     
    340332  /* Walk through every network interface to check for a match. */
    341333  for(netif = netifs; netif != NULL; netif = netif->next) {
    342     if(ipaddr_maskcmp(BUF->destipaddr, netif->ipaddr,
    343                       netif->netmask)) {
     334    if(ipaddr_maskcmp(&BUF->destipaddr, &netif->ipaddr,
     335                      &netif->netmask)) {
    344336      /* If there was a match, we break the loop. */
    345337      return netif;
     
    371363{
    372364  struct uip_fw_netif *netif;
     365#if UIP_BROADCAST
     366  const struct uip_udpip_hdr *udp = (void *)BUF;
     367#endif /* UIP_BROADCAST */
    373368
    374369  if(uip_len == 0) {
     
    380375#if UIP_BROADCAST
    381376  /* Link local broadcasts go out on all interfaces. */
    382   if(/*BUF->proto == UIP_PROTO_UDP &&*/
    383      BUF->destipaddr[0] == 0xffff &&
    384      BUF->destipaddr[1] == 0xffff) {
     377  if(uip_ipaddr_cmp(&udp->destipaddr, &uip_broadcast_addr)) {
    385378    if(defaultnetif != NULL) {
    386379      defaultnetif->output();
     
    422415  /* First check if the packet is destined for ourselves and return 0
    423416     to indicate that the packet should be processed locally. */
    424   if(BUF->destipaddr[0] == uip_hostaddr[0] &&
    425      BUF->destipaddr[1] == uip_hostaddr[1]) {
     417  if(uip_ipaddr_cmp(&BUF->destipaddr, &uip_hostaddr)) {
    426418    return UIP_FW_LOCAL;
    427419  }
     
    430422     not yet configured, we should intercept all ICMP echo packets. */
    431423#if UIP_PINGADDRCONF
    432   if((uip_hostaddr[0] | uip_hostaddr[1]) == 0 &&
     424  if(uip_ipaddr_cmp(&uip_hostaddr, &uip_all_zeroes_addr) &&
    433425     BUF->proto == UIP_PROTO_ICMP &&
    434426     ICMPBUF->type == ICMP_ECHO) {
     
    447439#endif
    448440       fw->ipid == BUF->ipid &&
    449        fw->srcipaddr[0] == BUF->srcipaddr[0] &&
    450        fw->srcipaddr[1] == BUF->srcipaddr[1] &&
    451        fw->destipaddr[0] == BUF->destipaddr[0] &&
    452        fw->destipaddr[1] == BUF->destipaddr[1] &&
     441       uip_ipaddr_cmp(&fw->srcipaddr, &BUF->srcipaddr) &&
     442       uip_ipaddr_cmp(&fw->destipaddr, &BUF->destipaddr) &&
    453443#if notdef
    454444       fw->payload[0] == BUF->srcport &&
     
    464454     in the uip_buf buffer and forward that packet back to the sender
    465455     of the packet. */
     456
    466457  if(BUF->ttl <= 1) {
    467458    /* No time exceeded for broadcasts and multicasts! */
    468     if(BUF->destipaddr[0] == 0xffff && BUF->destipaddr[1] == 0xffff) {
     459    if(uip_ipaddr_cmp(&BUF->destipaddr, &uip_broadcast_addr)) {
    469460      return UIP_FW_LOCAL;
    470461    }
     
    476467 
    477468  /* Update the IP checksum. */
    478   if(BUF->ipchksum >= HTONS(0xffff - 0x0100)) {
    479     BUF->ipchksum = BUF->ipchksum + HTONS(0x0100) + 1;
     469  if(BUF->ipchksum >= UIP_HTONS(0xffff - 0x0100)) {
     470    BUF->ipchksum = BUF->ipchksum + UIP_HTONS(0x0100) + 1;
    480471  } else {
    481     BUF->ipchksum = BUF->ipchksum + HTONS(0x0100);
     472    BUF->ipchksum = BUF->ipchksum + UIP_HTONS(0x0100);
    482473  }
    483474
     
    488479
    489480#if UIP_BROADCAST
    490   if(BUF->destipaddr[0] == 0xffff && BUF->destipaddr[1] == 0xffff) {
     481  if(uip_ipaddr_cmp(&BUF->destipaddr, &uip_broadcast_addr)) {
    491482    return UIP_FW_LOCAL;
    492483  }
  • uKadecot/trunk/uip/net/ipv4/uip-fw.h

    r158 r262  
    5555  struct uip_fw_netif *next;  /**< Pointer to the next interface when
    5656                                 linked in a list. */
    57   uint16_t ipaddr[2];            /**< The IP address of this interface. */
    58   uint16_t netmask[2];           /**< The netmask of the interface. */
     57  uip_ipaddr_t ipaddr;            /**< The IP address of this interface. */
     58  uip_ipaddr_t netmask;           /**< The netmask of the interface. */
    5959  uint8_t (* output)(void);
    6060                              /**< A pointer to the function that
     
    6363
    6464/**
    65  * Intantiating macro for a uIP network interface.
     65 * Instantiating macro for a uIP network interface.
    6666 *
    6767 * Example:
     
    8080#define UIP_FW_NETIF(ip1,ip2,ip3,ip4, nm1,nm2,nm3,nm4, outputfunc) \
    8181        NULL, \
    82         {HTONS((ip1 << 8) | ip2), HTONS((ip3 << 8) | ip4)}, \
    83         {HTONS((nm1 << 8) | nm2), HTONS((nm3 << 8) | nm4)}, \
     82        { {ip1, ip2, ip3, ip4} }, \
     83        { {nm1, nm2, nm3, nm4} }, \
    8484        outputfunc
    8585
  • uKadecot/trunk/uip/net/ipv4/uip-neighbor.c

    r158 r262  
    8383/*---------------------------------------------------------------------------*/
    8484void
    85 uip_neighbor_add(uip_ipaddr_t ipaddr, struct uip_neighbor_addr *addr)
     85uip_neighbor_add(uip_ipaddr_t *ipaddr, struct uip_neighbor_addr *addr)
    8686{
    8787  int i, oldest;
     
    100100      break;
    101101    }
    102     if(uip_ipaddr_cmp(entries[i].ipaddr, addr)) {
     102    if(uip_ipaddr_cmp(&entries[i].ipaddr, ipaddr)) {
    103103      oldest = i;
    104104      break;
     
    113113     "oldest" variable). */
    114114  entries[oldest].time = 0;
    115   uip_ipaddr_copy(entries[oldest].ipaddr, ipaddr);
     115  uip_ipaddr_copy(&entries[oldest].ipaddr, ipaddr);
    116116  memcpy(&entries[oldest].addr, addr, sizeof(struct uip_neighbor_addr));
    117117}
    118118/*---------------------------------------------------------------------------*/
    119119static struct neighbor_entry *
    120 find_entry(uip_ipaddr_t ipaddr)
     120find_entry(uip_ipaddr_t *ipaddr)
    121121{
    122122  int i;
    123123 
    124124  for(i = 0; i < ENTRIES; ++i) {
    125     if(uip_ipaddr_cmp(entries[i].ipaddr, ipaddr)) {
     125    if(uip_ipaddr_cmp(&entries[i].ipaddr, ipaddr)) {
    126126      return &entries[i];
    127127    }
     
    131131/*---------------------------------------------------------------------------*/
    132132void
    133 uip_neighbor_update(uip_ipaddr_t ipaddr)
     133uip_neighbor_update(uip_ipaddr_t *ipaddr)
    134134{
    135135  struct neighbor_entry *e;
     
    142142/*---------------------------------------------------------------------------*/
    143143struct uip_neighbor_addr *
    144 uip_neighbor_lookup(uip_ipaddr_t ipaddr)
     144uip_neighbor_lookup(uip_ipaddr_t *ipaddr)
    145145{
    146146  struct neighbor_entry *e;
  • uKadecot/trunk/uip/net/ipv4/uip-neighbor.h

    r158 r262  
    5454
    5555void uip_neighbor_init(void);
    56 void uip_neighbor_add(uip_ipaddr_t ipaddr, struct uip_neighbor_addr *addr);
    57 void uip_neighbor_update(uip_ipaddr_t ipaddr);
    58 struct uip_neighbor_addr *uip_neighbor_lookup(uip_ipaddr_t ipaddr);
     56void uip_neighbor_add(uip_ipaddr_t *ipaddr, struct uip_neighbor_addr *addr);
     57void uip_neighbor_update(uip_ipaddr_t *ipaddr);
     58struct uip_neighbor_addr *uip_neighbor_lookup(uip_ipaddr_t *ipaddr);
    5959void uip_neighbor_periodic(void);
    6060
  • uKadecot/trunk/uip/net/ipv4/uip.c

    r158 r262  
    9999#if UIP_FIXEDADDR > 0
    100100const uip_ipaddr_t uip_hostaddr =
    101   {HTONS((UIP_IPADDR0 << 8) | UIP_IPADDR1),
    102    HTONS((UIP_IPADDR2 << 8) | UIP_IPADDR3)};
     101  { UIP_IPADDR0, UIP_IPADDR1, UIP_IPADDR2, UIP_IPADDR3 };
    103102const uip_ipaddr_t uip_draddr =
    104   {HTONS((UIP_DRIPADDR0 << 8) | UIP_DRIPADDR1),
    105    HTONS((UIP_DRIPADDR2 << 8) | UIP_DRIPADDR3)};
     103  { UIP_DRIPADDR0, UIP_DRIPADDR1, UIP_DRIPADDR2, UIP_DRIPADDR3 };
    106104const uip_ipaddr_t uip_netmask =
    107   {HTONS((UIP_NETMASK0 << 8) | UIP_NETMASK1),
    108    HTONS((UIP_NETMASK2 << 8) | UIP_NETMASK3)};
     105  { UIP_NETMASK0, UIP_NETMASK1, UIP_NETMASK2, UIP_NETMASK3 };
    109106#else
    110107uip_ipaddr_t uip_hostaddr, uip_draddr, uip_netmask;
    111108#endif /* UIP_FIXEDADDR */
    112109
    113 static const uip_ipaddr_t all_ones_addr =
     110const uip_ipaddr_t uip_broadcast_addr =
    114111#if UIP_CONF_IPV6
    115   {0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff};
     112  { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
     113      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } };
    116114#else /* UIP_CONF_IPV6 */
    117   {0xffff,0xffff};
     115  { { 0xff, 0xff, 0xff, 0xff } };
    118116#endif /* UIP_CONF_IPV6 */
    119 static const uip_ipaddr_t all_zeroes_addr =
    120 #if UIP_CONF_IPV6
    121   {0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000};
    122 #else /* UIP_CONF_IPV6 */
    123   {0x0000,0x0000};
    124 #endif /* UIP_CONF_IPV6 */
    125 
     117const uip_ipaddr_t uip_all_zeroes_addr = { { 0x0, /* rest is 0 */ } };
    126118
    127119#if UIP_FIXEDETHADDR
    128 const struct uip_eth_addr uip_ethaddr = {{UIP_ETHADDR0,
     120const struct uip_eth_addr uip_lladdr = {{UIP_ETHADDR0,
    129121                                          UIP_ETHADDR1,
    130122                                          UIP_ETHADDR2,
     
    133125                                          UIP_ETHADDR5}};
    134126#else
    135 struct uip_eth_addr uip_ethaddr = {{0,0,0,0,0,0}};
     127struct uip_eth_addr uip_lladdr = {{0,0,0,0,0,0}};
    136128#endif
    137129
     
    311303uip_chksum(uint16_t *data, uint16_t len)
    312304{
    313   return htons(chksum(0, (uint8_t *)data, len));
     305  return uip_htons(chksum(0, (uint8_t *)data, len));
    314306}
    315307/*---------------------------------------------------------------------------*/
     
    322314  sum = chksum(0, &uip_buf[UIP_LLH_LEN], UIP_IPH_LEN);
    323315  DEBUG_PRINTF("uip_ipchksum: sum 0x%04x\n", sum);
    324   return (sum == 0) ? 0xffff : htons(sum);
     316  return (sum == 0) ? 0xffff : uip_htons(sum);
    325317}
    326318#endif
     
    343335  sum = upper_layer_len + proto;
    344336  /* Sum IP source and destination addresses. */
    345   sum = chksum(sum, (uint8_t *)&BUF->srcipaddr[0], 2 * sizeof(uip_ipaddr_t));
     337  sum = chksum(sum, (uint8_t *)&BUF->srcipaddr, 2 * sizeof(uip_ipaddr_t));
    346338
    347339  /* Sum TCP header and data. */
     
    349341               upper_layer_len);
    350342
    351   return (sum == 0) ? 0xffff : htons(sum);
     343  return (sum == 0) ? 0xffff : uip_htons(sum);
    352344}
    353345/*---------------------------------------------------------------------------*/
     
    375367#endif /* UIP_UDP_CHECKSUMS */
    376368#endif /* UIP_ARCH_CHKSUM */
    377 uint8_t
    378 uip_ismulticast(uip_ipaddr_t ipaddr)
    379 {
    380 #if UIP_CONF_IPV6
    381   return 0;
    382 #else
    383   static const uint16_t multicast_ipaddr[2] = { 0x00e0, 0x0000 };
    384   static const uint16_t multicast_mask[2] = { 0x00f0, 0x0000 };
    385   return uip_ipaddr_maskcmp(ipaddr, multicast_ipaddr, multicast_mask);
    386 #endif
    387 }
    388369/*---------------------------------------------------------------------------*/
    389370void
     
    433414    conn = &uip_conns[c];
    434415    if(conn->tcpstateflags != UIP_CLOSED &&
    435        conn->lport == htons(lastport)) {
     416       conn->lport == uip_htons(lastport)) {
    436417      goto again;
    437418    }
     
    472453  conn->sa = 0;
    473454  conn->sv = 16;   /* Initial value of the RTT variance. */
    474   conn->lport = htons(lastport);
     455  conn->lport = uip_htons(lastport);
    475456  conn->rport = rport;
    476457  uip_ipaddr_copy(&conn->ripaddr, ripaddr);
     
    482463#if UIP_UDP
    483464struct uip_udp_conn *
    484 uip_udp_new(uip_ipaddr_t *ripaddr, uint16_t rport)
     465uip_udp_new(const uip_ipaddr_t *ripaddr, uint16_t rport)
    485466{
    486467  register struct uip_udp_conn *conn;
     
    495476
    496477  for(c = 0; c < UIP_UDP_CONNS; ++c) {
    497     if(uip_udp_conns[c].lport == htons(lastport)) {
     478    if(uip_udp_conns[c].lport == uip_htons(lastport)) {
    498479      goto again;
    499480    }
     
    513494  }
    514495
    515   conn->lport = HTONS(lastport);
     496  conn->lport = UIP_HTONS(lastport);
    516497  conn->rport = rport;
    517498  if(ripaddr == NULL) {
    518     memset(conn->ripaddr, 0, sizeof(uip_ipaddr_t));
     499    memset(&conn->ripaddr, 0, sizeof(uip_ipaddr_t));
    519500  } else {
    520501    uip_ipaddr_copy(&conn->ripaddr, ripaddr);
     
    748729         connection's timer and see if it has reached the RTO value
    749730         in which case we retransmit. */
     731
    750732      if(uip_outstanding(uip_connr)) {
    751733        if(uip_connr->timer-- == 0) {
     
    901883#endif /* UIP_CONF_IPV6 */
    902884
    903   if(uip_ipaddr_cmp(uip_hostaddr, all_zeroes_addr)) {
     885  if(uip_ipaddr_cmp(&uip_hostaddr, &uip_all_zeroes_addr)) {
    904886    /* If we are configured to use ping IP address configuration and
    905887       hasn't been assigned an IP address yet, we accept all ICMP
     
    921903    DEBUG_PRINTF("UDP IP checksum 0x%04x\n", uip_ipchksum());
    922904    if(BUF->proto == UIP_PROTO_UDP &&
    923        (uip_ipaddr_cmp(BUF->destipaddr, all_ones_addr) ||
    924        uip_ismulticast(BUF->destipaddr))
    925        /*&&
    926          uip_ipchksum() == 0xffff*/) {
     905       (uip_ipaddr_cmp(&BUF->destipaddr, &uip_broadcast_addr) ||
     906        (BUF->destipaddr.u8[0] & 224) == 224)) {  /* XXX this is a
     907                                                     hack to be able
     908                                                     to receive UDP
     909                                                     multicast
     910                                                     packets. We check
     911                                                     for the bit
     912                                                     pattern of the
     913                                                     multicast
     914                                                     prefix. */
    927915      goto udp_input;
    928916    }
     
    931919    /* Check if the packet is destined for our IP address. */
    932920#if !UIP_CONF_IPV6
    933     if(!uip_ipaddr_cmp(BUF->destipaddr, uip_hostaddr)) {
     921    if(!uip_ipaddr_cmp(&BUF->destipaddr, &uip_hostaddr)) {
    934922      UIP_STAT(++uip_stat.ip.drop);
    935923      goto drop;
     
    941929       address) as well. However, we will cheat here and accept all
    942930       multicast packets that are sent to the ff02::/16 addresses. */
    943     if(!uip_ipaddr_cmp(BUF->destipaddr, uip_hostaddr) &&
    944        BUF->destipaddr[0] != HTONS(0xff02)) {
     931    if(!uip_ipaddr_cmp(&BUF->destipaddr, &uip_hostaddr) &&
     932       BUF->destipaddr.u16[0] != UIP_HTONS(0xff02)) {
    945933      UIP_STAT(++uip_stat.ip.drop);
    946934      goto drop;
     
    1000988     ourself. */
    1001989#if UIP_PINGADDRCONF
    1002   if((uip_hostaddr[0] | uip_hostaddr[1]) == 0) {
    1003     uip_hostaddr[0] = BUF->destipaddr[0];
    1004     uip_hostaddr[1] = BUF->destipaddr[1];
     990  if(uip_ipaddr_cmp(&uip_hostaddr, &uip_all_zeroes_addr)) {
     991    uip_hostaddr = BUF->destipaddr;
    1005992  }
    1006993#endif /* UIP_PINGADDRCONF */
     
    1008995  ICMPBUF->type = ICMP_ECHO_REPLY;
    1009996
    1010   if(ICMPBUF->icmpchksum >= HTONS(0xffff - (ICMP_ECHO << 8))) {
    1011     ICMPBUF->icmpchksum += HTONS(ICMP_ECHO << 8) + 1;
     997  if(ICMPBUF->icmpchksum >= UIP_HTONS(0xffff - (ICMP_ECHO << 8))) {
     998    ICMPBUF->icmpchksum += UIP_HTONS(ICMP_ECHO << 8) + 1;
    1012999  } else {
    1013     ICMPBUF->icmpchksum += HTONS(ICMP_ECHO << 8);
     1000    ICMPBUF->icmpchksum += UIP_HTONS(ICMP_ECHO << 8);
    10141001  }
    10151002
    10161003  /* Swap IP addresses. */
    1017   uip_ipaddr_copy(BUF->destipaddr, BUF->srcipaddr);
    1018   uip_ipaddr_copy(BUF->srcipaddr, uip_hostaddr);
     1004  uip_ipaddr_copy(&BUF->destipaddr, &BUF->srcipaddr);
     1005  uip_ipaddr_copy(&BUF->srcipaddr, &uip_hostaddr);
    10191006
    10201007  UIP_STAT(++uip_stat.icmp.sent);
    1021   goto send;
     1008  BUF->ttl = UIP_TTL;
     1009  goto ip_send_nolen;
    10221010
    10231011  /* End of IPv4 input header processing code. */
     
    10401028     a neighbor advertisement message back. */
    10411029  if(ICMPBUF->type == ICMP6_NEIGHBOR_SOLICITATION) {
    1042     if(uip_ipaddr_cmp(ICMPBUF->icmp6data, uip_hostaddr)) {
     1030    if(uip_ipaddr_cmp(&ICMPBUF->icmp6data, &uip_hostaddr)) {
    10431031
    10441032      if(ICMPBUF->options[0] == ICMP6_OPTION_SOURCE_LINK_ADDRESS) {
    10451033        /* Save the sender's address in our neighbor list. */
    1046         uip_neighbor_add(ICMPBUF->srcipaddr, &(ICMPBUF->options[2]));
     1034        uip_neighbor_add(&ICMPBUF->srcipaddr, &(ICMPBUF->options[2]));
    10471035      }
    10481036
     
    10541042      ICMPBUF->reserved1 = ICMPBUF->reserved2 = ICMPBUF->reserved3 = 0;
    10551043
    1056       uip_ipaddr_copy(ICMPBUF->destipaddr, ICMPBUF->srcipaddr);
    1057       uip_ipaddr_copy(ICMPBUF->srcipaddr, uip_hostaddr);
     1044      uip_ipaddr_copy(&ICMPBUF->destipaddr, &ICMPBUF->srcipaddr);
     1045      uip_ipaddr_copy(&ICMPBUF->srcipaddr, &uip_hostaddr);
    10581046      ICMPBUF->options[0] = ICMP6_OPTION_TARGET_LINK_ADDRESS;
    10591047      ICMPBUF->options[1] = 1;  /* Options length, 1 = 8 bytes. */
    1060       memcpy(&(ICMPBUF->options[2]), &uip_ethaddr, sizeof(uip_ethaddr));
     1048      memcpy(&(ICMPBUF->options[2]), &uip_lladdr, sizeof(uip_lladdr));
    10611049      ICMPBUF->icmpchksum = 0;
    10621050      ICMPBUF->icmpchksum = ~uip_icmp6chksum();
     1051
    10631052      goto send;
    10641053
     
    10721061    ICMPBUF->type = ICMP6_ECHO_REPLY;
    10731062
    1074     uip_ipaddr_copy(BUF->destipaddr, BUF->srcipaddr);
    1075     uip_ipaddr_copy(BUF->srcipaddr, uip_hostaddr);
     1063    uip_ipaddr_copy(&BUF->destipaddr, &BUF->srcipaddr);
     1064    uip_ipaddr_copy(&BUF->srcipaddr, &uip_hostaddr);
    10761065    ICMPBUF->icmpchksum = 0;
    10771066    ICMPBUF->icmpchksum = ~uip_icmp6chksum();
     
    11101099  uip_len = uip_len - UIP_IPUDPH_LEN;
    11111100#endif /* UIP_UDP_CHECKSUMS */
     1101
     1102  /* Make sure that the UDP destination port number is not zero. */
     1103  if(UDPBUF->destport == 0) {
     1104    UIP_LOG("udp: zero port.");
     1105    goto drop;
     1106  }
    11121107
    11131108  /* Demultiplex this UDP packet between the UDP "connections". */
     
    11261121       (uip_udp_conn->rport == 0 ||
    11271122        UDPBUF->srcport == uip_udp_conn->rport) &&
    1128        (uip_ipaddr_cmp(uip_udp_conn->ripaddr, all_zeroes_addr) ||
    1129         uip_ipaddr_cmp(uip_udp_conn->ripaddr, all_ones_addr) ||
    1130         uip_ipaddr_cmp(BUF->srcipaddr, uip_udp_conn->ripaddr))) {
     1123       (uip_ipaddr_cmp(&uip_udp_conn->ripaddr, &uip_all_zeroes_addr) ||
     1124        uip_ipaddr_cmp(&uip_udp_conn->ripaddr, &uip_broadcast_addr) ||
     1125        uip_ipaddr_cmp(&BUF->srcipaddr, &uip_udp_conn->ripaddr))) {
    11311126      goto udp_found;
    11321127    }
     
    11411136  uip_slen = 0;
    11421137  UIP_UDP_APPCALL();
     1138
    11431139 udp_send:
    11441140  if(uip_slen == 0) {
     
    11601156  BUF->proto = UIP_PROTO_UDP;
    11611157
    1162   UDPBUF->udplen = HTONS(uip_slen + UIP_UDPH_LEN);
     1158  UDPBUF->udplen = UIP_HTONS(uip_slen + UIP_UDPH_LEN);
    11631159  UDPBUF->udpchksum = 0;
    11641160
     
    11661162  BUF->destport = uip_udp_conn->rport;
    11671163
    1168   uip_ipaddr_copy(BUF->srcipaddr, uip_hostaddr);
    1169   uip_ipaddr_copy(BUF->destipaddr, uip_udp_conn->ripaddr);
     1164  uip_ipaddr_copy(&BUF->srcipaddr, &uip_hostaddr);
     1165  uip_ipaddr_copy(&BUF->destipaddr, &uip_udp_conn->ripaddr);
    11701166
    11711167  uip_appdata = &uip_buf[UIP_LLH_LEN + UIP_IPTCPH_LEN];
     
    11961192  }
    11971193
     1194  /* Make sure that the TCP port number is not zero. */
     1195  if(BUF->destport == 0 || BUF->srcport == 0) {
     1196    UIP_LOG("tcp: zero port.");
     1197    goto drop;
     1198  }
    11981199
    11991200  /* Demultiplex this segment. */
     
    12041205       BUF->destport == uip_connr->lport &&
    12051206       BUF->srcport == uip_connr->rport &&
    1206        uip_ipaddr_cmp(BUF->srcipaddr, uip_connr->ripaddr)) {
     1207       uip_ipaddr_cmp(&BUF->srcipaddr, &uip_connr->ripaddr)) {
    12071208      goto found;
    12081209    }
     
    12201221  /* Next, check listening connections. */
    12211222  for(c = 0; c < UIP_LISTENPORTS; ++c) {
    1222     if(tmp16 == uip_listenports[c])
     1223    if(tmp16 == uip_listenports[c]) {
    12231224      goto found_listen;
     1225    }
    12241226  }
    12251227
    12261228  /* No matching connection found, so we send a RST packet. */
    12271229  UIP_STAT(++uip_stat.tcp.synrst);
     1230
    12281231 reset:
    1229 
    12301232  /* We do not send resets in response to resets. */
    12311233  if(BUF->flags & TCP_RST) {
     
    12731275
    12741276  /* Swap IP addresses. */
    1275   uip_ipaddr_copy(BUF->destipaddr, BUF->srcipaddr);
    1276   uip_ipaddr_copy(BUF->srcipaddr, uip_hostaddr);
     1277  uip_ipaddr_copy(&BUF->destipaddr, &BUF->srcipaddr);
     1278  uip_ipaddr_copy(&BUF->srcipaddr, &uip_hostaddr);
    12771279
    12781280  /* And send out the RST packet! */
     
    12831285     connection and send a SYNACK in return. */
    12841286 found_listen:
    1285   /* First we check if there are any connections avaliable. Unused
     1287  /* First we check if there are any connections available. Unused
    12861288     connections are kept in the same table as used connections, but
    12871289     unused ones have the tcpstate set to CLOSED. Also, connections in
     
    13201322  uip_connr->lport = BUF->destport;
    13211323  uip_connr->rport = BUF->srcport;
    1322   uip_ipaddr_copy(uip_connr->ripaddr, BUF->srcipaddr);
     1324  uip_ipaddr_copy(&uip_connr->ripaddr, &BUF->srcipaddr);
    13231325  uip_connr->tcpstateflags = UIP_SYN_RCVD;
    13241326
     
    14061408    goto drop;
    14071409  }
    1408   /* Calculated the length of the data, if the application has sent
     1410  /* Calculate the length of the data, if the application has sent
    14091411     any data to us. */
    14101412  c = (BUF->tcpoffset >> 4) << 2;
     
    14161418  /* First, check if the sequence number of the incoming packet is
    14171419     what we're expecting next. If not, we send out an ACK with the
    1418      correct numbers in. */
    1419   if(!(((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_SYN_SENT) &&
    1420        ((BUF->flags & TCP_CTL) == (TCP_SYN | TCP_ACK)))) {
     1420     correct numbers in, unless we are in the SYN_RCVD state and
     1421     receive a SYN, in which case we should retransmit our SYNACK
     1422     (which is done futher down). */
     1423  if(!((((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_SYN_SENT) &&
     1424        ((BUF->flags & TCP_CTL) == (TCP_SYN | TCP_ACK))) ||
     1425       (((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_SYN_RCVD) &&
     1426        ((BUF->flags & TCP_CTL) == TCP_SYN)))) {
    14211427    if((uip_len > 0 || ((BUF->flags & (TCP_SYN | TCP_FIN)) != 0)) &&
    14221428       (BUF->seqno[0] != uip_connr->rcv_nxt[0] ||
     
    14441450      uip_connr->snd_nxt[2] = uip_acc32[2];
    14451451      uip_connr->snd_nxt[3] = uip_acc32[3];
    1446 
    14471452
    14481453      /* Do RTT estimation, unless we have done retransmissions. */
     
    14951500      goto appsend;
    14961501    }
     1502    /* We need to retransmit the SYNACK */
     1503    if((BUF->flags & TCP_CTL) == TCP_SYN) {
     1504      goto tcp_send_synack;
     1505    }
    14971506    goto drop;
    14981507#if UIP_ACTIVE_OPEN
     
    17981807  goto drop;
    17991808
    1800 
    18011809  /* We jump here when we are ready to send the packet, and just want
    18021810     to set the appropriate TCP sequence numbers in the TCP header. */
    18031811 tcp_send_ack:
    18041812  BUF->flags = TCP_ACK;
     1813
    18051814 tcp_send_nodata:
    18061815  uip_len = UIP_IPTCPH_LEN;
     1816
    18071817 tcp_send_noopts:
    18081818  BUF->tcpoffset = (UIP_TCPH_LEN / 4) << 4;
    1809  tcp_send:
     1819
    18101820  /* We're done with the input processing. We are now ready to send a
    18111821     reply. Our job is to fill in all the fields of the TCP and IP
    18121822     headers before calculating the checksum and finally send the
    18131823     packet. */
     1824 tcp_send:
    18141825  BUF->ackno[0] = uip_connr->rcv_nxt[0];
    18151826  BUF->ackno[1] = uip_connr->rcv_nxt[1];
     
    18271838  BUF->destport = uip_connr->rport;
    18281839
    1829   uip_ipaddr_copy(BUF->srcipaddr, uip_hostaddr);
    1830   uip_ipaddr_copy(BUF->destipaddr, uip_connr->ripaddr);
     1840  uip_ipaddr_copy(&BUF->srcipaddr, &uip_hostaddr);
     1841  uip_ipaddr_copy(&BUF->destipaddr, &uip_connr->ripaddr);
    18311842
    18321843  if(uip_connr->tcpstateflags & UIP_STOPPED) {
     
    18581869
    18591870 ip_send_nolen:
    1860 
    18611871#if UIP_CONF_IPV6
    18621872  BUF->vtc = 0x60;
     
    18751885  DEBUG_PRINTF("uip ip_send_nolen: chkecum 0x%04x\n", uip_ipchksum());
    18761886#endif /* UIP_CONF_IPV6 */
    1877 
    18781887  UIP_STAT(++uip_stat.tcp.sent);
     1888#if UIP_CONF_IPV6
    18791889 send:
     1890#endif /* UIP_CONF_IPV6 */
    18801891  DEBUG_PRINTF("Sending packet with length %d (%d)\n", uip_len,
    18811892               (BUF->len[0] << 8) | BUF->len[1]);
     
    18851896  uip_flags = 0;
    18861897  return;
     1898
    18871899 drop:
    18881900  uip_len = 0;
     
    18921904/*---------------------------------------------------------------------------*/
    18931905uint16_t
    1894 htons(uint16_t val)
     1906uip_htons(uint16_t val)
    18951907{
    1896   return HTONS(val);
     1908  return UIP_HTONS(val);
    18971909}
    18981910/*---------------------------------------------------------------------------*/
  • uKadecot/trunk/uip/net/ipv4/uip_arp.c

    r158 r262  
    7878  uint16_t opcode;
    7979  struct uip_eth_addr shwaddr;
    80   uint16_t sipaddr[2];
     80  uip_ipaddr_t sipaddr;
    8181  struct uip_eth_addr dhwaddr;
    82   uint16_t dipaddr[2];
     82  uip_ipaddr_t dipaddr;
    8383};
    8484
     
    9494    proto;
    9595  uint16_t ipchksum;
    96   uint16_t srcipaddr[2],
    97     destipaddr[2];
     96  uip_ipaddr_t srcipaddr, destipaddr;
    9897};
    9998
     
    110109
    111110struct arp_entry {
    112   uint16_t ipaddr[2];
     111  uip_ipaddr_t ipaddr;
    113112  struct uip_eth_addr ethaddr;
    114113  uint8_t time;
     
    118117  {{0xff,0xff,0xff,0xff,0xff,0xff}};
    119118static const uint16_t broadcast_ipaddr[2] = {0xffff,0xffff};
    120 static const uint16_t multicast_ipaddr[2] = { 0x00e0, 0x0000 };
    121 static const uint16_t multicast_mask[2] = { 0x00f0, 0x0000 };
    122119
    123120static struct arp_entry arp_table[UIP_ARPTAB_SIZE];
    124 static uint16_t ipaddr[2];
     121static uip_ipaddr_t ipaddr;
    125122static uint8_t i, c;
    126123
     
    140137{
    141138  for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
    142     memset(arp_table[i].ipaddr, 0, 4);
     139    memset(&arp_table[i].ipaddr, 0, 4);
    143140  }
    144141}
     
    161158  for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
    162159    tabptr = &arp_table[i];
    163     if((tabptr->ipaddr[0] | tabptr->ipaddr[1]) != 0 &&
     160    if(uip_ipaddr_cmp(&tabptr->ipaddr, &uip_all_zeroes_addr) &&
    164161       arptime - tabptr->time >= UIP_ARP_MAXAGE) {
    165       memset(tabptr->ipaddr, 0, 4);
    166     }
    167   }
    168 
    169 }
     162      memset(&tabptr->ipaddr, 0, 4);
     163    }
     164  }
     165
     166}
     167
    170168/*-----------------------------------------------------------------------------------*/
    171169static void
    172 uip_arp_update(uint16_t *ipaddr, struct uip_eth_addr *ethaddr)
    173 {
    174   register struct arp_entry *tabptr = NULL;
     170uip_arp_update(uip_ipaddr_t *ipaddr, struct uip_eth_addr *ethaddr)
     171{
     172  register struct arp_entry *tabptr = arp_table;
     173
    175174  /* Walk through the ARP mapping table and try to find an entry to
    176175     update. If none is found, the IP -> MAC address mapping is
    177176     inserted in the ARP table. */
    178177  for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
    179 
    180178    tabptr = &arp_table[i];
     179
    181180    /* Only check those entries that are actually in use. */
    182     if(tabptr->ipaddr[0] != 0 &&
    183        tabptr->ipaddr[1] != 0) {
     181    if(!uip_ipaddr_cmp(&tabptr->ipaddr, &uip_all_zeroes_addr)) {
    184182
    185183      /* Check if the source IP address of the incoming packet matches
    186184         the IP address in this ARP table entry. */
    187       if(ipaddr[0] == tabptr->ipaddr[0] &&
    188          ipaddr[1] == tabptr->ipaddr[1]) {
     185      if(uip_ipaddr_cmp(ipaddr, &tabptr->ipaddr)) {
    189186
    190187        /* An old entry found, update this and return. */
     
    203200  for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
    204201    tabptr = &arp_table[i];
    205     if(tabptr->ipaddr[0] == 0 &&
    206        tabptr->ipaddr[1] == 0) {
     202    if(uip_ipaddr_cmp(&tabptr->ipaddr, &uip_all_zeroes_addr)) {
    207203      break;
    208204    }
     
    227223  /* Now, i is the ARP table entry which we will fill with the new
    228224     information. */
    229   memcpy(tabptr->ipaddr, ipaddr, 4);
     225  uip_ipaddr_copy(&tabptr->ipaddr, ipaddr);
    230226  memcpy(tabptr->ethaddr.addr, ethaddr->addr, 6);
    231227  tabptr->time = arptime;
     
    300296
    301297  switch(BUF->opcode) {
    302   case HTONS(ARP_REQUEST):
     298  case UIP_HTONS(ARP_REQUEST):
    303299    /* ARP request. If it asked for our address, we send out a
    304300       reply. */
    305     if(uip_ipaddr_cmp(BUF->dipaddr, uip_hostaddr)) {
     301    if(uip_ipaddr_cmp(&BUF->dipaddr, &uip_hostaddr)) {
    306302      /* First, we register the one who made the request in our ARP
    307303         table, since it is likely that we will do more communication
    308304         with this host in the future. */
    309       uip_arp_update(BUF->sipaddr, &BUF->shwaddr);
     305      uip_arp_update(&BUF->sipaddr, &BUF->shwaddr);
    310306
    311307      /* The reply opcode is 2. */
    312       BUF->opcode = HTONS(2);
     308      BUF->opcode = UIP_HTONS(2);
    313309
    314310      memcpy(BUF->dhwaddr.addr, BUF->shwaddr.addr, 6);
    315       memcpy(BUF->shwaddr.addr, uip_ethaddr.addr, 6);
    316       memcpy(BUF->ethhdr.src.addr, uip_ethaddr.addr, 6);
     311      memcpy(BUF->shwaddr.addr, uip_lladdr.addr, 6);
     312      memcpy(BUF->ethhdr.src.addr, uip_lladdr.addr, 6);
    317313      memcpy(BUF->ethhdr.dest.addr, BUF->dhwaddr.addr, 6);
    318314
    319       BUF->dipaddr[0] = BUF->sipaddr[0];
    320       BUF->dipaddr[1] = BUF->sipaddr[1];
    321       BUF->sipaddr[0] = uip_hostaddr[0];
    322       BUF->sipaddr[1] = uip_hostaddr[1];
    323 
    324       BUF->ethhdr.type = HTONS(UIP_ETHTYPE_ARP);
     315      uip_ipaddr_copy(&BUF->dipaddr, &BUF->sipaddr);
     316      uip_ipaddr_copy(&BUF->sipaddr, &uip_hostaddr);
     317
     318      BUF->ethhdr.type = UIP_HTONS(UIP_ETHTYPE_ARP);
    325319      uip_len = sizeof(struct arp_hdr);
    326320    }
    327321    break;
    328   case HTONS(ARP_REPLY):
     322  case UIP_HTONS(ARP_REPLY):
    329323    /* ARP reply. We insert or update the ARP table if it was meant
    330324       for us. */
    331     if(uip_ipaddr_cmp(BUF->dipaddr, uip_hostaddr)) {
    332       uip_arp_update(BUF->sipaddr, &BUF->shwaddr);
     325    if(uip_ipaddr_cmp(&BUF->dipaddr, &uip_hostaddr)) {
     326      uip_arp_update(&BUF->sipaddr, &BUF->shwaddr);
    333327    }
    334328    break;
     
    378372
    379373  /* First check if destination is a local broadcast. */
    380   if(uip_ipaddr_cmp(IPBUF->destipaddr, broadcast_ipaddr)) {
     374  if(uip_ipaddr_cmp(&IPBUF->destipaddr, &uip_broadcast_addr)) {
    381375    memcpy(IPBUF->ethhdr.dest.addr, broadcast_ethaddr.addr, 6);
    382   }
    383   else if(uip_ipaddr_maskcmp(IPBUF->destipaddr, multicast_ipaddr, multicast_mask)) {
     376  } else if(IPBUF->destipaddr.u8[0] == 224) {
     377    /* Multicast. */
    384378    IPBUF->ethhdr.dest.addr[0] = 0x01;
    385379    IPBUF->ethhdr.dest.addr[1] = 0x00;
    386     IPBUF->ethhdr.dest.addr[2] = 0x5E;
    387     IPBUF->ethhdr.dest.addr[3] = uip_ipaddr2(IPBUF->destipaddr) & 0x7F;
    388     IPBUF->ethhdr.dest.addr[4] = uip_ipaddr3(IPBUF->destipaddr);
    389     IPBUF->ethhdr.dest.addr[5] = uip_ipaddr4(IPBUF->destipaddr);
     380    IPBUF->ethhdr.dest.addr[2] = 0x5e;
     381    IPBUF->ethhdr.dest.addr[3] = IPBUF->destipaddr.u8[1];
     382    IPBUF->ethhdr.dest.addr[4] = IPBUF->destipaddr.u8[2];
     383    IPBUF->ethhdr.dest.addr[5] = IPBUF->destipaddr.u8[3];
    390384  } else {
    391385    /* Check if the destination address is on the local network. */
    392     if(!uip_ipaddr_maskcmp(IPBUF->destipaddr, uip_hostaddr, uip_netmask)) {
     386    if(!uip_ipaddr_maskcmp(&IPBUF->destipaddr, &uip_hostaddr, &uip_netmask)) {
    393387      /* Destination address was not on the local network, so we need to
    394388         use the default router's IP address instead of the destination
    395389         address when determining the MAC address. */
    396       uip_ipaddr_copy(ipaddr, uip_draddr);
     390      uip_ipaddr_copy(&ipaddr, &uip_draddr);
    397391    } else {
    398392      /* Else, we use the destination IP address. */
    399       uip_ipaddr_copy(ipaddr, IPBUF->destipaddr);
    400     }
    401 
     393      uip_ipaddr_copy(&ipaddr, &IPBUF->destipaddr);
     394    }
    402395    for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
    403396      tabptr = &arp_table[i];
    404       if(uip_ipaddr_cmp(ipaddr, tabptr->ipaddr)) {
     397      if(uip_ipaddr_cmp(&ipaddr, &tabptr->ipaddr)) {
    405398        break;
    406399      }
     
    413406      memset(BUF->ethhdr.dest.addr, 0xff, 6);
    414407      memset(BUF->dhwaddr.addr, 0x00, 6);
    415       memcpy(BUF->ethhdr.src.addr, uip_ethaddr.addr, 6);
    416       memcpy(BUF->shwaddr.addr, uip_ethaddr.addr, 6);
    417 
    418       uip_ipaddr_copy(BUF->dipaddr, ipaddr);
    419       uip_ipaddr_copy(BUF->sipaddr, uip_hostaddr);
    420       BUF->opcode = HTONS(ARP_REQUEST); /* ARP request. */
    421       BUF->hwtype = HTONS(ARP_HWTYPE_ETH);
    422       BUF->protocol = HTONS(UIP_ETHTYPE_IP);
     408      memcpy(BUF->ethhdr.src.addr, uip_lladdr.addr, 6);
     409      memcpy(BUF->shwaddr.addr, uip_lladdr.addr, 6);
     410
     411      uip_ipaddr_copy(&BUF->dipaddr, &ipaddr);
     412      uip_ipaddr_copy(&BUF->sipaddr, &uip_hostaddr);
     413      BUF->opcode = UIP_HTONS(ARP_REQUEST); /* ARP request. */
     414      BUF->hwtype = UIP_HTONS(ARP_HWTYPE_ETH);
     415      BUF->protocol = UIP_HTONS(UIP_ETHTYPE_IP);
    423416      BUF->hwlen = 6;
    424417      BUF->protolen = 4;
    425       BUF->ethhdr.type = HTONS(UIP_ETHTYPE_ARP);
     418      BUF->ethhdr.type = UIP_HTONS(UIP_ETHTYPE_ARP);
    426419
    427420      uip_appdata = &uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN];
     
    434427    memcpy(IPBUF->ethhdr.dest.addr, tabptr->ethaddr.addr, 6);
    435428  }
    436   memcpy(IPBUF->ethhdr.src.addr, uip_ethaddr.addr, 6);
    437 
    438   IPBUF->ethhdr.type = HTONS(UIP_ETHTYPE_IP);
     429  memcpy(IPBUF->ethhdr.src.addr, uip_lladdr.addr, 6);
     430
     431  IPBUF->ethhdr.type = UIP_HTONS(UIP_ETHTYPE_IP);
    439432
    440433  uip_len += sizeof(struct uip_eth_hdr);
     
    444437/** @} */
    445438/** @} */
     439
  • uKadecot/trunk/uip/net/ipv4/uip_arp.h

    r158 r262  
    6161#endif
    6262
    63 extern struct uip_eth_addr uip_ethaddr;
     63extern struct uip_eth_addr uip_lladdr;
    6464
    6565/**
     
    143143 * \hideinitializer
    144144 */
    145 #define uip_setethaddr(eaddr) do {uip_ethaddr.addr[0] = eaddr.addr[0]; \
    146                               uip_ethaddr.addr[1] = eaddr.addr[1];\
    147                               uip_ethaddr.addr[2] = eaddr.addr[2];\
    148                               uip_ethaddr.addr[3] = eaddr.addr[3];\
    149                               uip_ethaddr.addr[4] = eaddr.addr[4];\
    150                               uip_ethaddr.addr[5] = eaddr.addr[5];} while(0)
     145#define uip_setethaddr(eaddr) do {uip_lladdr.addr[0] = eaddr.addr[0]; \
     146                              uip_lladdr.addr[1] = eaddr.addr[1];\
     147                              uip_lladdr.addr[2] = eaddr.addr[2];\
     148                              uip_lladdr.addr[3] = eaddr.addr[3];\
     149                              uip_lladdr.addr[4] = eaddr.addr[4];\
     150                              uip_lladdr.addr[5] = eaddr.addr[5];} while(0)
    151151
    152152/** @} */
    153 /** @} */
     153
    154154
    155155#endif /* __UIP_ARP_H__ */
     156/** @} */
Note: See TracChangeset for help on using the changeset viewer.