/[lwip]/lwip/src/netif/etharp.c
ViewVC logotype

Diff of /lwip/src/netif/etharp.c

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

revision 1.11 by likewise, Mon Nov 18 10:31:05 2002 UTC revision 1.12 by likewise, Thu Nov 28 09:26:18 2002 UTC
# Line 3  Line 3 
3   * Address Resolution Protocol module for IP over Ethernet   * Address Resolution Protocol module for IP over Ethernet
4   *   *
5   * $Log$   * $Log$
6     * Revision 1.12  2002/11/28 09:26:18  likewise
7     * All ARP queueing code is now conditionally compiled-in.
8     *
9   * Revision 1.11  2002/11/18 10:31:05  likewise   * Revision 1.11  2002/11/18 10:31:05  likewise
10   * Conditionally have ARP queue outgoing pbufs.   * Conditionally have ARP queue outgoing pbufs.
11   *   *
# Line 105  RFC 3220 4.6          IP Mobility Suppor Line 108  RFC 3220 4.6          IP Mobility Suppor
108  #ifndef ETHARP_SNOOP_UPDATES  #ifndef ETHARP_SNOOP_UPDATES
109  #  define ETHARP_SNOOP_UPDATES 0  #  define ETHARP_SNOOP_UPDATES 0
110  #endif  #endif
   
111    
112  #define HWTYPE_ETHERNET 1  #define HWTYPE_ETHERNET 1
113    
# Line 129  struct etharp_entry { Line 131  struct etharp_entry {
131    struct ip_addr ipaddr;    struct ip_addr ipaddr;
132    struct eth_addr ethaddr;    struct eth_addr ethaddr;
133    enum etharp_state state;    enum etharp_state state;
134    #if ARP_QUEUEING
135    struct pbuf *p;    struct pbuf *p;
136    #endif
137    u8_t ctime;    u8_t ctime;
138  };  };
139    
# Line 177  etharp_tmr(void) Line 181  etharp_tmr(void)
181                (ctime - arp_table[i].ctime >= ARP_MAXPENDING)) {                (ctime - arp_table[i].ctime >= ARP_MAXPENDING)) {
182        DEBUGF(ETHARP_DEBUG, ("etharp_timer: expired pending entry %u - dequeueing %p.\n", i, arp_table[i].p));        DEBUGF(ETHARP_DEBUG, ("etharp_timer: expired pending entry %u - dequeueing %p.\n", i, arp_table[i].p));
183        arp_table[i].state = ETHARP_STATE_EMPTY;        arp_table[i].state = ETHARP_STATE_EMPTY;
184    #if ARP_QUEUEING
185        /* remove any queued packet */        /* remove any queued packet */
186        pbuf_free(arp_table[i].p);              pbuf_free(arp_table[i].p);      
187        arp_table[i].p = NULL;        arp_table[i].p = NULL;
188    #endif
189      }      }
190    }      }  
191  }  }
# Line 240  static struct pbuf * Line 246  static struct pbuf *
246  update_arp_entry(struct ip_addr *ipaddr, struct eth_addr *ethaddr, u8_t flags)  update_arp_entry(struct ip_addr *ipaddr, struct eth_addr *ethaddr, u8_t flags)
247  {  {
248    u8_t i, k;    u8_t i, k;
   struct pbuf *p;  
249    struct eth_hdr *ethhdr;    struct eth_hdr *ethhdr;
250    #if ARP_QUEUEING
251      struct pbuf *p;
252    #endif
253    
254    /* Walk through the ARP mapping table and try to find an entry to    /* Walk through the ARP mapping table and try to find an entry to
255    update. If none is found, the IP -> MAC address mapping is    update. If none is found, the IP -> MAC address mapping is
# Line 270  update_arp_entry(struct ip_addr *ipaddr, Line 278  update_arp_entry(struct ip_addr *ipaddr,
278          }          }
279          arp_table[i].ctime = ctime;          arp_table[i].ctime = ctime;
280          arp_table[i].state = ETHARP_STATE_STABLE;          arp_table[i].state = ETHARP_STATE_STABLE;
281    #if ARP_QUEUEING
282          p = arp_table[i].p;          p = arp_table[i].p;
283          // queued packet present? */          // queued packet present? */
284          if(p != NULL) {          if(p != NULL) {
# Line 288  update_arp_entry(struct ip_addr *ipaddr, Line 297  update_arp_entry(struct ip_addr *ipaddr,
297          }          }
298          /* return queued packet, if any */          /* return queued packet, if any */
299          return p;          return p;
300    #else
301            /* ARP queueing disabled */
302            return NULL;
303    #endif
304        }        }
305      }      }
306    }    }

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

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