1 | /* $Id: VBoxNetUDP.h 17374 2009-03-05 06:50:26Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxNetUDP - UDP Library for IntNet.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009 Sun Microsystems, Inc.
|
---|
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 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
18 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
19 | * additional information or have any questions.
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef ___VBoxNetUDP_h___
|
---|
23 | #define ___VBoxNetUDP_h___
|
---|
24 |
|
---|
25 | #include <iprt/net.h>
|
---|
26 | #include <VBox/intnet.h>
|
---|
27 |
|
---|
28 | __BEGIN_DECLS
|
---|
29 |
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * Header pointers optionally returned by VBoxNetUDPMatch.
|
---|
33 | */
|
---|
34 | typedef struct VBOXNETUDPHDRS
|
---|
35 | {
|
---|
36 | PCRTNETETHERHDR pEth; /**< Pointer to the ethernet header. */
|
---|
37 | PCRTNETIPV4 pIpv4; /**< Pointer to the IPV4 header if IPV4 packet. */
|
---|
38 | PCRTNETUDP pUdp; /**< Pointer to the UDP header. */
|
---|
39 | } VBOXNETUDPHDRS;
|
---|
40 | /** Pointer to a VBOXNETUDPHDRS structure. */
|
---|
41 | typedef VBOXNETUDPHDRS *PVBOXNETUDPHDRS;
|
---|
42 |
|
---|
43 |
|
---|
44 | /** @name VBoxNetUDPMatch flags.
|
---|
45 | * @{ */
|
---|
46 | #define VBOXNETUDP_MATCH_UNICAST RT_BIT_32(0)
|
---|
47 | #define VBOXNETUDP_MATCH_BROADCAST RT_BIT_32(1)
|
---|
48 | #define VBOXNETUDP_MATCH_CHECKSUM RT_BIT_32(2)
|
---|
49 | #define VBOXNETUDP_MATCH_REQUIRE_CHECKSUM RT_BIT_32(3)
|
---|
50 | #define VBOXNETUDP_MATCH_PRINT_STDERR RT_BIT_32(31)
|
---|
51 | /** @} */
|
---|
52 |
|
---|
53 | void *VBoxNetUDPMatch(PCINTNETBUF pBuf, unsigned uDstPort, PCRTMAC pDstMac, uint32_t fFlags, PVBOXNETUDPHDRS pHdrs, size_t *pcb);
|
---|
54 |
|
---|
55 |
|
---|
56 | __END_DECLS
|
---|
57 |
|
---|
58 | #endif
|
---|
59 |
|
---|