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".
27 #include <palacios/vmm.h>
29 typedef enum {MAC_ANY, MAC_NOT, MAC_NONE} mac_type_t; //for 'src_mac_qual' and 'dst_mac_qual'
30 typedef enum {LINK_INTERFACE, LINK_EDGE, LINK_ANY} link_type_t; //for 'type' and 'src_type' in struct routing
33 #define VNET_HASH_SIZE 17
34 #define ETHERNET_HEADER_LEN 14
35 #define ETHERNET_DATA_MAX 1500
36 #define ETHERNET_PACKET_LEN (ETHERNET_HEADER_LEN + ETHERNET_DATA_MAX)
39 struct v3_vnet_route {
46 uint32_t dst_id; //link[dest] is the link to be used to send pkt
47 uint8_t dst_type; //EDGE|INTERFACE|ANY
50 uint8_t src_type; //EDGE|INTERFACE|ANY
51 } __attribute__((packed));
61 * IMPORTANT The next three fields must be grouped and packed together
62 * They are used to generate a hash value
65 uint8_t hash_buf[VNET_HASH_SIZE];
69 uint8_t data[ETHERNET_PACKET_LEN];
70 } __attribute__((packed));
71 } __attribute__((packed));
72 } __attribute__((packed));
75 int v3_vnet_send_pkt(struct v3_vnet_pkt * pkt);
77 int v3_vnet_add_route(struct v3_vnet_route route);
79 //int v3_vnet_del_route();
85 //int v3_vnet_add_bridge(struct v3_vm_info * vm, uint8_t mac[6]);
87 int v3_vnet_add_dev(struct v3_vm_info *info, uint8_t mac[6],
88 int (*dev_input)(struct v3_vm_info * vm, struct v3_vnet_pkt * pkt, void * private_data),
93 int v3_vnet_pkt_process();