xref: /original-bsd/sys/netns/ns_if.h (revision 2ca53284)
1 /*
2  * Copyright (c) 1984, 1985, 1986, 1987 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)ns_if.h	7.6 (Berkeley) 06/28/90
8  */
9 
10 /*
11  * Interface address, xerox version.  One of these structures
12  * is allocated for each interface with an internet address.
13  * The ifaddr structure contains the protocol-independent part
14  * of the structure and is assumed to be first.
15  */
16 
17 struct ns_ifaddr {
18 	struct	ifaddr ia_ifa;		/* protocol-independent info */
19 #define	ia_ifp		ia_ifa.ifa_ifp
20 #define	ia_flags	ia_ifa.ifa_flags
21 /*	union	ns_net	ia_net;		/* network number of interface */
22 #define ia_net		ia_addr.sns_addr.x_net
23 	struct	ns_ifaddr *ia_next;	/* next in list of xerox addresses */
24 	struct	sockaddr_ns ia_addr;	/* reserve space for my address */
25 	struct	sockaddr_ns ia_dstaddr;	/* space for my broadcast address */
26 #define ia_broadaddr	ia_dstaddr
27 	struct	sockaddr_ns ia_netmask;	/* space for my network mask */
28 };
29 
30 struct	ns_aliasreq {
31 	char	ifra_name[IFNAMSIZ];		/* if name, e.g. "en0" */
32 	struct	sockaddr_ns ifra_addr;
33 	struct	sockaddr_ns ifra_broadaddr;
34 #define ifra_dstaddr ifra_broadaddr
35 };
36 /*
37  * Given a pointer to an ns_ifaddr (ifaddr),
38  * return a pointer to the addr as a sockadd_ns.
39  */
40 
41 #define	IA_SNS(ia) (&(((struct ns_ifaddr *)(ia))->ia_addr))
42 
43 /* This is not the right place for this but where is? */
44 #define	ETHERTYPE_NS	0x0600
45 
46 #ifdef	NSIP
47 struct nsip_req {
48 	struct sockaddr rq_ns;	/* must be ns format destination */
49 	struct sockaddr rq_ip;	/* must be ip format gateway */
50 	short rq_flags;
51 };
52 #endif
53 
54 #ifdef	KERNEL
55 struct	ns_ifaddr *ns_ifaddr;
56 struct	ns_ifaddr *ns_iaonnetof();
57 struct	ifqueue	nsintrq;	/* XNS input packet queue */
58 #endif
59