1 /* (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> */
2 /* (c) 2008, The V3VEE Project <http://www.v3vee.org> */
4 #ifndef GEEKOS_SOCKET_H
5 #define GEEKOS_SOCKET_H
7 #include <geekos/ring_buffer.h>
8 #include <geekos/kthread.h>
14 typedef enum {WAITING, CLOSED, LISTEN, ESTABLISHED} sock_state_t;
18 struct Thread_Queue recv_wait_queue;
19 struct ring_buffer *send_buf;
20 struct ring_buffer *recv_buf;
28 void init_socket_layer();
30 int connect(const uchar_t ip_addr[4], ushort_t port);
31 int close(const int sockfd);
32 int recv(int sockfd, void * buf, uint_t len);
33 int send(int sockfd, void * buf, uint_t len);
35 void set_ip_addr(uchar_t addr[4]);