xref: /csrg-svn/sbin/XNSrouted/interface.h (revision 61474)
124327Ssklower /*
2*61474Sbostic  * Copyright (c) 1983, 1993
3*61474Sbostic  *	The Regents of the University of California.  All rights reserved.
424327Ssklower  *
542698Sbostic  * %sccs.include.redist.c%
635551Sbostic  *
7*61474Sbostic  *	@(#)interface.h	8.1 (Berkeley) 06/05/93
824327Ssklower  */
924308Ssklower 
1024308Ssklower /*
1124308Ssklower  * Routing table management daemon.
1224308Ssklower  */
1324308Ssklower 
1424308Ssklower /*
1524308Ssklower  * An ``interface'' is similar to an ifnet structure,
1624308Ssklower  * except it doesn't contain q'ing info, and it also
1724308Ssklower  * handles ``logical'' interfaces (remote gateways
1824308Ssklower  * that we want to keep polling even if they go down).
1924308Ssklower  * The list of interfaces which we maintain is used
2024308Ssklower  * in supplying the gratuitous routing table updates.
2124308Ssklower  * We list only one address for  each interface, the AF_XNS one.
2224308Ssklower  */
2324308Ssklower #define NIFADDR 3
2424308Ssklower struct interface {
2524308Ssklower 	struct	interface *int_next;
2624308Ssklower 	struct	sockaddr int_addr;		/* address on this host */
2724308Ssklower 	union {
2824308Ssklower 		struct	sockaddr intu_broadaddr;
2924308Ssklower 		struct	sockaddr intu_dstaddr;
3024308Ssklower 	} int_intu;
3124308Ssklower #define	int_broadaddr	int_intu.intu_broadaddr	/* broadcast address */
3224308Ssklower #define	int_dstaddr	int_intu.intu_dstaddr	/* other end of p-to-p link */
3324308Ssklower 	int	int_metric;			/* init's routing entry */
3424308Ssklower 	int	int_flags;			/* see below */
3524308Ssklower 	struct	ifdebug int_input, int_output;	/* packet tracing stuff */
3624308Ssklower 	int	int_ipackets;			/* input packets received */
3724308Ssklower 	int	int_opackets;			/* output packets sent */
3824308Ssklower 	char	*int_name;			/* from kernel if structure */
3924308Ssklower 	u_short	int_transitions;		/* times gone up-down */
4024327Ssklower /*XNS Specific entry */
4124327Ssklower 	struct	sameq {
4224327Ssklower 		struct sameq *n;		/* q of other pt-to-pt links */
4324327Ssklower 		struct sameq *p;		/* with same net # */
4424327Ssklower 	}	int_sq;
4524308Ssklower };
4624308Ssklower 
4724308Ssklower /*
4824327Ssklower  * 0x1 to 0x10 are reused from the kernel's ifnet definitions,
4924308Ssklower  * the others agree with the RTS_ flags defined elsewhere.
5024308Ssklower  */
5124308Ssklower #define	IFF_UP		0x1		/* interface is up */
5224308Ssklower #define	IFF_BROADCAST	0x2		/* broadcast address valid */
5324308Ssklower #define	IFF_DEBUG	0x4		/* turn on debugging */
5424308Ssklower #define	IFF_ROUTE	0x8		/* routing entry installed */
5524308Ssklower #define	IFF_POINTOPOINT	0x10		/* interface is point-to-point link */
5624308Ssklower 
5724308Ssklower #define	IFF_PASSIVE	0x2000		/* can't tell if up/down */
5824308Ssklower #define	IFF_INTERFACE	0x4000		/* hardware interface */
5924308Ssklower #define	IFF_REMOTE	0x8000		/* interface isn't on this machine */
6024308Ssklower 
6124308Ssklower struct	interface *if_ifwithaddr();
6224327Ssklower struct	interface *if_ifwithdstaddr();
6324308Ssklower struct	interface *if_ifwithnet();
6424308Ssklower struct	interface *if_iflookup();
65