FreeBSD/Linux Kernel Cross Reference
sys/netns/ns_var.h
1 /* $NetBSD: ns_var.h,v 1.13 2004/04/19 00:10:48 matt Exp $ */
2
3 /*-
4 * Copyright (c) 1995 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Christos Zoulas.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 #ifdef _KERNEL
40 extern long ns_pexseq;
41 extern const u_char nsctlerrmap[];
42
43 struct socket;
44 struct nspcb;
45 struct ifaddr;
46 struct ifnet;
47 struct ns_ifaddr;
48 struct sockaddr_ns;
49 struct mbuf;
50 struct ns_addr;
51 struct route;
52 struct ifnet_en;
53 struct in_addr;
54 struct sockaddr;
55
56 /* ns.c */
57 int ns_control (struct socket *, u_long, caddr_t, struct ifnet *,
58 struct proc *);
59 void ns_ifscrub (struct ifnet *, struct ns_ifaddr *);
60 int ns_ifinit (struct ifnet *, struct ns_ifaddr *, struct sockaddr_ns *,
61 int);
62 struct ns_ifaddr *ns_iaonnetof (struct ns_addr *);
63 void ns_purgeaddr (struct ifaddr *, struct ifnet *);
64 void ns_purgeif (struct ifnet *);
65
66 /* ns_cksum.c */
67 u_int16_t ns_cksum (struct mbuf *, int);
68
69 /* ns_error.c */
70 int ns_err_x (int);
71 void ns_error (struct mbuf *, int, int );
72 void ns_printhost (struct ns_addr *);
73 void ns_err_input (struct mbuf *);
74 u_int32_t nstime (void);
75 int ns_echo (struct mbuf *);
76
77 /* ns_input.c */
78 void ns_init (void);
79 void nsintr (void);
80 void *idp_ctlinput (int, struct sockaddr *, void *);
81 void idp_forward (struct mbuf *);
82 int idp_do_route (struct ns_addr *, struct route *);
83 void idp_undo_route (struct route *);
84 void ns_watch_output (struct mbuf *, struct ifnet *);
85
86 /* ns_ip.c */
87 struct ifnet_en *nsipattach (void);
88 int nsipioctl (struct ifnet *, u_long, caddr_t);
89 void idpip_input (struct mbuf *, ...);
90 void nsipstart (struct ifnet *);
91 int nsip_route (struct mbuf *);
92 int nsip_free (struct ifnet *);
93 void *nsip_ctlinput (int, struct sockaddr *, void *);
94
95 /* ns_output.c */
96 int ns_output (struct mbuf *, ...);
97
98 /* ns_pcb.c */
99 int ns_pcballoc (struct socket *, struct nspcb *);
100 int ns_pcbbind (struct nspcb *, struct mbuf *, struct proc *);
101 int ns_pcbconnect (struct nspcb *, struct mbuf *);
102 void ns_pcbdisconnect (struct nspcb *);
103 void ns_pcbdetach (struct nspcb *);
104 void ns_setsockaddr (struct nspcb *, struct mbuf *);
105 void ns_setpeeraddr (struct nspcb *, struct mbuf *);
106 void ns_pcbnotify (struct ns_addr *, int, void (*)(struct nspcb *), long);
107 void ns_rtchange (struct nspcb *);
108 struct nspcb *ns_pcblookup (const struct ns_addr *, u_short, int);
109
110 #endif
Cache object: 7bfc0f331f5d6cde8fe55b47dd115126
|