Text   |  XML   |  ReML   |   Visible Warnings:

Unused Value  at packet-sip.c:3640

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

sip_find_invite

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-sip.c)expand/collapse
Show more  
 3573  guint sip_find_invite(packet_info *pinfo,
 3574                          gchar *cseq_method _U_,
 3575                          gchar *call_id,
 3576                          guchar cseq_number_set,
 3577                          guint32 cseq_number _U_,
 3578                          guint32 *response_time)
 3579  {
 3580          guint32 cseq_to_compare = 0;
 3581          sip_hash_key   key;
 3582          sip_hash_value *p_val = 0;
 3583          sip_frame_result_value *sip_frame_result = NULL;
 3584          guint result = 0;
 3585          gint seconds_between_packets;
 3586          gint nseconds_between_packets;
 3587   
 3588          /* Only consider UDP */
 3589          if (pinfo->ptype != PT_UDP)
 3590          {
 3591                  return 0;
 3592          }
 3593   
 3594          /* Ignore error (usually ICMP) frames */
 3595          if (pinfo->in_error_pkt)
 3596          {
 3597                  return 0;
 3598          }
 3599   
 3600          /* A broken packet may have no cseq number set. Ignore. */
 3601          if (!cseq_number_set)
 3602          {
 3603                  return 0;
 3604          }
 3605   
 3606          /* Return any answer stored from previous dissection */
 3607          if (pinfo->fd->flags.visited)
 3608          {
 3609                  sip_frame_result = (sip_frame_result_value*)p_get_proto_data(pinfo->fd, proto_sip);
 3610                  if (sip_frame_result != NULL)
 3611                  {
 3612                          *response_time = sip_frame_result->response_time;
 3613                          return sip_frame_result->response_request_frame_num;
 3614                  }
 3615                  else 
 3616                  {
 3617                          return 0;
 3618                  }
 3619          }
 3620   
 3621          /* No packet entry found, consult global hash table */
 3622   
 3623          /* Prepare the key */
 3624          g_strlcpy(key.call_id, call_id, MAX_CALL_ID_SIZE);
 3625   
 3626          /* Looking for matching INVITE */
 3627          SET_ADDRESS(&key.dest_address, pinfo->net_dst.type, pinfo->net_dst.len,
 3628                          pinfo->net_dst.data);
 3629          SET_ADDRESS(&key.source_address, pinfo->net_src.type, pinfo->net_src.len,
 3630                      pinfo->net_src.data);
 3631          key.dest_port = pinfo->destport;
 3632          key.source_port = pinfo->srcport;
 3633   
 3634          /* Do the lookup */
 3635          p_val = (sip_hash_value*)g_hash_table_lookup(sip_hash, &key);
 3636   
 3637          if (p_val)
 3638          {
 3639                  /* Table entry found, we'll use its value for comparison */
 3640                  cseq_to_compare = p_val->cseq;
 3641          }
 3642          else 
 3643          {
 3644                  /* We don't have the request */
 3645                  return 0;
 3646          }
 3647   
 3648   
 3649          /**************************************************/
 3650          /* Is it a response to a request that we've seen? */
 3651  #if 0 
 3652          if ((cseq_number == cseq_to_compare) &&
 3653              (p_val->transaction_state == request_seen) &&
 3654              (strcmp(cseq_method, p_val->method) == 0))
 3655          {
 3656                  result = p_val->frame_number;
 3657          }
 3658  #endif
 3659   
 3660          result = p_val->frame_number;
 3661   
 3662          /* Store return value with this packet */
 3663          sip_frame_result = p_get_proto_data(pinfo->fd, proto_sip);
 3664          if (sip_frame_result == NULL)
 3665          {
 3666                  /* Allocate and set all values to zero */
 3667                  sip_frame_result = se_alloc0(sizeof(sip_frame_result_value));
 3668          }
 3669   
 3670          sip_frame_result->response_request_frame_num = result;
 3671   
 3672          /* Work out response time */
 3673          seconds_between_packets = (gint)
 3674              (pinfo->fd->abs_ts.secs - p_val->request_time.secs);
 3675          nseconds_between_packets =
 3676               pinfo->fd->abs_ts.nsecs - p_val->request_time.nsecs;
 3677          sip_frame_result->response_time = (seconds_between_packets*1000) +
 3678                                            (nseconds_between_packets / 1000000);
 3679          *response_time = sip_frame_result->response_time;
 3680   
 3681          p_add_proto_data(pinfo->fd, proto_sip, sip_frame_result);
 3682   
 3683          return result;
 3684  }
Show more  




Change Warning 2946.30606 : Unused Value

Priority:
State:
Finding:
Owner:
Note: