xref: /original-bsd/sys/netns/ns_if.h (revision 5f5c18da)
1 /*
2  * Copyright (c) 1984, 1985, 1986, 1987 Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that the above copyright notice and this paragraph are
7  * duplicated in all such forms and that any documentation,
8  * advertising materials, and other materials related to such
9  * distribution and use acknowledge that the software was developed
10  * by the University of California, Berkeley.  The name of the
11  * University may not be used to endorse or promote products derived
12  * from this software without specific prior written permission.
13  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  *	@(#)ns_if.h	7.4 (Berkeley) 04/22/89
18  */
19 
20 /*
21  * Interface address, xerox version.  One of these structures
22  * is allocated for each interface with an internet address.
23  * The ifaddr structure contains the protocol-independent part
24  * of the structure and is assumed to be first.
25  */
26 
27 struct ns_ifaddr {
28 	struct	ifaddr ia_ifa;		/* protocol-independent info */
29 #define	ia_ifp		ia_ifa.ifa_ifp
30 /*	union	ns_net	ia_net;		/* network number of interface */
31 #define ia_net		ia_addr.sns_addr.x_net
32 	int	ia_flags;
33 	struct	ns_ifaddr *ia_next;	/* next in list of xerox addresses */
34 	struct	sockaddr_ns ia_addr;	/* reserve space for my address */
35 	struct	sockaddr_ns ia_dstaddr;	/* space for my broadcast address */
36 #define ia_broadaddr	ia_dstaddr
37 	struct	sockaddr_ns ia_netmask;	/* space for my network mask */
38 };
39 
40 struct	ns_aliasreq {
41 	char	ifra_name[IFNAMSIZ];		/* if name, e.g. "en0" */
42 	struct	sockaddr_ns ifra_addr;
43 	struct	sockaddr_ns ifra_broadaddr;
44 #define ifra_dstaddr ifra_broadaddr
45 };
46 /*
47  * Given a pointer to an ns_ifaddr (ifaddr),
48  * return a pointer to the addr as a sockadd_ns.
49  */
50 
51 #define	IA_SNS(ia) (&(((struct ns_ifaddr *)(ia))->ia_addr))
52 /*
53  * ia_flags
54  */
55 #define	IFA_ROUTE	0x01		/* routing entry installed */
56 
57 /* This is not the right place for this but where is? */
58 #define	ETHERTYPE_NS	0x0600
59 
60 #ifdef	NSIP
61 struct nsip_req {
62 	struct sockaddr rq_ns;	/* must be ns format destination */
63 	struct sockaddr rq_ip;	/* must be ip format gateway */
64 	short rq_flags;
65 };
66 #endif
67 
68 #ifdef	KERNEL
69 struct	ns_ifaddr *ns_ifaddr;
70 struct	ns_ifaddr *ns_iaonnetof();
71 struct	ifqueue	nsintrq;	/* XNS input packet queue */
72 #endif
73