VirtualBox

source: vbox/trunk/src/VBox/NetworkServices/NetLib/VBoxNetBaseService.h@ 44824

Last change on this file since 44824 was 44824, checked in by vboxsync, 12 years ago

Network-service for lwip-driven proxy.
additionally enables SrvNat trunk type for Nat services.
Note: all changes disabled by default.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1/* $Id: VBoxNetBaseService.h 44824 2013-02-25 18:30:42Z vboxsync $ */
2/** @file
3 * VBoxNetUDP - IntNet Client Library.
4 */
5
6/*
7 * Copyright (C) 2009-2011 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#ifndef ___VBoxNetBaseService_h___
19#define ___VBoxNetBaseService_h___
20#include <iprt/critsect.h>
21class VBoxNetBaseService
22{
23public:
24 VBoxNetBaseService();
25 virtual ~VBoxNetBaseService();
26 int parseArgs(int argc, char **argv);
27 int tryGoOnline(void);
28 void shutdown(void);
29 int syncEnter() { return RTCritSectEnter(&this->m_csThis);}
30 int syncLeave() { return RTCritSectLeave(&this->m_csThis);}
31 int waitForIntNetEvent(int cMillis);
32 int sendBufferOnWire(PCINTNETSEG pSg, int cSg, size_t cbBuffer);
33 void flushWire();
34 virtual void usage(void) = 0;
35 virtual void run(void) = 0;
36 virtual int init(void);
37 virtual int parseOpt(int rc, const RTGETOPTUNION& getOptVal) = 0;
38
39 inline void debugPrint( int32_t iMinLevel, bool fMsg, const char *pszFmt, ...) const;
40 void debugPrintV(int32_t iMinLevel, bool fMsg, const char *pszFmt, va_list va) const;
41public:
42 /** @name The server configuration data members.
43 * @{ */
44 std::string m_Name;
45 std::string m_Network;
46 std::string m_TrunkName;
47 INTNETTRUNKTYPE m_enmTrunkType;
48 RTMAC m_MacAddress;
49 RTNETADDRIPV4 m_Ipv4Address;
50 /* cs for syncing */
51 RTCRITSECT m_csThis;
52 /** @} */
53 /** @name The network interface
54 * @{ */
55 PSUPDRVSESSION m_pSession;
56 uint32_t m_cbSendBuf;
57 uint32_t m_cbRecvBuf;
58 INTNETIFHANDLE m_hIf; /**< The handle to the network interface. */
59 PINTNETBUF m_pIfBuf; /**< Interface buffer. */
60 std::vector<PRTGETOPTDEF> m_vecOptionDefs;
61 /** @} */
62 /** @name Debug stuff
63 * @{ */
64 int32_t m_cVerbosity;
65private:
66 PRTGETOPTDEF getOptionsPtr();
67 /** @} */
68};
69#endif
Note: See TracBrowser for help on using the repository browser.

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