init.c
ubixos/types.h
ubixos/sched.h
ubixos/endtask.h
net/sys.h
net/mem.h
net/memp.h
net/tcpip.h
netif/loopif.h
netif/tcpdump.h
netif/ethernetif.h
ubixos/exec.h
lib/kmalloc.h
lib/kprintf.h
sys/thread.h
net/ipv4/ip.h
arch/lib.h
ubixos/sched.h
net/netif.h
ubixos/endtask.h
net/udp.h
arch/cpu.h
arch/sys_arch.h
net/tcp.h
ubixos/types.h
sys/_types.h
net/arch.h
net/ipv4/icmp.h
vfs/file.h
sys/tss.h
lib/kmalloc.h
net/lwipopts.h
net/tcpip.h
net/api_msg.h
netif/ethernetif.h
net/def.h
net/mem.h
src/sys/net/net/init.c
net/memp.h
vfs/vfs.h
vfs/mount.h
lib/kprintf.h
net/ipv4/ip_addr.h
net/err.h
netif/tcpdump.h
net/api.h
ubixfs/dirCache.h
netif/loopif.h
ubixos/exec.h
net/opt.h
sys/sysproto.h
ubixos/elf.h
sys/signal.h
net/sys.h
ubixos/tty.h
net/pbuf.h
net/debug.h
net/ipv4/inet.h
arch/cc.h
int int net_init () net_init mem_init memp_init netMainThread pbuf_init sys_init sys_thread_new
void void netMainThread () netMainThread _current endTask ethernetif_init taskStruct::id IP4_ADDR kprintf loopif_init netif_add netif_init netif_set_default shell_init sys_sem_free sys_sem_new sys_sem_wait tcpip_init tcpip_init_done tcpip_input net_init
void static void tcpip_init_done (void *arg) tcpip_init_done void * arg sys_sem_signal

    /*****************************************************************************************
    Copyright(c)2004TheUbixOSProject
    Allrightsreserved.

    Redistributionanduseinsourceandbinaryforms,withorwithoutmodification,are
    permittedprovidedthatthefollowingconditionsaremet:

    Redistributionsofsourcecodemustretaintheabovecopyrightnotice,thislistof
    conditions,thefollowingdisclaimerandthelistofauthors.Redistributionsinbinary
    formmustreproducetheabovecopyrightnotice,thislistofconditions,thefollowing
    disclaimerandthelistofauthorsinthedocumentationand/orothermaterialsprovided
    withthedistribution.NeitherthenameoftheUbixOSProjectnorthenamesofits
    contributorsmaybeusedtoendorseorpromoteproductsderivedfromthissoftware
    withoutspecificpriorwrittenpermission.

    THISSOFTWAREISPROVIDEDBYTHECOPYRIGHTHOLDERSANDCONTRIBUTORS"ASIS"ANDANY
    EXPRESSORIMPLIEDWARRANTIES,INCLUDING,BUTNOTLIMITEDTO,THEIMPLIEDWARRANTIESOF
    MERCHANTABILITYANDFITNESSFORAPARTICULARPURPOSEAREDISCLAIMED.INNOEVENTSHALL
    THECOPYRIGHTOWNERORCONTRIBUTORSBELIABLEFORANYDIRECT,INDIRECT,INCIDENTAL,
    SPECIAL,EXEMPLARY,ORCONSEQUENTIALDAMAGES(INCLUDING,BUTNOTLIMITEDTO,PROCUREMENT
    OFSUBSTITUTEGOODSORSERVICES;LOSSOFUSE,DATA,ORPROFITS;ORBUSINESSINTERRUPTION)
    HOWEVERCAUSEDANDONANYTHEORYOFLIABILITY,WHETHERINCONTRACT,STRICTLIABILITY,OR
    TORT(INCLUDINGNEGLIGENCEOROTHERWISE)ARISINGINANYWAYOUTOFTHEUSEOFTHIS
    SOFTWARE,EVENIFADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGE.

    $Id: init_8c.xml 88 2016-01-12 00:11:29Z reddawg $

    *****************************************************************************************/

    #include<ubixos/types.h>
    #include<ubixos/sched.h>
    #include<ubixos/endtask.h>

    #include<net/sys.h>
    #include<net/mem.h>
    #include<net/memp.h>
    #include<net/tcpip.h>

    #include<netif/loopif.h>
    #include<netif/tcpdump.h>
    #include<netif/ethernetif.h>

    #include<ubixos/exec.h>
    #include<lib/kmalloc.h>
    #include<lib/kprintf.h>

    voidnetMainThread();
    staticvoidtcpip_init_done(void*arg);

    intnet_init(){
    sys_init();
    mem_init();
    memp_init();
    pbuf_init();

    /*
    *thread=(void*)execThread((void*)start_routine,0x0,arg);
    */

    sys_thread_new((void*)(netMainThread),0x0);

    return(0x0);
    }

    voidnetMainThread(){
    structip_addripaddr,netmask,gw;
    sys_sem_tsem;

    netif_init();
    sem=sys_sem_new(0);
    tcpip_init(tcpip_init_done,&sem);
    sys_sem_wait(sem);
    sys_sem_free(sem);

    kprintf("TCP/IPinitialized.\n");

    IP4_ADDR(&gw,10,4,0,1);
    IP4_ADDR(&ipaddr,10,4,0,69);
    IP4_ADDR(&netmask,255,255,255,0);
    netif_set_default(netif_add(&ipaddr,&netmask,&gw,ethernetif_init,tcpip_input));

    IP4_ADDR(&gw,127,0,0,1);
    IP4_ADDR(&ipaddr,127,0,0,1);
    IP4_ADDR(&netmask,255,0,0,0);
    netif_add(&ipaddr,&netmask,&gw,loopif_init,tcpip_input);

    //udpecho_init();
    shell_init();
    //bot_init();
    endTask(_current->id);
    }

    staticvoidtcpip_init_done(void*arg){
    sys_sem_t*sem=0x0;
    sem=arg;
    sys_sem_signal(*sem);
    }

    /***
    END
    ***/