home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilss / sockets / include / protocols / h / routed
Encoding:
Text File  |  1995-01-11  |  3.5 KB  |  99 lines

  1. /* -*-C-*-
  2.  *
  3.  * $Header: /ax/networking:include/protocols/routed.h:networking  1.1  $
  4.  * $Source: /ax/networking:include/protocols/routed.h: $
  5.  *
  6.  * Copyright (c) 1995 Acorn Computers Ltd., Cambridge, England
  7.  *
  8.  * $Log:    routed.h,v $
  9.  * Revision 1.1  95/01/11  10:18:19  kwelton
  10.  * Initial revision
  11.  * 
  12.  */
  13.  
  14. /*
  15.  * Copyright (c) 1983 Regents of the University of California.
  16.  * All rights reserved.
  17.  *
  18.  * Redistribution and use in source and binary forms are permitted
  19.  * provided that the above copyright notice and this paragraph are
  20.  * duplicated in all such forms and that any documentation,
  21.  * advertising materials, and other materials related to such
  22.  * distribution and use acknowledge that the software was developed
  23.  * by the University of California, Berkeley.  The name of the
  24.  * University may not be used to endorse or promote products derived
  25.  * from this software without specific prior written permission.
  26.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  27.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  28.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  29.  *
  30.  *      %W% (Berkeley) %G%
  31.  */
  32.  
  33. /*
  34.  * Routing Information Protocol
  35.  *
  36.  * Derived from Xerox NS Routing Information Protocol
  37.  * by changing 32-bit net numbers to sockaddr's and
  38.  * padding stuff to 32-bit boundaries.
  39.  */
  40. #define RIPVERSION      1
  41.  
  42. struct netinfo {
  43.         struct  sockaddr rip_dst;       /* destination net/host */
  44.         int     rip_metric;             /* cost of route */
  45. };
  46.  
  47. struct rip {
  48.         u_char  rip_cmd;                /* request/response */
  49.         u_char  rip_vers;               /* protocol version # */
  50.         u_char  rip_res1[2];            /* pad to 32-bit boundary */
  51.         union {
  52.                 struct  netinfo ru_nets[1];     /* variable length... */
  53.                 char    ru_tracefile[1];        /* ditto ... */
  54.         } ripun;
  55. #define rip_nets        ripun.ru_nets
  56. #define rip_tracefile   ripun.ru_tracefile
  57. };
  58.  
  59. /*
  60.  * Packet types.
  61.  */
  62. #define RIPCMD_REQUEST          1       /* want info */
  63. #define RIPCMD_RESPONSE         2       /* responding to request */
  64. #define RIPCMD_TRACEON          3       /* turn tracing on */
  65. #define RIPCMD_TRACEOFF         4       /* turn it off */
  66.  
  67. #define RIPCMD_MAX              5
  68. #ifdef RIPCMDS
  69. char *ripcmds[RIPCMD_MAX] =
  70.   { "#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF" };
  71. #endif
  72.  
  73. #define HOPCNT_INFINITY         16      /* per Xerox NS */
  74. #define MAXPACKETSIZE           512     /* max broadcast size */
  75.  
  76. /*
  77.  * Timer values used in managing the routing table.
  78.  * Complete tables are broadcast every SUPPLY_INTERVAL seconds.
  79.  * If changes occur between updates, dynamic updates containing only changes
  80.  * may be sent.  When these are sent, a timer is set for a random value
  81.  * between MIN_WAITTIME and MAX_WAITTIME, and no additional dynamic updates
  82.  * are sent until the timer expires.
  83.  *
  84.  * Every update of a routing entry forces an entry's timer to be reset.
  85.  * After EXPIRE_TIME without updates, the entry is marked invalid,
  86.  * but held onto until GARBAGE_TIME so that others may
  87.  * see it "be deleted".
  88.  */
  89. #define TIMER_RATE              30      /* alarm clocks every 30 seconds */
  90.  
  91. #define SUPPLY_INTERVAL         30      /* time to supply tables */
  92. #define MIN_WAITTIME            2       /* min. interval to broadcast changes */
  93. #define MAX_WAITTIME            5       /* max. time to delay changes */
  94.  
  95. #define EXPIRE_TIME             180     /* time to mark entry invalid */
  96. #define GARBAGE_TIME            240     /* time to garbage collect */
  97.  
  98. /* EOF routed.h */
  99.