123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876
#ifndef _SMT_
#define _SMT_
#define SMT6_10
#define SMT7_20
#define OPT_PMF /* if parameter management is supported */
#define OPT_SRF /* if status report is supported */
#define SMT_VID 0x0001 /* V 5.1 .. 6.1 */
#define SMT_VID_2 0x0002 /* V 7.2 */
struct smt_sid {
u_char sid_oem[2] ;
struct fddi_addr sid_node ;
} ;
typedef u_char t_station_id[8] ;
_packed struct smt_header {
struct fddi_addr smt_dest ;
struct fddi_addr smt_source ;
u_char smt_class ;
u_char smt_type ;
u_short smt_version ;
u_int smt_tid ;
struct smt_sid smt_sid ;
u_short smt_pad ;
u_short smt_len ;
} ;
#define SWAP_SMTHEADER "662sl8ss"
#if 0
#define FC_SMT_INFO 0x41 /* SMT info */
#define FC_SMT_NSA 0x4f /* SMT Next Station Addressing */
#endif
#define SMT_ANNOUNCE 0x01 /* announcement */
#define SMT_REQUEST 0x02 /* request */
#define SMT_REPLY 0x03 /* reply */
#define SMT_NIF 0x01 /* neighbor information frames */
#define SMT_SIF_CONFIG 0x02 /* station information configuration */
#define SMT_SIF_OPER 0x03 /* station information operation */
#define SMT_ECF 0x04 /* echo frames */
#define SMT_RAF 0x05 /* resource allocation */
#define SMT_RDF 0x06 /* request denied */
#define SMT_SRF 0x07 /* status report */
#define SMT_PMF_GET 0x08 /* parameter management get */
#define SMT_PMF_SET 0x09 /* parameter management set */
#define SMT_ESF 0xff /* extended service */
#define SMT_MAX_ECHO_LEN 4458 /* max length of SMT Echo */
#if defined(CONC) || defined(CONC_II)
#define SMT_TEST_ECHO_LEN 50 /* test length of SMT Echo */
#else
#define SMT_TEST_ECHO_LEN SMT_MAX_ECHO_LEN /* test length */
#endif
#define SMT_MAX_INFO_LEN (4352-20) /* max length for SMT info */
struct smt_para {
u_short p_type ;
u_short p_len ;
} ;
#define PARA_LEN (sizeof(struct smt_para))
#define SMTSETPARA(p,t) (p)->para.p_type = (t),\
(p)->para.p_len = sizeof(*(p)) - PARA_LEN
#define SMT_P_UNA 0x0001 /* upstream neighbor address */
#define SWAP_SMT_P_UNA "s6"
struct smt_p_una {
struct smt_para para ;
u_short una_pad ;
struct fddi_addr una_node ;
} ;
#define SMT_P_SDE 0x0002 /* station descriptor */
#define SWAP_SMT_P_SDE "1111"
#define SMT_SDE_STATION 0 /* end node */
#define SMT_SDE_CONCENTRATOR 1 /* concentrator */
struct smt_p_sde {
struct smt_para para ;
u_char sde_type ;
u_char sde_mac_count ;
u_char sde_non_master ;
u_char sde_master ;
} ;
#define SMT_P_STATE 0x0003 /* station state */
#define SWAP_SMT_P_STATE "scc"
struct smt_p_state {
struct smt_para para ;
u_short st_pad ;
u_char st_topology ;
u_char st_dupl_addr ;
} ;
#define SMT_ST_WRAPPED (1<<0) /* station wrapped */
#define SMT_ST_UNATTACHED (1<<1) /* unattached concentrator */
#define SMT_ST_TWISTED_A (1<<2) /* A-A connection, twisted ring */
#define SMT_ST_TWISTED_B (1<<3) /* B-B connection, twisted ring */
#define SMT_ST_ROOTED_S (1<<4) /* rooted station */
#define SMT_ST_SRF (1<<5) /* SRF protocol supported */
#define SMT_ST_SYNC_SERVICE (1<<6) /* use synchronous bandwidth */
#define SMT_ST_MY_DUPA (1<<0) /* my station detected dupl. */
#define SMT_ST_UNA_DUPA (1<<1) /* my UNA detected duplicate */
#define SMT_P_TIMESTAMP 0x0004 /* time stamp */
#define SWAP_SMT_P_TIMESTAMP "8"
struct smt_p_timestamp {
struct smt_para para ;
u_char ts_time[8] ;
} ;
#define SMT_P_POLICY 0x0005 /* station policies */
#define SWAP_SMT_P_POLICY "ss"
struct smt_p_policy {
struct smt_para para ;
u_short pl_config ;
u_short pl_connect ;
} ;
#define SMT_PL_HOLD 1 /* hold policy supported (Dual MAC) */
#define SMT_P_LATENCY 0x0006 /* latency */
#define SWAP_SMT_P_LATENCY "ssss"
struct smt_p_latency {
struct smt_para para ;
u_short lt_phyout_idx1 ;
u_short lt_latency1 ;
u_short lt_phyout_idx2 ;
u_short lt_latency2 ;
} ;
#define SMT_P_NEIGHBORS 0x0007 /* MAC neighbor description */
#define SWAP_SMT_P_NEIGHBORS "ss66"
struct smt_p_neighbor {
struct smt_para para ;
u_short nb_mib_index ;
u_short nb_mac_index ;
struct fddi_addr nb_una ;
struct fddi_addr nb_dna ;
} ;
#define SMT_PHY_A 0 /* A port */
#define SMT_PHY_B 1 /* B port */
#define SMT_PHY_S 2 /* slave port */
#define SMT_PHY_M 3 /* master port */
#define SMT_CS_DISABLED 0 /* connect state : disabled */
#define SMT_CS_CONNECTING 1 /* connect state : connecting */
#define SMT_CS_STANDBY 2 /* connect state : stand by */
#define SMT_CS_ACTIVE 3 /* connect state : active */
#define SMT_RM_NONE 0
#define SMT_RM_MAC 1
struct smt_phy_rec {
u_short phy_mib_index ;
u_char phy_type ;
u_char phy_connect_state ;
u_char phy_remote_type ;
u_char phy_remote_mac ;
u_short phy_resource_idx ;
} ;
struct smt_mac_rec {
struct fddi_addr mac_addr ;
u_short mac_resource_idx ;
} ;
#define SMT_P_PATH 0x0008 /* path descriptor */
#define SWAP_SMT_P_PATH "[6s]"
struct smt_p_path {
struct smt_para para ;
struct smt_phy_rec pd_phy[2] ;
struct smt_mac_rec pd_mac ;
} ;
#define SMT_P_MAC_STATUS 0x0009 /* MAC status */
#define SWAP_SMT_P_MAC_STATUS "sslllllllll"
struct smt_p_mac_status {
struct smt_para para ;
u_short st_mib_index ;
u_short st_mac_index ;
u_int st_t_req ;
u_int st_t_neg ;
u_int st_t_max ;
u_int st_tvx_value ;
u_int st_t_min ;
u_int st_sba ;
u_int st_frame_ct ;
u_int st_error_ct ;
u_int st_lost_ct ;
} ;
#define SMT_P_LEM 0x000a /* link error monitor */
#define SWAP_SMT_P_LEM "ssccccll"
struct smt_p_lem {
struct smt_para para ;
u_short lem_mib_index ;
u_short lem_phy_index ;
u_char lem_pad2 ;
u_char lem_cutoff ;
u_char lem_alarm ;
u_char lem_estimate ;
u_int lem_reject_ct ;
u_int lem_ct ;
} ;
#define SMT_P_MAC_COUNTER 0x000b /* MAC frame counters */
#define SWAP_SMT_P_MAC_COUNTER "ssll"
struct smt_p_mac_counter {
struct smt_para para ;
u_short mc_mib_index ;
u_short mc_index ;
u_int mc_receive_ct ;
u_int mc_transmit_ct ;
} ;
#define SMT_P_MAC_FNC 0x000c /* MAC frame not copied counter */
#define SWAP_SMT_P_MAC_FNC "ssl"
struct smt_p_mac_fnc {
struct smt_para para ;
u_short nc_mib_index ;
u_short nc_index ;
u_int nc_counter ;
} ;
#define SMT_P_PRIORITY 0x000d /* MAC priority values */
#define SWAP_SMT_P_PRIORITY "ssl"
struct smt_p_priority {
struct smt_para para ;
u_short pr_mib_index ;
u_short pr_index ;
u_int pr_priority[7] ;
} ;
#define SMT_P_EB 0x000e /* PHY EB status */
#define SWAP_SMT_P_EB "ssl"
struct smt_p_eb {
struct smt_para para ;
u_short eb_mib_index ;
u_short eb_index ;
u_int eb_error_ct ;
} ;
#define SMT_P_MANUFACTURER 0x000f /* manufacturer field */
#define SWAP_SMT_P_MANUFACTURER ""
struct smp_p_manufacturer {
struct smt_para para ;
u_char mf_data[32] ;
} ;
#define SMT_P_USER 0x0010 /* manufacturer field */
#define SWAP_SMT_P_USER ""
struct smp_p_user {
struct smt_para para ;
u_char us_data[32] ;
} ;
#define SMT_P_ECHODATA 0x0011 /* echo data */
#define SWAP_SMT_P_ECHODATA ""
struct smt_p_echo {
struct smt_para para ;
u_char ec_data[SMT_MAX_ECHO_LEN-4] ;
} ;
#define SMT_P_REASON 0x0012 /* reason code */
#define SWAP_SMT_P_REASON "l"
struct smt_p_reason {
struct smt_para para ;
u_int rdf_reason ;
} ;
#define SMT_RDF_CLASS 0x00000001 /* class not supported */
#define SMT_RDF_VERSION 0x00000002 /* version not supported */
#define SMT_RDF_SUCCESS 0x00000003 /* success (PMF) */
#define SMT_RDF_BADSET 0x00000004 /* bad set count (PMF) */
#define SMT_RDF_ILLEGAL 0x00000005 /* read only (PMF) */
#define SMT_RDF_NOPARAM 0x6 /* parameter not supported (PMF) */
#define SMT_RDF_RANGE 0x8 /* out of range */
#define SMT_RDF_AUTHOR 0x9 /* not authorized */
#define SMT_RDF_LENGTH 0x0a /* length error */
#define SMT_RDF_TOOLONG 0x0b /* length error */
#define SMT_RDF_SBA 0x0d /* SBA denied */
#define SMT_P_REFUSED 0x0013 /* refused frame beginning */
#define SWAP_SMT_P_REFUSED "l"
struct smt_p_refused {
struct smt_para para ;
u_int ref_fc ;
struct smt_header ref_header ;
} ;
#define SMT_P_VERSION 0x0014 /* SMT supported versions */
#define SWAP_SMT_P_VERSION "sccss"
struct smt_p_version {
struct smt_para para ;
u_short v_pad ;
u_char v_n ;
u_char v_index ;
u_short v_version[1] ;
u_short v_pad2 ;
} ;
#define SWAP_SMT_P0015 "l"
struct smt_p_0015 {
struct smt_para para ;
u_int res_type ;
} ;
#define SYNC_BW 0x00000001L /* Synchronous Bandwidth */
#define SWAP_SMT_P0016 "l"
struct smt_p_0016 {
struct smt_para para ;
u_int sba_cmd ;
} ;
#define REQUEST_ALLOCATION 0x1 /* req allocation of sync bandwidth */
#define REPORT_ALLOCATION 0x2 /* rep of sync bandwidth allocation */
#define CHANGE_ALLOCATION 0x3 /* forces a station using sync band-*/
#define SWAP_SMT_P0017 "l"
struct smt_p_0017 {
struct smt_para para ;
int sba_pl_req ;
} ;
#define SWAP_SMT_P0018 "l"
struct smt_p_0018 {
struct smt_para para ;
int sba_ov_req ;
} ;
#define SWAP_SMT_P0019 "s6"
struct smt_p_0019 {
struct smt_para para ;
u_short sba_pad ;
struct fddi_addr alloc_addr ;
} ;
#define SWAP_SMT_P001A "l"
struct smt_p_001a {
struct smt_para para ;
u_int category ;
} ;
#define SWAP_SMT_P001B "l"
struct smt_p_001b {
struct smt_para para ;
u_int max_t_neg ;
} ;
#define SWAP_SMT_P001C "l"
struct smt_p_001c {
struct smt_para para ;
u_int min_seg_siz ;
} ;
#define SWAP_SMT_P001D "l"
struct smt_p_001d {
struct smt_para para ;
u_int allocatable ;
} ;
#define SMT_P_FSC 0x200b
struct smt_p_fsc {
struct smt_para para ;
u_short fsc_pad0 ;
u_short fsc_mac_index ;
u_short fsc_pad1 ;
u_short fsc_value ;
} ;
#define FSC_TYPE0 0 /* "normal" node (A/C handling) */
#define FSC_TYPE1 1 /* Special A/C indicator forwarding */
#define FSC_TYPE2 2 /* Special A/C indicator forwarding */
#define SMT_P_AUTHOR 0x0021
#define SWAP_SMT_P1048 "ll"
struct smt_p_1048 {
u_int p1048_flag ;
u_int p1048_cf_state ;
} ;
#define SWAP_SMT_P208C "4lss66"
struct smt_p_208c {
u_int p208c_flag ;
u_short p208c_pad ;
u_short p208c_dupcondition ;
struct fddi_addr p208c_fddilong ;
struct fddi_addr p208c_fddiunalong ;
} ;
#define SWAP_SMT_P208D "4lllll"
struct smt_p_208d {
u_int p208d_flag ;
u_int p208d_frame_ct ;
u_int p208d_error_ct ;
u_int p208d_lost_ct ;
u_int p208d_ratio ;
} ;
#define SWAP_SMT_P208E "4llll"
struct smt_p_208e {
u_int p208e_flag ;
u_int p208e_not_copied ;
u_int p208e_copied ;
u_int p208e_not_copied_ratio ;
} ;
#define SWAP_SMT_P208F "4ll6666s6"
struct smt_p_208f {
u_int p208f_multiple ;
u_int p208f_nacondition ;
struct fddi_addr p208f_old_una ;
struct fddi_addr p208f_new_una ;
struct fddi_addr p208f_old_dna ;
struct fddi_addr p208f_new_dna ;
u_short p208f_curren_path ;
struct fddi_addr p208f_smt_address ;
} ;
#define SWAP_SMT_P2090 "4lssl"
struct smt_p_2090 {
u_int p2090_multiple ;
u_short p2090_availablepaths ;
u_short p2090_currentpath ;
u_int p2090_requestedpaths ;
} ;
#ifdef LITTLE_ENDIAN
#define SBAPATHINDEX (0x01000000L)
#else
#define SBAPATHINDEX (0x01L)
#endif
#define SWAP_SMT_P320B "42s"
struct smt_p_320b {
struct smt_para para ;
u_int mib_index ;
u_short path_pad ;
u_short path_index ;
} ;
#define SWAP_SMT_P320F "4l"
struct smt_p_320f {
struct smt_para para ;
u_int mib_index ;
u_int mib_payload ;
} ;
#define SWAP_SMT_P3210 "4l"
struct smt_p_3210 {
struct smt_para para ;
u_int mib_index ;
u_int mib_overhead ;
} ;
#define SWAP_SMT_P4050 "4l1111ll"
struct smt_p_4050 {
u_int p4050_flag ;
u_char p4050_pad ;
u_char p4050_cutoff ;
u_char p4050_alarm ;
u_char p4050_estimate ;
u_int p4050_reject_ct ;
u_int p4050_ct ;
} ;
#define SWAP_SMT_P4051 "4lssss"
struct smt_p_4051 {
u_int p4051_multiple ;
u_short p4051_porttype ;
u_short p4051_connectstate ;
u_short p4051_pc_neighbor ;
u_short p4051_pc_withhold ;
} ;
#define SWAP_SMT_P4052 "4ll"
struct smt_p_4052 {
u_int p4052_flag ;
u_int p4052_eberrorcount ;
} ;
#define SWAP_SMT_P4053 "4lsslss"
struct smt_p_4053 {
u_int p4053_multiple ;
u_short p4053_availablepaths ;
u_short p4053_currentpath ;
u_int p4053_requestedpaths ;
u_short p4053_mytype ;
u_short p4053_neighbortype ;
} ;
#define SMT_P_SETCOUNT 0x1035
#define SWAP_SMT_P_SETCOUNT "l8"
struct smt_p_setcount {
struct smt_para para ;
u_int count ;
u_char timestamp[8] ;
} ;
struct smt_nif {
struct smt_header smt ;
struct smt_p_una una ;
struct smt_p_sde sde ;
struct smt_p_state state ;
#ifdef SMT6_10
struct smt_p_fsc fsc ;
#endif
} ;
struct smt_sif_config {
struct smt_header smt ;
struct smt_p_timestamp ts ;
struct smt_p_sde sde ;
struct smt_p_version version ;
struct smt_p_state state ;
struct smt_p_policy policy ;
struct smt_p_latency latency ;
struct smt_p_neighbor neighbor ;
#ifdef OPT_PMF
struct smt_p_setcount setcount ;
#endif
struct smt_p_path path ;
} ;
#define SIZEOF_SMT_SIF_CONFIG (sizeof(struct smt_sif_config)- \
sizeof(struct smt_p_path))
struct smt_sif_operation {
struct smt_header smt ;
struct smt_p_timestamp ts ;
struct smt_p_mac_status status ;
struct smt_p_mac_counter mc ;
struct smt_p_mac_fnc fnc ;
struct smp_p_manufacturer man ;
struct smp_p_user user ;
#ifdef OPT_PMF
struct smt_p_setcount setcount ;
#endif
struct smt_p_lem lem[];
} ;
struct smt_ecf {
struct smt_header smt ;
struct smt_p_echo ec_echo ;
} ;
#define SMT_ECF_LEN (sizeof(struct smt_header)+sizeof(struct smt_para))
struct smt_rdf {
struct smt_header smt ;
struct smt_p_reason reason ;
struct smt_p_version version ;
struct smt_p_refused refused ;
} ;
struct smt_sba_alc_res {
struct smt_header smt ;
struct smt_p_0015 s_type ;
struct smt_p_0016 cmd ;
struct smt_p_reason reason ;
struct smt_p_320b path ;
struct smt_p_320f payload ;
struct smt_p_3210 overhead ;
struct smt_p_0019 a_addr ;
struct smt_p_001a cat ;
struct smt_p_001d alloc ;
} ;
struct smt_sba_alc_req {
struct smt_header smt ;
struct smt_p_0015 s_type ;
struct smt_p_0016 cmd ;
struct smt_p_320b path ;
struct smt_p_0017 pl_req ;
struct smt_p_0018 ov_req ;
struct smt_p_320f payload ;
struct smt_p_3210 overhead ;
struct smt_p_0019 a_addr ;
struct smt_p_001a cat ;
struct smt_p_001b tneg ;
struct smt_p_001c segm ;
} ;
struct smt_sba_chg {
struct smt_header smt ;
struct smt_p_0015 s_type ;
struct smt_p_0016 cmd ;
struct smt_p_320b path ;
struct smt_p_320f payload ;
struct smt_p_3210 overhead ;
struct smt_p_001a cat ;
} ;
struct smt_sba_rep_req {
struct smt_header smt ;
struct smt_p_0015 s_type ;
struct smt_p_0016 cmd ;
} ;
struct smt_sba_rep_res {
struct smt_header smt ;
struct smt_p_0015 s_type ;
struct smt_p_0016 cmd ;
struct smt_p_320b path ;
struct smt_p_320f payload ;
struct smt_p_3210 overhead ;
} ;
#define SMT_STATION_ACTION 1
#define SMT_STATION_ACTION_CONNECT 0
#define SMT_STATION_ACTION_DISCONNECT 1
#define SMT_STATION_ACTION_PATHTEST 2
#define SMT_STATION_ACTION_SELFTEST 3
#define SMT_STATION_ACTION_DISABLE_A 4
#define SMT_STATION_ACTION_DISABLE_B 5
#define SMT_STATION_ACTION_DISABLE_M 6
#define SMT_PORT_ACTION 2
#define SMT_PORT_ACTION_MAINT 0
#define SMT_PORT_ACTION_ENABLE 1
#define SMT_PORT_ACTION_DISABLE 2
#define SMT_PORT_ACTION_START 3
#define SMT_PORT_ACTION_STOP 4
#endif /* _SMT_ */