route.8: Remove NS remains.
[dragonfly.git] / usr.sbin / IPXrouted / defs.h
1 /*
2  * Copyright (c) 1983, 1993
3  *      The Regents of the University of California.  All rights reserved.
4  *
5  * Copyright (c) 1995 John Hay.  All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
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.
22  *
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
33  * SUCH DAMAGE.
34  *
35  *      @(#)defs.h      8.1 (Berkeley) 6/5/93
36  *
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.3 2005/09/11 11:35:38 swildner Exp $
39  */
40
41 #include <sys/types.h>
42 #include <sys/socket.h>
43
44 #include <net/route.h>
45 #include <netipx/ipx.h>
46
47 #define xnnet(x) ((u_long) (x)->rip_dst[0] << 16 | (u_long) (x)->rip_dst[1] )
48
49 #include <stdio.h>
50 #include <string.h>
51 #include <syslog.h>
52
53 #include "protocol.h"
54 #include "sap.h"
55 #include "table.h"
56 #include "trace.h"
57 #include "interface.h"
58 #include "af.h"
59
60
61 /*
62  * When we find any interfaces marked down we rescan the
63  * kernel every CHECK_INTERVAL seconds to see if they've
64  * come up.
65  */
66 #define CHECK_INTERVAL  (5*60)
67
68 #define equal(a1, a2) \
69         (bcmp((caddr_t)(a1), (caddr_t)(a2), sizeof (struct sockaddr)) == 0)
70 #define min(a,b)        ((a)>(b)?(b):(a))
71 #define max(a,b)        ((a)<(b)?(b):(a))
72
73 extern int      ripsock;                /* Socket to listen on */
74 extern int      sapsock;                /* Socket to listen on */
75 extern int      kmem;
76 extern int      supplier;               /* process should supply updates */
77 extern int      dosap;                  /* SAP is enabled */
78 extern int      dognreply;              /* enable GET_NEAREST response */
79 extern int      install;                /* if 1 call kernel */
80 extern int      lookforinterfaces;      /* if 1 probe kernel for new up ifs */
81 extern int      performnlist;           /* if 1 check if /kernel has changed */
82 extern int      externalinterfaces;     /* # of remote and local interfaces */
83 extern int      timeval;                /* local idea of time */
84 extern int      noteremoterequests;     /* squawk on requests from non-local nets */
85 extern int      r;                      /* Routing socket to install updates with */
86 extern int gateway;
87 extern struct   sockaddr_ipx ipx_netmask;       /* Used in installing routes */
88
89 extern char     packet[MAXRXPACKETSIZE+1];
90 extern struct   rip *msg;
91
92 extern char     **argv0;
93
94 #define ADD     1
95 #define DELETE  2
96 #define CHANGE  3
97
98 void    sndmsg(struct sockaddr *, int, struct interface *, int);
99 void    supply(struct sockaddr *, int, struct interface *, int);
100 void    addrouteforif(struct interface *);
101 void    ifinit(void);
102 void    toall(void (*f)(struct sockaddr *, int, struct interface *, int),
103               struct rt_entry *, int);
104 void    rip_input(struct sockaddr *, int);
105