]> git.saurik.com Git - apple/xnu.git/blob - bsd/netinet6/natpt_var.h
xnu-123.5.tar.gz
[apple/xnu.git] / bsd / netinet6 / natpt_var.h
1 /* $KAME: natpt_var.h,v 1.6 2000/03/25 07:23:57 sumikawa Exp $ */
2
3 /*
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the project nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 */
31
32
33 extern int natpt_initialized;
34 extern int ip6_protocol_tr;
35 extern u_int natpt_debug;
36 extern u_int natpt_dump;
37
38 extern struct ifnet *natpt_ip6src;
39
40 /* natpt_log.c */
41 void natpt_logMsg __P((int, void *, size_t));
42 void natpt_logMBuf __P((int, struct mbuf *, char *));
43 void natpt_logIp4 __P((int, struct ip *));
44 void natpt_logIp6 __P((int, struct ip6_hdr *));
45 int natpt_log __P((int, int, void *, size_t));
46 int natpt_logIN6addr __P((int, char *, struct in6_addr *));
47
48 void natpt_debugProbe __P((void));
49 void natpt_assert __P((const char *, int, const char *));
50 void natpt_initialize __P((void));
51
52
53 /* natpt_rule.c */
54 struct _cSlot *lookingForIncomingV4Rule __P((struct _cv *));
55 struct _cSlot *lookingForOutgoingV4Rule __P((struct _cv *));
56 struct _cSlot *lookingForIncomingV6Rule __P((struct _cv *));
57 struct _cSlot *lookingForOutgoingV6Rule __P((struct _cv *));
58 int _natptEnableTrans __P((caddr_t));
59 int _natptDisableTrans __P((caddr_t));
60 int _natptSetRule __P((caddr_t));
61 int _natptSetFaithRule __P((caddr_t));
62 int _natptFlushRule __P((caddr_t));
63 int _natptSetPrefix __P((caddr_t));
64
65 int _natptBreak __P((void));
66
67
68 struct ifBox *natpt_asIfBox __P((char *));
69 struct ifBox *natpt_setIfBox __P((char *));
70
71
72 /* natpt_trans.c */
73 #ifdef NATPT_NAT
74 struct mbuf *translatingIPv4To4 __P((struct _cv *, struct pAddr *));
75 struct mbuf *translatingICMPv4To4 __P((struct _cv *, struct pAddr *));
76 struct mbuf *translatingTCPv4To4 __P((struct _cv *, struct pAddr *));
77 struct mbuf *translatingUDPv4To4 __P((struct _cv *, struct pAddr *));
78 #endif
79
80 struct mbuf *translatingIPv4To6 __P((struct _cv *, struct pAddr *));
81 struct mbuf *translatingICMPv4To6 __P((struct _cv *, struct pAddr *));
82 struct mbuf *translatingTCPv4To6 __P((struct _cv *, struct pAddr *));
83 struct mbuf *translatingUDPv4To6 __P((struct _cv *, struct pAddr *));
84 struct mbuf *translatingTCPUDPv4To6 __P((struct _cv *, struct pAddr *, struct _cv *));
85
86 struct mbuf *translatingIPv6To4 __P((struct _cv *, struct pAddr *));
87 struct mbuf *translatingICMPv6To4 __P((struct _cv *, struct pAddr *));
88 struct mbuf *translatingTCPv6To4 __P((struct _cv *, struct pAddr *));
89 struct mbuf *translatingUDPv6To4 __P((struct _cv *, struct pAddr *));
90 struct mbuf *translatingTCPUDPv6To4 __P((struct _cv *, struct pAddr *, struct _cv *));
91
92
93 /* natpt_tslot.c */
94 struct _tSlot *lookingForOutgoingV4Hash __P((struct _cv *));
95 struct _tSlot *lookingForIncomingV4Hash __P((struct _cv *));
96 struct _tSlot *lookingForOutgoingV6Hash __P((struct _cv *));
97 struct _tSlot *lookingForIncomingV6Hash __P((struct _cv *));
98 struct _tSlot *internIncomingV4Hash __P((int, struct _cSlot *, struct _cv *));
99 struct _tSlot *internOutgoingV4Hash __P((int, struct _cSlot *, struct _cv *));
100 struct _tSlot *internIncomingV6Hash __P((int, struct _cSlot *, struct _cv *));
101 struct _tSlot *internOutgoingV6Hash __P((int, struct _cSlot *, struct _cv *));
102
103 struct _tSlot *checkTraceroute6Return __P((struct _cv *));
104
105 void init_hash __P((void));
106 void init_tslot __P((void));
107
108
109 /* natpt_usrreq.c */
110 void natpt_input __P((struct mbuf *, struct sockproto *,
111 struct sockaddr *src, struct sockaddr *dst));
112