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.


1a88c2411eeacdac071e752845069f17c08e3a80
[palacios.git] / palacios / include / palacios / vmm_vnet.h
1 /* 
2  * This file is part of the Palacios Virtual Machine Monitor developed
3  * by the V3VEE Project with funding from the United States National 
4  * Science Foundation and the Department of Energy.  
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at 
8  * http://www.v3vee.org
9  *
10  * Copyright (c) 2009, Lei Xia <lxia@northwestern.edu> 
11  * Copyright (c) 2009, Yuan Tang <ytang@northwestern.edu> 
12  * Copyright (c) 2009, The V3VEE Project <http://www.v3vee.org> 
13  * All rights reserved.
14  *
15  * Author: Lei Xia <lxia@northwestern.edu>
16  *                Yuan Tang <ytang@northwestern.edu>
17  *
18  * This is free software.  You are permitted to use,
19  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
20  */
21
22 #ifndef __VNET_H__
23 #define __VNET_H__
24
25 #include <palacios/vmm.h>
26 #include <palacios/vmm_string.h>
27 #include <palacios/vmm_types.h>
28 #include <palacios/vmm_queue.h>
29 #include <palacios/vmm_hashtable.h>
30 #include <palacios/vmm_sprintf.h>
31
32 typedef enum {MAC_ANY, MAC_NOT, MAC_NONE} mac_type_t; //for 'src_mac_qual' and 'dst_mac_qual'
33 typedef enum {LINK_INTERFACE, LINK_EDGE, LINK_ANY} link_type_t; //for 'type' and 'src_type' in struct routing
34
35 //routing table entry
36 struct v3_vnet_route {
37     char src_mac[6];
38     char dest_mac[6];
39
40     mac_type_t src_mac_qual;
41     mac_type_t dest_mac_qual;
42
43     int link_idx; //link[dest] is the link to be used to send pkt
44     link_type_t link_type; //EDGE|INTERFACE|ANY
45  
46     int src_link_idx;
47     link_type_t src_type; //EDGE|INTERFACE|ANY
48 };
49
50
51 int v3_vnet_send_rawpkt(uchar_t *buf, int len, void *private_data);
52 int v3_vnet_send_udppkt(uchar_t *buf, int len, void *private_data);
53
54 int v3_vnet_add_route(struct v3_vnet_route *route);
55
56 //int v3_vnet_del_route();
57 //int v3_vnet_get_routes();
58
59
60 //int v3_vnet_add_link(struct v3_vnet_link link);
61
62 // int v3_vnet_del_link();
63 //int v3_vnet_get_link(int idx, struct vnet_link * link);
64
65
66 int v3_init_vnet();
67
68 //int v3_vnet_add_bridge(struct v3_vm_info * vm, uint8_t mac[6]);
69
70 int v3_vnet_add_node(struct v3_vm_info *info, 
71                    char * dev_name, 
72                    uchar_t mac[6], 
73                     int (*netif_input)(struct v3_vm_info * vm, uchar_t * pkt, uint_t size, void * private_data), 
74                     void * priv_data);
75
76
77 // temporary hack
78 int v3_vnet_pkt_process();
79
80
81 #endif
82
83