1 | /* $Id: pxremap.h 69498 2017-10-28 15:07:25Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * NAT Network - Loopback remapping, declarations and definitions.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2013-2016 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 _pxremap_h_
|
---|
19 | #define _pxremap_h_
|
---|
20 |
|
---|
21 | #include "lwip/err.h"
|
---|
22 | #include "lwip/ip_addr.h"
|
---|
23 |
|
---|
24 | struct netif;
|
---|
25 |
|
---|
26 |
|
---|
27 | #define PXREMAP_FAILED (-1)
|
---|
28 | #define PXREMAP_ASIS 0
|
---|
29 | #define PXREMAP_MAPPED 1
|
---|
30 |
|
---|
31 | /* IPv4 */
|
---|
32 | #if ARP_PROXY
|
---|
33 | int pxremap_proxy_arp(struct netif *netif, ip_addr_t *dst);
|
---|
34 | #endif
|
---|
35 | int pxremap_ip4_divert(struct netif *netif, ip_addr_t *dst);
|
---|
36 | int pxremap_outbound_ip4(ip_addr_t *dst, ip_addr_t *src);
|
---|
37 | int pxremap_inbound_ip4(ip_addr_t *dst, ip_addr_t *src);
|
---|
38 |
|
---|
39 | /* IPv6 */
|
---|
40 | int pxremap_proxy_na(struct netif *netif, ip6_addr_t *dst);
|
---|
41 | int pxremap_ip6_divert(struct netif *netif, ip6_addr_t *dst);
|
---|
42 | int pxremap_outbound_ip6(ip6_addr_t *dst, ip6_addr_t *src);
|
---|
43 | int pxremap_inbound_ip6(ip6_addr_t *dst, ip6_addr_t *src);
|
---|
44 |
|
---|
45 | #define pxremap_outbound_ipX(is_ipv6, dst, src) \
|
---|
46 | ((is_ipv6) ? pxremap_outbound_ip6(&(dst)->ip6, &(src)->ip6) \
|
---|
47 | : pxremap_outbound_ip4(&(dst)->ip4, &(src)->ip4))
|
---|
48 |
|
---|
49 | #endif /* _pxremap_h_ */
|
---|