Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Control Flow  at packet-catapult-dct2000.c:1203

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

attach_fp_info

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-catapult-dct2000.c)expand/collapse
Show more  
 1146  void attach_fp_info(packet_info *pinfo, gboolean received, const char *protocol_name, int variant)
 1147  {
 1148      int  i=0;
 1149      int  chan;
 1150      int  tf_start, num_chans_start;
 1151      gint node_type;
 1152   
 1153      /* Only need to set info once per session. */
 1154      struct fp_info *p_fp_info = p_get_proto_data(pinfo->fd, proto_fp);
 1155      if (p_fp_info != NULL)
 1156      {
 1157          return;
 1158      }
 1159   
 1160      /* Allocate struct */
 1161      p_fp_info = se_alloc0(sizeof(struct fp_info));
 1162      if (!p_fp_info)
 1163      {
 1164          return;
 1165      }
 1166   
 1167      /* Check that the number of outhdr values looks sensible */
 1168      if (((strcmp(protocol_name, "fpiur_r5") == 0) && (outhdr_values_found != 2)) ||
 1169          (outhdr_values_found < 5))
 1170      {
 1171          return;
 1172      }
 1173   
 1174      /* 3gpp release (99, 4, 5, 6, 7) */
 1175      if (strcmp(protocol_name, "fp") == 0)
 1176      {
 1177          p_fp_info->release = 99;
 1178      }
 1179      else if (strcmp(protocol_name, "fp_r4") == 0)
 1180      {
 1181          p_fp_info->release = 4;
 1182      }
 1183      else if (strcmp(protocol_name, "fp_r5") == 0)
 1184      {
 1185          p_fp_info->release = 5;
 1186      }
 1187      else if (strcmp(protocol_name, "fp_r6") == 0)
 1188      {
 1189          p_fp_info->release = 6;
 1190      }
 1191      else if (strcmp(protocol_name, "fp_r7") == 0)
 1192      {
 1193          p_fp_info->release = 7;
 1194      }
 1195      else if (strcmp(protocol_name, "fpiur_r5") == 0)
 1196      {
 1197          p_fp_info->release = 5;
 1198      }
 1199      else 
 1200      {
 1201          /* Really shouldn't get here */
 1202          DISSECTOR_ASSERT_NOT_REACHED();
 1203          return;
 1204      }
 1205   
 1206      /* Release date is derived from variant number */
 1207      /* Only R6 sub-versions currently influence format within a release */
 1208      switch (p_fp_info->release)
 1209      {
 1210          case 6:
 1211              switch (variant % 256)
 1212              {
 1213                  case 1:
 1214                      p_fp_info->release_year = 2005;
 1215                      p_fp_info->release_month = 6;
 1216                      break;
 1217                  case 2:
 1218                      p_fp_info->release_year = 2005;
 1219                      p_fp_info->release_month = 9;
 1220                      break;
 1221                  case 3:
 1222                  default:
 1223                      p_fp_info->release_year = 2006;
 1224                      p_fp_info->release_month = 3;
 1225                      break;
 1226              }
 1227              break;
 1228          case 7:
 1229              p_fp_info->release_year = 2008;
 1230              p_fp_info->release_month = 3;
 1231              break;
 1232   
 1233          default:
 1234              p_fp_info->release_year = 0;
 1235              p_fp_info->release_month = 0;
 1236      }
 1237   
 1238   
 1239      /* Channel type */
 1240      p_fp_info->channel = outhdr_values[i++];
 1241   
 1242      /* Derive direction from node type/side */
 1243      node_type = outhdr_values[i++];
 1244      p_fp_info->is_uplink = (( received  && (node_type == 2)) ||
 1245                              (!received  && (node_type == 1)));
 1246   
 1247      /* Division type introduced for R7 */
 1248      if (p_fp_info->release == 7)
 1249      {
 1250          p_fp_info->division = outhdr_values[i++];
 1251      }
 1252   
 1253      /* HS-DSCH config */
 1254      if (p_fp_info->channel == CHANNEL_HSDSCH)
 1255      {
 1256          if (p_fp_info->release == 7)
 1257          {
 1258              /* Entity (MAC-hs or MAC-ehs) used */
 1259              if (outhdr_values[i++])
 1260              {
 1261                  p_fp_info->hsdsch_entity = ehs;
 1262              }
 1263          }
 1264          else 
 1265          {
 1266              /* This is the pre-R7 default */
 1267              p_fp_info->hsdsch_entity = hs;
 1268          }
 1269      }
 1270   
 1271   
 1272      /* IUR only uses the above... */
 1273      if (strcmp(protocol_name, "fpiur_r5") == 0)
 1274      {
 1275          /* Store info in packet */
 1276          p_fp_info->iface_type = IuR_Interface;
 1277          p_add_proto_data(pinfo->fd, proto_fp, p_fp_info);
 1278          return;
 1279      }
 1280   
 1281      /* DCH CRC present... */
 1282      p_fp_info->dch_crc_present = outhdr_values[i++];
 1283   
 1284      /* ... but don't trust for edch */
 1285      if (p_fp_info->channel == CHANNEL_EDCH)
 1286      {
 1287          p_fp_info->dch_crc_present = 2; /* unknown */
 1288      }
 1289   
 1290      /* How many paging indications (if PCH data) */
 1291      p_fp_info->paging_indications = outhdr_values[i++];
 1292   
 1293      /* Number of channels (for coordinated channels) */
 1294      p_fp_info->num_chans = outhdr_values[i++];
 1295   
 1296      if (p_fp_info->channel != CHANNEL_EDCH)
 1297      {
 1298          /* TF size for each channel */
 1299          tf_start = i;
 1300          for (chan=0; chan < p_fp_info->num_chans; chan++)
 1301          {
 1302              p_fp_info->chan_tf_size[chan] = outhdr_values[tf_start+chan];
 1303          }
 1304   
 1305          /* Number of TBs for each channel */
 1306          num_chans_start = tf_start + p_fp_info->num_chans;
 1307          for (chan=0; chan < p_fp_info->num_chans; chan++)
 1308          {
 1309              p_fp_info->chan_num_tbs[chan] = outhdr_values[num_chans_start+chan];
 1310          }
 1311      }
 1312      /* EDCH info */
 1313      else 
 1314      {
 1315          int n;
 1316   
 1317          p_fp_info->no_ddi_entries = outhdr_values[i++];
 1318   
 1319          /* DDI values */
 1320          for (n=0; n < p_fp_info->no_ddi_entries; n++)
 1321          {
 1322              p_fp_info->edch_ddi[n] = outhdr_values[i++];
 1323          }
 1324   
 1325          /* Corresponding MAC-d sizes */
 1326          for (n=0; n < p_fp_info->no_ddi_entries; n++)
 1327          {
 1328              p_fp_info->edch_macd_pdu_size[n] = outhdr_values[i++];
 1329          }
 1330      }
 1331   
 1332      /* Interface must be IuB */
 1333      p_fp_info->iface_type = IuB_Interface;
 1334   
 1335      /* Store info in packet */
 1336      p_add_proto_data(pinfo->fd, proto_fp, p_fp_info);
 1337  }
Show more  




Change Warning 1966.30624 : Unreachable Control Flow

Priority:
State:
Finding:
Owner:
Note: