[23860] | 1 | /** @file
|
---|
[36310] | 2 | * Symbols from libvdeplug.so to be loaded at runtime for DrvVDE.cpp
|
---|
[23860] | 3 | */
|
---|
| 4 |
|
---|
| 5 | /*
|
---|
[69107] | 6 | * Copyright (C) 2008-2017 Oracle Corporation
|
---|
[23860] | 7 | *
|
---|
| 8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
| 9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
| 10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
| 11 | * General Public License (GPL) as published by the Free Software
|
---|
| 12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
| 13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
| 14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
[29200] | 15 | *
|
---|
| 16 | * The contents of this file may alternatively be used under the terms
|
---|
| 17 | * of the Common Development and Distribution License Version 1.0
|
---|
| 18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
| 19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
| 20 | * CDDL are applicable instead of those of the GPL.
|
---|
| 21 | *
|
---|
| 22 | * You may elect to license modified versions of this file under the
|
---|
| 23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
[23860] | 24 | */
|
---|
| 25 |
|
---|
[28406] | 26 | #include <stddef.h>
|
---|
| 27 | #include <sys/types.h>
|
---|
[30788] | 28 |
|
---|
[28406] | 29 | /** Opaque connection type */
|
---|
| 30 | struct vdeconn;
|
---|
| 31 | typedef struct vdeconn VDECONN;
|
---|
| 32 |
|
---|
| 33 | /** Structure to be passed to the open function describing the connection.
|
---|
| 34 | * All members can be left zero to use the default values. */
|
---|
| 35 | struct vde_open_args
|
---|
| 36 | {
|
---|
[30788] | 37 | /** The port of the switch to connect to. */
|
---|
[28406] | 38 | int port;
|
---|
[30788] | 39 | /** The group to set ownership of the port socket to. */
|
---|
[28406] | 40 | char *group;
|
---|
[30788] | 41 | /** The file mode to set the port socket to. */
|
---|
[28406] | 42 | mode_t mode;
|
---|
| 43 | };
|
---|
| 44 |
|
---|
[28357] | 45 | /** The file name of the DBus library */
|
---|
[36310] | 46 | #define VBOX_LIB_VDE_PLUG_NAME "libvdeplug.so"
|
---|
[29122] | 47 | #define RT_RUNTIME_LOADER_LIB_NAME VBOX_LIB_VDE_PLUG_NAME
|
---|
[28357] | 48 |
|
---|
| 49 | /** The name of the loader function */
|
---|
[28406] | 50 | #define RT_RUNTIME_LOADER_FUNCTION DrvVDELoadVDEPlug
|
---|
[28357] | 51 |
|
---|
[28406] | 52 | /** The following are the symbols which we need from the library. */
|
---|
[28357] | 53 | #define RT_RUNTIME_LOADER_INSERT_SYMBOLS \
|
---|
[28406] | 54 | RT_PROXY_STUB(vde_open_real, VDECONN *, \
|
---|
| 55 | (const char *vde_switch, const char *descr, int interface_version, struct vde_open_args *open_args), \
|
---|
| 56 | (vde_switch, descr, interface_version, open_args)) \
|
---|
| 57 | RT_PROXY_STUB(vde_recv, size_t, \
|
---|
[30788] | 58 | (VDECONN *conn, void *buf,size_t len, int flags), \
|
---|
[28406] | 59 | (conn, buf, len, flags)) \
|
---|
| 60 | RT_PROXY_STUB(vde_send, size_t, \
|
---|
[30788] | 61 | (VDECONN *conn, const void *buf, size_t len, int flags), \
|
---|
[28406] | 62 | (conn, buf, len, flags)) \
|
---|
[29461] | 63 | RT_PROXY_STUB(vde_datafd, int, (VDECONN *conn), (conn)) \
|
---|
| 64 | RT_PROXY_STUB(vde_close, void, (VDECONN *conn), (conn))
|
---|
[28357] | 65 |
|
---|
[28406] | 66 | #ifdef VDEPLUG_GENERATE_HEADER
|
---|
[28357] | 67 | # define RT_RUNTIME_LOADER_GENERATE_HEADER
|
---|
| 68 | # define RT_RUNTIME_LOADER_GENERATE_DECLS
|
---|
| 69 | # include <iprt/runtime-loader.h>
|
---|
| 70 | # undef RT_RUNTIME_LOADER_GENERATE_HEADER
|
---|
| 71 | # undef RT_RUNTIME_LOADER_GENERATE_DECLS
|
---|
[28406] | 72 | #elif defined (VDEPLUG_GENERATE_BODY)
|
---|
[28357] | 73 | # define RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
|
---|
| 74 | # include <iprt/runtime-loader.h>
|
---|
| 75 | # undef RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
|
---|
| 76 | #else
|
---|
[30788] | 77 | # error This file should only be included to generate stubs for loading the libvdeplug library at runtime
|
---|
[23860] | 78 | #endif
|
---|
| 79 |
|
---|
[28357] | 80 | #undef RT_RUNTIME_LOADER_LIB_NAME
|
---|
| 81 | #undef RT_RUNTIME_LOADER_INSERT_SYMBOLS
|
---|
[30788] | 82 |
|
---|