3 * This file is part of the Palacios Virtual Machine Monitor developed
4 * by the V3VEE Project with funding from the United States National
5 * Science Foundation and the Department of Energy.
7 * The V3VEE Project is a joint project between Northwestern University
8 * and the University of New Mexico. You can find out more at
11 * Copyright (c) 2010, Lei Xia <lxia@northwestern.edu>
12 * Copyright (c) 2009, Yuan Tang <ytang@northwestern.edu>
13 * Copyright (c) 2010, The V3VEE Project <http://www.v3vee.org>
14 * All rights reserved.
16 * Author: Lei Xia <lxia@northwestern.edu>
17 * Yuan Tang <ytang@northwestern.edu>
19 * This is free software. You are permitted to use,
20 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
26 #include <palacios/vmm_ethernet.h>
27 #include <vnet/vnet_base.h>
28 #include <vnet/vnet_host.h>
29 #include <vnet/vnet_vmm.h>
38 #define LINK_INTERFACE 11
42 #define VNET_HASH_SIZE 17
44 struct v3_vnet_route {
45 uint8_t src_mac[ETH_ALEN];
46 uint8_t dst_mac[ETH_ALEN];
56 } __attribute__((packed));
66 * IMPORTANT The next three fields must be grouped and packed together
67 * They are used to generate a hash value
70 uint8_t hash_buf[VNET_HASH_SIZE];
74 uint8_t header[ETHERNET_HEADER_LEN];
76 } __attribute__((packed));
77 } __attribute__((packed));
78 } __attribute__((packed));
89 struct v3_vnet_bridge_ops {
90 int (*input)(struct v3_vm_info * vm,
91 struct v3_vnet_pkt * pkt,
93 void (*poll)(struct v3_vm_info * vm,
97 #define HOST_LNX_BRIDGE 1
98 #define CTL_VM_BRIDGE 2
100 int v3_vnet_add_bridge(struct v3_vm_info * vm,
101 struct v3_vnet_bridge_ops * ops,
105 void v3_vnet_del_bridge(uint8_t type);
107 int v3_vnet_add_route(struct v3_vnet_route route);
108 void v3_vnet_del_route(uint32_t route_idx);
110 int v3_vnet_send_pkt(struct v3_vnet_pkt * pkt, void * private_data, int synchronize);
111 int v3_vnet_find_dev(uint8_t * mac);
112 int v3_vnet_stat(struct vnet_stat * stats);
116 struct v3_vnet_dev_ops {
117 int (*input)(struct v3_vm_info * vm,
118 struct v3_vnet_pkt * pkt,
122 int v3_init_vnet(void);
123 void v3_deinit_vnet(void);
125 int v3_vnet_add_dev(struct v3_vm_info * info, uint8_t * mac,
126 struct v3_vnet_dev_ops * ops,
128 int v3_vnet_del_dev(int dev_id);