VirtualBox

source: vbox/trunk/src/VBox/Main/testcase/tstUSBLinux.h@ 37952

Last change on this file since 37952 was 30714, checked in by vboxsync, 14 years ago

Main: remove SupportErrorInfo template magic

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1/* $Id: tstUSBLinux.h 30714 2010-07-07 16:20:03Z vboxsync $ */
2/** @file
3 * VirtualBox USB Proxy Service class, test version for Linux hosts.
4 */
5
6/*
7 * Copyright (C) 2008 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18
19#ifndef ____H_TSTUSBLINUX
20#define ____H_TSTUSBLINUX
21
22typedef int HRESULT;
23enum { S_OK = 0, E_NOTIMPL = 1 };
24
25#include <VBox/usb.h>
26#include <VBox/usbfilter.h>
27
28#include <VBox/err.h>
29
30#ifdef VBOX_USB_WITH_SYSFS
31# include <libhal.h>
32#endif
33
34#include <stdio.h>
35/**
36 * The Linux hosted USB Proxy Service.
37 */
38class USBProxyServiceLinux
39{
40public:
41 USBProxyServiceLinux()
42 : mLastError(VINF_SUCCESS)
43 {}
44
45 HRESULT initSysfs(void);
46 PUSBDEVICE getDevicesFromSysfs(void);
47 int getLastError(void)
48 {
49 return mLastError;
50 }
51
52private:
53 int start(void) { return VINF_SUCCESS; }
54 static void freeDevice(PUSBDEVICE) {} /* We don't care about leaks in a test. */
55 int usbProbeInterfacesFromLibhal(const char *pszHalUuid, PUSBDEVICE pDev);
56 int mLastError;
57# ifdef VBOX_USB_WITH_SYSFS
58 /** Our connection to DBus for getting information from hal. This will be
59 * NULL if the initialisation failed. */
60 DBusConnection *mDBusConnection;
61 /** Handle to libhal. */
62 LibHalContext *mLibHalContext;
63# endif
64};
65
66#endif /* !____H_TSTUSBLINUX */
67
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette