📄 smt.h
字号:
u_short v_pad ; u_char v_n ; /* 1 .. 0xff, #versions */ u_char v_index ; /* 1 .. 0xff, index of op. v. */ u_short v_version[1] ; /* list of min. 1 version */ u_short v_pad2 ; /* pad if necessary */} ;/* * P15 : Resource Type */#define SWAP_SMT_P0015 "l"struct smt_p_0015 { struct smt_para para ; /* generic parameter header */ u_int res_type ; /* recsource type */} ;#define SYNC_BW 0x00000001L /* Synchronous Bandwidth *//* * P16 : SBA Command */#define SWAP_SMT_P0016 "l"struct smt_p_0016 { struct smt_para para ; /* generic parameter header */ u_int sba_cmd ; /* command for the SBA */} ;#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-*/ /* width to change its current allo-*/ /* cation *//* * P17 : SBA Payload Request */#define SWAP_SMT_P0017 "l"struct smt_p_0017 { struct smt_para para ; /* generic parameter header */ int sba_pl_req ; /* total sync bandwidth measured in */} ; /* bytes per 125 us *//* * P18 : SBA Overhead Request */#define SWAP_SMT_P0018 "l"struct smt_p_0018 { struct smt_para para ; /* generic parameter header */ int sba_ov_req ; /* total sync bandwidth req for overhead*/} ; /* measuered in bytes per T_Neg *//* * P19 : SBA Allocation Address */#define SWAP_SMT_P0019 "s6"struct smt_p_0019 { struct smt_para para ; /* generic parameter header */ u_short sba_pad ; struct fddi_addr alloc_addr ; /* Allocation Address */} ;/* * P1A : SBA Category */#define SWAP_SMT_P001A "l"struct smt_p_001a { struct smt_para para ; /* generic parameter header */ u_int category ; /* Allocator defined classification */} ;/* * P1B : Maximum T_Neg */#define SWAP_SMT_P001B "l"struct smt_p_001b { struct smt_para para ; /* generic parameter header */ u_int max_t_neg ; /* longest T_NEG for the sync service*/} ;/* * P1C : Minimum SBA Segment Size */#define SWAP_SMT_P001C "l"struct smt_p_001c { struct smt_para para ; /* generic parameter header */ u_int min_seg_siz ; /* smallest number of bytes per frame*/} ;/* * P1D : SBA Allocatable */#define SWAP_SMT_P001D "l"struct smt_p_001d { struct smt_para para ; /* generic parameter header */ u_int allocatable ; /* total sync bw available for alloc */} ;/* * P20 0B : frame status capabilities * NOTE: not in swap table, is used by smt.c AND PMF table */#define SMT_P_FSC 0x200b/* #define SWAP_SMT_P_FSC "ssss" */struct smt_p_fsc { struct smt_para para ; /* generic parameter header */ u_short fsc_pad0 ; u_short fsc_mac_index ; /* mac index 1 .. ff */ u_short fsc_pad1 ; u_short fsc_value ; /* FSC_TYPE[0-2] */} ;#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 *//* * P00 21 : user defined authoriziation (see pmf.c) */#define SMT_P_AUTHOR 0x0021/* * notification parameters */#define SWAP_SMT_P1048 "ll"struct smt_p_1048 { u_int p1048_flag ; u_int p1048_cf_state ;} ;/* * NOTE: all 2xxx 3xxx and 4xxx must include the INDEX in the swap string, * even so the INDEX is NOT part of the struct. * INDEX is already swapped in pmf.c, format in string is '4' */#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 ;} ;/* * NOTE: * special kludge for parameters 320b,320f,3210 * these parameters are part of RAF frames * RAF frames are parsed in SBA.C and must be swapped * PMF.C has special code to avoid double swapping */#ifdef LITTLE_ENDIAN#define SBAPATHINDEX (0x01000000L)#else#define SBAPATHINDEX (0x01L)#endif#define SWAP_SMT_P320B "42s"struct smt_p_320b { struct smt_para para ; /* generic parameter header */ 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 ; /* generic parameter header */ u_int mib_index ; u_int mib_payload ;} ;#define SWAP_SMT_P3210 "4l"struct smt_p_3210 { struct smt_para para ; /* generic parameter header */ 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 ; /* generic parameter header */ u_int count ; u_char timestamp[8] ;} ;/* * SMT FRAMES *//* * NIF : neighbor information frames */struct smt_nif { struct smt_header smt ; /* generic header */ struct smt_p_una una ; /* UNA */ struct smt_p_sde sde ; /* station descriptor */ struct smt_p_state state ; /* station state */#ifdef SMT6_10 struct smt_p_fsc fsc ; /* frame status cap. */#endif} ;/* * SIF : station information frames */struct smt_sif_config { struct smt_header smt ; /* generic header */ struct smt_p_timestamp ts ; /* time stamp */ struct smt_p_sde sde ; /* station descriptor */ struct smt_p_version version ; /* supported versions */ struct smt_p_state state ; /* station state */ struct smt_p_policy policy ; /* station policy */ struct smt_p_latency latency ; /* path latency */ struct smt_p_neighbor neighbor ; /* neighbors, we have only one*/#ifdef OPT_PMF struct smt_p_setcount setcount ; /* Set Count mandatory */#endif /* WARNING : path MUST BE LAST FIELD !!! (see smt.c:smt_fill_path) */ struct smt_p_path path ; /* path descriptor */} ;#define SIZEOF_SMT_SIF_CONFIG (sizeof(struct smt_sif_config)- \ sizeof(struct smt_p_path))struct smt_sif_operation { struct smt_header smt ; /* generic header */ struct smt_p_timestamp ts ; /* time stamp */ struct smt_p_mac_status status ; /* mac status */ struct smt_p_mac_counter mc ; /* MAC counter */ struct smt_p_mac_fnc fnc ; /* MAC frame not copied */ struct smp_p_manufacturer man ; /* manufacturer field */ struct smp_p_user user ; /* user field */#ifdef OPT_PMF struct smt_p_setcount setcount ; /* Set Count mandatory */#endif /* must be last */ struct smt_p_lem lem[1] ; /* phy lem status */} ;#define SIZEOF_SMT_SIF_OPERATION (sizeof(struct smt_sif_operation)- \ sizeof(struct smt_p_lem))/* * ECF : echo frame */struct smt_ecf { struct smt_header smt ; /* generic header */ struct smt_p_echo ec_echo ; /* echo parameter */} ;#define SMT_ECF_LEN (sizeof(struct smt_header)+sizeof(struct smt_para))/* * RDF : request denied frame */struct smt_rdf { struct smt_header smt ; /* generic header */ struct smt_p_reason reason ; /* reason code */ struct smt_p_version version ; /* supported versions */ struct smt_p_refused refused ; /* refused frame fragment */} ;/* * SBA Request Allocation Responce Frame */struct smt_sba_alc_res { struct smt_header smt ; /* generic header */ struct smt_p_0015 s_type ; /* resource type */ struct smt_p_0016 cmd ; /* SBA command */ struct smt_p_reason reason ; /* reason code */ struct smt_p_320b path ; /* path type */ struct smt_p_320f payload ; /* current SBA payload */ struct smt_p_3210 overhead ; /* current SBA overhead */ struct smt_p_0019 a_addr ; /* Allocation Address */ struct smt_p_001a cat ; /* Category - from the request */ struct smt_p_001d alloc ; /* SBA Allocatable */} ;/* * SBA Request Allocation Request Frame */struct smt_sba_alc_req { struct smt_header smt ; /* generic header */ struct smt_p_0015 s_type ; /* resource type */ struct smt_p_0016 cmd ; /* SBA command */ struct smt_p_320b path ; /* path type */ struct smt_p_0017 pl_req ; /* requested payload */ struct smt_p_0018 ov_req ; /* requested SBA overhead */ struct smt_p_320f payload ; /* current SBA payload */ struct smt_p_3210 overhead ; /* current SBA overhead */ struct smt_p_0019 a_addr ; /* Allocation Address */ struct smt_p_001a cat ; /* Category - from the request */ struct smt_p_001b tneg ; /* max T-NEG */ struct smt_p_001c segm ; /* minimum segment size */} ;/* * SBA Change Allocation Request Frame */struct smt_sba_chg { struct smt_header smt ; /* generic header */ struct smt_p_0015 s_type ; /* resource type */ struct smt_p_0016 cmd ; /* SBA command */ struct smt_p_320b path ; /* path type */ struct smt_p_320f payload ; /* current SBA payload */ struct smt_p_3210 overhead ; /* current SBA overhead */ struct smt_p_001a cat ; /* Category - from the request */} ;/* * SBA Report Allocation Request Frame */struct smt_sba_rep_req { struct smt_header smt ; /* generic header */ struct smt_p_0015 s_type ; /* resource type */ struct smt_p_0016 cmd ; /* SBA command */} ;/* * SBA Report Allocation Response Frame */struct smt_sba_rep_res { struct smt_header smt ; /* generic header */ struct smt_p_0015 s_type ; /* resource type */ struct smt_p_0016 cmd ; /* SBA command */ struct smt_p_320b path ; /* path type */ struct smt_p_320f payload ; /* current SBA payload */ struct smt_p_3210 overhead ; /* current SBA overhead */} ;/* * actions */#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_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -