Lines Matching +full:4 +full:- +full:switch
21 …ps://web.archive.org/web/20160401194747/http://www.oiforum.com/public/documents/OIF-UNI-01.0.pdf */
25 #include "netdissect-stdinc.h"
38 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
39 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
43 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
93 { 0x08, "Link-Id configuration error"},
94 { 0x10, "Unknown object c-type"},
99 { 0x01, "Unacceptable non-negotiable LINK-SUMMARY parameters"},
100 { 0x02, "Renegotiate LINK-SUMMARY parameters"},
101 { 0x04, "Invalid TE-LINK Object"},
102 { 0x08, "Invalid DATA-LINK Object"},
103 { 0x10, "Unknown TE-LINK Object c-type"},
104 { 0x20, "Unknown DATA-LINK Object c-type"},
153 #define LMP_MSGTYPE_HELLO 4
206 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
207 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
208 * |N| C-Type | Class | Length |
209 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
213 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
225 #define LMP_OBJ_INTERFACE_ID 4
280 #define LMP_CTYPE_IPV6_RMT 4
293 /* C-Types for Service Config Object */
297 #define LMP_CTYPE_SERVICE_CONFIG_NETWORK_DIVERSITY 4
353 { 256*LMP_OBJ_SERVICE_CONFIG+LMP_CTYPE_SERVICE_CONFIG_NETWORK_DIVERSITY, "4" },
378 if (subobj_len < 4) { in lmp_print_data_link_subobjs()
382 if ((subobj_len % 4) != 0) { in lmp_print_data_link_subobjs()
383 ND_PRINT(" (not a multiple of 4)"); in lmp_print_data_link_subobjs()
390 switch(subobj_type) { in lmp_print_data_link_subobjs()
402 bw.i = GET_BE_U_4(obj_tptr + offset + 4); in lmp_print_data_link_subobjs()
411 GET_BE_U_4(obj_tptr + offset + 4)); in lmp_print_data_link_subobjs()
418 total_subobj_len-=subobj_len; in lmp_print_data_link_subobjs()
440 ndo->ndo_protocol = "lmp"; in lmp_print()
445 version_res = GET_BE_U_2(lmp_com_header->version_res); in lmp_print()
456 /* in non-verbose mode just lets print the basic Message Type*/ in lmp_print()
457 if (ndo->ndo_vflag < 1) { in lmp_print()
460 tok2str(lmp_msg_type_values, "unknown (%u)",GET_U_1(lmp_com_header->msg_type)), in lmp_print()
465 /* ok they seem to want to know everything - lets fully decode it */ in lmp_print()
467 tlen=GET_BE_U_2(lmp_com_header->length); in lmp_print()
469 ND_PRINT("\n\tLMPv%u, msg-type: %s, Flags: [%s], length: %u", in lmp_print()
471 tok2str(lmp_msg_type_values, "unknown, type: %u",GET_U_1(lmp_com_header->msg_type)), in lmp_print()
472 bittok2str(lmp_header_flag_values,"none",GET_U_1(lmp_com_header->flags)), in lmp_print()
484 tlen-=sizeof(struct lmp_common_header); in lmp_print()
489 lmp_obj_len=GET_BE_U_2(lmp_obj_header->length); in lmp_print()
490 lmp_obj_ctype=GET_U_1(lmp_obj_header->ctype)&0x7f; in lmp_print()
492 ND_PRINT("\n\t %s Object (%u), Class-Type: %s (%u) Flags: [%snegotiable], length: %u", in lmp_print()
495 GET_U_1(lmp_obj_header->class_num)), in lmp_print()
496 GET_U_1(lmp_obj_header->class_num), in lmp_print()
499 (GET_U_1(lmp_obj_header->class_num)<<8)+lmp_obj_ctype), in lmp_print()
501 GET_U_1(lmp_obj_header->ctype)&0x80 ? "" : "non-", in lmp_print()
504 if (lmp_obj_len < 4) { in lmp_print()
508 if ((lmp_obj_len % 4) != 0) { in lmp_print()
509 ND_PRINT(" (not a multiple of 4)"); in lmp_print()
514 obj_tlen=lmp_obj_len-sizeof(struct lmp_object_header); in lmp_print()
520 switch(GET_U_1(lmp_obj_header->class_num)) { in lmp_print()
523 switch(lmp_obj_ctype) { in lmp_print()
526 if (obj_tlen != 4) { in lmp_print()
542 switch(lmp_obj_ctype) { in lmp_print()
545 if (obj_tlen != 4) { in lmp_print()
565 if (obj_tlen != 4) { in lmp_print()
579 switch(lmp_obj_ctype) { in lmp_print()
581 if (obj_tlen != 4) { in lmp_print()
590 if (obj_tlen != 4) { in lmp_print()
604 switch(lmp_obj_ctype) { in lmp_print()
607 if (obj_tlen != 4) { in lmp_print()
622 switch(lmp_obj_ctype) { in lmp_print()
624 if (obj_tlen != 4) { in lmp_print()
639 switch(lmp_obj_ctype) { in lmp_print()
647 GET_BE_U_4(obj_tptr + 4)); in lmp_print()
656 switch(lmp_obj_ctype) { in lmp_print()
667 ND_PRINT("\n\t Local Link-ID: %s (0x%08x)" in lmp_print()
668 "\n\t Remote Link-ID: %s (0x%08x)", in lmp_print()
669 GET_IPADDR_STRING(obj_tptr+4), in lmp_print()
670 GET_BE_U_4(obj_tptr + 4), in lmp_print()
685 ND_PRINT("\n\t Local Link-ID: %s (0x%08x)" in lmp_print()
686 "\n\t Remote Link-ID: %s (0x%08x)", in lmp_print()
687 GET_IP6ADDR_STRING(obj_tptr+4), in lmp_print()
688 GET_BE_U_4(obj_tptr + 4), in lmp_print()
703 ND_PRINT("\n\t Local Link-ID: %u (0x%08x)" in lmp_print()
704 "\n\t Remote Link-ID: %u (0x%08x)", in lmp_print()
705 GET_BE_U_4(obj_tptr + 4), in lmp_print()
706 GET_BE_U_4(obj_tptr + 4), in lmp_print()
717 switch(lmp_obj_ctype) { in lmp_print()
729 GET_IPADDR_STRING(obj_tptr+4), in lmp_print()
730 GET_BE_U_4(obj_tptr + 4), in lmp_print()
734 if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 12, 12)) in lmp_print()
749 GET_IP6ADDR_STRING(obj_tptr+4), in lmp_print()
750 GET_BE_U_4(obj_tptr + 4), in lmp_print()
754 if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 36, 36)) in lmp_print()
769 GET_BE_U_4(obj_tptr + 4), in lmp_print()
770 GET_BE_U_4(obj_tptr + 4), in lmp_print()
774 if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 12, 12)) in lmp_print()
784 switch(lmp_obj_ctype) { in lmp_print()
797 GET_BE_U_4(obj_tptr + 4)); in lmp_print()
816 switch(lmp_obj_ctype) { in lmp_print()
818 if (obj_tlen != 4) { in lmp_print()
834 switch(lmp_obj_ctype) { in lmp_print()
836 if (obj_tlen != 4) { in lmp_print()
850 switch(lmp_obj_ctype) { in lmp_print()
853 /* Decode pairs: <Interface_ID (4 bytes), Channel_status (4 bytes)> */ in lmp_print()
860 (GET_BE_U_4(obj_tptr + offset + 4)>>31) ? in lmp_print()
861 "Allocated" : "Non-allocated", in lmp_print()
862 (GET_BE_U_4(obj_tptr + offset + 4)>>31)); in lmp_print()
865 (GET_BE_U_4(obj_tptr + offset + 4)>>30)&0x1 ? in lmp_print()
867 (GET_BE_U_4(obj_tptr + offset + 4)>>30)&0x1); in lmp_print()
872 GET_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF), in lmp_print()
873 GET_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF); in lmp_print()
880 /* Decode pairs: <Interface_ID (16 bytes), Channel_status (4 bytes)> */ in lmp_print()
888 "Allocated" : "Non-allocated", in lmp_print()
907 /* Decode pairs: <Interface_ID (4 bytes), Channel_status (4 bytes)> */ in lmp_print()
914 (GET_BE_U_4(obj_tptr + offset + 4)>>31) ? in lmp_print()
915 "Allocated" : "Non-allocated", in lmp_print()
916 (GET_BE_U_4(obj_tptr + offset + 4)>>31)); in lmp_print()
919 (GET_BE_U_4(obj_tptr + offset + 4)>>30)&0x1 ? in lmp_print()
921 (GET_BE_U_4(obj_tptr + offset + 4)>>30)&0x1); in lmp_print()
926 GET_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF), in lmp_print()
927 GET_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF); in lmp_print()
938 switch(lmp_obj_ctype) { in lmp_print()
941 while (offset+4 <= obj_tlen) { in lmp_print()
945 offset+=4; in lmp_print()
961 while (offset+4 <= obj_tlen) { in lmp_print()
965 offset+=4; in lmp_print()
975 switch(lmp_obj_ctype) { in lmp_print()
977 if (obj_tlen != 4) { in lmp_print()
988 if (obj_tlen != 4) { in lmp_print()
1003 switch (lmp_obj_ctype) { in lmp_print()
1005 if (obj_tlen != 4) { in lmp_print()
1032 switch (link_type) { in lmp_print()
1061 GET_BE_U_2(obj_tptr + 4)); in lmp_print()
1099 if (obj_tlen != 4) { in lmp_print()
1118 if (ndo->ndo_vflag <= 1) in lmp_print()
1123 if (ndo->ndo_vflag > 1 || hexdump==TRUE) in lmp_print()
1125 lmp_obj_len-sizeof(struct lmp_object_header)); in lmp_print()
1133 tlen-=lmp_obj_len; in lmp_print()