4 * Copyright(c) 2022 Vladislav Yaroshchuk <vladislav.yaroshchuk@jetbrains.com>
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
13 #include "qemu/osdep.h"
14 #include "vmnet_int.h"
17 #include <vmnet/vmnet.h>
18 #include <dispatch/dispatch.h>
21 * From vmnet.framework documentation
23 * Each read/write call allows up to 200 packets to be
24 * read or written for a maximum of 256KB.
26 * Each packet written should be a complete
29 * https://developer.apple.com/documentation/vmnet
31 #define VMNET_PACKETS_LIMIT 200
33 typedef struct VmnetState
{
35 interface_ref vmnet_if
;
38 uint64_t max_packet_size
;
40 dispatch_queue_t if_queue
;
44 struct vmpktdesc packets_buf
[VMNET_PACKETS_LIMIT
];
45 int packets_send_current_pos
;
46 int packets_send_end_pos
;
48 struct iovec iov_buf
[VMNET_PACKETS_LIMIT
];
51 const char *vmnet_status_map_str(vmnet_return_t status
);
53 int vmnet_if_create(NetClientState
*nc
,
57 ssize_t
vmnet_receive_common(NetClientState
*nc
,
61 void vmnet_cleanup_common(NetClientState
*nc
);
63 #endif /* VMNET_INT_H */