protocol.h revision 296373
1218885Sdim/* 2218885Sdim * Copyright (c) 1985, 1993 3218885Sdim * The Regents of the University of California. All rights reserved. 4218885Sdim * 5218885Sdim * Copyright (c) 1995 John Hay. All rights reserved. 6218885Sdim * 7218885Sdim * This file includes significant work done at Cornell University by 8218885Sdim * Bill Nesheim. That work included by permission. 9218885Sdim * 10218885Sdim * Redistribution and use in source and binary forms, with or without 11218885Sdim * modification, are permitted provided that the following conditions 12218885Sdim * are met: 13218885Sdim * 1. Redistributions of source code must retain the above copyright 14218885Sdim * notice, this list of conditions and the following disclaimer. 15218885Sdim * 2. Redistributions in binary form must reproduce the above copyright 16218885Sdim * notice, this list of conditions and the following disclaimer in the 17249423Sdim * documentation and/or other materials provided with the distribution. 18218885Sdim * 3. All advertising materials mentioning features or use of this software 19218885Sdim * must display the following acknowledgement: 20218885Sdim * This product includes software developed by the University of 21218885Sdim * California, Berkeley and its contributors. 22234353Sdim * 4. Neither the name of the University nor the names of its contributors 23234353Sdim * may be used to endorse or promote products derived from this software 24218885Sdim * without specific prior written permission. 25218885Sdim * 26218885Sdim * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 27218885Sdim * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28218885Sdim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 29218885Sdim * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 30218885Sdim * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31218885Sdim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32218885Sdim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33218885Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34218885Sdim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35218885Sdim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36218885Sdim * SUCH DAMAGE. 37218885Sdim * 38221345Sdim * @(#)protocol.h 8.1 (Berkeley) 6/5/93 39218885Sdim * 40218885Sdim * $FreeBSD: releng/10.3/usr.sbin/IPXrouted/protocol.h 50479 1999-08-28 01:35:59Z peter $ 41218885Sdim */ 42218885Sdim 43218885Sdim/* 44221345Sdim * IPX Routing Information Protocol 45221345Sdim * 46221345Sdim */ 47221345Sdim 48221345Sdimstruct netinfo { 49221345Sdim union ipx_net rip_dst; /* destination net */ 50221345Sdim u_short rip_metric; /* cost of route */ 51221345Sdim u_short rip_ticks; /* cost of route */ 52218885Sdim}; 53218885Sdim 54218885Sdimstruct rip { 55218885Sdim u_short rip_cmd; /* request/response */ 56218885Sdim struct netinfo rip_nets[1]; /* variable length */ 57218885Sdim}; 58218885Sdim 59218885Sdim/* 60218885Sdim * Packet types. 61218885Sdim */ 62218885Sdim#define RIPCMD_REQUEST 1 /* want info */ 63218885Sdim#define RIPCMD_RESPONSE 2 /* responding to request */ 64218885Sdim 65218885Sdim#define RIPCMD_MAX 3 66218885Sdim#ifdef RIPCMDS 67218885Sdimchar *ripcmds[RIPCMD_MAX] = 68218885Sdim { "#0", "REQUEST", "RESPONSE" }; 69218885Sdim#endif 70218885Sdim 71218885Sdim#define HOPCNT_INFINITY 16 /* per IPX */ 72218885Sdim#define DSTNETS_ALL 0xffffffff /* per IPX */ 73218885Sdim#define MAXRXPACKETSIZE 1500 /* max rx broadcast size */ 74218885Sdim#define MAXRIPNETS 50 /* max nets in tx packet */ 75218885Sdim 76218885Sdimextern union ipx_net ipx_anynet; 77218885Sdimextern union ipx_net ipx_zeronet; 78218885Sdim 79218885Sdim/* 80218885Sdim * Timer values used in managing the routing table. 81218885Sdim * Every update forces an entry's timer to be reset. After 82218885Sdim * EXPIRE_TIME without updates, the entry is marked invalid, 83218885Sdim * but held onto until GARBAGE_TIME so that others may 84218885Sdim * see it "be deleted". 85218885Sdim */ 86218885Sdim#define TIMER_RATE 30 /* alarm clocks every 30 seconds */ 87218885Sdim 88218885Sdim#define SUPPLY_INTERVAL 30 /* time to supply tables */ 89218885Sdim#define RIP_INTERVAL 60 /* time to supply rip tables */ 90218885Sdim 91218885Sdim#define EXPIRE_TIME 180 /* time to mark entry invalid */ 92218885Sdim#define GARBAGE_TIME 240 /* time to garbage collect */ 93218885Sdim