(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-tipc.c) |
| |
| 826 | | | dissect_tipc_v2_internal_msg(tvbuff_t *tipc_tvb, proto_tree *tipc_tree, packet_info *pinfo, int offset, guint8 user, guint32 msg_size, guint8 orig_hdr_size) |
| 827 | | | { |
| 828 | | | guint32 dword; |
| 829 | | | gchar *addr_str_ptr; |
| 830 | | | tvbuff_t *data_tvb; |
| 831 | | | guint8 message_type; |
| 832 | | | guint8 item_size = 0; |
| 833 | | | guint16 message_count; |
| 834 | | | guint msg_no = 0; |
| 835 | | | guint32 msg_in_bundle_size; |
| 836 | | | guint8 msg_in_bundle_user; |
| 837 | | | gint b_inst_strlen, padlen; |
| 838 | | | |
| 839 | | | |
| 840 | | | gint len, reported_len; |
| 841 | | | gboolean save_fragmented; |
| 842 | | | guint32 frag_no, frag_msg_no; |
| 843 | | | tvbuff_t* new_tvb = NULL; |
| 844 | | | fragment_data *frag_msg = NULL; |
| 845 | | | |
| 846 | | | message_type = (tvb_get_guint8(tipc_tvb, offset) >>5) & 0x7; |
| 847 | | | |
| 848 | | | switch (user) { |
| 849 | | | case TIPCv2_BCAST_PROTOCOL: |
| 850 | | | |
| 851 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_bcast_mtype, tipc_tvb, offset, 4, FALSE); |
| 852 | | | |
| 853 | | | |
| 854 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_broadcast_ack_no, tipc_tvb, offset, 4, FALSE); |
| 855 | | | offset = offset + 4; |
| 856 | | | |
| 857 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_ack_no, tipc_tvb, offset, 4, FALSE); |
| 858 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_seq_no, tipc_tvb, offset, 4, FALSE); |
| 859 | | | offset = offset + 4; |
| 860 | | | |
| 861 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 862 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 863 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 864 | | | offset = offset + 4; |
| 865 | | | if (handle_v2_as & (V2_AS_1_6)) { |
| 866 | | | |
| 867 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 20, "words 4-8 unused for this user"); |
| 868 | | | offset = offset + 20; |
| 869 | | | } else { |
| 870 | | | |
| 871 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4, "word 4 unused for this user"); |
| 872 | | | offset = offset + 4; |
| 873 | | | |
| 874 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 875 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 876 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_network_id, tipc_tvb, offset, 4, FALSE); |
| 877 | | | offset = offset + 4; |
| 878 | | | |
| 879 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 880 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 881 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_orig_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 882 | | | offset = offset + 4; |
| 883 | | | |
| 884 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 885 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 886 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_dest_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 887 | | | offset = offset + 4; |
| 888 | | | |
| 889 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4, "word 8 unused for this user"); |
| 890 | | | offset = offset + 4; |
| 891 | | | } |
| 892 | | | |
| 893 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_bcast_tag, tipc_tvb, offset, 4, FALSE); |
| 894 | | | |
| 895 | | | offset = offset + 4; |
| 896 | | | break; |
| 897 | | | case TIPCv2_MSG_BUNDLER: |
| 898 | | | if (handle_v2_as & (V2_AS_1_6)) { |
| 899 | | | |
| 900 | | | |
| 901 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 8, "words 1+2 unused for this user"); |
| 902 | | | offset = offset + 8; |
| 903 | | | } else { |
| 904 | | | |
| 905 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_bundler_mtype, tipc_tvb, offset, 4, FALSE); |
| 906 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_broadcast_ack_no, tipc_tvb, offset, 4, FALSE); |
| 907 | | | offset = offset + 4; |
| 908 | | | |
| 909 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_ack_no, tipc_tvb, offset, 4, FALSE); |
| 910 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_seq_no, tipc_tvb, offset, 4, FALSE); |
| 911 | | | offset = offset + 4; |
| 912 | | | } |
| 913 | | | |
| 914 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 915 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 916 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 917 | | | offset = offset + 4; |
| 918 | | | if (handle_v2_as & (V2_AS_1_6)) { |
| 919 | | | |
| 920 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 20, "words 4-8 unused for this user"); |
| 921 | | | offset = offset + 20; |
| 922 | | | } else { |
| 923 | | | |
| 924 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 8, "words 4+5 unused for this user"); |
| 925 | | | offset = offset + 8; |
| 926 | | | |
| 927 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 928 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 929 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_orig_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 930 | | | offset = offset + 4; |
| 931 | | | |
| 932 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 933 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 934 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_dest_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 935 | | | offset = offset + 4; |
| 936 | | | |
| 937 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4, "word 8 unused for this user"); |
| 938 | | | offset = offset + 4; |
| 939 | | | } |
| 940 | | | |
| 941 | | | |
| 942 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_msg_count, tipc_tvb, offset, 4, FALSE); |
| 943 | | | message_count = tvb_get_ntohs(tipc_tvb, offset); |
| 944 | | | |
| 945 | | | |
| 946 | | | |
| 947 | | | |
| 948 | | | |
| 949 | | | offset = offset + 4; |
| 950 | | | |
| 951 | | | |
| 952 | | | while ((guint32)offset < msg_size) { |
| 953 | | | msg_no++; |
| 954 | | | |
| 955 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 956 | | | msg_in_bundle_size = dword & 0x1ffff; |
| 957 | | | msg_in_bundle_user = (dword >> 25) & 0xf; |
| 958 | | | |
| 959 | | | proto_tree_add_text(top_tree, tipc_tvb, offset, msg_in_bundle_size, "Message %u of %u in Bundle (%s)", |
| 960 | | | msg_no, message_count, val_to_str(msg_in_bundle_user, tipcv2_user_short_str_vals, "unknown")); |
| 961 | | | data_tvb = tvb_new_subset(tipc_tvb, offset, msg_in_bundle_size, msg_in_bundle_size); |
| 962 | | | |
| 963 | | | |
| 964 | | | |
| 965 | | | if (check_col(pinfo->cinfo, COL_INFO)) { |
| 966 | | | col_append_str(pinfo->cinfo, COL_INFO, " | "); |
| 967 | | | col_set_fence(pinfo->cinfo, COL_INFO); |
| 968 | | | } |
| 969 | | | |
| 970 | | | dissect_tipc(data_tvb, pinfo, top_tree); |
| 971 | | | |
| 972 | | | |
| 973 | | | offset += msg_in_bundle_size + ((msg_in_bundle_size%4)?(4-(msg_in_bundle_size%4)):0); |
| 974 | | | } |
| 975 | | | break; |
| 976 | | | case TIPCv2_LINK_PROTOCOL: |
| 977 | | | |
| 978 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_mtype, tipc_tvb, offset, 4, FALSE); |
| 979 | | | |
| 980 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_bcast_seq_gap, tipc_tvb, offset, 4, FALSE); |
| 981 | | | |
| 982 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_sequence_gap, tipc_tvb, offset, 4, FALSE); |
| 983 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_broadcast_ack_no, tipc_tvb, offset, 4, FALSE); |
| 984 | | | offset = offset + 4; |
| 985 | | | |
| 986 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_ack_no, tipc_tvb, offset, 4, FALSE); |
| 987 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_seq_no, tipc_tvb, offset, 4, FALSE); |
| 988 | | | offset = offset + 4; |
| 989 | | | |
| 990 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 991 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 992 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 993 | | | offset = offset + 4; |
| 994 | | | |
| 995 | | | |
| 996 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_next_sent_broadcast, tipc_tvb, offset, 4, FALSE); |
| 997 | | | |
| 998 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_next_sent_packet, tipc_tvb, offset, 4, FALSE); |
| 999 | | | offset = offset + 4; |
| 1000 | | | |
| 1001 | | | |
| 1002 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_session_no, tipc_tvb, offset, 4, FALSE); |
| 1003 | | | |
| 1004 | | | |
| 1005 | | | |
| 1006 | | | |
| 1007 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_redundant_link, tipc_tvb, offset, 4, FALSE); |
| 1008 | | | |
| 1009 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_bearer_id, tipc_tvb, offset, 4, FALSE); |
| 1010 | | | |
| 1011 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_prio, tipc_tvb, offset, 4, FALSE); |
| 1012 | | | |
| 1013 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_network_plane, tipc_tvb, offset, 4, FALSE); |
| 1014 | | | |
| 1015 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_probe, tipc_tvb, offset, 4, FALSE); |
| 1016 | | | offset = offset + 4; |
| 1017 | | | if (handle_v2_as & (V2_AS_1_6)) { |
| 1018 | | | |
| 1019 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 12, "words 6-8 unused for this user"); |
| 1020 | | | offset = offset + 12; |
| 1021 | | | } else { |
| 1022 | | | |
| 1023 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1024 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1025 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_orig_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1026 | | | offset = offset + 4; |
| 1027 | | | |
| 1028 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1029 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1030 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_dest_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1031 | | | offset = offset + 4; |
| 1032 | | | |
| 1033 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_timestamp, tipc_tvb, offset, 4, FALSE); |
| 1034 | | | offset = offset + 4; |
| 1035 | | | } |
| 1036 | | | |
| 1037 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_max_packet, tipc_tvb, offset, 4, FALSE); |
| 1038 | | | |
| 1039 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_tolerance, tipc_tvb, offset, 4, FALSE); |
| 1040 | | | offset = offset + 4; |
| 1041 | | | |
| 1042 | | | if ((message_type == TIPCv2_RESET_MSG) |
| 1043 | | | || ((message_type == TIPCv2_STATE_MSG) && ((msg_size-(orig_hdr_size*4)) != 0))) |
| 1044 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_bearer_instance, tipc_tvb, offset, -1, FALSE); |
| 1045 | | | |
| 1046 | | | b_inst_strlen = tvb_strsize(tipc_tvb, offset); |
| 1047 | | | offset += b_inst_strlen; |
| 1048 | | | if ((padlen = (4-b_inst_strlen%4)) > 0) { |
| 1049 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, padlen, "Padding: %d byte%c", padlen, (padlen!=1?'s':0)); |
| 1050 | | | offset += padlen; |
| 1051 | | | }; |
| 1052 | | | if ((offset-msg_size) > 0) { |
| 1053 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, -1, "Filler for MTU discovery: %d byte%c", tvb_length_remaining(tipc_tvb, offset), (padlen!=1?'s':0)); |
| 1054 | | | }; |
| 1055 | | | break; |
| 1056 | | | case TIPCv2_CONN_MANAGER: |
| 1057 | | | |
| 1058 | | | |
| 1059 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_connmgr_mtype, tipc_tvb, offset, 4, FALSE); |
| 1060 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_errorcode, tipc_tvb, offset, 4, FALSE); |
| 1061 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_rer_cnt, tipc_tvb, offset, 4, FALSE); |
| 1062 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_lookup_scope, tipc_tvb, offset, 4, FALSE); |
| 1063 | | | |
| 1064 | | | |
| 1065 | | | |
| 1066 | | | |
| 1067 | | | |
| 1068 | | | |
| 1069 | | | |
| 1070 | | | |
| 1071 | | | |
| 1072 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_broadcast_ack_no , tipc_tvb, offset, 4, FALSE); |
| 1073 | | | offset = offset + 4; |
| 1074 | | | |
| 1075 | | | |
| 1076 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_ack_no , tipc_tvb, offset, 4, FALSE); |
| 1077 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_seq_no , tipc_tvb, offset, 4, FALSE); |
| 1078 | | | offset = offset + 4; |
| 1079 | | | |
| 1080 | | | |
| 1081 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1082 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1083 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1084 | | | offset = offset + 4; |
| 1085 | | | |
| 1086 | | | |
| 1087 | | | proto_tree_add_item(tipc_tree, hf_tipc_org_port , tipc_tvb, offset, 4, FALSE); |
| 1088 | | | offset = offset + 4; |
| 1089 | | | |
| 1090 | | | |
| 1091 | | | proto_tree_add_item(tipc_tree, hf_tipc_dst_port , tipc_tvb, offset, 4, FALSE); |
| 1092 | | | offset = offset + 4; |
| 1093 | | | |
| 1094 | | | |
| 1095 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1096 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1097 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_orig_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1098 | | | offset = offset + 4; |
| 1099 | | | |
| 1100 | | | |
| 1101 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1102 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1103 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_dest_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1104 | | | offset = offset + 4; |
| 1105 | | | |
| 1106 | | | |
| 1107 | | | |
| 1108 | | | |
| 1109 | | | |
| 1110 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4, "word 8 unused for this user (might be set prior to 1.7.3 but was never verified)"); |
| 1111 | | | offset = offset + 4; |
| 1112 | | | |
| 1113 | | | |
| 1114 | | | |
| 1115 | | | |
| 1116 | | | |
| 1117 | | | |
| 1118 | | | |
| 1119 | | | |
| 1120 | | | |
| 1121 | | | |
| 1122 | | | |
| 1123 | | | if (message_type == TIPCv2_CONMGR_MSG_ACK || (handle_v2_as & (V2_AS_ALL + V2_AS_1_7))) |
| 1124 | | | { |
| 1125 | | | |
| 1126 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_conn_mgr_msg_ack, tipc_tvb, offset, 4, FALSE); |
| 1127 | | | offset += 4; |
| 1128 | | | } |
| 1129 | | | break; |
| 1130 | | | case TIPCv2_ROUTE_DISTRIBUTOR: |
| 1131 | | | |
| 1132 | | | |
| 1133 | | | dword = tvb_get_ntohl(tipc_tvb, offset+28); |
| 1134 | | | item_size = (dword >> 24) & 0xff; |
| 1135 | | | if ((handle_v2_as & V2_AS_1_6) || ((handle_v2_as & V2_AS_ALL) == 0)) { |
| 1136 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_route_mtype_1_6, tipc_tvb, offset, 4, FALSE); |
| 1137 | | | } else { |
| 1138 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_route_mtype_1_7, tipc_tvb, offset, 4, FALSE); |
| 1139 | | | } |
| 1140 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_broadcast_ack_no, tipc_tvb, offset, 4, FALSE); |
| 1141 | | | offset = offset + 4; |
| 1142 | | | |
| 1143 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_ack_no, tipc_tvb, offset, 4, FALSE); |
| 1144 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_seq_no, tipc_tvb, offset, 4, FALSE); |
| 1145 | | | offset = offset + 4; |
| 1146 | | | |
| 1147 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1148 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1149 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1150 | | | offset = offset + 4; |
| 1151 | | | |
| 1152 | | | |
| 1153 | | | if (handle_v2_as & V2_AS_1_6) { |
| 1154 | | | |
| 1155 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 24, "words 4-9 unused for this user"); |
| 1156 | | | offset = offset + 24; |
| 1157 | | | } else { |
| 1158 | | | |
| 1159 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4, "word 4 unused for this user"); |
| 1160 | | | offset = offset + 4; |
| 1161 | | | |
| 1162 | | | proto_tree_add_item(tipc_tree, hf_tipc_dst_port, tipc_tvb, offset, 4, FALSE); |
| 1163 | | | offset = offset + 4; |
| 1164 | | | |
| 1165 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1166 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1167 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_orig_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1168 | | | offset = offset + 4; |
| 1169 | | | |
| 1170 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1171 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1172 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_dest_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1173 | | | offset = offset + 4; |
| 1174 | | | |
| 1175 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4, "word 8 unused for this user"); |
| 1176 | | | offset = offset + 4; |
| 1177 | | | |
| 1178 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1179 | | | item_size = (dword >> 24) & 0xff; |
| 1180 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_item_size, tipc_tvb, offset, 4, FALSE); |
| 1181 | | | offset = offset + 4; |
| 1182 | | | } |
| 1183 | | | |
| 1184 | | | |
| 1185 | | | if ((handle_v2_as & V2_AS_1_6) || ((handle_v2_as & V2_AS_ALL) && (item_size == 0))) { |
| 1186 | | | |
| 1187 | | | switch (message_type) { |
| 1188 | | | case TIPCv2_EXT_ROUTING_TABLE: |
| 1189 | | | case TIPCv2_LOCAL_ROUTING_TABLE: |
| 1190 | | | case TIPCv2_SEC_ROUTING_TABLE: |
| 1191 | | | |
| 1192 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1193 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1194 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_cluster_address, tipc_tvb, offset, 4, addr_str_ptr); |
| 1195 | | | offset = offset + 4; |
| 1196 | | | |
| 1197 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_bitmap, tipc_tvb, offset, -1, FALSE); |
| 1198 | | | break; |
| 1199 | | | case TIPCv2_ROUTE_ADDITION: |
| 1200 | | | case TIPCv2_ROUTE_REMOVAL: |
| 1201 | | | |
| 1202 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1203 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1204 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_node_address, tipc_tvb, offset, 4, addr_str_ptr); |
| 1205 | | | offset = offset + 4; |
| 1206 | | | default: |
| 1207 | | | break; |
| 1208 | | | } |
| 1209 | | | } else { |
| 1210 | | | |
| 1211 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1212 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1213 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_network_region, tipc_tvb, offset, 4, addr_str_ptr); |
| 1214 | | | offset += 4; |
| 1215 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1216 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1217 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_local_router, tipc_tvb, offset, 4, addr_str_ptr); |
| 1218 | | | offset += 4; |
| 1219 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1220 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1221 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_remote_router, tipc_tvb, offset, 4, addr_str_ptr); |
| 1222 | | | offset += 4; |
| 1223 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_dist_dist, tipc_tvb, offset, 4, FALSE); |
| 1224 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_dist_scope, tipc_tvb, offset, 4, FALSE); |
| 1225 | | | offset = offset + 4; |
| 1226 | | | } |
| 1227 | | | break; |
| 1228 | | | |
| 1229 | | | case TIPCv2_CHANGEOVER_PROTOCOL: |
| 1230 | | | |
| 1231 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_changeover_mtype, tipc_tvb, offset, 4, FALSE); |
| 1232 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_broadcast_ack_no, tipc_tvb, offset, 4, FALSE); |
| 1233 | | | offset = offset + 4; |
| 1234 | | | |
| 1235 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_ack_no, tipc_tvb, offset, 4, FALSE); |
| 1236 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_seq_no, tipc_tvb, offset, 4, FALSE); |
| 1237 | | | offset = offset + 4; |
| 1238 | | | |
| 1239 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1240 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1241 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1242 | | | offset = offset + 4; |
| 1243 | | | |
| 1244 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4, "word 4 unused for this user"); |
| 1245 | | | offset = offset + 4; |
| 1246 | | | |
| 1247 | | | |
| 1248 | | | |
| 1249 | | | |
| 1250 | | | if (handle_v2_as & (V2_AS_1_6)) { |
| 1251 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_redundant_link, tipc_tvb, offset, 4, FALSE); |
| 1252 | | | } |
| 1253 | | | |
| 1254 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_bearer_id, tipc_tvb, offset, 4, FALSE); |
| 1255 | | | offset = offset + 4; |
| 1256 | | | |
| 1257 | | | if (handle_v2_as & (V2_AS_1_6)) { |
| 1258 | | | |
| 1259 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 12, "words 6-8 unused for this user"); |
| 1260 | | | offset = offset + 12; |
| 1261 | | | } else { |
| 1262 | | | |
| 1263 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1264 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1265 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_orig_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1266 | | | offset = offset + 4; |
| 1267 | | | |
| 1268 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1269 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1270 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_dest_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1271 | | | offset = offset + 4; |
| 1272 | | | |
| 1273 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4, "word 8 unused for this user"); |
| 1274 | | | offset = offset + 4; |
| 1275 | | | } |
| 1276 | | | |
| 1277 | | | switch (message_type) |
| 1278 | | | { |
| 1279 | | | case 0: |
| 1280 | | | |
| 1281 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4, "word 9 unused for this message type"); |
| 1282 | | | break; |
| 1283 | | | case 1: |
| 1284 | | | |
| 1285 | | | |
| 1286 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_msg_count, tipc_tvb, offset, 4, FALSE); |
| 1287 | | | break; |
| 1288 | | | default: |
| 1289 | | | break; |
| 1290 | | | } |
| 1291 | | | offset = offset + 4; |
| 1292 | | | break; |
| 1293 | | | case TIPCv2_NAME_DISTRIBUTOR: |
| 1294 | | | |
| 1295 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_naming_mtype, tipc_tvb, offset, 4, FALSE); |
| 1296 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_broadcast_ack_no, tipc_tvb, offset, 4, FALSE); |
| 1297 | | | offset = offset + 4; |
| 1298 | | | |
| 1299 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_ack_no, tipc_tvb, offset, 4, FALSE); |
| 1300 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_seq_no, tipc_tvb, offset, 4, FALSE); |
| 1301 | | | offset = offset + 4; |
| 1302 | | | |
| 1303 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1304 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1305 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1306 | | | offset = offset + 4; |
| 1307 | | | |
| 1308 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 8, "words 4+5 unused for this user"); |
| 1309 | | | offset = offset + 8; |
| 1310 | | | |
| 1311 | | | |
| 1312 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1313 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1314 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_orig_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1315 | | | offset = offset + 4; |
| 1316 | | | |
| 1317 | | | |
| 1318 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1319 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1320 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_dest_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1321 | | | offset = offset + 4; |
| 1322 | | | if (handle_v2_as & (V2_AS_1_6 + V2_AS_ALL)) { |
| 1323 | | | |
| 1324 | | | |
| 1325 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_transport_seq_no, tipc_tvb, offset, 4, FALSE); |
| 1326 | | | offset = offset + 4; |
| 1327 | | | } else { |
| 1328 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4, "word 8 unused for this user"); |
| 1329 | | | offset = offset + 4; |
| 1330 | | | } |
| 1331 | | | |
| 1332 | | | if (handle_v2_as & V2_AS_1_6) { |
| 1333 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4, "word 9 unused for this user"); |
| 1334 | | | offset = offset + 4; |
| 1335 | | | } else { |
| 1336 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1337 | | | item_size = (dword >> 24) & 0xff; |
| 1338 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_item_size, tipc_tvb, offset, 4, FALSE); |
| 1339 | | | offset = offset + 4; |
| 1340 | | | } |
| 1341 | | | |
| 1342 | | | |
| 1343 | | | data_tvb = tvb_new_subset(tipc_tvb, offset, -1, -1); |
| 1344 | | | dissect_tipc_name_dist_data(data_tvb, tipc_tree, item_size); |
| 1345 | | | break; |
| 1346 | | | case TIPCv2_MSG_FRAGMENTER: |
| 1347 | | | |
| 1348 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_fragmenter_mtype, tipc_tvb, offset, 4, FALSE); |
| 1349 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_broadcast_ack_no, tipc_tvb, offset, 4, FALSE); |
| 1350 | | | offset = offset + 4; |
| 1351 | | | |
| 1352 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_ack_no, tipc_tvb, offset, 4, FALSE); |
| 1353 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_seq_no, tipc_tvb, offset, 4, FALSE); |
| 1354 | | | offset = offset + 4; |
| 1355 | | | |
| 1356 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1357 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1358 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1359 | | | offset = offset + 4; |
| 1360 | | | |
| 1361 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1362 | | | |
| 1363 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_fragment_number, tipc_tvb, offset, 4, FALSE); |
| 1364 | | | frag_no = (dword >> 16) & 0x0000ffff; |
| 1365 | | | |
| 1366 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_fragment_msg_number, tipc_tvb, offset, 4, FALSE); |
| 1367 | | | frag_msg_no = dword & 0x0000ffff; |
| 1368 | | | offset = offset + 4; |
| 1369 | | | if (handle_v2_as & (V2_AS_1_6)) { |
| 1370 | | | |
| 1371 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 20, "words 5-9 unused for this user"); |
| 1372 | | | offset = offset + 20; |
| 1373 | | | } else { |
| 1374 | | | |
| 1375 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4, "word 5 unused for this user"); |
| 1376 | | | offset = offset + 4; |
| 1377 | | | |
| 1378 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1379 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1380 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_orig_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1381 | | | offset = offset + 4; |
| 1382 | | | |
| 1383 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1384 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1385 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_dest_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1386 | | | offset = offset + 4; |
| 1387 | | | |
| 1388 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, 8, "words 8+9 unused for this user"); |
| 1389 | | | offset = offset + 8; |
| 1390 | | | } |
| 1391 | | | |
| 1392 | | | len = (msg_size - (orig_hdr_size<<2)); |
| 1393 | | | reported_len = tvb_reported_length_remaining(tipc_tvb, offset); |
| 1394 | | | |
| 1395 | | | if (tipc_defragment) { |
| 1396 | | | |
| 1397 | | | save_fragmented = pinfo->fragmented; |
| 1398 | | | pinfo->fragmented = TRUE; |
| 1399 | | | |
| 1400 | | | frag_msg = fragment_add_seq_check(tipc_tvb, offset, pinfo, |
| 1401 | | | frag_msg_no, |
| 1402 | | | |
| 1403 | | | tipc_msg_fragment_table, |
| 1404 | | | tipc_msg_reassembled_table, |
| 1405 | | | |
| 1406 | | | (frag_no-1), |
| 1407 | | | len, |
| 1408 | | | (message_type != TIPCv2_USER_LAST_FRAGMENT)); |
| 1409 | | | |
| 1410 | | | new_tvb = process_reassembled_data(tipc_tvb, offset, pinfo, |
| 1411 | | | "Reassembled Message", frag_msg, &tipc_msg_frag_items, |
| 1412 | | | NULL, tipc_tree); |
| 1413 | | | |
| 1414 | | | if (frag_msg) { |
| 1415 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 1416 | | | col_append_str(pinfo->cinfo, COL_INFO, |
| 1417 | | | " (Message Reassembled)"); |
| 1418 | | | } else { |
| 1419 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 1420 | | | col_append_fstr(pinfo->cinfo, COL_INFO, |
| 1421 | | | " (Message fragment %u)", frag_no); |
| 1422 | | | } |
| 1423 | | | if (new_tvb) { |
| 1424 | | | data_tvb = new_tvb; |
| 1425 | | | |
| 1426 | | | |
| 1427 | | | |
| 1428 | | | if (check_col(pinfo->cinfo, COL_INFO)) { |
| 1429 | | | col_append_str(pinfo->cinfo, COL_INFO, " | "); |
| 1430 | | | col_set_fence(pinfo->cinfo, COL_INFO); |
| 1431 | | | } |
| 1432 | | | dissect_tipc(new_tvb, pinfo, top_tree); |
| 1433 | | | } else { |
| 1434 | | | data_tvb = tvb_new_subset(tipc_tvb, offset, len, reported_len); |
| 1435 | | | call_dissector(data_handle, data_tvb, pinfo, top_tree); |
| 1436 | | | } |
| 1437 | | | |
| 1438 | | | pinfo->fragmented = save_fragmented; |
| 1439 | | | } else { |
| 1440 | | | |
| 1441 | | | data_tvb = tvb_new_subset(tipc_tvb, offset, len, reported_len); |
| 1442 | | | call_dissector(data_handle, data_tvb, pinfo, top_tree); |
| 1443 | | | } |
| 1444 | | | |
| 1445 | | | break; |
| 1446 | | | case TIPCv2_NEIGHBOUR_DISCOVERY: |
| 1447 | | | |
| 1448 | | | |
| 1449 | | | |
| 1450 | | | |
| 1451 | | | |
| 1452 | | | |
| 1453 | | | |
| 1454 | | | |
| 1455 | | | |
| 1456 | | | |
| 1457 1469 |  | | [ Lines 1457 to 1469 omitted. ] |
| 1470 | | | |
| 1471 | | | |
| 1472 | | | |
| 1473 | | | |
| 1474 | | | |
| 1475 | | | |
| 1476 | | | |
| 1477 | | | |
| 1478 | | | |
| 1479 | | | |
| 1480 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_neighbour_mtype, tipc_tvb, offset, 4, FALSE); |
| 1481 | | | |
| 1482 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_req_links, tipc_tvb, offset, 4, FALSE); |
| 1483 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_broadcast_ack_no, tipc_tvb, offset, 4, FALSE); |
| 1484 | | | offset = offset + 4; |
| 1485 | | | |
| 1486 | | | |
| 1487 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1488 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1489 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_destination_domain, tipc_tvb, offset, 4, addr_str_ptr); |
| 1490 | | | offset = offset + 4; |
| 1491 | | | |
| 1492 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1493 | | | addr_str_ptr = tipc_addr_to_str(dword); |
| 1494 | | | proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr); |
| 1495 | | | offset = offset + 4; |
| 1496 | | | |
| 1497 | | | |
| 1498 | | | dword = tvb_get_ntohl(tipc_tvb, offset); |
| 1499 | | | addr_str_ptr = tipc_addr_to_str(dword); |
Ignored Return Value
The return value of tipc_addr_to_str() is never checked in the highlighted execution scenario. - If the return value can indicate an error, the error will be ignored if the highlighted code executes.
- The return value of tipc_addr_to_str() is checked 97% of the time in this project. CodeSonar is configured to enforce Ignored Return Value checks for any function whose return value is checked at least 96% of the time, unless the function is used fewer than 20 times. (To modify these thresholds, use configuration file parameters RETURN_CHECKER_SAMPLE_SIZE and RETURN_CHECKER_RATIO. To exempt tipc_addr_to_str() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 1500 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_network_id, tipc_tvb, offset, 4, FALSE); |
| 1501 | | | offset = offset + 4; |
| 1502 | | | if (handle_v2_as & (V2_AS_1_6)) { |
Event 2:
Taking false branch. handle_v2_as & 2 evaluates to false.
hide
|
|
| 1503 | | | |
| 1504 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_bearer_level_orig_addr, tipc_tvb, offset, 20, FALSE); |
| 1505 | | | offset = offset + 20; |
| 1506 | | | } else { |
| 1507 | | | |
| 1508 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_media_id, tipc_tvb, offset, 4, FALSE); |
| 1509 | | | offset = offset + 4; |
| 1510 | | | |
| 1511 | | | proto_tree_add_item(tipc_tree, hf_tipcv2_bearer_level_orig_addr, tipc_tvb, offset, 16, FALSE); |
| 1512 | | | offset = offset + 16; |
| 1513 | | | } |
| 1514 | | | if (msg_size-(orig_hdr_size*4) != 0) { |
Event 3:
Taking true branch. msg_size - orig_hdr_size * 4 != 0 evaluates to true.
hide
|
|
| 1515 | | | proto_tree_add_text(tipc_tree, tipc_tvb, offset, -1, "Vendor specific data"); |
| 1516 | | | } |
| 1517 | | | break; |
| 1518 | | | default: |
| 1519 | | | break; |
| 1520 | | | } |
| 1521 | | | |
| 1522 | | | } |
| |