1 | /** @file
|
---|
2 | * Symbols from libvdeplug.so.2 to be loaded at runtime for DrvVDE.cpp
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2008-2010 Oracle Corporation
|
---|
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.
|
---|
15 | */
|
---|
16 |
|
---|
17 | #include <stddef.h>
|
---|
18 | #include <sys/types.h>
|
---|
19 | /** Opaque connection type */
|
---|
20 | struct vdeconn;
|
---|
21 | typedef struct vdeconn VDECONN;
|
---|
22 |
|
---|
23 | /** Structure to be passed to the open function describing the connection.
|
---|
24 | * All members can be left zero to use the default values. */
|
---|
25 | struct vde_open_args
|
---|
26 | {
|
---|
27 | /** The port of the switch to connect to */
|
---|
28 | int port;
|
---|
29 | /** The group to set ownership of the port socket to */
|
---|
30 | char *group;
|
---|
31 | /** The file mode to set the port socket to */
|
---|
32 | mode_t mode;
|
---|
33 | };
|
---|
34 |
|
---|
35 | /** The file name of the DBus library */
|
---|
36 | #define VBOX_LIB_VDE_PLUG_NAME "libvdeplug.so.2"
|
---|
37 | #define RT_RUNTIME_LOADER_LIB_NAME VBOX_LIB_VDE_PLUG_NAME
|
---|
38 |
|
---|
39 | /** The name of the loader function */
|
---|
40 | #define RT_RUNTIME_LOADER_FUNCTION DrvVDELoadVDEPlug
|
---|
41 |
|
---|
42 | /** The following are the symbols which we need from the library. */
|
---|
43 | #define RT_RUNTIME_LOADER_INSERT_SYMBOLS \
|
---|
44 | RT_PROXY_STUB(vde_open_real, VDECONN *, \
|
---|
45 | (const char *vde_switch, const char *descr, int interface_version, struct vde_open_args *open_args), \
|
---|
46 | (vde_switch, descr, interface_version, open_args)) \
|
---|
47 | RT_PROXY_STUB(vde_recv, size_t, \
|
---|
48 | (VDECONN *conn,void *buf,size_t len,int flags), \
|
---|
49 | (conn, buf, len, flags)) \
|
---|
50 | RT_PROXY_STUB(vde_send, size_t, \
|
---|
51 | (VDECONN *conn,const void *buf,size_t len,int flags), \
|
---|
52 | (conn, buf, len, flags)) \
|
---|
53 | RT_PROXY_STUB(vde_datafd, int, (VDECONN *conn), (conn))
|
---|
54 |
|
---|
55 | #ifdef VDEPLUG_GENERATE_HEADER
|
---|
56 | # define RT_RUNTIME_LOADER_GENERATE_HEADER
|
---|
57 | # define RT_RUNTIME_LOADER_GENERATE_DECLS
|
---|
58 | # include <iprt/runtime-loader.h>
|
---|
59 | # undef RT_RUNTIME_LOADER_GENERATE_HEADER
|
---|
60 | # undef RT_RUNTIME_LOADER_GENERATE_DECLS
|
---|
61 | #elif defined (VDEPLUG_GENERATE_BODY)
|
---|
62 | # define RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
|
---|
63 | # include <iprt/runtime-loader.h>
|
---|
64 | # undef RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
|
---|
65 | #else
|
---|
66 | # error This file should only be included to generate stubs for loading the \
|
---|
67 | libvdeplug library at runtime
|
---|
68 | #endif
|
---|
69 |
|
---|
70 | #undef RT_RUNTIME_LOADER_LIB_NAME
|
---|
71 | #undef RT_RUNTIME_LOADER_INSERT_SYMBOLS
|
---|