X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fgeekos%2Fsocket.h;h=1b839d6ec643d3a205b1a17cddd6f440f485bbee;hb=ac9621026b54c3b5e9bae3d7153736c65ab03652;hp=0bf1b081aeea1a0b94093e4d9b23e5fc93ef8792;hpb=7a1c54e7fb92e936bb8f5923ceda6f633ebf6077;p=palacios.releases.git diff --git a/palacios/include/geekos/socket.h b/palacios/include/geekos/socket.h index 0bf1b08..1b839d6 100644 --- a/palacios/include/geekos/socket.h +++ b/palacios/include/geekos/socket.h @@ -1,23 +1,36 @@ +/* (c) 2008, Jack Lange */ +/* (c) 2008, The V3VEE Project */ + #ifndef GEEKOS_SOCKET_H #define GEEKOS_SOCKET_H #include #include +#include + + +typedef enum {WAITING, CLOSED, LISTEN, ESTABLISHED} sock_state_t; struct socket { int in_use; - struct ring_buffer send_queue; - struct ring_buffer recv_queue; + 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