2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
5 * Copyright (c) 1995 John Hay. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by the University of
18 * California, Berkeley and its contributors.
19 * 4. Neither the name of the University nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * @(#)defs.h 8.1 (Berkeley) 6/5/93
37 * $FreeBSD: src/usr.sbin/IPXrouted/defs.h,v 1.8 1999/08/28 01:15:01 peter Exp $
38 * $DragonFly: src/usr.sbin/IPXrouted/defs.h,v 1.2 2003/06/17 04:29:52 dillon Exp $
41 #include <sys/types.h>
42 #include <sys/socket.h>
44 #include <net/route.h>
45 #include <netipx/ipx.h>
46 #if defined(vax) || defined(pdp11)
47 #define xnnet(x) ((u_long) (x)->rip_dst[1] << 16 | (u_long) (x)->rip_dst[0] )
49 #define xnnet(x) ((u_long) (x)->rip_dst[0] << 16 | (u_long) (x)->rip_dst[1] )
60 #include "interface.h"
65 * When we find any interfaces marked down we rescan the
66 * kernel every CHECK_INTERVAL seconds to see if they've
69 #define CHECK_INTERVAL (5*60)
71 #define equal(a1, a2) \
72 (bcmp((caddr_t)(a1), (caddr_t)(a2), sizeof (struct sockaddr)) == 0)
73 #define min(a,b) ((a)>(b)?(b):(a))
74 #define max(a,b) ((a)<(b)?(b):(a))
76 extern int ripsock; /* Socket to listen on */
77 extern int sapsock; /* Socket to listen on */
79 extern int supplier; /* process should supply updates */
80 extern int dosap; /* SAP is enabled */
81 extern int dognreply; /* enable GET_NEAREST response */
82 extern int install; /* if 1 call kernel */
83 extern int lookforinterfaces; /* if 1 probe kernel for new up ifs */
84 extern int performnlist; /* if 1 check if /kernel has changed */
85 extern int externalinterfaces; /* # of remote and local interfaces */
86 extern int timeval; /* local idea of time */
87 extern int noteremoterequests; /* squawk on requests from non-local nets */
88 extern int r; /* Routing socket to install updates with */
90 extern struct sockaddr_ipx ipx_netmask; /* Used in installing routes */
92 extern char packet[MAXRXPACKETSIZE+1];
93 extern struct rip *msg;
101 void sndmsg(struct sockaddr *, int, struct interface *, int);
102 void supply(struct sockaddr *, int, struct interface *, int);
103 void addrouteforif(struct interface *);
105 void toall(void (*f)(struct sockaddr *, int, struct interface *, int),
106 struct rt_entry *, int);
107 void rip_input(struct sockaddr *, int);