bot.c
lib/kmalloc.h
lib/kprintf.h
string.h
net/mem.h
net/debug.h
net/def.h
net/api.h
net/stats.h
net/ipv4/ip.h
arch/lib.h
net/stats.h
net/netif.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
src/sys/net/net/bot.c
string.h
lib/kmalloc.h
net/lwipopts.h
net/def.h
net/mem.h
net/memp.h
lib/kprintf.h
net/ipv4/ip_addr.h
net/err.h
net/api.h
net/opt.h
net/sys.h
net/pbuf.h
net/debug.h
net/ipv4/inet.h
arch/cc.h
void void bot_init (void) bot_init void bot_thread NULL sys_thread_new
void static void bot_thread (void *arg) bot_thread void * arg IP4_ADDR kprintf netbuf_copy netbuf_delete netbuf_len netconn_connect netconn_new netconn_recv NETCONN_TCP NULL bot_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: bot_8c.xml 88 2016-01-12 00:11:29Z reddawg $
    */

    #include<lib/kmalloc.h>
    #include<lib/kprintf.h>
    #include<string.h>

    #include"net/mem.h"
    #include"net/debug.h"
    #include"net/def.h"
    #include"net/api.h"
    #include"net/stats.h"

    /*UBU
    staticvoidsendstr(constchar*str,structnetconn*conn){
    netconn_write(conn,(void*)str,strlen(str),NETCONN_NOCOPY);
    }

    staticvoidbotErr(){
    kprintf("ERRROR\n");
    }
    */

    staticvoidbot_thread(void*arg){
    structnetconn*conn;
    intlen;
    charbufr[1500];
    structip_addripaddr;
    structnetbuf*buf=0x0;

    IP4_ADDR(&ipaddr,216,152,77,10);
    conn=netconn_new(NETCONN_TCP);
    kprintf("StartingUbixOSBot\n");
    while(1){
    kprintf("[A");
    kprintf("\n\nCONNECT:[%i]\n",netconn_connect(conn,&ipaddr,6667));
    kprintf("B]");
    while(1);
    if(buf!=NULL){
    buf=netconn_recv(conn);
    netbuf_copy(buf,bufr,1024);
    len=netbuf_len(buf);
    netbuf_delete(buf);
    bufr[len-2]='\0';
    kprintf("Bufr:[%s:%i]",bufr,len);
    //sendstr("BLah\n",conn);
    }
    }
    }

    voidbot_init(void){
    sys_thread_new(bot_thread,NULL);
    }

    /***
    END
    ***/