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.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
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.
15 * Author: Lei Xia <lxia@northwestern.edu>
16 * Yuan Tang <ytang@northwestern.edu>
18 * This is free software. You are permitted to use,
19 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
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>
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
36 struct v3_vnet_route {
40 mac_type_t src_mac_qual;
41 mac_type_t dest_mac_qual;
43 int link_idx; //link[dest] is the link to be used to send pkt
44 link_type_t link_type; //EDGE|INTERFACE|ANY
47 link_type_t src_type; //EDGE|INTERFACE|ANY
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);
54 int v3_vnet_add_route(struct v3_vnet_route *route);
56 //int v3_vnet_del_route();
57 //int v3_vnet_get_routes();
60 //int v3_vnet_add_link(struct v3_vnet_link link);
62 // int v3_vnet_del_link();
63 //int v3_vnet_get_link(int idx, struct vnet_link * link);
68 //int v3_vnet_add_bridge(struct v3_vm_info * vm, uint8_t mac[6]);
70 int v3_vnet_add_node(struct v3_vm_info *info,
73 int (*netif_input)(struct v3_vm_info * vm, uchar_t * pkt, uint_t size, void * private_data),
78 int v3_vnet_pkt_process();