Text   |  XML   |  ReML   |   Visible Warnings:

Format String  at packet-ncp2222.inc:8975

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

dissect_nds_reply

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ncp2222.inc)expand/collapse
Show more  
 8314  dissect_nds_reply(tvbuff_t *tvb, packet_info *pinfo,
 8315          proto_tree *ncp_tree, guint32 nds_error_code,
 8316          const char *nds_error_string, ncp_req_hash_value *request_value,
 8317          conversation_t *conversation)
 8318  {
 8319          guint32                         nds_offset;
 8320          guint32                         nds_reply_buffer;
 8321          guint32                         nds_frag;
 8322          proto_item                      *expert_item;
 8323          const char                      *verb_string;
 8324          nds_val                         pvalues[9];
 8325          gboolean                        resolve_eid=FALSE;
 8326          guint32                         global_eid=0;
 8327          gboolean                        add_eid = FALSE;
 8328          char                            global_object_name[256];
 8329          ncp_req_eid_hash_value          *request_eid_value = NULL;
 8330          int                             i;
 8331   
 8332          global_object_name[0] = '\0';
 8333   
 8334          nds_offset = 8;
 8335   
 8336          nds_reply_buffer = tvb_get_letohl(tvb, nds_offset);
 8337          proto_tree_add_uint(ncp_tree, hf_ncp_fragment_size, tvb, nds_offset,
 8338                  4, nds_reply_buffer);
 8339          nds_offset += 4;
 8340          nds_frag = tvb_get_letohl(tvb, nds_offset);
 8341          proto_tree_add_uint(ncp_tree, hf_ncp_fragment_handle, tvb, nds_offset,
 8342                  4, nds_frag);
 8343          nds_offset += 4;
 8344          /*
 8345           * Is the possibly-reassembled reply large enough to have a completion 
 8346           * code?  (We can't check the fragment size as this might just be the
 8347           * last fragment.)
 8348           */
 8349          if (tvb_reported_length_remaining(tvb, nds_offset) >= 4)
 8350          {
 8351                  /* Yes - process the completion code. */
 8352                  expert_item = proto_tree_add_uint_format(ncp_tree, hf_nds_reply_error, tvb, nds_offset,
 8353                          4, nds_error_code, "NDS Completion Code: 0x%08x, %s",
 8354                          nds_error_code, nds_error_string);
 8355   
 8356                  if (nds_error_code != 0 && ncp_echo_err) {
 8357                          expert_add_info_format(pinfo, expert_item, PI_RESPONSE_CODE, PI_ERROR, "NDS Error: 0x%08x %s", nds_error_code, nds_error_string);
 8358                  }
 8359          }
 8360          if (request_value && nds_error_code == 0x00000000)
 8361          {
 8362                  nds_offset = 20;
 8363                  for (i = 0; i < 9; i++) {
 8364                          pvalues[i].vtype = 0;
 8365                          pvalues[i].vvalue = 0;
 8366                          pvalues[i].vlength = 0;
 8367                          pvalues[i].voffset = 0;
 8368                          pvalues[i].hfname = 0;
 8369                          pvalues[i].vdesc = "";
 8370                          pvalues[i].vstring = NULL;
 8371                          pvalues[i].mvtype = 0;
 8372                  }
 8373                  verb_string = val_to_str(request_value->nds_request_verb,
 8374                                           ncp_nds_verb_vals, "Continuation Fragment");
 8375                  if(request_value->req_nds_prot_flags & 0x4000)
 8376                  {
 8377                          /* CRC is included in the NDS header so justify the offset */
 8378                          proto_tree_add_item(ncp_tree, hf_nds_crc, tvb, nds_offset, 4, TRUE);
 8379                          nds_offset += 4;
 8380                  }
 8381                  switch (request_value->nds_request_verb)
 8382                  {
 8383                          case 0x01:
 8384                                  pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
 8385                                  pvalues[0].vstring = (char *)match_strval(pvalues[0].vvalue, nds_tags);
 8386                                  if(pvalues[0].vstring == NULL)
 8387                                  {
 8388                                          pvalues[0].vstring = "No Tags Set";
 8389                                  }
 8390                                  pvalues[0].vtype = VTYPE_STRING;
 8391                                  pvalues[0].vdesc = "Tag: %s";
 8392                                  pvalues[0].vlength = 4;
 8393                                  pvalues[0].voffset = nds_offset;
 8394                                  pvalues[0].hfname = hf_nds_tag_string;
 8395                                  nds_offset = nds_offset+pvalues[0].vlength;
 8396                                  switch(pvalues[0].vvalue)
 8397                                  {
 8398                                          case NDS_TAG_NO_SUCH_ENTRY:
 8399                                                  break;
 8400                                          case NDS_TAG_LOCAL_ENTRY:
 8401                                                  pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
 8402                                                  pvalues[1].vtype = VTYPE_UINT32;
 8403                                                  pvalues[1].vdesc = "Entry ID: 0x%08x";
 8404                                                  add_eid = TRUE;
 8405                                                  resolve_eid = TRUE;
 8406                                                  g_strlcpy(global_object_name, request_value->object_name, 256);
 8407                                                  global_eid = pvalues[1].vvalue;
 8408                                                  pvalues[1].vlength = 4;
 8409                                                  pvalues[1].voffset = nds_offset;
 8410                                                  pvalues[1].hfname = hf_nds_eid;
 8411                                                  nds_offset = nds_offset+pvalues[1].vlength;
 8412                                                  pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
 8413                                                  pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
 8414                                                  pvalues[2].vdesc = "Referral Records: %u";
 8415                                                  pvalues[2].vlength = 4;
 8416                                                  pvalues[2].voffset = nds_offset;
 8417                                                  pvalues[2].hfname = hf_nds_referrals;
 8418                                                  pvalues[2].mvtype = MVTYPE_LOC_ADDR_REFERRAL_REPLY;
 8419                                                  break;
 8420                                          case NDS_TAG_REMOTE_ENTRY:
 8421                                                  nds_offset += 4;   /* GUINT32 reserved field */
 8422                                                  pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
 8423                                                  pvalues[1].vtype = VTYPE_UINT32;
 8424                                                  pvalues[1].vdesc = "Entry ID: 0x%08x";
 8425                                                  pvalues[1].vlength = 4;
 8426                                                  pvalues[1].voffset = nds_offset;
 8427                                                  pvalues[1].hfname = hf_nds_eid;
 8428                                                  nds_offset = nds_offset+pvalues[1].vlength;
 8429                                                  pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
 8430                                                  pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
 8431                                                  pvalues[2].vdesc = "Referral Records: %u";
 8432                                                  pvalues[2].vlength = 4;
 8433                                                  pvalues[2].voffset = nds_offset;
 8434                                                  pvalues[2].hfname = hf_nds_referrals;
 8435                                                  pvalues[2].mvtype = MVTYPE_LOC_ADDR_REFERRAL_REPLY;
 8436                                                  break;
 8437                                          case NDS_TAG_ALIAS_ENTRY:
 8438                                                  pvalues[1].vtype = VTYPE_STRING;
 8439                                                  pvalues[1].vdesc = "Alias Name: %s";
 8440                                                  pvalues[1].mvtype = MVTYPE_ATTR_REQUEST;
 8441                                                  pvalues[1].vvalue = 0;
 8442                                                  pvalues[1].vlength = 256;
 8443                                                  pvalues[1].vlength = tvb_get_letohl(tvb, nds_offset);
 8444                                                  if (pvalues[1].vlength == 0x00)
 8445                                                  {
 8446                                                          pvalues[1].vtype = VTYPE_NONE;
 8447                                                          break;
 8448                                                  }
 8449                                                  pvalues[1].voffset = nds_offset+4;
 8450                                                  nds_offset += 4;
 8451                                                  pvalues[1].vstring = get_string(tvb, pvalues[1].voffset, pvalues[1].vlength);
 8452                                                  nds_offset += pvalues[1].vlength;
 8453                                                  nds_offset += align_4(tvb, nds_offset);
 8454                                                  pvalues[1].hfname= hf_nds_name;
 8455                                                  break;
 8456                                          case NDS_TAG_REFERRAL_INFORMATION:
 8457                                                  pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
 8458                                                  pvalues[1].vtype = VTYPE_UINT32;
 8459                                                  pvalues[1].vdesc = "Distance Object is From Root: 0x%08x";
 8460                                                  pvalues[1].vlength = 4;
 8461                                                  pvalues[1].voffset = nds_offset;
 8462                                                  pvalues[1].hfname = hf_nds_eid;
 8463                                                  nds_offset = nds_offset+pvalues[1].vlength;
 8464                                                  pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
 8465                                                  pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
 8466                                                  pvalues[2].vdesc = "Referral Records: %u";
 8467                                                  pvalues[2].vlength = 4;
 8468                                                  pvalues[2].voffset = nds_offset;
 8469                                                  pvalues[2].hfname = hf_nds_depth;
 8470                                                  pvalues[2].mvtype = MVTYPE_ADDR_REFERRAL_REPLY;
 8471                                                  break;
 8472                                          case NDS_TAG_ENTRY_AND_REFERRALS:
 8473                                                  pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
 8474                                                  pvalues[1].vtype = VTYPE_UINT32;
 8475                                                  pvalues[1].vdesc = "Result Flags: 0x%08x";
 8476                                                  pvalues[1].vlength = 4;
 8477                                                  pvalues[1].voffset = nds_offset;
 8478                                                  pvalues[1].hfname = hf_nds_result_flags;
 8479                                                  nds_offset = nds_offset+pvalues[1].vlength;
 8480                                                  pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
 8481                                                  pvalues[2].vtype = VTYPE_UINT32;
 8482                                                  pvalues[2].vdesc = "Entry ID: 0x%08x";
 8483                                                  add_eid = TRUE;
 8484                                                  resolve_eid = TRUE;
 8485                                                  global_eid = pvalues[2].vvalue;
 8486                                                  g_strlcpy(global_object_name, request_value->object_name, 256);
 8487                                                  pvalues[2].vlength = 4;
 8488                                                  pvalues[2].voffset = nds_offset;
 8489                                                  pvalues[2].hfname = hf_nds_eid;
 8490                                                  nds_offset = nds_offset+pvalues[2].vlength;
 8491                                                  pvalues[3].vvalue = tvb_get_letohl(tvb, nds_offset);
 8492                                                  pvalues[3].vtype = VTYPE_MULTIVALUE_UINT32;
 8493                                                  pvalues[3].vdesc = "Referral Records: %u";
 8494                                                  pvalues[3].vlength = 4;
 8495                                                  pvalues[3].voffset = nds_offset;
 8496                                                  pvalues[3].mvtype = MVTYPE_ADDR_REFERRAL_REPLY;
 8497                                                  pvalues[3].hfname = hf_nds_referrals;
 8498                                                  break;
 8499                                          default:
 8500                                                  break;
 8501                                          }
 8502                                  break;
 8503                          case 0x02:
 8504                                  nds_offset -= 4;
 8505                                  pvalues[0].vvalue = 1;
 8506                                  pvalues[0].vtype = VTYPE_MULTIVALUE_UINT32;
 8507                                  pvalues[0].vdesc = "Entry Information";
 8508                                  pvalues[0].vlength = 0;
 8509                                  pvalues[0].voffset = nds_offset;
 8510                                  pvalues[0].hfname = hf_nds_name;
 8511                                  pvalues[0].mvtype = MVTYPE_LIST_PARTITIONS;
 8512                                  pvalues[0].vflags = request_value->req_nds_flags;
 8513                                  break;
 8514                          case 0x03:
 8515                                  pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
 8516                                  pvalues[0].vtype = VTYPE_UINT32;
 8517                                  pvalues[0].vdesc = "Iteration Handle: 0x%08x";
 8518                                  pvalues[0].vlength = 4;
 8519                                  pvalues[0].voffset = nds_offset;
 8520                                  pvalues[0].hfname = hf_nds_iteration;
 8521                                  nds_offset = nds_offset+pvalues[0].vlength;
 8522                                  pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
 8523                                  pvalues[1].vstring = (char *)match_strval(pvalues[1].vvalue, nds_info_type);
 8524                                  if(pvalues[1].vstring == NULL)
 8525                                  {
 8526                                          pvalues[1].vstring = "No Info Type Set";
 8527                                  }
 8528                                  pvalues[1].vtype = VTYPE_STRING;
 8529                                  pvalues[1].vdesc = "Info Type: %s";
 8530                                  pvalues[1].vlength = 4;
 8531                                  pvalues[1].voffset = nds_offset;
 8532                                  pvalues[1].hfname = hf_nds_info_type;
 8533                                  nds_offset = nds_offset+pvalues[1].vlength;
 8534                                  pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
 8535                                  pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
 8536                                  pvalues[2].vdesc = "Number of Attributes: %u";
 8537                                  pvalues[2].vlength = 4;
 8538                                  pvalues[2].voffset = nds_offset;
 8539                                  pvalues[2].hfname = hf_nds_attr;
 8540                                  pvalues[2].mvtype = MVTYPE_ATTR_REPLY;
 8541                                  pvalues[2].vflags = request_value->req_nds_flags;
 8542                                  pvalues[2].nds_version = request_value->nds_version;
 8543                                  pvalues[2].pflags = request_value->req_nds_prot_flags;
 8544                                  break;
 8545                          case 0x04:
 8546                                  pvalues[0].vvalue = tvb_get_guint8(tvb, nds_offset);
 8547                                  if (pvalues[0].vvalue == 0)
 8548                                  {
 8549                                          pvalues[0].vstring = "Did Not Match";
 8550                                  }
 8551                                  else 
 8552                                  {
 8553                                          pvalues[0].vstring = "Matched";
 8554                                  }
 8555                                  pvalues[0].vtype = VTYPE_STRING;
 8556                                  pvalues[0].vdesc = "Compare Values Returned - %s";
 8557                                  pvalues[0].vlength = 1;
 8558                                  pvalues[0].voffset = nds_offset;
 8559                                  pvalues[0].mvtype = 0;
 8560                                  pvalues[0].hfname= hf_nds_compare_results;
 8561                                  nds_offset += pvalues[0].vlength;
 8562                                  break;
 8563                          case 0x05:
 8564                                  pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
 8565                                  pvalues[0].vtype = VTYPE_UINT32;
 8566                                  pvalues[0].vdesc = "Iteration Handle: 0x%08x";
 8567                                  pvalues[0].vlength = 4;
 8568                                  pvalues[0].voffset = nds_offset;
 8569                                  pvalues[0].hfname = hf_nds_iteration;
 8570                                  nds_offset = nds_offset+pvalues[0].vlength;
 8571                                  pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
 8572                                  pvalues[1].vtype = VTYPE_MULTIVALUE_UINT32;
 8573                                  pvalues[1].vdesc = "Entry Information";
 8574                                  pvalues[1].vlength = 0;
 8575                                  pvalues[1].voffset = nds_offset;
 8576                                  pvalues[1].hfname = hf_nds_name;
 8577                                  pvalues[1].mvtype = MVTYPE_LIST_PARTITIONS;
 8578                                  pvalues[1].vflags = request_value->req_nds_flags;
 8579                                  break;
 8580                          case 0x06:
 8581                                  break;
 8582                          case 0x07:
 8583                                  break;
 8584                          case 0x08:
 8585                                  break;
 8586                          case 0x09:
 8587                                  break;
 8588                          case 0x0a:
 8589                                  break;
 8590                          case 0x0b:
 8591                                  break;
 8592                          case 0x0c:
 8593                                  break;
 8594                          case 0x0d:
 8595                                  break;
 8596                          case 0x0e:
 8597                                  break;
 8598                          case 0x0f:
 8599                                  pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
 8600                                  pvalues[0].vtype = VTYPE_UINT32;
 8601                                  pvalues[0].vdesc = "Iteration Handle: 0x%08x";
 8602                                  pvalues[0].vlength = 4;
 8603                                  pvalues[0].voffset = nds_offset;
 8604                                  pvalues[0].hfname = hf_nds_iteration;
 8605                                  nds_offset = nds_offset+pvalues[0].vlength;
 8606                                  pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
 8607                                  pvalues[1].vstring = (char *)match_strval(pvalues[1].vvalue, class_def_type);
 8608                                  if(pvalues[1].vstring == NULL)
 8609                                  {
 8610                                          pvalues[1].vstring = "No Class Definition Type Set";
 8611                                  }
 8612                                  pvalues[1].vtype = VTYPE_STRING;
 8613                                  pvalues[1].vdesc = "Class Definition Type: %s";
 8614                                  pvalues[1].vlength = 4;
 8615                                  pvalues[1].voffset = nds_offset;
 8616                                  pvalues[1].mvtype = 0;
 8617                                  pvalues[1].hfname= hf_nds_class_def_type;
 8618                                  nds_offset = nds_offset + pvalues[1].vlength;
 8619                                  pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);;
 8620                                  pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
 8621                                  pvalues[2].vdesc = "Class Definitions %u";
 8622                                  pvalues[2].vlength = 0;
 8623                                  pvalues[2].voffset = nds_offset;
 8624                                  pvalues[2].hfname = hf_nds_classes;
 8625                                  pvalues[2].mvtype = MVTYPE_CLASS_NAMES;
 8626                                  pvalues[2].vflags = request_value->req_nds_flags;
 8627                                  break;
 8628                          case 0x10:
 8629                                  break;
 8630                          case 0x11:
 8631                                  break;
 8632                          case 0x12:
 8633                                  pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
 8634                                  pvalues[0].vtype = VTYPE_UINT32;
 8635                                  pvalues[0].vdesc = "Iteration Handle: 0x%08x";
 8636                                  pvalues[0].vlength = 4;
 8637                                  pvalues[0].voffset = nds_offset;
 8638                                  pvalues[0].hfname = hf_nds_iteration;
 8639                                  nds_offset = nds_offset+pvalues[0].vlength;
 8640                                  pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
 8641                                  pvalues[1].vtype = VTYPE_MULTIVALUE_UINT32;
 8642                                  pvalues[1].vdesc = "Classes: %u";
 8643                                  pvalues[1].vlength = 4;
 8644                                  pvalues[1].voffset = nds_offset;
 8645                                  pvalues[1].mvtype = MVTYPE_READ_CLASS_REQ;
 8646                                  pvalues[1].hfname= hf_nds_classes;
 8647                                  break;
 8648                          case 0x13:
 8649                                  pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
 8650                                  pvalues[0].vtype = VTYPE_UINT32;
 8651                                  pvalues[0].vdesc = "Privileges: 0x%08x";
 8652                                  pvalues[0].vlength = 4;
 8653                                  pvalues[0].voffset = nds_offset;
 8654                                  pvalues[0].hfname = hf_nds_privileges;
 8655                                  nds_offset = nds_offset+pvalues[0].vlength;
 8656                                  break;
 8657                          case 0x14:
 8658                                  break;
 8659                          case 0x15:
 8660                                  break;
 8661                          case 0x16:
 8662                                  pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
 8663                                  pvalues[0].vtype = VTYPE_UINT32;
 8664                                  pvalues[0].vdesc = "Iteration Handle: 0x%08x";
 8665                                  pvalues[0].vlength = 4;
 8666                                  pvalues[0].voffset = nds_offset;
 8667                                  pvalues[0].hfname = hf_nds_iteration;
 8668                                  nds_offset = nds_offset+pvalues[0].vlength;
 8669                                  pvalues[1].vtype = VTYPE_STRING;
 8670                                  pvalues[1].vdesc = "Server Distinguished Name: %s";
 8671                                  pvalues[1].mvtype = MVTYPE_ATTR_REQUEST;
 8672                                  pvalues[1].vvalue = 0;
 8673                                  pvalues[1].vlength = 256;
 8674                                  pvalues[1].vlength = tvb_get_letohl(tvb, nds_offset);
 8675                                  if (pvalues[1].vlength == 0x00)
 8676                                  {
 8677                                          pvalues[1].vtype = VTYPE_NONE;
 8678                                          break;
 8679                                  }
 8680                                  pvalues[1].voffset = nds_offset+4;
 8681                                  nds_offset += 4;
 8682                                  pvalues[1].vstring = get_string(tvb, pvalues[1].voffset, pvalues[1].vlength);
 8683                                  nds_offset += pvalues[1].vlength;
 8684                                  nds_offset += align_4(tvb, nds_offset);
 8685                                  pvalues[1].hfname= hf_nds_name;
 8686                                  nds_offset += align_4(tvb, nds_offset);
 8687                                  pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
 8688                                  pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
 8689                                  pvalues[2].vdesc = "Replicas: %u";
 8690                                  pvalues[2].vlength = 4;
 8691                                  pvalues[2].voffset = nds_offset;
 8692                                  pvalues[2].hfname = hf_nds_replicas;
 8693                                  pvalues[2].mvtype = MVTYPE_READ_REPLICAS;
 8694                                  pvalues[2].bit1 = "Output Flags";
 8695                                  pvalues[2].bit2 = "Entry ID";
 8696                                  pvalues[2].bit3 = "Replica State";
 8697                                  pvalues[2].bit4 = "Modification Timestamp";
 8698                                  pvalues[2].bit5 = "Purge Time";
 8699                                  pvalues[2].bit6 = "Local Partition ID";
 8700                                  pvalues[2].bit7 = "Distinguished Name";
 8701                                  pvalues[2].bit8 = "Replica Type";
 8702                                  pvalues[2].bit9 = "Partition Busy";
 8703                                  pvalues[2].vflags = request_value->req_nds_flags;
 8704                                  break;
 8705                          case 0x17:
 8706                                  break;
 8707                          case 0x18:
 8708                                  break;
 8709                          case 0x19:
 8710                                  break;
 8711                          case 0x1a:
 8712                                  break;
 8713                          case 0x1b:
 8714                                  pvalues[0].vvalue = tvb_get_ntohl(tvb, nds_offset);
 8715                                  pvalues[0].vtype = VTYPE_UINT32;
 8716                                  pvalues[0].vdesc = "File Handle: 0x%08x";
 8717                                  pvalues[0].vlength = 4;
 8718                                  pvalues[0].voffset = nds_offset;
 8719                                  pvalues[0].hfname = hf_nds_file_handle;
 8720                                  nds_offset = nds_offset+pvalues[0].vlength;
 8721                                  pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
 8722                                  pvalues[1].vtype = VTYPE_UINT32;
 8723                                  pvalues[1].vdesc = "File Size: %u";
 8724                                  pvalues[1].vlength = 4;
 8725                                  pvalues[1].voffset = nds_offset;
 8726                                  pvalues[1].hfname = hf_nds_file_size;
 8727                                  nds_offset = nds_offset+pvalues[1].vlength;
 8728                                  break;
 8729                          case 0x1c:
 8730                                  break;
 8731                          case 0x1d:
 8732                                  break;
 8733                          case 0x1e:
 8734                                  break;
 8735                          case 0x1f:
 8736                                  break;
 8737                          case 0x20:
 8738                                  break;
 8739                          case 0x21:
 8740                                  break;
 8741                          case 0x22:
 8742                                  break;
 8743                          case 0x23:
 8744                                  break;
 8745                          case 0x24:
 8746                                  break;
 8747                          case 0x25:
 8748                                  break;
 8749                          case 0x26:
 8750                                  break;
 8751                          case 0x27:
 8752                                  break;
 8753                          case 0x28:
 8754                                  break;
 8755                          case 0x29:
 8756                                  break;
 8757                          case 0x2a:
 8758                                  break;
 8759                          case 0x2b:
 8760                                  break;
 8761                          case 0x2c:
 8762                                  break;
 8763                          case 0x2d:
 8764                                  break;
 8765                          case 0x2e:
 8766                                  break;
 8767                          case 0x2f:
 8768                                  break;
 8769                          case 0x30:
 8770                                  break;
 8771                          case 0x31:
 8772                                  break;
 8773                          case 0x32:
 8774                                  break;
 8775                          case 0x33:
 8776                                  break;
 8777                          case 0x34:
 8778                                  break;
 8779                          case 0x35:
 8780                                  pvalues[0].vtype = VTYPE_MULTIVALUE_UINT32;
 8781                                  pvalues[0].vdesc = "Server Name";
 8782                                  pvalues[0].mvtype = MVTYPE_PROCESS_TAGS;
 8783                                  pvalues[0].vflags = request_value->req_nds_flags;
 8784                                  pvalues[0].hfname = hf_nds_svr_dst_name;
 8785                                  pvalues[0].vlength = tvb_get_letohl(tvb, nds_offset);
 8786                                  if (pvalues[0].vlength == 0x00)
 8787                                  {
 8788                                          pvalues[0].vtype = VTYPE_NONE;
 8789                                          break;
 8790                                  }
 8791                                  pvalues[0].voffset = nds_offset;
 8792                                  nds_offset += pvalues[0].vlength + 4;
 8793                                  nds_offset += align_4(tvb, nds_offset);
 8794                                  pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
 8795                                  pvalues[1].vtype = VTYPE_MULTIVALUE_UINT32;
 8796                                  pvalues[1].vdesc = "Referral Records: %u";
 8797                                  pvalues[1].vlength = 4;
 8798                                  pvalues[1].voffset = nds_offset;
 8799                                  pvalues[1].hfname = hf_nds_referrals;
 8800                                  pvalues[1].mvtype = MVTYPE_LOC_ADDR_REFERRAL_REPLY;
 8801                                  break;
 8802                          case 0x36:
 8803                                  break;
 8804                          case 0x37:
 8805                                  break;
 8806                          case 0x38:
 8807                                  break;
 8808                          case 0x39:
 8809                                  pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
 8810                                  pvalues[1].vtype = VTYPE_UINT32;
 8811                                  pvalues[1].vdesc = "Entry ID: 0x%08x";
 8812                                  add_eid = TRUE;
 8813                                  resolve_eid = TRUE;
 8814                                  g_strlcpy(global_object_name, request_value->object_name, 256);
 8815                                  global_eid = pvalues[1].vvalue;
 8816                                  pvalues[1].vlength = 4;
 8817                                  pvalues[1].voffset = nds_offset;
 8818                                  pvalues[1].hfname = hf_nds_eid;
 8819                                  nds_offset = nds_offset+pvalues[1].vlength;
 8820                                  break;
 8821                          case 0x3a:
 8822                                  break;
 8823                          case 0x3b:
 8824                                  break;
 8825                          case 0x3c:
 8826                                  break;
 8827                          case 0x3d:
 8828                                  break;
 8829                          case 0x3e:
 8830                                  break;
 8831                          case 0x3f:
 8832                                  break;
 8833                          case 0x40:
 8834                                  break;
 8835                          case 0x41:
 8836                                  break;
 8837                          case 0x42:
 8838                                  break;
 8839                          case 0x43:
 8840                                  break;
 8841                          case 0x44:
 8842                                  break;
 8843                          case 0x45:
 8844                                  break;
 8845                          case 0x46:
 8846                                  break;
 8847                          case 0x47:
 8848                                  break;
 8849                          case 0x48:
 8850                                  break;
 8851                          case 0x49:
 8852                                  break;
 8853                          case 0x4a:
 8854                                  break;
 8855                          case 0x4b:
 8856                                  break;
 8857                          case 0x4c:
 8858                                  break;
 8859                          case 0x4d:
 8860                                  break;
 8861                          case 0x6e:
 8862                                  pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
 8863                                  pvalues[0].vtype = VTYPE_UINT32;
 8864                                  pvalues[0].vdesc = "Iteration Handle: 0x%08x";
 8865                                  pvalues[0].vlength = 4;
 8866                                  pvalues[0].voffset = nds_offset;
 8867                                  pvalues[0].hfname= hf_nds_iteration;
 8868                                  nds_offset = nds_offset+pvalues[0].vlength;
 8869                                  pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
 8870                                  pvalues[1].vtype = VTYPE_NONE;
 8871                                  pvalues[1].vdesc = "Iteration Completion Code: 0x%08x";
 8872                                  pvalues[1].vlength = 4;
 8873                                  pvalues[1].voffset = nds_offset;
 8874                                  pvalues[1].hfname = hf_iter_completion_code;
 8875                                  expert_item = proto_tree_add_uint_format(ncp_tree, pvalues[1].hfname, tvb, nds_offset,
 8876                                          4, pvalues[1].vvalue, "NDS Iteration Completion Code: 0x%08x, %s",
 8877                                          pvalues[1].vvalue, match_strval(pvalues[1].vvalue, nds_reply_errors));
 8878   
 8879                                  if (pvalues[1].vvalue != 0 && ncp_echo_err) {
 8880                                          expert_add_info_format(pinfo, expert_item, PI_RESPONSE_CODE, PI_ERROR, "NDS Iteration Error: 0x%08x %s", pvalues[1].vvalue, match_strval(pvalues[1].vvalue, nds_reply_errors));
 8881                                  }
 8882                                  nds_offset = nds_offset+pvalues[1].vlength;
 8883                                  pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
 8884                                  pvalues[2].vtype = VTYPE_ITEM;
 8885                                  pvalues[2].vlength = 4;
 8886                                  pvalues[2].voffset = nds_offset;
 8887                                  pvalues[2].mvtype = MVTYPE_PROCESS_ITERATOR;
 8888                                  pvalues[2].hfname = hf_ncp_nds_iterverb;
 8889                                  nds_offset = nds_offset + pvalues[2].vlength;
 8890                                  break;
 8891                          default:
 8892                                  break;
 8893                  }
 8894                  if(request_value->nds_request_verb != 0)
 8895                  {
 8896                          proto_tree_add_uint_format(ncp_tree,
 8897                                      hf_ncp_nds_verb, tvb, 6, 0,
 8898                                      request_value->nds_request_verb,
 8899                                      "NDS Verb: %d, %s",
 8900                                      request_value->nds_request_verb, verb_string);
 8901                  }
 8902                  /* NDS Entry ID's (EID) is identified in the reply 
 8903                   * packet of an NDS resolve name. We need to store
 8904                   * this EID and its associated name into our hash 
 8905                   * so that we can resolve the name for other NDS
 8906                   * requests. */
 8907                  if (!pinfo->fd->flags.visited) {
 8908                          if(add_eid)
 8909                          {
 8910                                  request_eid_value = ncp_eid_hash_lookup(conversation, global_eid);
 8911                                  if (!request_eid_value) {
 8912                                          request_eid_value = ncp_eid_hash_insert(global_eid);
 8913                                          g_strlcpy(request_eid_value->object_name, global_object_name, 256);
 8914                                  }
 8915                          }
 8916                  }
 8917                  /* Echo EID data to expert Chat window */
 8918                  if (add_eid && nds_echo_eid) {
 8919                          expert_add_info_format(pinfo, NULL,
 8920                                                 PI_RESPONSE_CODE, PI_CHAT,
 8921                                                 "EID (%08x) = %s", global_eid, global_object_name);
 8922                  }
 8923                  /* For NDS requests with just an EID, resolve name
 8924                   * from hash table. */
 8925                  if(resolve_eid)
 8926                  {
 8927                          request_eid_value = ncp_eid_hash_lookup(conversation, global_eid);
 8928                          if (request_eid_value) {
 8929                                  g_strlcpy(global_object_name, request_eid_value->object_name, 256);
 8930                                  proto_tree_add_string_format(ncp_tree,
 8931                                                               hf_nds_name, tvb, 6, 0,
 8932                                                               global_object_name,
 8933                                                               "NDS Name for EID - %s",
 8934                                                               global_object_name);
 8935                          }
 8936                  }
 8937                  for (i = 0; i < 9; i++) {
 8938                          switch (pvalues[i].vtype) {
 8939   
 8940                                  case VTYPE_NONE: /* no value */
 8941                                          break;
 8942   
 8943                                  case VTYPE_ITEM:
 8944                                          if (pvalues[i].mvtype == MVTYPE_PROCESS_ITERATOR)
 8945                                          {
 8946                                                  dissect_nds_iterator(ncp_tree, tvb, pinfo, pvalues[i].vvalue, 0, nds_offset, FALSE);
 8947                                          }
 8948                                          else 
 8949                                          {
 8950                                                  proto_tree_add_item(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
 8951                                                      pvalues[i].vlength, TRUE);
 8952                                          }
 8953                                          break;
 8954                                  case VTYPE_UINT8:
 8955                                          proto_tree_add_uint_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
 8956                                              pvalues[i].vlength, pvalues[i].vtype, "NDS Parameter not defined %u",
 8957                                              pvalues[i].vtype);
 8958                                          break;
 8959   
 8960                                  case VTYPE_UINT16:
 8961                                          proto_tree_add_uint_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
 8962                                              pvalues[i].vlength, pvalues[i].vtype, "NDS Parameter not defined %u",
 8963                                              pvalues[i].vtype);
 8964                                          break;
 8965   
 8966                                  case VTYPE_UINT32:
 8967                                          proto_tree_add_uint_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
 8968                                              pvalues[i].vlength, pvalues[i].vvalue, pvalues[i].vdesc,
 8969                                              pvalues[i].vvalue);
 8970                                          break;
 8971   
 8972                                  case VTYPE_STRING:
 8973                                          proto_tree_add_string_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
 8974                                              pvalues[i].vlength, pvalues[i].vstring, pvalues[i].vdesc,
 8975                                              pvalues[i].vstring);
 8976                                          break;
 8977   
 8978                                  case VTYPE_BITFIELD:
 8979                                          process_bitfield(ncp_tree, tvb, &pvalues[i]);
 8980                                          break;
 8981   
 8982                                  case VTYPE_MULTIVALUE_UINT32:
 8983                                          process_multivalues(ncp_tree, tvb, pinfo, &pvalues[i]);
 8984                                          break;
 8985   
 8986                                  default:
 8987                                          proto_tree_add_uint_format(ncp_tree, hf_nds_p1type, tvb, pvalues[i].voffset,
 8988                                              pvalues[i].vlength, pvalues[i].vtype, "NDS Parameter not defined %u",
 8989                                              pvalues[i].vtype);
 8990                                          break;
 8991                          }
 8992                  }
 8993          }
 8994  }
Show more  




Change Warning 5570.35878 : Format String

Priority:
State:
Finding:
Owner:
Note: