VirtualBox

source: vbox/trunk/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp@ 49109

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

VBoxNetLwipNAT.cpp: typo (copy'n'paste) in dynamic port-forwarding proccessing.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 37.0 KB
Line 
1/* $Id: VBoxNetLwipNAT.cpp 49109 2013-10-15 08:54:39Z vboxsync $ */
2/** @file
3 * VBoxNetNAT - NAT Service for connecting to IntNet.
4 */
5
6/*
7 * Copyright (C) 2009 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.215389.xyz. 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#include "winutils.h"
19
20#include <VBox/com/com.h>
21#include <VBox/com/listeners.h>
22#include <VBox/com/string.h>
23#include <VBox/com/Guid.h>
24#include <VBox/com/array.h>
25#include <VBox/com/ErrorInfo.h>
26#include <VBox/com/errorprint.h>
27#include <VBox/com/VirtualBox.h>
28
29#include <iprt/net.h>
30#include <iprt/initterm.h>
31#include <iprt/alloca.h>
32#ifndef RT_OS_WINDOWS
33# include <arpa/inet.h>
34#endif
35#include <iprt/err.h>
36#include <iprt/time.h>
37#include <iprt/timer.h>
38#include <iprt/thread.h>
39#include <iprt/stream.h>
40#include <iprt/path.h>
41#include <iprt/param.h>
42#include <iprt/pipe.h>
43#include <iprt/getopt.h>
44#include <iprt/string.h>
45#include <iprt/mem.h>
46#include <iprt/message.h>
47#include <iprt/req.h>
48#include <iprt/file.h>
49#include <iprt/semaphore.h>
50#include <iprt/cpp/utils.h>
51#define LOG_GROUP LOG_GROUP_NAT_SERVICE
52#include <VBox/log.h>
53
54#include <VBox/sup.h>
55#include <VBox/intnet.h>
56#include <VBox/intnetinline.h>
57#include <VBox/vmm/pdmnetinline.h>
58#include <VBox/vmm/vmm.h>
59#include <VBox/version.h>
60
61#ifndef RT_OS_WINDOWS
62# include <sys/poll.h>
63# include <sys/socket.h>
64# include <netinet/in.h>
65#endif
66
67#include <vector>
68#include <string>
69
70#include "../NetLib/VBoxNetLib.h"
71#include "../NetLib/VBoxNetBaseService.h"
72#include "VBoxLwipCore.h"
73
74extern "C"
75{
76/* bunch of LWIP headers */
77#include "lwip/opt.h"
78#ifdef LWIP_SOCKET
79# undef LWIP_SOCKET
80# define LWIP_SOCKET 0
81#endif
82#include "lwip/sys.h"
83#include "lwip/stats.h"
84#include "lwip/mem.h"
85#include "lwip/memp.h"
86#include "lwip/pbuf.h"
87#include "lwip/netif.h"
88#include "lwip/api.h"
89#include "lwip/tcp_impl.h"
90#include "ipv6/lwip/ethip6.h"
91#include "lwip/nd6.h" // for proxy_na_hook
92#include "lwip/mld6.h"
93#include "lwip/udp.h"
94#include "lwip/tcp.h"
95#include "lwip/tcpip.h"
96#include "lwip/sockets.h"
97#include "netif/etharp.h"
98
99#include "proxy.h"
100#include "pxremap.h"
101#include "portfwd.h"
102}
103
104#include "../NetLib/VBoxPortForwardString.h"
105
106static RTGETOPTDEF g_aGetOptDef[] =
107{
108 { "--port-forward4", 'p', RTGETOPT_REQ_STRING },
109 { "--port-forward6", 'P', RTGETOPT_REQ_STRING }
110};
111
112typedef struct NATSEVICEPORTFORWARDRULE
113{
114 PORTFORWARDRULE Pfr;
115 fwspec FWSpec;
116} NATSEVICEPORTFORWARDRULE, *PNATSEVICEPORTFORWARDRULE;
117
118typedef std::vector<NATSEVICEPORTFORWARDRULE> VECNATSERVICEPF;
119typedef VECNATSERVICEPF::iterator ITERATORNATSERVICEPF;
120typedef VECNATSERVICEPF::const_iterator CITERATORNATSERVICEPF;
121
122class NATNetworkListener;
123
124class VBoxNetLwipNAT: public VBoxNetBaseService
125{
126 friend class NATNetworkListener;
127 public:
128 VBoxNetLwipNAT();
129 virtual ~VBoxNetLwipNAT();
130 void usage(){ /* @todo: should be implemented */ };
131 int run();
132 virtual int init(void);
133 /* @todo: when configuration would be really needed */
134 virtual int parseOpt(int rc, const RTGETOPTUNION& getOptVal);
135
136 private:
137 struct proxy_options m_ProxyOptions;
138 struct sockaddr_in m_src4;
139 struct sockaddr_in6 m_src6;
140 /**
141 * place for registered local interfaces.
142 */
143 ip4_lomap m_lo2off[10];
144 ip4_lomap_desc m_loOptDescriptor;
145
146 uint16_t m_u16Mtu;
147 netif m_LwipNetIf;
148 /* Queues */
149 RTREQQUEUE hReqIntNet;
150 /* thread where we're waiting for a frames, no semaphores needed */
151 RTTHREAD hThrIntNetRecv;
152
153 /* Our NAT network descriptor in Main */
154 ComPtr<INATNetwork> net;
155 STDMETHOD(HandleEvent)(VBoxEventType_T aEventType, IEvent *pEvent);
156
157 RTSEMEVENT hSemSVC;
158 /* Only for debug needs, by default NAT service should load rules from SVC
159 * on startup, and then on sync them on events.
160 */
161 bool fDontLoadRulesOnStartup;
162 static void onLwipTcpIpInit(void *arg);
163 static void onLwipTcpIpFini(void *arg);
164 static err_t netifInit(netif *pNetif);
165 static err_t netifLinkoutput(netif *pNetif, pbuf *pBuf);
166 static int intNetThreadRecv(RTTHREAD, void *);
167 static void vboxNetLwipNATProcessXmit(void);
168
169 VECNATSERVICEPF m_vecPortForwardRule4;
170 VECNATSERVICEPF m_vecPortForwardRule6;
171
172 static int natServicePfRegister(NATSEVICEPORTFORWARDRULE& natServicePf);
173 static int natServiceProcessRegisteredPf(VECNATSERVICEPF& vecPf);
174};
175
176
177class NATNetworkListener
178{
179public:
180 NATNetworkListener():m_pNAT(NULL){}
181
182 HRESULT init(VBoxNetLwipNAT *pNAT)
183 {
184 AssertPtrReturn(pNAT, E_INVALIDARG);
185
186 m_pNAT = pNAT;
187 return S_OK;
188 }
189
190 HRESULT init()
191 {
192 m_pNAT = NULL;
193 return S_OK;
194 }
195
196 void uninit() { m_pNAT = NULL; }
197
198 STDMETHOD(HandleEvent)(VBoxEventType_T aEventType, IEvent *pEvent)
199 {
200 if (m_pNAT)
201 return m_pNAT->HandleEvent(aEventType, pEvent);
202 else
203 return E_FAIL;
204 }
205
206private:
207 VBoxNetLwipNAT *m_pNAT;
208};
209
210
211typedef ListenerImpl<NATNetworkListener, VBoxNetLwipNAT *> NATNetworkListenerImpl;
212VBOX_LISTENER_DECLARE(NATNetworkListenerImpl)
213
214
215
216static VBoxNetLwipNAT *g_pLwipNat;
217
218
219STDMETHODIMP VBoxNetLwipNAT::HandleEvent(VBoxEventType_T aEventType,
220 IEvent *pEvent)
221{
222 HRESULT hrc = S_OK;
223 switch (aEventType)
224 {
225 case VBoxEventType_OnNATNetworkSetting:
226 {
227 ComPtr<INATNetworkSettingEvent> evSettings(pEvent);
228 // XXX: only handle IPv6 default route for now
229
230 if (!m_ProxyOptions.ipv6_enabled)
231 {
232 break;
233 }
234
235 BOOL fIPv6DefaultRoute = FALSE;
236 hrc = evSettings->COMGETTER(AdvertiseDefaultIPv6RouteEnabled)(&fIPv6DefaultRoute);
237 AssertReturn(SUCCEEDED(hrc), hrc);
238
239 if (m_ProxyOptions.ipv6_defroute == fIPv6DefaultRoute)
240 {
241 break;
242 }
243
244 // XXX: TODO: should prod rtadvd for immediate unsolicited
245 // advertisement with new router lifetime
246 m_ProxyOptions.ipv6_defroute = fIPv6DefaultRoute;
247
248 break;
249 }
250
251 case VBoxEventType_OnNATNetworkPortForward:
252 {
253 com::Bstr name, strHostAddr, strGuestAddr;
254 LONG lHostPort, lGuestPort;
255 BOOL fCreateFW, fIPv6FW;
256 NATProtocol_T proto = NATProtocol_TCP;
257
258
259 ComPtr<INATNetworkPortForwardEvent> pfEvt = pEvent;
260
261 hrc = pfEvt->COMGETTER(Name)(name.asOutParam());
262 AssertReturn(SUCCEEDED(hrc), hrc);
263
264 hrc = pfEvt->COMGETTER(Proto)(&proto);
265 AssertReturn(SUCCEEDED(hrc), hrc);
266
267 hrc = pfEvt->COMGETTER(HostIp)(strHostAddr.asOutParam());
268 AssertReturn(SUCCEEDED(hrc), hrc);
269
270 hrc = pfEvt->COMGETTER(HostPort)(&lHostPort);
271 AssertReturn(SUCCEEDED(hrc), hrc);
272
273 hrc = pfEvt->COMGETTER(GuestIp)(strGuestAddr.asOutParam());
274 AssertReturn(SUCCEEDED(hrc), hrc);
275
276 hrc = pfEvt->COMGETTER(GuestPort)(&lGuestPort);
277 AssertReturn(SUCCEEDED(hrc), hrc);
278
279 hrc = pfEvt->COMGETTER(Create)(&fCreateFW);
280 AssertReturn(SUCCEEDED(hrc), hrc);
281
282 hrc = pfEvt->COMGETTER(Ipv6)(&fIPv6FW);
283 AssertReturn(SUCCEEDED(hrc), hrc);
284
285 VECNATSERVICEPF& rules = (fIPv6FW ?
286 m_vecPortForwardRule6 :
287 m_vecPortForwardRule4);
288
289 NATSEVICEPORTFORWARDRULE r;
290
291 RT_ZERO(r);
292
293 if (name.length() > RT_ELEMENTS(r.Pfr.aszPfrName))
294 {
295 hrc = E_INVALIDARG;
296 goto port_forward_done;
297 }
298
299 switch (proto)
300 {
301 case NATProtocol_TCP:
302 r.Pfr.iPfrProto = IPPROTO_TCP;
303 break;
304 case NATProtocol_UDP:
305 r.Pfr.iPfrProto = IPPROTO_UDP;
306 break;
307 default:
308 goto port_forward_done;
309 }
310
311
312 RTStrPrintf(r.Pfr.aszPfrName, RT_ELEMENTS(r.Pfr.aszPfrName),
313 "%s",
314 com::Utf8Str(name).c_str());
315
316 RTStrPrintf(r.Pfr.aszPfrHostAddr, RT_ELEMENTS(r.Pfr.aszPfrHostAddr),
317 "%s",
318 com::Utf8Str(strHostAddr).c_str());
319
320 /* XXX: limits should be checked */
321 r.Pfr.u16PfrHostPort = (uint16_t)lHostPort;
322
323 RTStrPrintf(r.Pfr.aszPfrGuestAddr, RT_ELEMENTS(r.Pfr.aszPfrGuestAddr),
324 "%s",
325 com::Utf8Str(strGuestAddr).c_str());
326
327 /* XXX: limits should be checked */
328 r.Pfr.u16PfrGuestPort = (uint16_t)lGuestPort;
329
330 if (fCreateFW) /* Addition */
331 {
332 rules.push_back(r);
333
334 natServicePfRegister(rules.back());
335 }
336 else /* Deletion */
337 {
338 ITERATORNATSERVICEPF it;
339 for (it = rules.begin(); it != rules.end(); ++it)
340 {
341 /* compare */
342 NATSEVICEPORTFORWARDRULE& natFw = *it;
343 if ( natFw.Pfr.iPfrProto == r.Pfr.iPfrProto
344 && natFw.Pfr.u16PfrHostPort == r.Pfr.u16PfrHostPort
345 && (strncmp(natFw.Pfr.aszPfrHostAddr, r.Pfr.aszPfrHostAddr, INET6_ADDRSTRLEN) == 0)
346 && natFw.Pfr.u16PfrGuestPort == r.Pfr.u16PfrGuestPort
347 && (strncmp(natFw.Pfr.aszPfrGuestAddr, r.Pfr.aszPfrGuestAddr, INET6_ADDRSTRLEN) == 0))
348 {
349 fwspec *pFwCopy = (fwspec *)RTMemAllocZ(sizeof(fwspec));
350 if (!pFwCopy)
351 {
352 break;
353 }
354 memcpy(pFwCopy, &natFw.FWSpec, sizeof(fwspec));
355
356 /* We shouldn't care about pFwCopy this memory will be freed when
357 * will message will arrive to the destination.
358 */
359 portfwd_rule_del(pFwCopy);
360
361 rules.erase(it);
362 break;
363 }
364 } /* loop over vector elements */
365 } /* condition add or delete */
366 port_forward_done:
367 /* clean up strings */
368 name.setNull();
369 strHostAddr.setNull();
370 strGuestAddr.setNull();
371 break;
372 }
373 }
374 return hrc;
375}
376
377
378void VBoxNetLwipNAT::onLwipTcpIpInit(void* arg)
379{
380 AssertPtrReturnVoid(arg);
381 VBoxNetLwipNAT *pNat = static_cast<VBoxNetLwipNAT *>(arg);
382
383 HRESULT hrc = com::Initialize();
384 Assert(!FAILED(hrc));
385
386 proxy_arp_hook = pxremap_proxy_arp;
387 proxy_ip4_divert_hook = pxremap_ip4_divert;
388
389 proxy_na_hook = pxremap_proxy_na;
390 proxy_ip6_divert_hook = pxremap_ip6_divert;
391
392 /* lwip thread */
393 RTNETADDRIPV4 IpNetwork;
394 IpNetwork.u = g_pLwipNat->m_Ipv4Address.u & g_pLwipNat->m_Ipv4Netmask.u;
395
396 ip_addr LwipIpAddr, LwipIpNetMask, LwipIpNetwork;
397
398 memcpy(&LwipIpAddr, &g_pLwipNat->m_Ipv4Address, sizeof(ip_addr));
399 memcpy(&LwipIpNetMask, &g_pLwipNat->m_Ipv4Netmask, sizeof(ip_addr));
400 memcpy(&LwipIpNetwork, &IpNetwork, sizeof(ip_addr));
401
402 netif *pNetif = netif_add(&g_pLwipNat->m_LwipNetIf /* Lwip Interface */,
403 &LwipIpAddr /* IP address*/,
404 &LwipIpNetMask /* Network mask */,
405 &LwipIpAddr /* gateway address, @todo: is self IP acceptable? */,
406 g_pLwipNat /* state */,
407 VBoxNetLwipNAT::netifInit /* netif_init_fn */,
408 lwip_tcpip_input /* netif_input_fn */);
409
410 AssertPtrReturnVoid(pNetif);
411
412 netif_set_up(pNetif);
413 netif_set_link_up(pNetif);
414
415 if (pNat->m_ProxyOptions.ipv6_enabled) {
416 /*
417 * XXX: lwIP currently only ever calls mld6_joingroup() in
418 * nd6_tmr() for fresh tentative addresses, which is a wrong place
419 * to do it - but I'm not keen on fixing this properly for now
420 * (with correct handling of interface up and down transitions,
421 * etc). So stick it here as a kludge.
422 */
423 for (int i = 0; i <= 1; ++i) {
424 ip6_addr_t *paddr = netif_ip6_addr(pNetif, i);
425
426 ip6_addr_t solicited_node_multicast_address;
427 ip6_addr_set_solicitednode(&solicited_node_multicast_address,
428 paddr->addr[3]);
429 mld6_joingroup(paddr, &solicited_node_multicast_address);
430 }
431
432 /*
433 * XXX: We must join the solicited-node multicast for the
434 * addresses we do IPv6 NA-proxy for. We map IPv6 loopback to
435 * proxy address + 1. We only need the low 24 bits, and those are
436 * fixed.
437 */
438 {
439 ip6_addr_t solicited_node_multicast_address;
440
441 ip6_addr_set_solicitednode(&solicited_node_multicast_address,
442 /* last 24 bits of the address */
443 PP_HTONL(0x00000002));
444 mld6_netif_joingroup(pNetif, &solicited_node_multicast_address);
445 }
446 }
447
448 proxy_init(&g_pLwipNat->m_LwipNetIf, &g_pLwipNat->m_ProxyOptions);
449
450 natServiceProcessRegisteredPf(g_pLwipNat->m_vecPortForwardRule4);
451 natServiceProcessRegisteredPf(g_pLwipNat->m_vecPortForwardRule6);
452}
453
454
455void VBoxNetLwipNAT::onLwipTcpIpFini(void* arg)
456{
457 AssertPtrReturnVoid(arg);
458 VBoxNetLwipNAT *pThis = (VBoxNetLwipNAT *)arg;
459
460 /* XXX: proxy finalization */
461 netif_set_link_down(&g_pLwipNat->m_LwipNetIf);
462 netif_set_down(&g_pLwipNat->m_LwipNetIf);
463 netif_remove(&g_pLwipNat->m_LwipNetIf);
464
465}
466
467/*
468 * Callback for netif_add() to initialize the interface.
469 */
470err_t VBoxNetLwipNAT::netifInit(netif *pNetif)
471{
472 err_t rcLwip = ERR_OK;
473
474 AssertPtrReturn(pNetif, ERR_ARG);
475
476 VBoxNetLwipNAT *pNat = static_cast<VBoxNetLwipNAT *>(pNetif->state);
477 AssertPtrReturn(pNat, ERR_ARG);
478
479 LogFlowFunc(("ENTER: pNetif[%c%c%d]\n", pNetif->name[0], pNetif->name[1], pNetif->num));
480 /* validity */
481 AssertReturn( pNetif->name[0] == 'N'
482 && pNetif->name[1] == 'T', ERR_ARG);
483
484
485 pNetif->hwaddr_len = sizeof(RTMAC);
486 memcpy(pNetif->hwaddr, &pNat->m_MacAddress, sizeof(RTMAC));
487
488 pNat->m_u16Mtu = 1500; // XXX: FIXME
489 pNetif->mtu = pNat->m_u16Mtu;
490
491 pNetif->flags = NETIF_FLAG_BROADCAST
492 | NETIF_FLAG_ETHARP /* Don't bother driver with ARP and let Lwip resolve ARP handling */
493 | NETIF_FLAG_ETHERNET; /* Lwip works with ethernet too */
494
495 pNetif->linkoutput = netifLinkoutput; /* ether-level-pipe */
496 pNetif->output = lwip_etharp_output; /* ip-pipe */
497
498 if (pNat->m_ProxyOptions.ipv6_enabled) {
499 pNetif->output_ip6 = ethip6_output;
500
501 /* IPv6 link-local address in slot 0 */
502 netif_create_ip6_linklocal_address(pNetif, /* :from_mac_48bit */ 1);
503 netif_ip6_addr_set_state(pNetif, 0, IP6_ADDR_PREFERRED); // skip DAD
504
505 /*
506 * RFC 4193 Locally Assigned Global ID (ULA) in slot 1
507 * [fd17:625c:f037:XXXX::1] where XXXX, 16 bit Subnet ID, are two
508 * bytes from the middle of the IPv4 address, e.g. :dead: for
509 * 10.222.173.1
510 */
511 u8_t nethi = ip4_addr2(&pNetif->ip_addr);
512 u8_t netlo = ip4_addr3(&pNetif->ip_addr);
513
514 ip6_addr_t *paddr = netif_ip6_addr(pNetif, 1);
515 IP6_ADDR(paddr, 0, 0xFD, 0x17, 0x62, 0x5C);
516 IP6_ADDR(paddr, 1, 0xF0, 0x37, nethi, netlo);
517 IP6_ADDR(paddr, 2, 0x00, 0x00, 0x00, 0x00);
518 IP6_ADDR(paddr, 3, 0x00, 0x00, 0x00, 0x01);
519 netif_ip6_addr_set_state(pNetif, 1, IP6_ADDR_PREFERRED);
520
521#if LWIP_IPV6_SEND_ROUTER_SOLICIT
522 pNetif->rs_count = 0;
523#endif
524 }
525
526 LogFlowFunc(("LEAVE: %d\n", rcLwip));
527 return rcLwip;
528}
529
530
531/**
532 * Intnet-recv thread
533 */
534int VBoxNetLwipNAT::intNetThreadRecv(RTTHREAD, void *)
535{
536 int rc = VINF_SUCCESS;
537
538 /* 1. initialization and connection */
539 HRESULT hrc = com::Initialize();
540 if (FAILED(hrc))
541 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to initialize COM!");
542
543 /* Well we're ready */
544 PINTNETRINGBUF pRingBuf = &g_pLwipNat->m_pIfBuf->Recv;
545
546 for (;;)
547 {
548 /*
549 * Wait for a packet to become available.
550 */
551 /* 2. waiting for request for */
552 rc = g_pLwipNat->waitForIntNetEvent(2000);
553 if (RT_FAILURE(rc))
554 {
555 if (rc == VERR_TIMEOUT || rc == VERR_INTERRUPTED)
556 {
557 /* do we want interrupt anyone ??? */
558 continue;
559 }
560 LogRel(("VBoxNetNAT: waitForIntNetEvent returned %Rrc\n", rc));
561 AssertRCReturn(rc,ERR_IF);
562 }
563
564 /*
565 * Process the receive buffer.
566 */
567 PCINTNETHDR pHdr;
568
569 while ((pHdr = IntNetRingGetNextFrameToRead(pRingBuf)) != NULL)
570 {
571 uint8_t const u8Type = pHdr->u8Type;
572 size_t cbFrame = pHdr->cbFrame;
573 uint8_t *pu8Frame = NULL;
574 pbuf *pPbufHdr = NULL;
575 pbuf *pPbuf = NULL;
576 switch (u8Type)
577 {
578
579 case INTNETHDR_TYPE_FRAME:
580 /* @todo:should it be really here?
581 * Well well well, we're accessing lwip code here
582 */
583 pPbufHdr = pPbuf = pbuf_alloc(PBUF_RAW, pHdr->cbFrame, PBUF_POOL);
584 if (!pPbuf)
585 {
586 LogRel(("NAT: Can't allocate send buffer cbFrame=%u\n", cbFrame));
587 break;
588 }
589 Assert(pPbufHdr->tot_len == cbFrame);
590 pu8Frame = (uint8_t *)IntNetHdrGetFramePtr(pHdr, g_pLwipNat->m_pIfBuf);
591 while(pPbuf)
592 {
593 memcpy(pPbuf->payload, pu8Frame, pPbuf->len);
594 pu8Frame += pPbuf->len;
595 pPbuf = pPbuf->next;
596 }
597
598 g_pLwipNat->m_LwipNetIf.input(pPbufHdr, &g_pLwipNat->m_LwipNetIf);
599
600 AssertReleaseRC(rc);
601 break;
602 case INTNETHDR_TYPE_GSO:
603 {
604 PCPDMNETWORKGSO pGso = IntNetHdrGetGsoContext(pHdr,
605 g_pLwipNat->m_pIfBuf);
606 if (!PDMNetGsoIsValid(pGso, cbFrame,
607 cbFrame - sizeof(PDMNETWORKGSO)))
608 break;
609 cbFrame -= sizeof(PDMNETWORKGSO);
610 uint8_t abHdrScratch[256];
611 uint32_t const cSegs = PDMNetGsoCalcSegmentCount(pGso,
612 cbFrame);
613 for (size_t iSeg = 0; iSeg < cSegs; iSeg++)
614 {
615 uint32_t cbSegFrame;
616 void *pvSegFrame =
617 PDMNetGsoCarveSegmentQD(pGso,
618 (uint8_t *)(pGso + 1),
619 cbFrame,
620 abHdrScratch,
621 iSeg,
622 cSegs,
623 &cbSegFrame);
624
625 pPbuf = pbuf_alloc(PBUF_RAW, cbSegFrame, PBUF_POOL);
626 if (!pPbuf)
627 {
628 LogRel(("NAT: Can't allocate send buffer cbFrame=%u\n", cbSegFrame));
629 break;
630 }
631 Assert( !pPbuf->next
632 && pPbuf->len == cbSegFrame);
633 memcpy(pPbuf->payload, pvSegFrame, cbSegFrame);
634 g_pLwipNat->m_LwipNetIf.input(pPbuf, &g_pLwipNat->m_LwipNetIf);
635
636 }
637
638 }
639 break;
640 case INTNETHDR_TYPE_PADDING:
641 break;
642 default:
643 STAM_REL_COUNTER_INC(&g_pLwipNat->m_pIfBuf->cStatBadFrames);
644 break;
645 }
646 IntNetRingSkipFrame(&g_pLwipNat->m_pIfBuf->Recv);
647
648 } /* loop */
649 }
650 /* 3. deinitilization and termination */
651 LogFlowFuncLeaveRC(rc);
652 return rc;
653}
654
655
656/**
657 *
658 */
659void VBoxNetLwipNAT::vboxNetLwipNATProcessXmit()
660{
661 int rc = VINF_SUCCESS;
662 INTNETIFSENDREQ SendReq;
663 SendReq.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC;
664 SendReq.Hdr.cbReq = sizeof(SendReq);
665 SendReq.pSession = g_pLwipNat->m_pSession;
666 SendReq.hIf = g_pLwipNat->m_hIf;
667 rc = SUPR3CallVMMR0Ex(NIL_RTR0PTR, NIL_VMCPUID, VMMR0_DO_INTNET_IF_SEND, 0, &SendReq.Hdr);
668 AssertRC(rc);
669}
670
671
672err_t VBoxNetLwipNAT::netifLinkoutput(netif *pNetif, pbuf *pPBuf)
673{
674 int rc = VINF_SUCCESS;
675 err_t rcLwip = ERR_OK;
676 AssertPtrReturn(pNetif, ERR_ARG);
677 AssertPtrReturn(pPBuf, ERR_ARG);
678 AssertReturn((void *)g_pLwipNat == pNetif->state, ERR_ARG);
679 LogFlowFunc(("ENTER: pNetif[%c%c%d], pPbuf:%p\n",
680 pNetif->name[0],
681 pNetif->name[1],
682 pNetif->num,
683 pPBuf));
684
685 /*
686 * We're on the lwip thread ...
687 * try accure Xmit lock (actually we DO accure the lock ... )
688 * 1. we've entered csXmit so we should create frame
689 * 1.a. Frame creation success see 2.
690 * 1.b. (hm ... what about queue processing in place)
691 * 1.c. 2nd attempt create frame
692 * 1.d. Unlock the Xmit
693 * 1.e. goto BUSY.1
694 * 2. Copy pbuf to the frame
695 * 3. Send
696 * 4. leave csXmit & return.
697 *
698 * @todo: perhaps we can use it for optimization,
699 * e.g. drop UDP and reoccure lock on TCP NOTE: now BUSY is unachievable!
700 * Otherwise (BUSY)
701 * 1. Unbuffered (drop)
702 * (buffered)
703 * 1. Copy pbuf to entermediate buffer.
704 * 2. Add call buffer to the queue
705 * 3. return.
706 */
707 /* see p.1 */
708 rc = VINF_SUCCESS;
709 PINTNETHDR pHdr = NULL;
710 uint8_t *pu8Frame = NULL;
711 int offFrame = 0;
712 int idxSg = 0;
713 struct pbuf *pPBufPtr = pPBuf;
714 /* Allocate frame, and pad it if required. */
715 rc = IntNetRingAllocateFrame(&g_pLwipNat->m_pIfBuf->Send, pPBuf->tot_len, &pHdr, (void **)&pu8Frame);
716 if (RT_SUCCESS(rc))
717 {
718 /* see p. 2 */
719 while (pPBufPtr)
720 {
721 memcpy(&pu8Frame[offFrame], pPBufPtr->payload, pPBufPtr->len);
722 offFrame += pPBufPtr->len;
723 pPBufPtr = pPBufPtr->next;
724 }
725 }
726 if (RT_FAILURE(rc))
727 {
728 /* Could it be that some frames are still in the ring buffer */
729 /* 1.c */
730 AssertMsgFailed(("Debug Me!"));
731 }
732
733 /* Commit - what really this function do */
734 IntNetRingCommitFrameEx(&g_pLwipNat->m_pIfBuf->Send, pHdr, pPBuf->tot_len);
735
736 g_pLwipNat->vboxNetLwipNATProcessXmit();
737
738 AssertRCReturn(rc, ERR_IF);
739 LogFlowFunc(("LEAVE: %d\n", rcLwip));
740 return rcLwip;
741}
742
743
744VBoxNetLwipNAT::VBoxNetLwipNAT()
745{
746 LogFlowFuncEnter();
747
748 m_ProxyOptions.ipv6_enabled = 0;
749 m_ProxyOptions.ipv6_defroute = 0;
750 m_ProxyOptions.tftp_root = NULL;
751 m_ProxyOptions.src4 = NULL;
752 m_ProxyOptions.src6 = NULL;
753 memset(&m_src4, 0, sizeof(m_src4));
754 memset(&m_src6, 0, sizeof(m_src6));
755 m_src4.sin_family = AF_INET;
756 m_src6.sin6_family = AF_INET6;
757#if HAVE_SA_LEN
758 m_src4.sin_len = sizeof(m_src4);
759 m_src6.sin6_len = sizeof(m_src6);
760#endif
761
762 m_LwipNetIf.name[0] = 'N';
763 m_LwipNetIf.name[1] = 'T';
764 m_MacAddress.au8[0] = 0x52;
765 m_MacAddress.au8[1] = 0x54;
766 m_MacAddress.au8[2] = 0;
767 m_MacAddress.au8[3] = 0x12;
768 m_MacAddress.au8[4] = 0x35;
769 m_MacAddress.au8[5] = 0;
770 m_Ipv4Address.u = RT_MAKE_U32_FROM_U8( 10, 0, 2, 2); // NB: big-endian
771 m_Ipv4Netmask.u = RT_H2N_U32_C(0xffffff00);
772
773 fDontLoadRulesOnStartup = false;
774
775 for(unsigned int i = 0; i < RT_ELEMENTS(g_aGetOptDef); ++i)
776 m_vecOptionDefs.push_back(&g_aGetOptDef[i]);
777
778 m_enmTrunkType = kIntNetTrunkType_SrvNat;
779
780 LogFlowFuncLeave();
781}
782
783
784VBoxNetLwipNAT::~VBoxNetLwipNAT()
785{
786 if (m_ProxyOptions.tftp_root != NULL)
787 {
788 RTStrFree((char *)m_ProxyOptions.tftp_root);
789 }
790}
791
792
793int VBoxNetLwipNAT::natServicePfRegister(NATSEVICEPORTFORWARDRULE& natPf)
794{
795 int lrc = 0;
796 int rc = VINF_SUCCESS;
797 int socketSpec = SOCK_STREAM;
798 char *pszHostAddr;
799 int sockFamily = (natPf.Pfr.fPfrIPv6 ? PF_INET6 : PF_INET);
800
801 switch(natPf.Pfr.iPfrProto)
802 {
803 case IPPROTO_TCP:
804 socketSpec = SOCK_STREAM;
805 break;
806 case IPPROTO_UDP:
807 socketSpec = SOCK_DGRAM;
808 break;
809 default:
810 return VERR_IGNORED; /* Ah, just ignore the garbage */
811 }
812
813 pszHostAddr = natPf.Pfr.aszPfrHostAddr;
814
815 /* XXX: workaround for inet_pton and an empty ipv4 address
816 * in rule declaration.
817 */
818 if ( sockFamily == PF_INET
819 && pszHostAddr[0] == 0)
820 pszHostAddr = (char *)"0.0.0.0"; /* XXX: fix it! without type cast */
821
822
823 lrc = fwspec_set(&natPf.FWSpec,
824 sockFamily,
825 socketSpec,
826 pszHostAddr,
827 natPf.Pfr.u16PfrHostPort,
828 natPf.Pfr.aszPfrGuestAddr,
829 natPf.Pfr.u16PfrGuestPort);
830
831 AssertReturn(!lrc, VERR_IGNORED);
832
833 fwspec *pFwCopy = (fwspec *)RTMemAllocZ(sizeof(fwspec));
834 AssertPtrReturn(pFwCopy, VERR_IGNORED);
835
836 /*
837 * We need pass the copy, because we can't be sure
838 * how much this pointer will be valid in LWIP environment.
839 */
840 memcpy(pFwCopy, &natPf.FWSpec, sizeof(fwspec));
841
842 lrc = portfwd_rule_add(pFwCopy);
843
844 AssertReturn(!lrc, VERR_IGNORED);
845
846 return VINF_SUCCESS;
847}
848
849
850int VBoxNetLwipNAT::natServiceProcessRegisteredPf(VECNATSERVICEPF& vecRules){
851 ITERATORNATSERVICEPF it;
852 for (it = vecRules.begin();
853 it != vecRules.end(); ++it)
854 {
855 int rc = natServicePfRegister((*it));
856 if (RT_FAILURE(rc))
857 {
858 LogRel(("PF: %s is ignored\n", (*it).Pfr.aszPfrName));
859 continue;
860 }
861 }
862 return VINF_SUCCESS;
863}
864
865
866int VBoxNetLwipNAT::init()
867{
868 com::Bstr bstr;
869 int rc = VINF_SUCCESS;
870 LogFlowFuncEnter();
871
872
873 /* virtualbox initialized in super class */
874
875 HRESULT hrc;
876 hrc = virtualbox->FindNATNetworkByName(com::Bstr(m_Network.c_str()).raw(),
877 net.asOutParam());
878 AssertComRCReturn(hrc, VERR_NOT_FOUND);
879
880 BOOL fIPv6Enabled = FALSE;
881 hrc = net->COMGETTER(IPv6Enabled)(&fIPv6Enabled);
882 AssertComRCReturn(hrc, VERR_NOT_FOUND);
883
884 BOOL fIPv6DefaultRoute = FALSE;
885 if (fIPv6Enabled)
886 {
887 hrc = net->COMGETTER(AdvertiseDefaultIPv6RouteEnabled)(&fIPv6DefaultRoute);
888 AssertComRCReturn(hrc, VERR_NOT_FOUND);
889 }
890
891 m_ProxyOptions.ipv6_enabled = fIPv6Enabled;
892 m_ProxyOptions.ipv6_defroute = fIPv6DefaultRoute;
893
894#if !defined(RT_OS_WINDOWS)
895 /* XXX: Temporaly disabled this code on Windows for further debugging */
896 ComPtr<IEventSource> pES;
897
898 hrc = net->COMGETTER(EventSource)(pES.asOutParam());
899 AssertComRC(hrc);
900
901 ComObjPtr<NATNetworkListenerImpl> listener;
902 hrc = listener.createObject();
903 AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);
904
905 hrc = listener->init(new NATNetworkListener(), this);
906 AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);
907
908 com::SafeArray<VBoxEventType_T> events;
909 events.push_back(VBoxEventType_OnNATNetworkPortForward);
910 events.push_back(VBoxEventType_OnNATNetworkSetting);
911
912 hrc = pES->RegisterListener(listener, ComSafeArrayAsInParam(events), true);
913 AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);
914#endif
915
916 com::Bstr bstrSourceIp4Key = com::BstrFmt("NAT/%s/SourceIp4",m_Network.c_str());
917 com::Bstr bstrSourceIpX;
918 RTNETADDRIPV4 addr;
919 hrc = virtualbox->GetExtraData(bstrSourceIp4Key.raw(), bstrSourceIpX.asOutParam());
920 if (SUCCEEDED(hrc))
921 {
922 rc = RTNetStrToIPv4Addr(com::Utf8Str(bstrSourceIpX).c_str(), &addr);
923 if (RT_SUCCESS(rc))
924 {
925 RT_ZERO(m_src4);
926
927 m_src4.sin_addr.s_addr = addr.u;
928 m_ProxyOptions.src4 = &m_src4;
929
930 bstrSourceIpX.setNull();
931 }
932 }
933
934 if (!fDontLoadRulesOnStartup)
935 {
936 /* XXX: extract function and do not duplicate */
937 com::SafeArray<BSTR> rules;
938 hrc = net->COMGETTER(PortForwardRules4)(ComSafeArrayAsOutParam(rules));
939 Assert(SUCCEEDED(hrc));
940
941 size_t idxRules = 0;
942 for (idxRules = 0; idxRules < rules.size(); ++idxRules)
943 {
944 Log(("%d-rule: %ls\n", idxRules, rules[idxRules]));
945 NATSEVICEPORTFORWARDRULE Rule;
946 RT_ZERO(Rule);
947 rc = netPfStrToPf(com::Utf8Str(rules[idxRules]).c_str(), 0, &Rule.Pfr);
948 AssertRC(rc);
949 m_vecPortForwardRule4.push_back(Rule);
950 }
951
952 rules.setNull();
953 hrc = net->COMGETTER(PortForwardRules6)(ComSafeArrayAsOutParam(rules));
954 Assert(SUCCEEDED(hrc));
955
956 for (idxRules = 0; idxRules < rules.size(); ++idxRules)
957 {
958 Log(("%d-rule: %ls\n", idxRules, rules[idxRules]));
959 NATSEVICEPORTFORWARDRULE Rule;
960 netPfStrToPf(com::Utf8Str(rules[idxRules]).c_str(), 1, &Rule.Pfr);
961 m_vecPortForwardRule6.push_back(Rule);
962 }
963 } /* if (!fDontLoadRulesOnStartup) */
964
965 com::SafeArray<BSTR> strs;
966 int count_strs;
967 hrc = net->COMGETTER(LocalMappings)(ComSafeArrayAsOutParam(strs));
968 if ( SUCCEEDED(hrc)
969 && (count_strs = strs.size()))
970 {
971 unsigned int j = 0;
972 int i;
973
974 for (i = 0; i < count_strs && j < RT_ELEMENTS(m_lo2off); ++i)
975 {
976 char aszAddr[17];
977 RTNETADDRIPV4 ip4addr;
978 char *pszTerm;
979 uint32_t u32Off;
980 com::Utf8Str strLo2Off(strs[i]);
981 const char *pszLo2Off = strLo2Off.c_str();
982
983 RT_ZERO(aszAddr);
984
985 pszTerm = RTStrStr(pszLo2Off, "=");
986
987 if ( !pszTerm
988 || (pszTerm - pszLo2Off) >= 17)
989 continue;
990
991 memcpy(aszAddr, pszLo2Off, (pszTerm - pszLo2Off));
992 rc = RTNetStrToIPv4Addr(aszAddr, &ip4addr);
993 if (RT_FAILURE(rc))
994 continue;
995
996 u32Off = RTStrToUInt32(pszTerm + 1);
997 if (u32Off == 0)
998 continue;
999
1000 ip4_addr_set_u32(&m_lo2off[j].loaddr, ip4addr.u);
1001 m_lo2off[j].off = u32Off;
1002 ++j;
1003 }
1004
1005 m_loOptDescriptor.lomap = m_lo2off;
1006 m_loOptDescriptor.num_lomap = j;
1007 m_ProxyOptions.lomap_desc = &m_loOptDescriptor;
1008 }
1009
1010 hrc = virtualbox->COMGETTER(HomeFolder)(bstr.asOutParam());
1011 AssertComRCReturn(hrc, VERR_NOT_FOUND);
1012 if (!bstr.isEmpty())
1013 {
1014 com::Utf8Str strTftpRoot(com::Utf8StrFmt("%ls%c%s",
1015 bstr.raw(), RTPATH_DELIMITER, "TFTP"));
1016 char *pszStrTemp; // avoid const char ** vs char **
1017 rc = RTStrUtf8ToCurrentCP(&pszStrTemp, strTftpRoot.c_str());
1018 AssertRC(rc);
1019 m_ProxyOptions.tftp_root = pszStrTemp;
1020 }
1021
1022 /* end of COM initialization */
1023
1024 rc = RTSemEventCreate(&hSemSVC);
1025 AssertRCReturn(rc, rc);
1026
1027 rc = RTReqQueueCreate(&hReqIntNet);
1028 AssertRCReturn(rc, rc);
1029
1030 g_pLwipNat->tryGoOnline();
1031 vboxLwipCoreInitialize(VBoxNetLwipNAT::onLwipTcpIpInit, this);
1032
1033 rc = RTThreadCreate(&g_pLwipNat->hThrIntNetRecv, /* thread handle*/
1034 VBoxNetLwipNAT::intNetThreadRecv, /* routine */
1035 NULL, /* user data */
1036 128 * _1K, /* stack size */
1037 RTTHREADTYPE_IO, /* type */
1038 0, /* flags, @todo: waitable ?*/
1039 "INTNET-RECV");
1040 AssertRCReturn(rc,rc);
1041
1042
1043
1044 LogFlowFuncLeaveRC(rc);
1045 return rc;
1046}
1047
1048
1049int VBoxNetLwipNAT::parseOpt(int rc, const RTGETOPTUNION& Val)
1050{
1051 switch (rc)
1052 {
1053 case 'p':
1054 case 'P':
1055 {
1056 NATSEVICEPORTFORWARDRULE Rule;
1057 VECNATSERVICEPF& rules = (rc == 'P'?
1058 m_vecPortForwardRule6
1059 : m_vecPortForwardRule4);
1060
1061 fDontLoadRulesOnStartup = true;
1062
1063 RT_ZERO(Rule);
1064
1065 int irc = netPfStrToPf(Val.psz, (rc == 'P'), &Rule.Pfr);
1066 rules.push_back(Rule);
1067 return VINF_SUCCESS;
1068 }
1069 default:;
1070 }
1071 return VERR_NOT_FOUND;
1072}
1073
1074
1075int VBoxNetLwipNAT::run()
1076{
1077
1078 while(true)
1079 {
1080 RTSemEventWait(g_pLwipNat->hSemSVC, RT_INDEFINITE_WAIT);
1081 }
1082
1083 vboxLwipCoreFinalize(VBoxNetLwipNAT::onLwipTcpIpFini, this);
1084
1085 /* @todo: clean up of port-forward rules */
1086 m_vecPortForwardRule4.clear();
1087 m_vecPortForwardRule6.clear();
1088
1089 return VINF_SUCCESS;
1090}
1091
1092
1093/**
1094 * Entry point.
1095 */
1096extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp)
1097{
1098 LogFlowFuncEnter();
1099
1100 NOREF(envp);
1101
1102#ifdef RT_OS_WINDOWS
1103 WSADATA wsaData;
1104 int err;
1105
1106 err = WSAStartup(MAKEWORD(2,2), &wsaData);
1107 if (err)
1108 {
1109 fprintf(stderr, "wsastartup: failed (%d)\n", err);
1110 return 1;
1111 }
1112#endif
1113
1114 HRESULT hrc = com::Initialize();
1115#ifdef VBOX_WITH_XPCOM
1116 if (hrc == NS_ERROR_FILE_ACCESS_DENIED)
1117 {
1118 char szHome[RTPATH_MAX] = "";
1119 com::GetVBoxUserHomeDirectory(szHome, sizeof(szHome));
1120 return RTMsgErrorExit(RTEXITCODE_FAILURE,
1121 "Failed to initialize COM because the global settings directory '%s' is not accessible!", szHome);
1122 }
1123#endif
1124 if (FAILED(hrc))
1125 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to initialize COM!");
1126
1127 g_pLwipNat = new VBoxNetLwipNAT();
1128
1129 Log2(("NAT: initialization\n"));
1130 int rc = g_pLwipNat->parseArgs(argc - 1, argv + 1);
1131 AssertRC(rc);
1132
1133
1134 if (!rc)
1135 {
1136
1137 g_pLwipNat->init();
1138 g_pLwipNat->run();
1139
1140 }
1141 delete g_pLwipNat;
1142 return 0;
1143}
1144
1145
1146#ifndef VBOX_WITH_HARDENING
1147
1148int main(int argc, char **argv, char **envp)
1149{
1150 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB);
1151 if (RT_FAILURE(rc))
1152 return RTMsgInitFailure(rc);
1153
1154 return TrustedMain(argc, argv, envp);
1155}
1156
1157# if defined(RT_OS_WINDOWS)
1158
1159static LRESULT CALLBACK WindowProc(HWND hwnd,
1160 UINT uMsg,
1161 WPARAM wParam,
1162 LPARAM lParam
1163)
1164{
1165 if(uMsg == WM_DESTROY)
1166 {
1167 PostQuitMessage(0);
1168 return 0;
1169 }
1170 return DefWindowProc (hwnd, uMsg, wParam, lParam);
1171}
1172
1173static LPCWSTR g_WndClassName = L"VBoxNetNatLwipClass";
1174
1175static DWORD WINAPI MsgThreadProc(__in LPVOID lpParameter)
1176{
1177 HWND hwnd = 0;
1178 HINSTANCE hInstance = (HINSTANCE)GetModuleHandle (NULL);
1179 bool bExit = false;
1180
1181 /* Register the Window Class. */
1182 WNDCLASS wc;
1183 wc.style = 0;
1184 wc.lpfnWndProc = WindowProc;
1185 wc.cbClsExtra = 0;
1186 wc.cbWndExtra = sizeof(void *);
1187 wc.hInstance = hInstance;
1188 wc.hIcon = NULL;
1189 wc.hCursor = NULL;
1190 wc.hbrBackground = (HBRUSH)(COLOR_BACKGROUND + 1);
1191 wc.lpszMenuName = NULL;
1192 wc.lpszClassName = g_WndClassName;
1193
1194 ATOM atomWindowClass = RegisterClass(&wc);
1195
1196 if (atomWindowClass != 0)
1197 {
1198 /* Create the window. */
1199 hwnd = CreateWindowEx (WS_EX_TOOLWINDOW | WS_EX_TRANSPARENT | WS_EX_TOPMOST,
1200 g_WndClassName, g_WndClassName,
1201 WS_POPUPWINDOW,
1202 -200, -200, 100, 100, NULL, NULL, hInstance, NULL);
1203
1204 if (hwnd)
1205 {
1206 SetWindowPos(hwnd, HWND_TOPMOST, -200, -200, 0, 0,
1207 SWP_NOACTIVATE | SWP_HIDEWINDOW | SWP_NOCOPYBITS | SWP_NOREDRAW | SWP_NOSIZE);
1208
1209 MSG msg;
1210 while (GetMessage(&msg, NULL, 0, 0))
1211 {
1212 TranslateMessage(&msg);
1213 DispatchMessage(&msg);
1214 }
1215
1216 DestroyWindow (hwnd);
1217
1218 bExit = true;
1219 }
1220
1221 UnregisterClass (g_WndClassName, hInstance);
1222 }
1223
1224 if(bExit)
1225 {
1226 /* no need any accuracy here, in anyway the DHCP server usually gets terminated with TerminateProcess */
1227 exit(0);
1228 }
1229
1230 return 0;
1231}
1232
1233
1234
1235/** (We don't want a console usually.) */
1236int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
1237{
1238#if 0
1239 NOREF(hInstance); NOREF(hPrevInstance); NOREF(lpCmdLine); NOREF(nCmdShow);
1240
1241 HANDLE hThread = CreateThread(
1242 NULL, /*__in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes, */
1243 0, /*__in SIZE_T dwStackSize, */
1244 MsgThreadProc, /*__in LPTHREAD_START_ROUTINE lpStartAddress,*/
1245 NULL, /*__in_opt LPVOID lpParameter,*/
1246 0, /*__in DWORD dwCreationFlags,*/
1247 NULL /*__out_opt LPDWORD lpThreadId*/
1248 );
1249
1250 if(hThread != NULL)
1251 CloseHandle(hThread);
1252
1253#endif
1254 return main(__argc, __argv, environ);
1255}
1256# endif /* RT_OS_WINDOWS */
1257
1258#endif /* !VBOX_WITH_HARDENING */
1259
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