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) 2010, Lei Xia <lxia@northwestern.edu>
11 * Copyright (c) 2009, Yuan Tang <ytang@northwestern.edu>
12 * Copyright (c) 2010, 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".
22 #ifndef __VNET_CORE_H__
23 #define __VNET_CORE_H__
25 #include <palacios/vmm.h>
26 #include <palacios/vmm_ethernet.h>
35 #define LINK_INTERFACE 11
39 #define VNET_HASH_SIZE 17
41 extern int v3_vnet_debug;
43 struct v3_vnet_route {
44 uint8_t src_mac[ETH_ALEN];
45 uint8_t dst_mac[ETH_ALEN];
55 } __attribute__((packed));
65 * IMPORTANT The next three fields must be grouped and packed together
66 * They are used to generate a hash value
69 uint8_t hash_buf[VNET_HASH_SIZE];
73 uint8_t header[ETHERNET_HEADER_LEN];
75 } __attribute__((packed));
76 } __attribute__((packed));
77 } __attribute__((packed));
88 struct v3_vnet_bridge_ops {
89 int (*input)(struct v3_vm_info * vm,
90 struct v3_vnet_pkt * pkt,
92 void (*poll)(struct v3_vm_info * vm,
96 #define HOST_LNX_BRIDGE 1
97 #define CTL_VM_BRIDGE 2
99 int v3_vnet_add_bridge(struct v3_vm_info * vm,
100 struct v3_vnet_bridge_ops * ops,
103 int v3_vnet_add_route(struct v3_vnet_route route);
104 int v3_vnet_send_pkt(struct v3_vnet_pkt * pkt, void * private_data, int synchronize);
105 int v3_vnet_find_dev(uint8_t * mac);
106 int v3_vnet_stat(struct vnet_stat * stats);
110 struct v3_vnet_dev_ops {
111 int (*input)(struct v3_vm_info * vm,
112 struct v3_vnet_pkt * pkt,
116 int v3_init_vnet(void);
117 void v3_deinit_vnet(void);
119 int v3_vnet_add_dev(struct v3_vm_info * info, uint8_t * mac,
120 struct v3_vnet_dev_ops * ops,
122 int v3_vnet_del_dev(int dev_id);