1: /*
   2:  * Copyright (c) 1983 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)protocol.h	5.1 (Berkeley) 6/4/85
   7:  */
   8: 
   9: /*
  10:  * Routing Information Protocol
  11:  *
  12:  * Derived from Xerox NS Routing Information Protocol
  13:  * by changing 32-bit net numbers to sockaddr's and
  14:  * padding stuff to 32-bit boundaries.
  15:  */
  16: #define RIPVERSION  1
  17: 
  18: struct netinfo {
  19:     struct  sockaddr rip_dst;   /* destination net/host */
  20:     int rip_metric;     /* cost of route */
  21: };
  22: 
  23: struct rip {
  24:     u_char  rip_cmd;        /* request/response */
  25:     u_char  rip_vers;       /* protocol version # */
  26:     u_char  rip_res1[2];        /* pad to 32-bit boundary */
  27:     union {
  28:         struct  netinfo ru_nets[1]; /* variable length... */
  29:         char    ru_tracefile[1];    /* ditto ... */
  30:     } ripun;
  31: #define rip_nets    ripun.ru_nets
  32: #define rip_tracefile   ripun.ru_tracefile
  33: };
  34: 
  35: /*
  36:  * Packet types.
  37:  */
  38: #define RIPCMD_REQUEST      1   /* want info */
  39: #define RIPCMD_RESPONSE     2   /* responding to request */
  40: #define RIPCMD_TRACEON      3   /* turn tracing on */
  41: #define RIPCMD_TRACEOFF     4   /* turn it off */
  42: 
  43: #define RIPCMD_MAX      5
  44: #ifdef RIPCMDS
  45: char *ripcmds[RIPCMD_MAX] =
  46:   { "#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF" };
  47: #endif
  48: 
  49: #define HOPCNT_INFINITY     16  /* per Xerox NS */
  50: #define MAXPACKETSIZE       512 /* max broadcast size */
  51: 
  52: /*
  53:  * Timer values used in managing the routing table.
  54:  * Every update forces an entry's timer to be reset.  After
  55:  * EXPIRE_TIME without updates, the entry is marked invalid,
  56:  * but held onto until GARBAGE_TIME so that others may
  57:  * see it "be deleted".
  58:  */
  59: #define TIMER_RATE      30  /* alarm clocks every 30 seconds */
  60: 
  61: #define SUPPLY_INTERVAL     30  /* time to supply tables */
  62: 
  63: #define EXPIRE_TIME     180 /* time to mark entry invalid */
  64: #define GARBAGE_TIME        240 /* time to garbage collect */

Defined variables

ripcmds defined in line 45; never used

Defined struct's

netinfo defined in line 18; used 2 times
  • in line 28(2)
rip defined in line 23; never used

Defined macros

EXPIRE_TIME defined in line 63; never used
GARBAGE_TIME defined in line 64; never used
HOPCNT_INFINITY defined in line 49; never used
MAXPACKETSIZE defined in line 50; never used
RIPCMD_MAX defined in line 43; used 1 times
  • in line 45
RIPCMD_REQUEST defined in line 38; never used
RIPCMD_RESPONSE defined in line 39; never used
RIPCMD_TRACEOFF defined in line 41; never used
RIPCMD_TRACEON defined in line 40; never used
RIPVERSION defined in line 16; never used
SUPPLY_INTERVAL defined in line 61; never used
TIMER_RATE defined in line 59; never used
rip_nets defined in line 31; never used
rip_tracefile defined in line 32; never used
Last modified: 1985-09-15
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 717
Valid CSS Valid XHTML 1.0 Strict