X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_vnet.h;h=90e3ca13319aba1ccfc122d751d21a2761d5ab41;hp=c94c6c625d40e22dc7f4d5143fb4e76b9151c5cf;hb=ca0524fbe3facc7acc0fa57d2449dffeb48d1ef6;hpb=4a159a81f66d3d4b826392059086962db2776a5c diff --git a/palacios/include/palacios/vmm_vnet.h b/palacios/include/palacios/vmm_vnet.h index c94c6c6..90e3ca1 100644 --- a/palacios/include/palacios/vmm_vnet.h +++ b/palacios/include/palacios/vmm_vnet.h @@ -36,7 +36,7 @@ #define ETHERNET_DATA_MAX 1500 #define ETHERNET_PACKET_LEN (ETHERNET_HEADER_LEN + ETHERNET_DATA_MAX) -typedef enum {MAC_ANY, MAC_NOT, MAC_NONE, MAC_EMPTY} mac_type_t; //for 'src_mac_qual' and 'dst_mac_qual' +typedef enum {MAC_ANY, MAC_NOT, MAC_NONE} mac_type_t; //for 'src_mac_qual' and 'dst_mac_qual' typedef enum {LINK_INTERFACE, LINK_EDGE, LINK_ANY} link_type_t; //for 'type' and 'src_type' in struct routing typedef enum {TCP_TYPE, UDP_TYPE, NONE_TYPE} prot_type_t; @@ -103,7 +103,7 @@ struct vnet_if_device { struct vnet_if_link { - prot_type_t pro_type; //protocal type of this link + prot_type_t pro_type; //transport layer protocal type of this link unsigned long dest_ip; uint16_t dest_port; @@ -130,12 +130,20 @@ struct link_entry { int v3_vnet_send_rawpkt(uchar_t *buf, int len, void *private_data); int v3_vnet_send_udppkt(uchar_t *buf, int len, void *private_data); -//int vnet_register_device(struct vm_device *vdev, -// char *dev_name, -// uchar_t mac[6], -// int (*netif_input)(uchar_t * pkt, uint_t size, void *private_data), -// void *data); -//int vnet_unregister_device(char *dev_name); +int vnet_register_device(struct vm_device *vdev, + char *dev_name, + uchar_t mac[6], + int (*netif_input)(uchar_t * pkt, uint_t size, void *private_data), + void *data); + +int vnet_add_route_entry(char src_mac[6], + char dest_mac[6], + int src_mac_qual, + int dest_mac_qual, + int link_idx, + link_type_t link_type, + int src_link_idx, + link_type_t src_link_type); int v3_vnet_pkt_process();