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.


Add lock to vmm_queue
[palacios.git] / palacios / include / palacios / vmm_vnet.h
index c94c6c6..eef724c 100644 (file)
@@ -9,8 +9,6 @@
  *
  * Copyright (c) 2009, Lei Xia <lxia@northwestern.edu> 
  * Copyright (c) 2009, Yuan Tang <ytang@northwestern.edu> 
- * Copyright (c) 2009, Jack Lange <jarusl@cs.northwestern.edu> 
- * Copyright (c) 2009, Peter Dinda <pdinda@northwestern.edu
  * Copyright (c) 2009, The V3VEE Project <http://www.v3vee.org> 
  * All rights reserved.
  *
 #define ETHERNET_DATA_MAX   1500
 #define ETHERNET_PACKET_LEN (ETHERNET_HEADER_LEN + ETHERNET_DATA_MAX)
 
-typedef enum {MAC_ANY, MAC_NOT, MAC_NONE, MAC_EMPTY} mac_type_t; //for 'src_mac_qual' and 'dst_mac_qual'
+typedef enum {MAC_ANY, MAC_NOT, MAC_NONE} mac_type_t; //for 'src_mac_qual' and 'dst_mac_qual'
 typedef enum {LINK_INTERFACE, LINK_EDGE, LINK_ANY} link_type_t; //for 'type' and 'src_type' in struct routing
 typedef enum {TCP_TYPE, UDP_TYPE, NONE_TYPE} prot_type_t;
 
+#define VNET_INITAB_HCALL 0xca00
+
 //routing table entry
 struct routing_entry{
     char src_mac[6];
@@ -103,7 +103,7 @@ struct vnet_if_device {
 
 
 struct vnet_if_link {
-    prot_type_t pro_type; //protocal type of this link
+    prot_type_t pro_type; //transport layer protocal type of this link
     unsigned long dest_ip;
     uint16_t dest_port;
 
@@ -115,7 +115,6 @@ struct vnet_if_link {
 }__attribute__((packed));
 
 
-//link table entry
 struct link_entry {
     link_type_t type;
   
@@ -127,19 +126,34 @@ struct link_entry {
     int use;
 }__attribute__((packed));
 
+struct ethernet_pkt {
+    uint32_t size; //size of data field
+    uint16_t type;
+    uint8_t use_header;
+    struct udp_link_header ext_hdr;
+    char data[ETHERNET_PACKET_LEN];
+}__attribute__((packed));
 
 int v3_vnet_send_rawpkt(uchar_t *buf, int len, void *private_data);
 int v3_vnet_send_udppkt(uchar_t *buf, int len, void *private_data);
-//int vnet_register_device(struct vm_device *vdev, 
-//                      char *dev_name, 
-//                      uchar_t mac[6], 
-//                      int (*netif_input)(uchar_t * pkt, uint_t size, void *private_data), 
-//                      void *data);
-//int vnet_unregister_device(char *dev_name);
+int vnet_register_device(struct vm_device *vdev, 
+                        char *dev_name, 
+                        uchar_t mac[6], 
+                        int (*netif_input)(uchar_t * pkt, uint_t size, void *private_data), 
+                        void *data);
+
+int vnet_add_route_entry(char src_mac[6],
+                               char dest_mac[6],
+                               int src_mac_qual,
+                               int dest_mac_qual,
+                               int link_idx,
+                               link_type_t link_type,
+                               int src_link_idx,
+                               link_type_t src_link_type);
 
 int v3_vnet_pkt_process(); 
 
-void v3_vnet_init(struct guest_info *vm);
+void v3_init_vnet();
 
 #endif