Ethereal-dev: RE: [Ethereal-dev] FW: Ethereal MGCP plugin update

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Alejandro Vaquero <Alejandro.Vaquero@xxxxxxxxxxx>
Date: Wed, 4 Jul 2001 16:09:19 -0300
Ok, sorry but Im new in this...here is the "diff -c"


-----Original Message-----
From: Guy Harris [mailto:gharris@xxxxxxxxx]
Sent: Wednesday, July 04, 2001 15:14
To: Alejandro Vaquero
Cc: Ed Warnicke; ethereal-dev@xxxxxxxxxxxx
Subject: Re: [Ethereal-dev] FW: Ethereal MGCP plugin update


On Wed, Jul 04, 2001 at 01:51:35PM -0300, Alejandro Vaquero wrote:
> Ok, here are the changes...

By "patch" Ed meant the output of "diff -c" or "diff -u" between the
unmodified MGCP source and the modified MGCP source - sending the whole
file means that the person receiving the file has to do more work if the
file has changed since the person sending the file made the
modifications, and a narrative description of the changes means the
person receiving the file has to apply those changes by hand.

The output of "diff -c" or "diff -u" can be supplied as input to the
"patch" program, which will attempt to apply the changes listed in that
output to the current version of the file.

*** packet-mgcp.old	Mon Apr 23 13:58:04 2001
--- packet-mgcp.c	Wed Jul  4 10:30:44 2001
***************
*** 133,138 ****
--- 133,140 ----
  static gboolean global_mgcp_raw_text = FALSE;
  static gboolean global_mgcp_dissect_tree = TRUE;
  static gboolean global_mgcp_message_count = FALSE;
+ static gboolean global_mgcp_param = TRUE;
+ 
  
  /*
   * Variables to allow for proper deletion of dissector registration when 
***************
*** 143,148 ****
--- 145,155 ----
  static int callagent_tcp_port = 0;
  static int callagent_udp_port = 0;
  
+ /*
+  * Variable to concatenate the MGCP parameters to be displayed in the Info Column. 
+  */ 
+ static char dsp_parameters[64] = "";
+ 
  
  /* A simple MGCP type that is occasionally handy */
  typedef enum _mgcp_type {
***************
*** 232,237 ****
--- 239,245 ----
         */
        do{
  	num_messages++;
+         dsp_parameters[0] = '\0';
  	if(tree){
  	  /* Create out mgcp subtree */
  	  ti = proto_tree_add_item(tree,proto_mgcp,tvb,0,0, FALSE);
***************
*** 277,285 ****
  	
      if (check_col(pinfo->fd, COL_INFO) ){
        sectionlen = tvb_find_line_end(tvb, tvb_sectionbegin,-1,
! 				     &tvb_sectionend);
!       col_add_fstr(pinfo->fd,COL_INFO, "%s", 
! 		   tvb_format_text(tvb,tvb_sectionbegin,sectionlen));
      } 
    }  
  }
--- 285,299 ----
  	
      if (check_col(pinfo->fd, COL_INFO) ){
        sectionlen = tvb_find_line_end(tvb, tvb_sectionbegin,-1,
! 				     &tvb_sectionend);            
!       if (global_mgcp_param == TRUE) {
!         col_add_fstr(pinfo->fd,COL_INFO, "%s | %s", 
! 		   tvb_format_text(tvb,tvb_sectionbegin,sectionlen), dsp_parameters);
!       }
!       else {
! 	col_add_fstr(pinfo->fd,COL_INFO, "%s", 
! 		   tvb_format_text(tvb,tvb_sectionbegin,sectionlen));  
!       }    
      } 
    }  
  }
***************
*** 554,559 ****
--- 568,579 ----
                                   "Display the number of MGCP messages", 
                                   "found in a packet in the protocol column.",
                                   &global_mgcp_message_count);
+ 
+  prefs_register_bool_preference(mgcp_module, "display_mgcp_param", 
+                                  "Display MGCP parameters in Info column", 
+                                  "Display MGCP parameters in Info column.",
+                                  &global_mgcp_param);
+ 
  }
  
  /* The registration hand-off routine */
***************
*** 830,841 ****
      }
      
      tvb_current_offset++;
!     if(*hf != NULL && len > (tvb_current_offset - offset) && 
         (tempchar = tvb_get_guint8(tvb,tvb_current_offset)) == ':'){
        tvb_current_offset++;
        tvb_current_offset = tvb_skip_wsp(tvb,tvb_current_offset,
  					(len - tvb_current_offset + offset));
!       if(len > tvb_current_offset - offset){
  	returnvalue = tvb_current_offset;
        }
      }
--- 850,862 ----
      }
      
      tvb_current_offset++;
! 
!    if(*hf != NULL && len > (tvb_current_offset - offset) && 
         (tempchar = tvb_get_guint8(tvb,tvb_current_offset)) == ':'){
        tvb_current_offset++;
        tvb_current_offset = tvb_skip_wsp(tvb,tvb_current_offset,
  					(len - tvb_current_offset + offset));
!       if(len >= tvb_current_offset - offset){
  	returnvalue = tvb_current_offset;
        }
      }
***************
*** 1025,1030 ****
--- 1046,1053 ----
        mgcp_param_ti = NULL;
      }
  
+     
+ 
      /* Parse the parameters */
      while(tvb_lineend < tvb_len){
        linelen = tvb_find_line_end(tvb, tvb_linebegin, -1,&tvb_lineend); 
***************
*** 1036,1041 ****
--- 1059,1066 ----
  				 tvb_linebegin, linelen, 
  				 tvb_format_text(tvb,tvb_tokenbegin,
  						 tokenlen));
+       strcat(dsp_parameters, tvb_format_text(tvb,tvb_linebegin,linelen));   
+       strcat(dsp_parameters, " ");
        }
        tvb_linebegin = tvb_lineend;
      }