sockets.h
ubixos/types.h
src/sys/lib/net.c
src/sys/net/api/sockets.c
ubixos/types.h
sys/_types.h
src/sys/include/net/sockets.h
src/sys/lib/net.c
src/sys/include/net/sockets.h
src/sys/net/api/sockets.c
in_addr
sockaddr
sockaddr_in
AF_INET
2
INADDR_ANY
0
INADDR_BROADCAST
0xffffffff
IPPROTO_TCP
6
IPPROTO_UDP
17
PF_INET
AF_INET
SOCK_DGRAM
2
lwip_socket
SOCK_STREAM
1
lwip_socket
int int lwip_accept (int s, struct sockaddr *addr, int *addrlen) lwip_accept int s struct sockaddr * addr int * addrlen ip_addr::addr alloc_socket lwip_socket::conn get_socket netconn_accept netconn_delete netconn_peer NULL
int int lwip_bind (int s, struct sockaddr *name, int namelen) lwip_bind int s struct sockaddr * name int namelen ip_addr::addr lwip_socket::conn ERR_OK get_socket name netconn_bind ntohs NULL
int int lwip_close (int s) lwip_close int s lwip_socket::conn DEBUGF get_socket lwip_socket::lastdata lwip_socket::lastoffset netbuf_delete netconn_delete NULL SOCKETS_DEBUG
int int lwip_connect (int s, struct sockaddr *name, int namelen) lwip_connect int s struct sockaddr * name int namelen ip_addr::addr lwip_socket::conn ERR_OK get_socket name netconn_connect ntohs NULL
int int lwip_listen (int s, int backlog) lwip_listen int s int backlog lwip_socket::conn ERR_OK get_socket netconn_listen NULL
int int lwip_read (int s, void *mem, int len) lwip_read int s void * mem int len lwip_recv
int int lwip_recv (int s, void *mem, int len, unsigned int flags) lwip_recv int s void * mem int len unsigned int flags lwip_recvfrom NULL lwip_read
int int lwip_recvfrom (int s, void *mem, int len, unsigned int flags, struct sockaddr *from, int *fromlen) lwip_recvfrom int s void * mem int len unsigned int flags struct sockaddr * from int * fromlen ip_addr::addr lwip_socket::conn get_socket htons lwip_socket::lastdata lwip_socket::lastoffset netbuf_copy_partial netbuf_delete netbuf_fromaddr netbuf_fromport netbuf_len netconn_recv NETCONN_TCP netconn_type NULL lwip_recv
int int lwip_send (int s, void *dataptr, int size, unsigned int flags) lwip_send int s void * dataptr int size unsigned int flags lwip_socket::conn DEBUGF netbuf::err ERR_ARG ERR_OK get_socket netbuf_delete netbuf_new netbuf_ref NETCONN_COPY netconn_send NETCONN_TCP netconn_type NETCONN_UDP netconn_write NULL SOCKETS_DEBUG lwip_sendto lwip_write
int int lwip_sendto (int s, void *dataptr, int size, unsigned int flags, struct sockaddr *to, int tolen) lwip_sendto int s void * dataptr int size unsigned int flags struct sockaddr * to int tolen ip_addr::addr lwip_socket::conn get_socket lwip_send netconn_connect netconn_peer NULL
int int lwip_socket (int domain, int type, int protocol) lwip_socket int domain int type int protocol alloc_socket DEBUGF netconn_delete netconn_new NETCONN_TCP NETCONN_UDP NULL SOCK_DGRAM SOCK_STREAM SOCKETS_DEBUG
int int lwip_write (int s, void *dataptr, int size) lwip_write int s void * dataptr int size lwip_socket::conn DEBUGF ERR_ARG ERR_OK get_socket lwip_send NETCONN_COPY NETCONN_TCP netconn_type NETCONN_UDP netconn_write NULL SOCKETS_DEBUG

    /*
    *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: sockets_8h.xml 88 2016-01-12 00:11:29Z reddawg $
    */

    #ifndef__LWIP_SOCKETS_H__
    #define__LWIP_SOCKETS_H__

    #include<ubixos/types.h>

    structin_addr{
    uInt32s_addr;
    };

    structsockaddr_in{
    uInt8sin_len;
    uInt8sin_family;
    uInt16sin_port;
    structin_addrsin_addr;
    charsin_zero[8];
    };

    structsockaddr{
    uInt8sa_len;
    uInt8sa_family;
    charsa_data[14];
    };

    #defineSOCK_STREAM1
    #defineSOCK_DGRAM2

    #defineAF_INET2
    #definePF_INETAF_INET

    #defineIPPROTO_TCP6
    #defineIPPROTO_UDP17

    #defineINADDR_ANY0
    #defineINADDR_BROADCAST0xffffffff

    intlwip_accept(ints,structsockaddr*addr,int*addrlen);
    intlwip_bind(ints,structsockaddr*name,intnamelen);
    intlwip_close(ints);
    intlwip_connect(ints,structsockaddr*name,intnamelen);
    intlwip_listen(ints,intbacklog);
    intlwip_recv(ints,void*mem,intlen,unsignedintflags);
    intlwip_read(ints,void*mem,intlen);
    intlwip_recvfrom(ints,void*mem,intlen,unsignedintflags,
    structsockaddr*from,int*fromlen);
    intlwip_send(ints,void*dataptr,intsize,unsignedintflags);
    intlwip_sendto(ints,void*dataptr,intsize,unsignedintflags,
    structsockaddr*to,inttolen);
    intlwip_socket(intdomain,inttype,intprotocol);
    intlwip_write(ints,void*dataptr,intsize);

    #ifdefLWIP_COMPAT_SOCKETS
    #defineaccept(a,b,c)lwip_accept(a,b,c)
    #definebind(a,b,c)lwip_bind(a,b,c)
    #defineclose(s)lwip_close(s)
    #defineconnect(a,b,c)lwip_connect(a,b,c)
    #definelisten(a,b)lwip_listen(a,b)
    #definerecv(a,b,c,d)lwip_recv(a,b,c,d)
    #defineread(a,b,c)lwip_read(a,b,c)
    #definerecvfrom(a,b,c,d,e,f)lwip_recvfrom(a,b,c,d,e,f)
    #definesend(a,b,c,d)lwip_send(a,b,c,d)
    #definesendto(a,b,c,d,e,f)lwip_sendto(a,b,c,d,e,f)
    #definesocket(a,b,c)lwip_socket(a,b,c)
    #definewrite(a,b,c)lwip_write(a,b,c)
    #endif/*LWIP_NO_COMPAT_SOCKETS*/

    #endif/*__LWIP_SOCKETS_H__*/