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".
25 #include <palacios/vmm.h>
26 #include <palacios/vmm_ethernet.h>
33 #define LINK_INTERFACE 0
37 #define VNET_HASH_SIZE 17
39 #define GUEST_DRIVERN 0
41 #define HOST_LNX_BRIDGE 1
42 #define CTL_VM_BRIDGE 2
45 struct v3_vnet_route {
57 } __attribute__((packed));
67 * IMPORTANT The next three fields must be grouped and packed together
68 * They are used to generate a hash value
71 uint8_t hash_buf[VNET_HASH_SIZE];
75 uint8_t header[ETHERNET_HEADER_LEN];
77 } __attribute__((packed));
78 } __attribute__((packed));
79 } __attribute__((packed));
82 struct v3_vnet_dev_ops {
83 int (*input)(struct v3_vm_info * vm,
84 struct v3_vnet_pkt * pkt,
86 void (*poll) (struct v3_vm_info * vm, void * dev_data);
88 void (*start_tx)(void * dev_data);
89 void (*stop_tx)(void * dev_data);
92 struct v3_vnet_bridge_ops {
93 int (*input)(struct v3_vm_info * vm,
94 struct v3_vnet_pkt * pkt,
96 void (*poll)(struct v3_vm_info * vm,
100 int v3_init_vnet(void);
101 void v3_deinit_vnet(void);
103 int v3_vnet_send_pkt(struct v3_vnet_pkt * pkt, void * private_data);
105 void v3_vnet_poll(struct v3_vm_info * vm);
107 int v3_vnet_add_route(struct v3_vnet_route route);
108 int v3_vnet_add_bridge(struct v3_vm_info * vm,
109 struct v3_vnet_bridge_ops * ops,
114 int v3_vnet_add_dev(struct v3_vm_info * info, uint8_t mac[6],
115 struct v3_vnet_dev_ops * ops,
117 int v3_vnet_del_dev(int dev_id);