home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / nics / root.2 / usr / include / sys / sr.h / sr
Text File  |  1998-08-19  |  4KB  |  131 lines

  1. /*
  2.  * Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved. 
  3.  *                                                                         
  4.  *        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE               
  5.  *                   SANTA CRUZ OPERATION INC.                             
  6.  *                                                                         
  7.  *   The copyright notice above does not evidence any actual or intended   
  8.  *   publication of such source code.                                      
  9.  */
  10.  
  11. #ifndef _IO_ND_SYS_SR_H  /* wrapper symbol for kernel use */
  12. #define _IO_ND_SYS_SR_H  /* subject to change without notice */
  13.  
  14. #ident "@(#)sr.h    29.1"
  15. #ident "$Header: $"
  16. /*
  17.  *      Copyright (C) The Santa Cruz Operation, 1993-1997.
  18.  *      This Module contains Proprietary Information of
  19.  *      The Santa Cruz Operation and should be treated
  20.  *      as Confidential.
  21.  */
  22.  
  23. #if defined(__cplusplus)
  24. extern "C" {
  25. #endif
  26.  
  27. #ifndef MAX_ROUTES
  28. #define MAX_ROUTES 2
  29. #endif
  30. #define HASH_MODULUS  509             /* number of hash heads - prime # */
  31.  
  32. #define MAX_SEGMENTS    14
  33. #define MAX_ROUTE_SZ    (MAX_SEGMENTS * sizeof(ushort))
  34.  
  35. struct  route_info {
  36.     unchar    ri_control0;
  37.     unchar    ri_control1;
  38.     ushort    ri_segments[MAX_SEGMENTS];
  39. };
  40.  
  41.     /* Broadcast indicator bits, for control0 field */
  42. #define    SRF    0x00    /* Specifically Routed Frame */
  43. #define STE    0xc0    /* Spanning Tree Explorer Frame */
  44. #define ARE    0x80    /* All Routes Explorer Frame */
  45. #define IS_SRF(x) (((x) & 0x80)==SRF)
  46. #define IS_STE(x) (((x) & 0xc0)==STE)
  47. #define IS_ARE(x) (((x) & 0xc0)==ARE)
  48. #define LEN_MASK    0x1f    /* Route Length mask */
  49.  
  50.     /* Direction indicator bits, for control1 field */
  51. #define DIR_FORWARD    0x00        /* Interpret Route Left to Right */
  52. #define DIR_BACKWARD    0x80        /* Interpret Route Right to Left */
  53. #define DIR_BIT        0x80
  54.  
  55.     /* Maximum frame size, for control1 field */
  56. #define LEN_516        0x00
  57. #define LEN_1500    0x10
  58. #define LEN_2052    0x20
  59. #define LEN_4472    0x30
  60. #define LEN_8144    0x40
  61. #define LEN_11407    0x50
  62. #define LEN_17800    0x60
  63. #define LEN_NOT_SPEC    0x70
  64.  
  65.     /* Route Indicator bit of source address */
  66. #define ROUTE_INDICATOR    0x80
  67. #define FDDI_ROUTE_INDICATOR    0x01
  68.  
  69. struct route {
  70.     struct route           *r_next, *r_back, *hsh_next;
  71.     time_t            r_timeout;    /* in seconds */
  72.     time_t            r_last_tx;    /* time of last tx */
  73.     unchar            r_mac_addr[6];
  74.     unchar            r_state;
  75.     unchar            r_list;
  76.     ulong            r_ARP_mon;
  77.     ulong             r_tx_mon;
  78.     ulong            r_STE_ucs;
  79.     struct route_info    r_info;
  80. };
  81.  
  82. /* following timing parameters are in seconds */
  83. struct route_param {
  84.     int         tx_resp;    /* timeout for responding to rx */
  85.     int         rx_ARE;        /* window for rejecting more AREs */
  86.     int        rx_STE_bcs; /* # STE bcs before invalidating route entry
  87.                      * and find new route */
  88.     int        rx_STE_ucs; /* # STE ucs before invalidating route entry
  89.                      * and find new route */
  90.     int         max_tx;        /* upper limit for tx "recur" window */
  91.     int        min_tx;        /* lower limit for tx "recur" window */
  92.     int        tx_recur;   /* detected "recurs" before tx STE */
  93.     int        ARE_disa;   /* disable sending ARE frames */
  94. };
  95.  
  96. struct route_table {
  97.     lock_t        *lock_rt;
  98.     struct route_param
  99.             *parms;
  100.     uint        nroutes;    /* number of routes in route_table */
  101.     uint        ninuse;        /* #Currently in use */
  102.     struct route    *free;        /* Free list head */
  103.     struct route    *free_b;    /* Free list tail */
  104.     struct route    *inuse;        /* List head for 'SR_IN_USE' */
  105.     struct route     *inuse_b;    /* tail for above */
  106.     struct route    *disco;        /* List head for other states */
  107.     struct route    *disco_b;    /* tail for above */
  108.         /* Routes */
  109.     struct route    no_route,    /* 'No route' */
  110.             ste_route,    /* 'Single-route broadcast' */
  111.             are_route;    /* 'All-routes broadcast' */
  112.         struct route    *hash_heads[HASH_MODULUS];
  113.     struct route    *routes;
  114. };
  115.  
  116. #if defined(__STDC__) && !defined(_NO_PROTOTYPE)
  117.  
  118. /* int    dlpiSR_init(per_card_info_t *cp); */
  119. int    dlpiSR_make_header(per_card_info_t *cp, unchar *, unchar *);
  120. int    dlpiSR_primitives(per_card_info_t *cp, queue_t *, mblk_t *);
  121. /* void    dlpiSR_rx_parse(per_card_info_t *cp, struct per_frame_info *); */
  122. /* void    dlpiSR_auto_rx(per_card_info_t *cp, struct per_frame_info *f); */
  123.  
  124. #endif
  125.  
  126. #if defined(__cplusplus)
  127.     }
  128. #endif
  129.  
  130. #endif    /* _IO_ND_SYS_SR_H */
  131.