arp.h
net/pbuf.h
net/ipv4/ip_addr.h
net/netif.h
src/sys/include/netif/arp.h
net/pbuf.h
net/ipv4/ip_addr.h
net/netif.h
eth_addr
eth_hdr
ARP_TMR_INTERVAL
10000
ETHTYPE_ARP
0x0806
ETHTYPE_IP
0x0800
pbuf * struct pbuf* arp_arp_input (struct netif *netif, struct eth_addr *ethaddr, struct pbuf *p) arp_arp_input struct netif * netif struct eth_addr * ethaddr struct pbuf * p
void void arp_init (void) arp_init void
void void arp_ip_input (struct netif *netif, struct pbuf *p) arp_ip_input struct netif * netif struct pbuf * p
eth_addr * struct eth_addr* arp_lookup (struct ip_addr *ipaddr) arp_lookup struct ip_addr * ipaddr
pbuf * struct pbuf* arp_query (struct netif *netif, struct eth_addr *ethaddr, struct ip_addr *ipaddr) arp_query struct netif * netif struct eth_addr * ethaddr struct ip_addr * ipaddr
void void arp_tmr (void) arp_tmr void
eth_hdr struct eth_hdr PACK_STRUCT_STRUCT PACK_STRUCT_STRUCT
eth_addr struct eth_addr PACK_STRUCT_STRUCT PACK_STRUCT_STRUCT

    /*
    *Copyright(c)2001,SwedishInstituteofComputerScience.
    *Allrightsreserved.
    *
    *Redistributionanduseinsourceandbinaryforms,withorwithout
    *modification,arepermittedprovidedthatthefollowingconditions
    *aremet:
    *1.Redistributionsofsourcecodemustretaintheabovecopyright
    *notice,thislistofconditionsandthefollowingdisclaimer.
    *2.Redistributionsinbinaryformmustreproducetheabovecopyright
    *notice,thislistofconditionsandthefollowingdisclaimerinthe
    *documentationand/orothermaterialsprovidedwiththedistribution.
    *3.Alladvertisingmaterialsmentioningfeaturesoruseofthissoftware
    *mustdisplaythefollowingacknowledgement:
    *ThisproductincludessoftwaredevelopedbytheSwedishInstitute
    *ofComputerScienceanditscontributors.
    *4.NeitherthenameoftheInstitutenorthenamesofitscontributors
    *maybeusedtoendorseorpromoteproductsderivedfromthissoftware
    *withoutspecificpriorwrittenpermission.
    *
    *THISSOFTWAREISPROVIDEDBYTHEINSTITUTEANDCONTRIBUTORS``ASIS''AND
    *ANYEXPRESSORIMPLIEDWARRANTIES,INCLUDING,BUTNOTLIMITEDTO,THE
    *IMPLIEDWARRANTIESOFMERCHANTABILITYANDFITNESSFORAPARTICULARPURPOSE
    *AREDISCLAIMED.INNOEVENTSHALLTHEINSTITUTEORCONTRIBUTORSBELIABLE
    *FORANYDIRECT,INDIRECT,INCIDENTAL,SPECIAL,EXEMPLARY,ORCONSEQUENTIAL
    *DAMAGES(INCLUDING,BUTNOTLIMITEDTO,PROCUREMENTOFSUBSTITUTEGOODS
    *ORSERVICES;LOSSOFUSE,DATA,ORPROFITS;ORBUSINESSINTERRUPTION)
    *HOWEVERCAUSEDANDONANYTHEORYOFLIABILITY,WHETHERINCONTRACT,STRICT
    *LIABILITY,ORTORT(INCLUDINGNEGLIGENCEOROTHERWISE)ARISINGINANYWAY
    *OUTOFTHEUSEOFTHISSOFTWARE,EVENIFADVISEDOFTHEPOSSIBILITYOF
    *SUCHDAMAGE.
    *
    *ThisfileispartofthelwIPTCP/IPstack.
    *
    *Author:AdamDunkels<adam@sics.se>
    *
    *$Id: arp_8h.xml 88 2016-01-12 00:11:29Z reddawg $
    *
    */

    #ifndef__NETIF_ARP_H__
    #define__NETIF_ARP_H__

    #include"net/pbuf.h"
    #include"net/ipv4/ip_addr.h"
    #include"net/netif.h"

    structeth_addr{
    PACK_STRUCT_FIELD(uInt8addr[6]);
    }PACK_STRUCT_STRUCT;

    structeth_hdr{
    PACK_STRUCT_FIELD(structeth_addrdest);
    PACK_STRUCT_FIELD(structeth_addrsrc);
    PACK_STRUCT_FIELD(uInt16type);
    }PACK_STRUCT_STRUCT;

    #defineARP_TMR_INTERVAL10000

    #defineETHTYPE_ARP0x0806
    #defineETHTYPE_IP0x0800

    /*InitializesARP.*/
    voidarp_init(void);

    /*Thearp_tmr()functionshouldbecalledeveryARP_TMR_INTERVAL
    microseconds(10seconds).Thisfunctionisresponsiblefor
    expiringoldentriesintheARPtable.*/
    voidarp_tmr(void);

    /*ShouldbecalledforallincomingpacketsofIPkind.Thefunction
    doesnotalterthepacketinanyway,itjustupdatestheARP
    table.Afterthisfunctionhasbeencalled,thenormalTCP/IPstack
    inputfunctionshouldbecalled.*/
    voidarp_ip_input(structnetif*netif,structpbuf*p);

    /*ShouldbecalledforincomingARPpackets.Thepbufintheargument
    isfreedbythisfunction.Ifthefunctionreturnsapbuf(i.e.,
    returnsnon-NULL),thatpbufconstitutesanARPreplyandshouldbe
    sentoutontheEthernet.*/
    structpbuf*arp_arp_input(structnetif*netif,structeth_addr*ethaddr,
    structpbuf*p);

    /*arp_loopup()iscalledtodoanIPaddress->Ethernetaddress
    translation.IfthefunctionreturnsNULL,thereisnomappingand
    thearp_query()functionshouldbecalled.*/
    structeth_addr*arp_lookup(structip_addr*ipaddr);

    /*ConstructsanARPquerypacketforthegivenIPaddress.The
    functionreturnsapbufthatcontainsthereplyandthatshouldbe
    sentoutontheEthernet.*/
    structpbuf*arp_query(structnetif*netif,structeth_addr*ethaddr,
    structip_addr*ipaddr);

    #endif/*__NETIF_ARP_H__*/