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