VDEPlugSymDefs.h revision 028e03a81552386af45c3b8173f8a06e11ff9797
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync/** @file
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync * Symbols from libvdeplug.so.2 to be loaded at runtime for DrvVDE.cpp
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync */
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync/*
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync * Copyright (C) 2008-2010 Oracle Corporation
c58f1213e628a545081c70e26c6b67a841cff880vboxsync *
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * available from http://www.virtualbox.org. This file is free software;
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * you can redistribute it and/or modify it under the terms of the GNU
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * General Public License (GPL) as published by the Free Software
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync *
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * The contents of this file may alternatively be used under the terms
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * of the Common Development and Distribution License Version 1.0
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * VirtualBox OSE distribution, in which case the provisions of the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * CDDL are applicable instead of those of the GPL.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync *
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * You may elect to license modified versions of this file under the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * terms and conditions of either the GPL or the CDDL or both.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync */
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync#include <stddef.h>
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync#include <sys/types.h>
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync/** Opaque connection type */
7db630a55be9d955c8ac125da609b304cbcc6010vboxsyncstruct vdeconn;
7db630a55be9d955c8ac125da609b304cbcc6010vboxsynctypedef struct vdeconn VDECONN;
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync/** Structure to be passed to the open function describing the connection.
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync * All members can be left zero to use the default values. */
7db630a55be9d955c8ac125da609b304cbcc6010vboxsyncstruct vde_open_args
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync{
bd53394d08b77c8294f14b32dd26aa4670f888eevboxsync /** The port of the switch to connect to */
bd53394d08b77c8294f14b32dd26aa4670f888eevboxsync int port;
bd53394d08b77c8294f14b32dd26aa4670f888eevboxsync /** The group to set ownership of the port socket to */
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync char *group;
bd53394d08b77c8294f14b32dd26aa4670f888eevboxsync /** The file mode to set the port socket to */
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync mode_t mode;
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync};
bd53394d08b77c8294f14b32dd26aa4670f888eevboxsync
bd53394d08b77c8294f14b32dd26aa4670f888eevboxsync/** The file name of the DBus library */
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync#define VBOX_LIB_VDE_PLUG_NAME "libvdeplug.so.2"
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync#define RT_RUNTIME_LOADER_LIB_NAME VBOX_LIB_VDE_PLUG_NAME
bd53394d08b77c8294f14b32dd26aa4670f888eevboxsync
bd53394d08b77c8294f14b32dd26aa4670f888eevboxsync/** The name of the loader function */
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync#define RT_RUNTIME_LOADER_FUNCTION DrvVDELoadVDEPlug
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync/** The following are the symbols which we need from the library. */
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync#define RT_RUNTIME_LOADER_INSERT_SYMBOLS \
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync RT_PROXY_STUB(vde_open_real, VDECONN *, \
bd53394d08b77c8294f14b32dd26aa4670f888eevboxsync (const char *vde_switch, const char *descr, int interface_version, struct vde_open_args *open_args), \
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync (vde_switch, descr, interface_version, open_args)) \
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync RT_PROXY_STUB(vde_recv, size_t, \
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync (VDECONN *conn,void *buf,size_t len,int flags), \
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync (conn, buf, len, flags)) \
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync RT_PROXY_STUB(vde_send, size_t, \
(VDECONN *conn,const void *buf,size_t len,int flags), \
(conn, buf, len, flags)) \
RT_PROXY_STUB(vde_datafd, int, (VDECONN *conn), (conn)) \
RT_PROXY_STUB(vde_close, void, (VDECONN *conn), (conn))
#ifdef VDEPLUG_GENERATE_HEADER
# define RT_RUNTIME_LOADER_GENERATE_HEADER
# define RT_RUNTIME_LOADER_GENERATE_DECLS
# include <iprt/runtime-loader.h>
# undef RT_RUNTIME_LOADER_GENERATE_HEADER
# undef RT_RUNTIME_LOADER_GENERATE_DECLS
#elif defined (VDEPLUG_GENERATE_BODY)
# define RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
# include <iprt/runtime-loader.h>
# undef RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
#else
# error This file should only be included to generate stubs for loading the \
libvdeplug library at runtime
#endif
#undef RT_RUNTIME_LOADER_LIB_NAME
#undef RT_RUNTIME_LOADER_INSERT_SYMBOLS