X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Finclude%2Finterfaces%2Fvmm_packet.h;h=812cc1157de747657440bc8d06e10cb815229460;hp=a4ba3e5325616e0517eb4e5801da920de8da3bca;hb=9a32111c4074aafd55cd9590a24bd5c751a6fe61;hpb=3e31ab96d49dcd604f85f9f81a7acc37a43ef036 diff --git a/palacios/include/interfaces/vmm_packet.h b/palacios/include/interfaces/vmm_packet.h index a4ba3e5..812cc11 100644 --- a/palacios/include/interfaces/vmm_packet.h +++ b/palacios/include/interfaces/vmm_packet.h @@ -24,19 +24,35 @@ #include #include +#define V3_ETHINT_NAMELEN 126 + +struct v3_packet { + void * host_packet_data; + void * guest_packet_data; + + char dev_mac[ETH_ALEN]; + int (*input)(struct v3_packet * packet, uint8_t * buf, uint32_t len); + + struct list_head node; +}; + #ifdef __V3VEE__ +#include -int V3_send_raw(const char * pkt, uint32_t len); -int V3_packet_add_recver(const char * mac, struct v3_vm_info * vm); -int V3_packet_del_recver(const char * mac, struct v3_vm_info * vm); +struct v3_packet * v3_packet_connect(struct v3_vm_info * vm, const char * host_nic, + const char * mac, + int (*input)(struct v3_packet * packet, uint8_t * buf, uint32_t len), + void * guest_packet_data); + +int v3_packet_send(struct v3_packet * packet, uint8_t * buf, uint32_t len); +void v3_packet_close(struct v3_packet * packet); #endif struct v3_packet_hooks { - - int (*send)(const char * pkt, unsigned int size, void * private_data); - int (*add_recver)(const char * mac, struct v3_vm_info * vm); - int (*del_recver)(const char * mac, struct v3_vm_info * vm); + int (*connect)(struct v3_packet * packet, const char * host_nic, void * host_vm_data); + int (*send)(struct v3_packet * packet, uint8_t * buf, uint32_t len); + void (*close)(struct v3_packet * packet); }; extern void V3_Init_Packet(struct v3_packet_hooks * hooks);