X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fgeekos%2Fsocket.h;h=fbc47ed45cb91df205a742c7cdfcdcc1d42264e5;hb=3fb8af7e2069d7517b5d6c4fb7dc04b22ddf8396;hp=cdd17d2cab40a5c3c13f2b045f742d3f82b3e8cb;hpb=fb8c4864a1d840edf0be5a84ca30bc1517af8796;p=palacios.releases.git diff --git a/palacios/include/geekos/socket.h b/palacios/include/geekos/socket.h index cdd17d2..fbc47ed 100644 --- a/palacios/include/geekos/socket.h +++ b/palacios/include/geekos/socket.h @@ -1,24 +1,40 @@ +/* (c) 2008, Jack Lange */ +/* (c) 2008, The V3VEE Project */ + #ifndef GEEKOS_SOCKET_H #define GEEKOS_SOCKET_H #include -#include #include +#ifdef UIP +#include + + +typedef enum {WAITING, CLOSED, LISTEN, ESTABLISHED} sock_state_t; + struct socket { int in_use; struct Thread_Queue recv_wait_queue; struct ring_buffer *send_buf; struct ring_buffer *recv_buf; struct uip_conn *con; + + sock_state_t state; + }; -void init_network(); +void init_socket_layer(); int connect(const uchar_t ip_addr[4], ushort_t port); int close(const int sockfd); int recv(int sockfd, void * buf, uint_t len); int send(int sockfd, void * buf, uint_t len); +void set_ip_addr(uchar_t addr[4]); + +#endif /* UIP */ + + #endif