FIXUP: give names to sec_vt_command's
[metze/wireshark/wip.git] / mkcap.c
diff --git a/mkcap.c b/mkcap.c
index 0a912e402a783ebbaf6c46c7a22c59fcb068071b..5f9515971a1269598f1e69cad06135c86bd2e202 100644 (file)
--- a/mkcap.c
+++ b/mkcap.c
@@ -20,7 +20,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
  * Using it to generate a capture file:
  * ./mkcap [some-flags] > some-file
@@ -320,10 +320,9 @@ gen_next_ack(int force, int spacing)
 void 
 makeackedrun(int len, int spacing, int ackdelay)
 {
-       int old_seq1, next_ack_ts=0;
+       int next_ack_ts=0;
         if (verbose) fprintf(stderr, "makeackedrun: Len=%d, spacing=%d, ackdelay=%d\n",
                len, spacing, ackdelay);
-       old_seq1=seq_1;
        while(len>0){
 
          /*
@@ -456,7 +455,6 @@ makeackedrundroppedtail8kb(int len, int spacing, int ackdelay)
 
        if(num_dupes<3){
                int seglen;
-               int new_seq;
                ts+=1000000;
                seglen=((seq_1-dropped_tail)>1460)?1460:(seq_1-dropped_tail);
                if(seglen==1460){
@@ -466,7 +464,6 @@ makeackedrundroppedtail8kb(int len, int spacing, int ackdelay)
                }
                ts+=ackdelay;
 
-               new_seq=seglen+seq_1;
                makeseg(eth_2, eth_1, ip_2, ip_1, port_2, port_1, &seq_2, &seq_1, "10", 0);
                ts+=spacing;
                return;
@@ -492,7 +489,7 @@ makeackedrundroppedtail8kb(int len, int spacing, int ackdelay)
 void usage()
 {
   fprintf(stderr, "Usage: mkcap [OPTIONS], where\n");
-  fprintf(stderr, "\t-a <ack-delay>        is the delay to an ACK (RTT)\n");
+  fprintf(stderr, "\t-a <ack-delay>        is the delay to an ACK (SRT)\n");
   fprintf(stderr, "\t-b <bytes-to-send>    is the bytes to send on connection\n");
   fprintf(stderr, "\t-i <ip-addr-hex>      is the sender IP address in hex\n");
   fprintf(stderr, "\t-I <ip-addr-hex>      is the recipient IP address in hex\n");
@@ -528,14 +525,14 @@ all_digits(char *str)
 void 
 process_drop_list(char *drop_list)
 {
-  int commas=0, i;
+  int commas=0;
   char *tok, *save;
 
   if (!drop_list || !(*drop_list)) {
     fprintf(stderr, "Strange drop list. NULL or an empty string. No drops!\n");
     return;
   }
-  save = (char *)strdup(drop_list);
+  save = (char *)g_strdup(drop_list);
 
   for (tok=(char *)strtok(drop_list, ","); tok; tok=(char *)strtok(NULL, ",")) {
     commas++;
@@ -544,11 +541,11 @@ process_drop_list(char *drop_list)
   /* Now, we have commas, divide by two and round up */
 
   seg_drop_count = (commas+1)/2;
-  drops = (seg_drop_t *)malloc(sizeof(seg_drop_t) * seg_drop_count);
+  drops = (seg_drop_t *)g_malloc(sizeof(seg_drop_t) * seg_drop_count);
   if (!drops) {
     fprintf(stderr, "Unable to allocate space for drops ... going without!\n");
     seg_drop_count = 0;
-    free(save);
+    g_free(save);
     return;
   }
 
@@ -563,8 +560,8 @@ process_drop_list(char *drop_list)
       fprintf(stderr, "Error in segment offset or count. Not all digits: %s\n",
              tok);
       fprintf(stderr, "No packet drops being performed!\n");
-      free(save);
-      free(drops);
+      g_free(save);
+      g_free(drops);
       seg_drop_count = 0; drops = NULL;
       return;
     }
@@ -574,8 +571,8 @@ process_drop_list(char *drop_list)
     else
       drops[commas / 2].drop_seg_start = num;
   }
-
   
+  g_free(save);
 
 }