1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #ifndef _SMT_
16 #define _SMT_
17
18
19 #define SMT6_10
20 #define SMT7_20
21
22 #define OPT_PMF
23 #define OPT_SRF
24
25
26
27
28
29 #define SMT_VID 0x0001
30 #define SMT_VID_2 0x0002
31
32 struct smt_sid {
33 u_char sid_oem[2] ;
34 struct fddi_addr sid_node ;
35 } ;
36
37 typedef u_char t_station_id[8] ;
38
39
40
41
42
43
44
45
46 _packed struct smt_header {
47 struct fddi_addr smt_dest ;
48 struct fddi_addr smt_source ;
49 u_char smt_class ;
50 u_char smt_type ;
51 u_short smt_version ;
52 u_int smt_tid ;
53 struct smt_sid smt_sid ;
54 u_short smt_pad ;
55 u_short smt_len ;
56 } ;
57 #define SWAP_SMTHEADER "662sl8ss"
58
59 #if 0
60
61
62
63 #define FC_SMT_INFO 0x41
64 #define FC_SMT_NSA 0x4f
65 #endif
66
67
68
69
70
71 #define SMT_ANNOUNCE 0x01
72 #define SMT_REQUEST 0x02
73 #define SMT_REPLY 0x03
74
75
76
77
78 #define SMT_NIF 0x01
79 #define SMT_SIF_CONFIG 0x02
80 #define SMT_SIF_OPER 0x03
81 #define SMT_ECF 0x04
82 #define SMT_RAF 0x05
83 #define SMT_RDF 0x06
84 #define SMT_SRF 0x07
85 #define SMT_PMF_GET 0x08
86 #define SMT_PMF_SET 0x09
87 #define SMT_ESF 0xff
88
89 #define SMT_MAX_ECHO_LEN 4458
90 #if defined(CONC) || defined(CONC_II)
91 #define SMT_TEST_ECHO_LEN 50
92 #else
93 #define SMT_TEST_ECHO_LEN SMT_MAX_ECHO_LEN
94 #endif
95
96 #define SMT_MAX_INFO_LEN (4352-20)
97
98
99
100
101
102
103 struct smt_para {
104 u_short p_type ;
105 u_short p_len ;
106 } ;
107
108 #define PARA_LEN (sizeof(struct smt_para))
109
110 #define SMTSETPARA(p,t) (p)->para.p_type = (t),\
111 (p)->para.p_len = sizeof(*(p)) - PARA_LEN
112
113
114
115
116 #define SMT_P_UNA 0x0001
117 #define SWAP_SMT_P_UNA "s6"
118
119 struct smt_p_una {
120 struct smt_para para ;
121 u_short una_pad ;
122 struct fddi_addr una_node ;
123 } ;
124
125
126
127
128 #define SMT_P_SDE 0x0002
129 #define SWAP_SMT_P_SDE "1111"
130
131 #define SMT_SDE_STATION 0
132 #define SMT_SDE_CONCENTRATOR 1
133
134 struct smt_p_sde {
135 struct smt_para para ;
136 u_char sde_type ;
137 u_char sde_mac_count ;
138 u_char sde_non_master ;
139 u_char sde_master ;
140 } ;
141
142
143
144
145 #define SMT_P_STATE 0x0003
146 #define SWAP_SMT_P_STATE "scc"
147
148 struct smt_p_state {
149 struct smt_para para ;
150 u_short st_pad ;
151 u_char st_topology ;
152 u_char st_dupl_addr ;
153 } ;
154 #define SMT_ST_WRAPPED (1<<0)
155 #define SMT_ST_UNATTACHED (1<<1)
156 #define SMT_ST_TWISTED_A (1<<2)
157 #define SMT_ST_TWISTED_B (1<<3)
158 #define SMT_ST_ROOTED_S (1<<4)
159 #define SMT_ST_SRF (1<<5)
160 #define SMT_ST_SYNC_SERVICE (1<<6)
161
162 #define SMT_ST_MY_DUPA (1<<0)
163 #define SMT_ST_UNA_DUPA (1<<1)
164
165
166
167
168 #define SMT_P_TIMESTAMP 0x0004
169 #define SWAP_SMT_P_TIMESTAMP "8"
170 struct smt_p_timestamp {
171 struct smt_para para ;
172 u_char ts_time[8] ;
173 } ;
174
175
176
177
178 #define SMT_P_POLICY 0x0005
179 #define SWAP_SMT_P_POLICY "ss"
180
181 struct smt_p_policy {
182 struct smt_para para ;
183 u_short pl_config ;
184 u_short pl_connect ;
185 } ;
186 #define SMT_PL_HOLD 1
187
188
189
190
191 #define SMT_P_LATENCY 0x0006
192 #define SWAP_SMT_P_LATENCY "ssss"
193
194
195
196
197
198 struct smt_p_latency {
199 struct smt_para para ;
200 u_short lt_phyout_idx1 ;
201 u_short lt_latency1 ;
202 u_short lt_phyout_idx2 ;
203 u_short lt_latency2 ;
204 } ;
205
206
207
208
209 #define SMT_P_NEIGHBORS 0x0007
210 #define SWAP_SMT_P_NEIGHBORS "ss66"
211
212 struct smt_p_neighbor {
213 struct smt_para para ;
214 u_short nb_mib_index ;
215 u_short nb_mac_index ;
216 struct fddi_addr nb_una ;
217 struct fddi_addr nb_dna ;
218 } ;
219
220
221
222
223 #define SMT_PHY_A 0
224 #define SMT_PHY_B 1
225 #define SMT_PHY_S 2
226 #define SMT_PHY_M 3
227
228 #define SMT_CS_DISABLED 0
229 #define SMT_CS_CONNECTING 1
230 #define SMT_CS_STANDBY 2
231 #define SMT_CS_ACTIVE 3
232
233 #define SMT_RM_NONE 0
234 #define SMT_RM_MAC 1
235
236 struct smt_phy_rec {
237 u_short phy_mib_index ;
238 u_char phy_type ;
239 u_char phy_connect_state ;
240 u_char phy_remote_type ;
241 u_char phy_remote_mac ;
242 u_short phy_resource_idx ;
243 } ;
244
245
246
247
248 struct smt_mac_rec {
249 struct fddi_addr mac_addr ;
250 u_short mac_resource_idx ;
251 } ;
252
253
254
255
256
257
258 #define SMT_P_PATH 0x0008
259 #define SWAP_SMT_P_PATH "[6s]"
260
261 struct smt_p_path {
262 struct smt_para para ;
263 struct smt_phy_rec pd_phy[2] ;
264 struct smt_mac_rec pd_mac ;
265 } ;
266
267
268
269
270 #define SMT_P_MAC_STATUS 0x0009
271 #define SWAP_SMT_P_MAC_STATUS "sslllllllll"
272
273 struct smt_p_mac_status {
274 struct smt_para para ;
275 u_short st_mib_index ;
276 u_short st_mac_index ;
277 u_int st_t_req ;
278 u_int st_t_neg ;
279 u_int st_t_max ;
280 u_int st_tvx_value ;
281 u_int st_t_min ;
282 u_int st_sba ;
283 u_int st_frame_ct ;
284 u_int st_error_ct ;
285 u_int st_lost_ct ;
286 } ;
287
288
289
290
291 #define SMT_P_LEM 0x000a
292 #define SWAP_SMT_P_LEM "ssccccll"
293
294
295
296 struct smt_p_lem {
297 struct smt_para para ;
298 u_short lem_mib_index ;
299 u_short lem_phy_index ;
300 u_char lem_pad2 ;
301 u_char lem_cutoff ;
302 u_char lem_alarm ;
303 u_char lem_estimate ;
304 u_int lem_reject_ct ;
305 u_int lem_ct ;
306 } ;
307
308
309
310
311 #define SMT_P_MAC_COUNTER 0x000b
312 #define SWAP_SMT_P_MAC_COUNTER "ssll"
313
314 struct smt_p_mac_counter {
315 struct smt_para para ;
316 u_short mc_mib_index ;
317 u_short mc_index ;
318 u_int mc_receive_ct ;
319 u_int mc_transmit_ct ;
320 } ;
321
322
323
324
325 #define SMT_P_MAC_FNC 0x000c
326 #define SWAP_SMT_P_MAC_FNC "ssl"
327
328 struct smt_p_mac_fnc {
329 struct smt_para para ;
330 u_short nc_mib_index ;
331 u_short nc_index ;
332 u_int nc_counter ;
333 } ;
334
335
336
337
338
339 #define SMT_P_PRIORITY 0x000d
340 #define SWAP_SMT_P_PRIORITY "ssl"
341
342 struct smt_p_priority {
343 struct smt_para para ;
344 u_short pr_mib_index ;
345 u_short pr_index ;
346 u_int pr_priority[7] ;
347 } ;
348
349
350
351
352 #define SMT_P_EB 0x000e
353 #define SWAP_SMT_P_EB "ssl"
354
355 struct smt_p_eb {
356 struct smt_para para ;
357 u_short eb_mib_index ;
358 u_short eb_index ;
359 u_int eb_error_ct ;
360 } ;
361
362
363
364
365 #define SMT_P_MANUFACTURER 0x000f
366 #define SWAP_SMT_P_MANUFACTURER ""
367
368 struct smp_p_manufacturer {
369 struct smt_para para ;
370 u_char mf_data[32] ;
371 } ;
372
373
374
375
376 #define SMT_P_USER 0x0010
377 #define SWAP_SMT_P_USER ""
378
379 struct smp_p_user {
380 struct smt_para para ;
381 u_char us_data[32] ;
382 } ;
383
384
385
386
387
388
389 #define SMT_P_ECHODATA 0x0011
390 #define SWAP_SMT_P_ECHODATA ""
391
392 struct smt_p_echo {
393 struct smt_para para ;
394 u_char ec_data[SMT_MAX_ECHO_LEN-4] ;
395 } ;
396
397
398
399
400 #define SMT_P_REASON 0x0012
401 #define SWAP_SMT_P_REASON "l"
402
403 struct smt_p_reason {
404 struct smt_para para ;
405 u_int rdf_reason ;
406 } ;
407 #define SMT_RDF_CLASS 0x00000001
408 #define SMT_RDF_VERSION 0x00000002
409 #define SMT_RDF_SUCCESS 0x00000003
410 #define SMT_RDF_BADSET 0x00000004
411 #define SMT_RDF_ILLEGAL 0x00000005
412 #define SMT_RDF_NOPARAM 0x6
413 #define SMT_RDF_RANGE 0x8
414 #define SMT_RDF_AUTHOR 0x9
415 #define SMT_RDF_LENGTH 0x0a
416 #define SMT_RDF_TOOLONG 0x0b
417 #define SMT_RDF_SBA 0x0d
418
419
420
421
422 #define SMT_P_REFUSED 0x0013
423 #define SWAP_SMT_P_REFUSED "l"
424
425 struct smt_p_refused {
426 struct smt_para para ;
427 u_int ref_fc ;
428 struct smt_header ref_header ;
429 } ;
430
431
432
433
434 #define SMT_P_VERSION 0x0014
435 #define SWAP_SMT_P_VERSION "sccss"
436
437 struct smt_p_version {
438 struct smt_para para ;
439 u_short v_pad ;
440 u_char v_n ;
441 u_char v_index ;
442 u_short v_version[1] ;
443 u_short v_pad2 ;
444 } ;
445
446
447
448
449 #define SWAP_SMT_P0015 "l"
450
451 struct smt_p_0015 {
452 struct smt_para para ;
453 u_int res_type ;
454 } ;
455
456 #define SYNC_BW 0x00000001L
457
458
459
460
461 #define SWAP_SMT_P0016 "l"
462
463 struct smt_p_0016 {
464 struct smt_para para ;
465 u_int sba_cmd ;
466 } ;
467
468 #define REQUEST_ALLOCATION 0x1
469 #define REPORT_ALLOCATION 0x2
470 #define CHANGE_ALLOCATION 0x3
471
472
473
474
475
476
477 #define SWAP_SMT_P0017 "l"
478
479 struct smt_p_0017 {
480 struct smt_para para ;
481 int sba_pl_req ;
482 } ;
483
484
485
486
487 #define SWAP_SMT_P0018 "l"
488
489 struct smt_p_0018 {
490 struct smt_para para ;
491 int sba_ov_req ;
492 } ;
493
494
495
496
497 #define SWAP_SMT_P0019 "s6"
498
499 struct smt_p_0019 {
500 struct smt_para para ;
501 u_short sba_pad ;
502 struct fddi_addr alloc_addr ;
503 } ;
504
505
506
507
508 #define SWAP_SMT_P001A "l"
509
510 struct smt_p_001a {
511 struct smt_para para ;
512 u_int category ;
513 } ;
514
515
516
517
518 #define SWAP_SMT_P001B "l"
519
520 struct smt_p_001b {
521 struct smt_para para ;
522 u_int max_t_neg ;
523 } ;
524
525
526
527
528 #define SWAP_SMT_P001C "l"
529
530 struct smt_p_001c {
531 struct smt_para para ;
532 u_int min_seg_siz ;
533 } ;
534
535
536
537
538 #define SWAP_SMT_P001D "l"
539
540 struct smt_p_001d {
541 struct smt_para para ;
542 u_int allocatable ;
543 } ;
544
545
546
547
548
549 #define SMT_P_FSC 0x200b
550
551
552 struct smt_p_fsc {
553 struct smt_para para ;
554 u_short fsc_pad0 ;
555 u_short fsc_mac_index ;
556 u_short fsc_pad1 ;
557 u_short fsc_value ;
558 } ;
559
560 #define FSC_TYPE0 0
561 #define FSC_TYPE1 1
562 #define FSC_TYPE2 2
563
564
565
566
567 #define SMT_P_AUTHOR 0x0021
568
569
570
571
572 #define SWAP_SMT_P1048 "ll"
573 struct smt_p_1048 {
574 u_int p1048_flag ;
575 u_int p1048_cf_state ;
576 } ;
577
578
579
580
581
582
583 #define SWAP_SMT_P208C "4lss66"
584 struct smt_p_208c {
585 u_int p208c_flag ;
586 u_short p208c_pad ;
587 u_short p208c_dupcondition ;
588 struct fddi_addr p208c_fddilong ;
589 struct fddi_addr p208c_fddiunalong ;
590 } ;
591
592 #define SWAP_SMT_P208D "4lllll"
593 struct smt_p_208d {
594 u_int p208d_flag ;
595 u_int p208d_frame_ct ;
596 u_int p208d_error_ct ;
597 u_int p208d_lost_ct ;
598 u_int p208d_ratio ;
599 } ;
600
601 #define SWAP_SMT_P208E "4llll"
602 struct smt_p_208e {
603 u_int p208e_flag ;
604 u_int p208e_not_copied ;
605 u_int p208e_copied ;
606 u_int p208e_not_copied_ratio ;
607 } ;
608
609 #define SWAP_SMT_P208F "4ll6666s6"
610
611 struct smt_p_208f {
612 u_int p208f_multiple ;
613 u_int p208f_nacondition ;
614 struct fddi_addr p208f_old_una ;
615 struct fddi_addr p208f_new_una ;
616 struct fddi_addr p208f_old_dna ;
617 struct fddi_addr p208f_new_dna ;
618 u_short p208f_curren_path ;
619 struct fddi_addr p208f_smt_address ;
620 } ;
621
622 #define SWAP_SMT_P2090 "4lssl"
623
624 struct smt_p_2090 {
625 u_int p2090_multiple ;
626 u_short p2090_availablepaths ;
627 u_short p2090_currentpath ;
628 u_int p2090_requestedpaths ;
629 } ;
630
631
632
633
634
635
636
637
638 #ifdef LITTLE_ENDIAN
639 #define SBAPATHINDEX (0x01000000L)
640 #else
641 #define SBAPATHINDEX (0x01L)
642 #endif
643
644 #define SWAP_SMT_P320B "42s"
645
646 struct smt_p_320b {
647 struct smt_para para ;
648 u_int mib_index ;
649 u_short path_pad ;
650 u_short path_index ;
651 } ;
652
653 #define SWAP_SMT_P320F "4l"
654
655 struct smt_p_320f {
656 struct smt_para para ;
657 u_int mib_index ;
658 u_int mib_payload ;
659 } ;
660
661 #define SWAP_SMT_P3210 "4l"
662
663 struct smt_p_3210 {
664 struct smt_para para ;
665 u_int mib_index ;
666 u_int mib_overhead ;
667 } ;
668
669 #define SWAP_SMT_P4050 "4l1111ll"
670
671 struct smt_p_4050 {
672 u_int p4050_flag ;
673 u_char p4050_pad ;
674 u_char p4050_cutoff ;
675 u_char p4050_alarm ;
676 u_char p4050_estimate ;
677 u_int p4050_reject_ct ;
678 u_int p4050_ct ;
679 } ;
680
681 #define SWAP_SMT_P4051 "4lssss"
682 struct smt_p_4051 {
683 u_int p4051_multiple ;
684 u_short p4051_porttype ;
685 u_short p4051_connectstate ;
686 u_short p4051_pc_neighbor ;
687 u_short p4051_pc_withhold ;
688 } ;
689
690 #define SWAP_SMT_P4052 "4ll"
691 struct smt_p_4052 {
692 u_int p4052_flag ;
693 u_int p4052_eberrorcount ;
694 } ;
695
696 #define SWAP_SMT_P4053 "4lsslss"
697
698 struct smt_p_4053 {
699 u_int p4053_multiple ;
700 u_short p4053_availablepaths ;
701 u_short p4053_currentpath ;
702 u_int p4053_requestedpaths ;
703 u_short p4053_mytype ;
704 u_short p4053_neighbortype ;
705 } ;
706
707
708 #define SMT_P_SETCOUNT 0x1035
709 #define SWAP_SMT_P_SETCOUNT "l8"
710
711 struct smt_p_setcount {
712 struct smt_para para ;
713 u_int count ;
714 u_char timestamp[8] ;
715 } ;
716
717
718
719
720
721
722
723
724 struct smt_nif {
725 struct smt_header smt ;
726 struct smt_p_una una ;
727 struct smt_p_sde sde ;
728 struct smt_p_state state ;
729 #ifdef SMT6_10
730 struct smt_p_fsc fsc ;
731 #endif
732 } ;
733
734
735
736
737 struct smt_sif_config {
738 struct smt_header smt ;
739 struct smt_p_timestamp ts ;
740 struct smt_p_sde sde ;
741 struct smt_p_version version ;
742 struct smt_p_state state ;
743 struct smt_p_policy policy ;
744 struct smt_p_latency latency ;
745 struct smt_p_neighbor neighbor ;
746 #ifdef OPT_PMF
747 struct smt_p_setcount setcount ;
748 #endif
749
750 struct smt_p_path path ;
751 } ;
752 #define SIZEOF_SMT_SIF_CONFIG (sizeof(struct smt_sif_config)- \
753 sizeof(struct smt_p_path))
754
755 struct smt_sif_operation {
756 struct smt_header smt ;
757 struct smt_p_timestamp ts ;
758 struct smt_p_mac_status status ;
759 struct smt_p_mac_counter mc ;
760 struct smt_p_mac_fnc fnc ;
761 struct smp_p_manufacturer man ;
762 struct smp_p_user user ;
763 #ifdef OPT_PMF
764 struct smt_p_setcount setcount ;
765 #endif
766
767 struct smt_p_lem lem[1] ;
768 } ;
769 #define SIZEOF_SMT_SIF_OPERATION (sizeof(struct smt_sif_operation)- \
770 sizeof(struct smt_p_lem))
771
772
773
774
775 struct smt_ecf {
776 struct smt_header smt ;
777 struct smt_p_echo ec_echo ;
778 } ;
779 #define SMT_ECF_LEN (sizeof(struct smt_header)+sizeof(struct smt_para))
780
781
782
783
784 struct smt_rdf {
785 struct smt_header smt ;
786 struct smt_p_reason reason ;
787 struct smt_p_version version ;
788 struct smt_p_refused refused ;
789 } ;
790
791
792
793
794 struct smt_sba_alc_res {
795 struct smt_header smt ;
796 struct smt_p_0015 s_type ;
797 struct smt_p_0016 cmd ;
798 struct smt_p_reason reason ;
799 struct smt_p_320b path ;
800 struct smt_p_320f payload ;
801 struct smt_p_3210 overhead ;
802 struct smt_p_0019 a_addr ;
803 struct smt_p_001a cat ;
804 struct smt_p_001d alloc ;
805 } ;
806
807
808
809
810 struct smt_sba_alc_req {
811 struct smt_header smt ;
812 struct smt_p_0015 s_type ;
813 struct smt_p_0016 cmd ;
814 struct smt_p_320b path ;
815 struct smt_p_0017 pl_req ;
816 struct smt_p_0018 ov_req ;
817 struct smt_p_320f payload ;
818 struct smt_p_3210 overhead ;
819 struct smt_p_0019 a_addr ;
820 struct smt_p_001a cat ;
821 struct smt_p_001b tneg ;
822 struct smt_p_001c segm ;
823 } ;
824
825
826
827
828 struct smt_sba_chg {
829 struct smt_header smt ;
830 struct smt_p_0015 s_type ;
831 struct smt_p_0016 cmd ;
832 struct smt_p_320b path ;
833 struct smt_p_320f payload ;
834 struct smt_p_3210 overhead ;
835 struct smt_p_001a cat ;
836 } ;
837
838
839
840
841 struct smt_sba_rep_req {
842 struct smt_header smt ;
843 struct smt_p_0015 s_type ;
844 struct smt_p_0016 cmd ;
845 } ;
846
847
848
849
850 struct smt_sba_rep_res {
851 struct smt_header smt ;
852 struct smt_p_0015 s_type ;
853 struct smt_p_0016 cmd ;
854 struct smt_p_320b path ;
855 struct smt_p_320f payload ;
856 struct smt_p_3210 overhead ;
857 } ;
858
859
860
861
862 #define SMT_STATION_ACTION 1
863 #define SMT_STATION_ACTION_CONNECT 0
864 #define SMT_STATION_ACTION_DISCONNECT 1
865 #define SMT_STATION_ACTION_PATHTEST 2
866 #define SMT_STATION_ACTION_SELFTEST 3
867 #define SMT_STATION_ACTION_DISABLE_A 4
868 #define SMT_STATION_ACTION_DISABLE_B 5
869 #define SMT_STATION_ACTION_DISABLE_M 6
870
871 #define SMT_PORT_ACTION 2
872 #define SMT_PORT_ACTION_MAINT 0
873 #define SMT_PORT_ACTION_ENABLE 1
874 #define SMT_PORT_ACTION_DISABLE 2
875 #define SMT_PORT_ACTION_START 3
876 #define SMT_PORT_ACTION_STOP 4
877
878 #endif