xref: /trueos/sys/netipx/ipx_var.h (revision 9ed1a4b5ebe734049aa444f14884ed8ad4c23aee)
1 /*-
2  * Copyright (c) 1984, 1985, 1986, 1987, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 4. Neither the name of the University nor the names of its contributors
14  *    may be used to endorse or promote products derived from this software
15  *    without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * Copyright (c) 1995, Mike Mitchell
30  *
31  * Redistribution and use in source and binary forms, with or without
32  * modification, are permitted provided that the following conditions
33  * are met:
34  * 1. Redistributions of source code must retain the above copyright
35  *    notice, this list of conditions and the following disclaimer.
36  * 2. Redistributions in binary form must reproduce the above copyright
37  *    notice, this list of conditions and the following disclaimer in the
38  *    documentation and/or other materials provided with the distribution.
39  * 3. All advertising materials mentioning features or use of this software
40  *    must display the following acknowledgement:
41  *	This product includes software developed by the University of
42  *	California, Berkeley and its contributors.
43  * 4. Neither the name of the University nor the names of its contributors
44  *    may be used to endorse or promote products derived from this software
45  *    without specific prior written permission.
46  *
47  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
48  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
49  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
50  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
51  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
52  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
53  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
54  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
55  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
56  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
57  * SUCH DAMAGE.
58  *
59  *	@(#)ipx_var.h
60  *
61  * $FreeBSD$
62  */
63 
64 #ifndef _NETIPX_IPX_VAR_H_
65 #define _NETIPX_IPX_VAR_H_
66 
67 /*
68  * IPX Kernel Structures and Variables
69  */
70 struct	ipxstat {
71 	u_long	ipxs_total;		/* total packets received */
72 	u_long	ipxs_badsum;		/* checksum bad */
73 	u_long	ipxs_tooshort;		/* packet too short */
74 	u_long	ipxs_toosmall;		/* not enough data */
75 	u_long	ipxs_forward;		/* packets forwarded */
76 	u_long	ipxs_cantforward;	/* packets rcvd for unreachable dest */
77 	u_long	ipxs_delivered;		/* datagrams delivered to upper level*/
78 	u_long	ipxs_localout;		/* total ipx packets generated here */
79 	u_long	ipxs_odropped;		/* lost packets due to nobufs, etc. */
80 	u_long	ipxs_noroute;		/* packets discarded due to no route */
81 	u_long	ipxs_mtutoosmall;	/* the interface mtu is too small */
82 };
83 
84 #ifdef _KERNEL
85 
86 #ifdef SYSCTL_DECL
87 SYSCTL_DECL(_net_ipx);
88 SYSCTL_DECL(_net_ipx_ipx);
89 #endif
90 
91 extern int ipxcksum;
92 extern long ipx_pexseq;
93 extern struct ipxstat ipxstat;
94 extern struct pr_usrreqs ipx_usrreqs;
95 extern struct pr_usrreqs ripx_usrreqs;
96 extern struct sockaddr_ipx ipx_netmask;
97 extern struct sockaddr_ipx ipx_hostmask;
98 
99 extern const union ipx_net ipx_zeronet;
100 extern const union ipx_net ipx_broadnet;
101 extern const union ipx_host ipx_broadhost;
102 
103 struct ifnet;
104 struct ipx_addr;
105 struct ipxpcb;
106 struct mbuf;
107 struct thread;
108 struct route;
109 struct sockaddr;
110 struct socket;
111 struct sockopt;
112 
113 u_short	ipx_cksum(struct mbuf *m, int len);
114 int	ipx_control(struct socket *so, u_long cmd, caddr_t data,
115 	    struct ifnet *ifp, struct thread *td);
116 void	ipx_ctlinput(int cmd, struct sockaddr *arg_as_sa, void *dummy);
117 int	ipx_ctloutput(struct socket *so, struct sockopt *sopt);
118 void	ipx_drop(struct ipxpcb *ipxp, int errno);
119 void	ipx_init(void);
120 void	ipx_input(struct mbuf *m, struct ipxpcb *ipxp);
121 int	ipx_outputfl(struct mbuf *m0, struct route *ro, int flags);
122 int	ipx_output_type20(struct mbuf *);
123 int	ipx_peeraddr(struct socket *so, struct sockaddr **nam);
124 void	ipx_printhost(struct ipx_addr *addr);
125 int	ipx_sockaddr(struct socket *so, struct sockaddr **nam);
126 
127 #endif /* _KERNEL */
128 
129 #endif /* !_NETIPX_IPX_VAR_H_ */
130