loopif.c
net/debug.h
net/mem.h
net/opt.h
netif/loopif.h
netif/tcpdump.h
net/tcp.h
net/ipv4/ip.h
net/ipv4/ip.h
arch/lib.h
net/netif.h
src/sys/net/netif/loopif.c
arch/cpu.h
arch/sys_arch.h
net/tcp.h
ubixos/types.h
sys/_types.h
net/arch.h
net/ipv4/icmp.h
net/lwipopts.h
net/def.h
net/mem.h
net/ipv4/ip_addr.h
net/err.h
netif/tcpdump.h
netif/loopif.h
net/opt.h
net/sys.h
net/pbuf.h
net/debug.h
net/ipv4/inet.h
arch/cc.h
void void loopif_init (struct netif *netif) loopif_init struct netif * netif loopif_output netif::name netif::output netMainThread
err_t static err_t loopif_output (struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr) loopif_output struct netif * netif struct pbuf * p struct ip_addr * ipaddr bcopy ERR_MEM ERR_OK netif::input pbuf::len pbuf::next NULL pbuf::payload pbuf_alloc PBUF_RAM PBUF_RAW tcpdump pbuf::tot_len loopif_init

    /*
    *Copyright(c)2001,SwedishInstituteofComputerScience.
    *Allrightsreserved.
    *
    *Redistributionanduseinsourceandbinaryforms,withorwithout
    *modification,arepermittedprovidedthatthefollowingconditions
    *aremet:
    *1.Redistributionsofsourcecodemustretaintheabovecopyright
    *notice,thislistofconditionsandthefollowingdisclaimer.
    *2.Redistributionsinbinaryformmustreproducetheabovecopyright
    *notice,thislistofconditionsandthefollowingdisclaimerinthe
    *documentationand/orothermaterialsprovidedwiththedistribution.
    *3.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: loopif_8c.xml 88 2016-01-12 00:11:29Z reddawg $
    */
    #include"net/debug.h"
    #include"net/mem.h"
    #include"net/opt.h"
    #include"netif/loopif.h"
    #include"netif/tcpdump.h"

    #include"net/tcp.h"
    #include"net/ipv4/ip.h"

    /*-----------------------------------------------------------------------------------*/
    staticerr_t
    loopif_output(structnetif*netif,structpbuf*p,
    structip_addr*ipaddr)
    {
    structpbuf*q,*r;
    char*ptr;

    #ifdefLWIP_DEBUG
    tcpdump(p);
    #endif/*LWIP_DEBUG*/

    r=pbuf_alloc(PBUF_RAW,p->tot_len,PBUF_RAM);
    if(r!=NULL){
    ptr=r->payload;

    for(q=p;q!=NULL;q=q->next){
    bcopy(q->payload,ptr,q->len);
    ptr+=q->len;
    }
    netif->input(r,netif);
    returnERR_OK;
    }
    returnERR_MEM;
    }
    /*-----------------------------------------------------------------------------------*/
    void
    loopif_init(structnetif*netif)
    {
    netif->name[0]='l';
    netif->name[1]='o';
    netif->output=loopif_output;
    }
    /*-----------------------------------------------------------------------------------*/