VBoxHostChannel.h revision c58f1213e628a545081c70e26c6b67a841cff880
/** @file
*
* Host Channel: the service definition.
*/
/*
* Copyright (C) 2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
#include <VBox/VBoxGuest2.h>
/*
* Host calls.
*/
#define VBOX_HOST_CHANNEL_HOST_FN_REGISTER 1
#define VBOX_HOST_CHANNEL_HOST_FN_UNREGISTER 2
/*
* Guest calls.
*/
/*
* The host event ids for the guest.
*/
#define VBOX_HOST_CHANNEL_EVENT_CANCELLED 0 /* Event was cancelled by FN_EVENT_CANCEL. */
/*
* The common control code ids for the VBOX_HOST_CHANNEL_FN_[CONTROL|QUERY]
*/
#define VBOX_HOST_CHANNEL_CTRL_EXISTS 0 /* Whether the channel instance or provider exists. */
#pragma pack(1)
/* Parameter of VBOX_HOST_CHANNEL_EVENT_RECV */
typedef struct VBOXHOSTCHANNELEVENTRECV
{
/*
* Guest calls.
*/
typedef struct VBoxHostChannelAttach
{
typedef struct VBoxHostChannelDetach
{
typedef struct VBoxHostChannelSend
{
typedef struct VBoxHostChannelRecv
{
typedef struct VBoxHostChannelControl
{
typedef struct VBoxHostChannelEventWait
{
typedef struct VBoxHostChannelEventCancel
{
typedef struct VBoxHostChannelQuery
{
/*
* Host calls
*/
typedef struct VBoxHostChannelHostRegister
{
typedef struct VBoxHostChannelHostUnregister
{
/* The channel provider will invoke this callback to report channel events. */
typedef struct VBOXHOSTCHANNELCALLBACKS
{
/* A channel event occured.
*
* @param pvCallbacks The callback context specified in HostChannelAttach.
* @param pvChannel The channel instance returned by HostChannelAttach.
* @param u32Id The event id.
* @param pvEvent The event parameters.
* @param cbEvent The size of event parameters.
*/
/* The channel has been deleted by the provider. pvCallback will not be used anymore.
*
* @param pvCallbacks The callback context specified in HostChannelAttach.
* @param pvChannel The channel instance returned by HostChannelAttach.
*/
typedef struct VBOXHOSTCHANNELINTERFACE
{
/* The channel provider context. */
void *pvProvider;
/* A new channel is requested.
*
* @param pvProvider The provider context VBOXHOSTCHANNELINTERFACE::pvProvider.
* @param ppvChannel Where to store pointer to the channel instance created by the provider.
* @param u32Flags Channel specific flags.
* @param pCallbacks Callbacks to be invoked by the channel provider.
* @param pvCallbacks The context of callbacks.
*/
DECLR3CALLBACKMEMBER(int, HostChannelAttach, (void *pvProvider, void **ppvChannel, uint32_t u32Flags,
/* The channel is closed. */
/* The guest sends data to the channel. */
/* The guest reads data from the channel. */
/* The guest talks to the provider of the channel.
* @param pvChannel The channel instance. NULL if the target is the provider, rather than a channel.
*/
#pragma pack()
#endif