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.


stable compliation version with some running problems in kernel thread
[palacios.git] / palacios / src / geekos / socket.c
index 661970e..4ef4907 100644 (file)
@@ -5,13 +5,16 @@
 #include <geekos/socket.h>
 #include <geekos/malloc.h>
 #include <geekos/ne2k.h>
+
+#ifdef UIP
+
 #include <uip/uip.h>
 #include <uip/uip_arp.h>
+
 #include <geekos/vmm_stubs.h>
 #include <geekos/debug.h>
 #include <geekos/timer.h>
 
-
 #define BUF ((struct uip_eth_hdr *)&uip_buf[0])
 
 #define MAX_SOCKS 1024
@@ -25,12 +28,11 @@ void socket_appcall(void);
 #endif /* UIP_APPCALL */
 
 
-
-
 static int Packet_Received(struct NE2K_Packet_Info* info, uchar_t *pkt);
 static void periodic_caller(int timer_id, void * arg);
 
 void init_socket_layer() {
+       
    int i = 0;
    bool iflag;
 
@@ -42,31 +44,24 @@ void init_socket_layer() {
       sockets[i].state = CLOSED;
    }
 
-
-
     //initiate uIP
     uip_init();
     uip_arp_init();
        
-    //setup device driver
-    Init_Ne2k(&Packet_Received);
+    //setup device driver 
+    Init_Ne2k(&Packet_Received); 
 
     iflag = Begin_Int_Atomic();
     Start_Timer(2, periodic_caller, NULL);
     End_Int_Atomic(iflag);
-
 }
 
-
-
-
 void set_ip_addr(uchar_t addr[4]) {
   uip_ipaddr_t ipaddr;
   uip_ipaddr(ipaddr, addr[0], addr[1], addr[2], addr[3]);  /* Local IP address */
   uip_sethostaddr(ipaddr);
 }
 
-
 static int allocate_socket_fd() {
   int i = 0;
   
@@ -107,7 +102,6 @@ struct socket * get_socket_from_fd(int fd) {
 }
 
 
-
 static void periodic_caller(int timer_id, void * arg) {
   int i;
   //handle the periodic calls of uIP
@@ -362,3 +356,6 @@ static int Packet_Received(struct NE2K_Packet_Info * info, uchar_t * pkt) {
 
   return 0;
 }
+
+
+#endif  /* UIP */