Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


modified copyright tags
[palacios.git] / palacios / include / geekos / socket.h
1 /* (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> */
2 /* (c) 2008, The V3VEE Project <http://www.v3vee.org> */
3
4 #ifndef GEEKOS_SOCKET_H
5 #define GEEKOS_SOCKET_H
6
7 #include <geekos/ring_buffer.h>
8 #include <uip/uip.h>
9 #include <geekos/kthread.h>
10
11
12 typedef enum {WAITING, CLOSED, LISTEN, ESTABLISHED} sock_state_t;
13
14 struct socket {
15   int in_use;
16   struct Thread_Queue recv_wait_queue;
17   struct ring_buffer *send_buf;
18   struct ring_buffer *recv_buf;
19   struct uip_conn *con;
20
21   sock_state_t state;
22
23 };
24
25
26 void init_socket_layer();
27
28 int connect(const uchar_t ip_addr[4], ushort_t port);
29 int close(const int sockfd);
30 int recv(int sockfd, void * buf, uint_t len);
31 int send(int sockfd, void * buf, uint_t len);
32
33 void set_ip_addr(uchar_t addr[4]);
34
35
36 #endif