1*11196Ssam /* if_hy.h 4.1 83/02/20 */ 2*11196Ssam 3*11196Ssam /* 4*11196Ssam * Network Systems Corporation Hyperchannel 5*11196Ssam * routing database 6*11196Ssam */ 7*11196Ssam 8*11196Ssam #define HYRSIZE 37 /* max number of adapters in routing tables */ 9*11196Ssam 10*11196Ssam struct hyroute { 11*11196Ssam time_t hyr_lasttime; /* last update time */ 12*11196Ssam struct hy_hash { 13*11196Ssam u_short hyr_flags; /* status flags - see below */ 14*11196Ssam u_short hyr_key; /* desired address */ 15*11196Ssam union { 16*11196Ssam /* 17*11196Ssam * direct entry (can get there directly) 18*11196Ssam */ 19*11196Ssam struct { 20*11196Ssam u_short hyru_dst; /* adapter number & port */ 21*11196Ssam u_short hyru_ctl; /* trunks to try */ 22*11196Ssam u_short hyru_access; /* access code (mostly unused) */ 23*11196Ssam } hyr_d; 24*11196Ssam #define hyr_dst hyr_u.hyr_d.hyru_dst 25*11196Ssam #define hyr_ctl hyr_u.hyr_d.hyru_ctl 26*11196Ssam #define hyr_access hyr_u.hyr_d.hyru_access 27*11196Ssam /* 28*11196Ssam * indirect entry (one or more hops required) 29*11196Ssam */ 30*11196Ssam struct { 31*11196Ssam u_char hyru_pgate; /* 1st gateway slot */ 32*11196Ssam u_char hyru_egate; /* # gateways */ 33*11196Ssam u_char hyru_nextgate; /* gateway to use next */ 34*11196Ssam } hyr_i; 35*11196Ssam #define hyr_pgate hyr_u.hyr_i.hyru_pgate 36*11196Ssam #define hyr_egate hyr_u.hyr_i.hyru_egate 37*11196Ssam #define hyr_nextgate hyr_u.hyr_i.hyru_nextgate 38*11196Ssam } hyr_u; 39*11196Ssam } hyr_hash[HYRSIZE]; 40*11196Ssam u_char hyr_gateway[256]; 41*11196Ssam }; 42*11196Ssam 43*11196Ssam #ifdef KERNEL 44*11196Ssam struct hyroute hy_route[NHY]; 45*11196Ssam #endif 46*11196Ssam 47*11196Ssam #define HYR_INUSE 0x01 /* entry in use */ 48*11196Ssam #define HYR_DIR 0x02 /* direct entry */ 49*11196Ssam #define HYR_GATE 0x04 /* gateway entry */ 50*11196Ssam 51*11196Ssam #define HYRHASH(x) (((x) ^ ((x) >> 16)) % HYRSIZE) 52*11196Ssam 53*11196Ssam #define HYSETROUTE ('H'<<8) | 0x80 54*11196Ssam #define HYGETROUTE ('H'<<8) | 0x81 55