June 2025 | ||||||
Mo | Tu | We | Th | Fr | Sa | Su |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
001: /*- 002: * Copyright (c) 1983, 1989, 1993 003: * The Regents of the University of California. All rights reserved. 004: * 005: * Redistribution and use in source and binary forms, with or without 006: * modification, are permitted provided that the following conditions 007: * are met: 008: * 1. Redistributions of source code must retain the above copyright 009: * notice, this list of conditions and the following disclaimer. 010: * 2. Redistributions in binary form must reproduce the above copyright 011: * notice, this list of conditions and the following disclaimer in the 012: * documentation and/or other materials provided with the distribution. 013: * 4. Neither the name of the University nor the names of its contributors 014: * may be used to endorse or promote products derived from this software 015: * without specific prior written permission. 016: * 017: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 018: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 019: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 020: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 021: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 022: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 023: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 024: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 025: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 026: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 027: * SUCH DAMAGE. 028: * 029: * @(#)routed.h 8.1 (Berkeley) 6/2/93 030: */ 031: 032: #ifndef _PROTOCOLS_ROUTED_H 033: #define _PROTOCOLS_ROUTED_H 1 034: 035: #include <sys/socket.h> 036: /* 037: * Routing Information Protocol 038: * 039: * Derived from Xerox NS Routing Information Protocol 040: * by changing 32-bit net numbers to sockaddr's and 041: * padding stuff to 32-bit boundaries. 042: */ 043: #define RIPVERSION 1 044: 045: struct netinfo { 046: struct sockaddr rip_dst; /* destination net/host */ 047: int rip_metric; /* cost of route */ 048: }; 049: 050: struct rip { 051: u_char rip_cmd; /* request/response */ 052: u_char rip_vers; /* protocol version # */ 053: u_char rip_res1[2]; /* pad to 32-bit boundary */ 054: union { 055: struct netinfo ru_nets[1]; /* variable length... */ 056: char ru_tracefile[1]; /* ditto ... */ 057: } ripun; 058: #define rip_nets ripun.ru_nets 059: #define rip_tracefile ripun.ru_tracefile 060: }; 061: 062: /* 063: * Packet types. 064: */ 065: #define RIPCMD_REQUEST 1 /* want info */ 066: #define RIPCMD_RESPONSE 2 /* responding to request */ 067: #define RIPCMD_TRACEON 3 /* turn tracing on */ 068: #define RIPCMD_TRACEOFF 4 /* turn it off */ 069: 070: #define RIPCMD_MAX 5 071: #ifdef RIPCMDS 072: char *ripcmds[RIPCMD_MAX] = 073: { "#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF" }; 074: #endif 075: 076: #define HOPCNT_INFINITY 16 /* per Xerox NS */ 077: #define MAXPACKETSIZE 512 /* max broadcast size */ 078: 079: /* 080: * Timer values used in managing the routing table. 081: * Complete tables are broadcast every SUPPLY_INTERVAL seconds. 082: * If changes occur between updates, dynamic updates containing only changes 083: * may be sent. When these are sent, a timer is set for a random value 084: * between MIN_WAITTIME and MAX_WAITTIME, and no additional dynamic updates 085: * are sent until the timer expires. 086: * 087: * Every update of a routing entry forces an entry's timer to be reset. 088: * After EXPIRE_TIME without updates, the entry is marked invalid, 089: * but held onto until GARBAGE_TIME so that others may 090: * see it "be deleted". 091: */ 092: #define TIMER_RATE 30 /* alarm clocks every 30 seconds */ 093: 094: #define SUPPLY_INTERVAL 30 /* time to supply tables */ 095: #define MIN_WAITTIME 2 /* min. interval to broadcast changes */ 096: #define MAX_WAITTIME 5 /* max. time to delay changes */ 097: 098: #define EXPIRE_TIME 180 /* time to mark entry invalid */ 099: #define GARBAGE_TIME 240 /* time to garbage collect */ 100: 101: #endif /* protocols/routed.h */ 102: