#include "palacios-stream.h"
#include "palacios-file.h"
#include "palacios-serial.h"
+#include "palacios-socket.h"
+#include "palacios-vnet.h"
+#include "palacios-packet.h"
MODULE_LICENSE("GPL");
break;
}
+
+ case V3_START_NETWORK: {
+ struct v3_network net;
+ memset(&net, 0, sizeof(struct v3_network));
+
+ if(copy_from_user(&net, argp, sizeof(struct v3_network))){
+ printk("copy from user error getting network service requests ... \n");
+ return -EFAULT;
+ }
+
+ #ifdef CONFIG_PALACIOS_SOCKET
+ if(net.socket == 1){
+ palacios_socket_init();
+ printk("Started Palacios Socket\n");
+ }
+ #endif
+ #ifdef CONFIG_PALACIOS_PACKET
+ if(net.packet == 1){
+ palacios_init_packet(NULL);
+ printk("Started Palacios Direct Network Bridge\n");
+ }
+ #endif
+ #ifdef CONFIG_PALACIOS_VNET
+ if(net.vnet == 1){
+ palacios_init_vnet();
+ printk("Started Palacios VNET Service\n");
+ }
+ #endif
+
+ break;
+ }
default:
printk("\tUnhandled\n");
return -EINVAL;
--- /dev/null
+/*
+ * Palacios VM Raw Packet interface
+ * (c) Lei Xia, 2010
+ */
+
+#ifndef __PALACIOS_SOCKET_H__
+#define __PALACIOS_SOCKET_H__
+
+int palacios_socket_init(void);
+
+#endif
/* Global Control IOCTLs */
#define V3_START_GUEST 10
#define V3_ADD_MEMORY 50
+#define V3_START_NETWORK 60
/* VM Specific IOCTLs */
#define V3_VM_CONSOLE_CONNECT 20
unsigned long long num_pages;
};
-
-
+struct v3_network {
+ unsigned char socket;
+ unsigned char packet;
+ unsigned char vnet;
+};
void * trace_malloc(size_t size, gfp_t flags);
void trace_free(const void * objp);
if (!compare_ethaddr(dev->mac_addr, mac)){
return dev;
}
-
- char *dmac = dev->mac_addr;
- PrintDebug("device %d: %2x:%2x:%2x:%2x:%2x:%2x\n", dev->dev_id, dmac[0], dmac[1], dmac[2], dmac[3], dmac[4], dmac[5]);
}
return NULL;
int v3_vnet_find_dev(uint8_t * mac) {
struct vnet_dev * dev = NULL;
- PrintDebug("find_dev: %2x:%2x:%2x:%2x:%2x:%2x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
-
dev = dev_by_mac(mac);
if(dev != NULL) {
new_route = (struct vnet_route_info *)V3_Malloc(sizeof(struct vnet_route_info));
memset(new_route, 0, sizeof(struct vnet_route_info));
+#ifdef CONFIG_DEBUG_VNET
PrintDebug("VNET/P Core: add_route_entry:\n");
print_route(&route);
+#endif
memcpy(new_route->route_def.src_mac, route.src_mac, ETH_ALEN);
memcpy(new_route->route_def.dst_mac, route.dst_mac, ETH_ALEN);