Function

vmnet_interface_set_event_callback

Schedules a callback to be executed when events for the specified interface are received.

Declaration

vmnet_return_t vmnet_interface_set_event_callback(interface_ref interface, interface_event_t event_mask, dispatch_queue_t queue, vmnet_interface_event_callback_t callback);

Parameters

interface

The interface reference.

flags

Flags indicating the events that the handler block will be called upon. See vmnet for possible values.

queue

The queue on which the handler is scheduled.

handler

A block to be executed after interface is started.

event_id

The type of event. See vmnet for possible values.

event

An XPC dictionary containing information about the event.

Possible keys are described in event XPC Dictionary.

Return Value

Returns vmnet on success, or an error code on failure. See vmnet for possible values.

Discussion

Once the block is set, the callback can be unset by calling the function again, specifying a NULL queue and a NULL handler.

See Also

Starting and Stopping Interfaces

vmnet_start_interface

Starts host or shared mode on an interface with a specified configuration.

vmnet_stop_interface

Stops the interface.