Text   |  XML   |  ReML   |   Visible Warnings:

Ignored Return Value  at msg_res_cmd.c:169

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

dissect_mac_mgmt_msg_res_cmd_decoder

(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/wimax/msg_res_cmd.c)expand/collapse
Show more  
 99  void dissect_mac_mgmt_msg_res_cmd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 100  {
 101          guint offset = 0;
 102          guint tvb_len, payload_type;
 103          gint  tlv_type, tlv_len, tlv_value_offset;
 104          proto_item *res_cmd_item = NULL;
 105          proto_tree *res_cmd_tree = NULL;
 106          proto_tree *tlv_tree = NULL;
 107          tlv_info_t tlv_info;
 108   
 109          /* Ensure the right payload type */
 110          payload_type = tvb_get_guint8(tvb, offset);
 111          if(payload_type != MAC_MGMT_MSG_RES_CMD)
 112          {
 113                  return;
 114          }
 115   
 116          if(tree)
 117          {       /* we are being asked for details */
 118                  /* Get the tvb reported length */
 119                  tvb_len =  tvb_reported_length(tvb);
 120                  /* display MAC payload type RES-CMD */
 121                  res_cmd_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_res_cmd_decoder, tvb, offset, tvb_len, "Reset Command (RES-CMD) (%u bytes)", tvb_len);
 122                  /* add MAC RES-CMD subtree */
 123                  res_cmd_tree = proto_item_add_subtree(res_cmd_item, ett_mac_mgmt_msg_res_cmd_decoder);
 124                  /* Decode and display the Reset Command (RES-CMD) */
 125                  /* display the Message Type */
 126                  proto_tree_add_item(res_cmd_tree, hf_res_cmd_message_type, tvb, offset, 1, FALSE);
 127                  /* set the offset for the TLV Encoded info */
 128                  offset++;
 129                  /* process the RES-CMD TLVs */
 130                  while(offset < tvb_len)
 131                  {
 132                          /* get the TLV information */
 133                          init_tlv_info(&tlv_info, tvb, offset);
 134                          /* get the TLV type */
 135                          tlv_type = get_tlv_type(&tlv_info);
 136                          /* get the TLV length */
 137                          tlv_len = get_tlv_length(&tlv_info);
 138                          if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
 139                          {       /* invalid tlv info */
 140                                  if(check_col(pinfo->cinfo, COL_INFO))
 141                                  {
 142                                          col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RES-CMD TLV error");
 143                                  }
 144                                  proto_tree_add_item(res_cmd_tree, hf_res_cmd_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
 145                                  break;
 146                          }
 147                          /* get the TLV value offset */
 148                          tlv_value_offset = get_tlv_value_offset(&tlv_info);
 149  #ifdef DEBUG /* for debug only */
 150                          proto_tree_add_protocol_format(res_cmd_tree, proto_mac_mgmt_msg_res_cmd_decoder, tvb, offset, (tlv_len + tlv_value_offset), "RES-CMD Type: %u (%u bytes, offset=%u, tlv_len=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tlv_len, tvb_len);
 151  #endif
 152                          /* update the offset for the TLV value */
 153                          offset += tlv_value_offset;
 154                          /* process RES-CMD TLV Encoded information */
 155                          switch (tlv_type)
 156                          {
 157                                  case HMAC_TUPLE:        /* Table 348d */
 158                                          /* decode and display the HMAC Tuple */
 159                                          tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_res_cmd_decoder, res_cmd_tree, proto_mac_mgmt_msg_res_cmd_decoder, tvb, offset, tlv_len, "HMAC Tuple (%u byte(s))", tlv_len);
 160                                          wimax_hmac_tuple_decoder(tlv_tree, tvb, offset, tlv_len);
 161                                  break;
 162                                  case CMAC_TUPLE:        /* Table 348b */
 163                                          /* decode and display the CMAC Tuple */
 164                                          tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_res_cmd_decoder, res_cmd_tree, proto_mac_mgmt_msg_res_cmd_decoder, tvb, offset, tlv_len, "CMAC Tuple (%u byte(s))", tlv_len);
 165                                          wimax_cmac_tuple_decoder(tlv_tree, tvb, offset, tlv_len);
 166                                  break;
 167                                  default:
 168                                          /* display the unknown tlv in hex */
 169                                          tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_res_cmd_decoder, res_cmd_tree, hf_res_cmd_unknown_type, tvb, offset, tlv_len, FALSE);
 170                                          proto_tree_add_item(res_cmd_tree, hf_res_cmd_unknown_type, tvb, offset, tlv_len, FALSE);
 171                                  break;
 172                          }
 173                          offset += tlv_len;
 174                  }       /* end of TLV process while loop */
 175          }
 176  }
Show more  




Change Warning 5494.35763 : Ignored Return Value

Priority:
State:
Finding:
Owner:
Note: