/[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.39.2.3 by likewise, Wed Jun 4 08:33:28 2003 UTC revision 1.39.2.4 by likewise, Wed Jun 4 10:18:38 2003 UTC
# Line 2  Line 2 
2   * @file   * @file
3   * Address Resolution Protocol module for IP over Ethernet   * Address Resolution Protocol module for IP over Ethernet
4   *   *
5     * Functionally, ARP is divided into two parts. The first maps an IP address
6     * to a physical address when sending a packet, and the second part answers
7     * requests from other machines.
8     *
9   */   */
10    
11  /*  /*
# Line 209  find_arp_entry(void) Line 213  find_arp_entry(void)
213                j = i;                j = i;
214        }        }
215      }      }
216        if (j != ARP_TABLE_SIZE) {
217      DEBUGF(ETHARP_DEBUG, ("find_arp_entry: found oldest stable entry %u\n", j));      DEBUGF(ETHARP_DEBUG, ("find_arp_entry: found oldest stable entry %u\n", j));
218        } else {
219          DEBUGF(ETHARP_DEBUG, ("find_arp_entry: no replacable entry could be found\n"));
220        }
221      i = j;      i = j;
222    }    }
223    DEBUGF(ETHARP_DEBUG, ("find_arp_entry: returning %u, state %u\n", i, arp_table[i].state));    DEBUGF(ETHARP_DEBUG, ("find_arp_entry: returning %u, state %u\n", i, arp_table[i].state));
# Line 495  etharp_arp_input(struct netif *netif, st Line 503  etharp_arp_input(struct netif *netif, st
503   *   *
504   * If ARP failed to allocate resources, NULL is returned.   * If ARP failed to allocate resources, NULL is returned.
505   *   *
506   * A returned non-NULL packet should be sent by the caller and   * A returned non-NULL packet should be sent by the caller.
  * etharp_output_sent() must be called afterwards to free any ARP  
  * request.  
507   *   *
508   * @param netif The lwIP network interface which the IP packet will be sent on.   * @param netif The lwIP network interface which the IP packet will be sent on.
509   * @param ipaddr The IP address of the packet destination.   * @param ipaddr The IP address of the packet destination.
510   * @param pbuf The pbuf(s) containing the IP packet to be sent.   * @param pbuf The pbuf(s) containing the IP packet to be sent.
511   *   *
512   * @return If non-NULL, a packet ready to be sent.   * @return If non-NULL, a packet ready to be sent.
  * @see etharp_output_sent()  
513   */   */
514  struct pbuf *  struct pbuf *
515  etharp_output(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q)  etharp_output(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q)
# Line 631  etharp_output(struct netif *netif, struc Line 636  etharp_output(struct netif *netif, struc
636   * @note Might be used in the future by manual IP configuration   * @note Might be used in the future by manual IP configuration
637   * as well.   * as well.
638   *   *
  * TODO: enqueue q here if possible (BEWARE: possible other packet already  
  * queued.  
  * TODO: The host requirements RFC states that ARP should save at least one  
  * packet, and this should be the _latest_ packet.  
639   * TODO: use the ctime field to see how long ago an ARP request was sent,   * TODO: use the ctime field to see how long ago an ARP request was sent,
640   * possibly retry.   * possibly retry.
641   */   */
# Line 643  err_t etharp_query(struct netif *netif, Line 644  err_t etharp_query(struct netif *netif,
644    struct eth_addr *srcaddr;    struct eth_addr *srcaddr;
645    struct etharp_hdr *hdr;    struct etharp_hdr *hdr;
646    struct pbuf *p;    struct pbuf *p;
647    err_t result;    err_t result = ERR_OK;
648    u8_t i;    u8_t i;
649    /* prevent warning if ARP_QUEUEING == 0 */    /* prevent warning if ARP_QUEUEING == 0 */
650    if (q);    if (q);

Legend:
Removed from v.1.39.2.3  
changed lines
  Added in v.1.39.2.4

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