diff -rupN argus-clients-3.0.6/ChangeLog argus-clients-3.0.6.new/ChangeLog
--- argus-clients-3.0.6/ChangeLog	2012-04-18 14:17:30.000000000 -0400
+++ argus-clients-3.0.6.new/ChangeLog	2012-05-08 17:38:46.000000000 -0400
@@ -1,3 +1,12 @@
+Tue May  8 17:25:03 EDT 2012
+Fixes for radium memory leak.  Was forgetting about deallocating label string.
+
+Mon May  7 11:46:40 EDT 2012
+Fix for rastream and rabins memory leak issues
+
+Tue May  1 09:48:01 EDT 2012
+Fix for rabins -f racluster.conf problems.
+
 Wed Apr 18 14:15:35 EDT 2012
 Mods for racluster to add field preservation as default, and to add -M options
 to turn it on and off.
diff -rupN argus-clients-3.0.6/MANIFEST argus-clients-3.0.6.new/MANIFEST
--- argus-clients-3.0.6/MANIFEST	2012-04-18 14:27:45.000000000 -0400
+++ argus-clients-3.0.6.new/MANIFEST	2012-05-08 17:38:46.000000000 -0400
@@ -19,30 +19,29 @@
  *
  */
 
-Argus Clients 3.0.6 distribution
+Argus Clients 3.0.6.1 distribution
 total 976
 -r--r--r--   1 carter  staff     523 Apr 17 12:22 AUTHORS
 -r--r--r--   1 carter  staff    7025 Apr 17 12:21 CHANGES
 -r--r--r--   1 carter  staff   35147 Apr 17 12:21 COPYING
 -r--r--r--   1 carter  staff    3943 Apr 17 12:21 CREDITS
--r--r--r--   1 carter  staff   28361 Apr 18 14:17 ChangeLog
+-r--r--r--   1 carter  staff   28620 May  8 17:28 ChangeLog
 -r--r--r--   1 carter  staff    8561 Apr 17 12:21 INSTALL
--rw-r--r--   1 carter  staff   22933 Apr 18 14:27 MANIFEST
+-rw-r--r--   1 carter  staff   22706 May  8 17:36 MANIFEST
 -r--r--r--   1 carter  staff    9030 Apr 17 12:21 Makefile.in
 -r--r--r--   1 carter  staff    3850 Apr 17 12:21 README
--r--r--r--   1 carter  staff       6 Apr 17 12:22 VERSION
+-r--r--r--   1 carter  staff       8 May  1 13:58 VERSION
 -r--r--r--   1 carter  staff     609 Apr 17 12:22 aclocal.m4
 -r--r--r--   1 carter  staff   57175 Apr 17 12:22 acsite.m4
-drwxr-xr-x   4 carter  staff     136 Apr 18 14:27 bin
-drwxr-xr-x  13 carter  staff     442 Apr 18 14:27 clients
-drwxr-xr-x  17 carter  staff     578 Apr 18 14:27 common
+drwxr-xr-x   4 carter  staff     136 May  8 17:14 bin
+drwxr-xr-x  13 carter  staff     442 May  8 17:14 clients
+drwxr-xr-x  17 carter  staff     578 May  8 17:14 common
 drwxr-xr-x   6 carter  staff     204 Apr 17 12:21 config
 -rwxr-xr-x   1 carter  staff  284919 Apr 17 12:24 configure
 -r--r--r--   1 carter  staff    9686 Apr 17 12:22 configure.ac
-drwxr-xr-x   6 carter  staff     204 Apr 17 12:21 doc
-drwxr-xr-x  25 carter  staff     850 Apr 18 14:27 examples
-drwxr-xr-x  41 carter  staff    1394 Apr 18 14:27 include
-drwxr-xr-x   4 carter  staff     136 Apr 18 14:27 lib
+drwxr-xr-x  25 carter  staff     850 May  8 17:14 examples
+drwxr-xr-x  41 carter  staff    1394 May  8 17:14 include
+drwxr-xr-x   4 carter  staff     136 May  8 17:14 lib
 drwxr-xr-x   5 carter  staff     170 Apr 17 12:21 man
 drwxr-xr-x   6 carter  staff     204 Apr 17 12:21 support
 
@@ -56,10 +55,10 @@ total 840
 -r--r--r--  1 carter  staff    4460 Apr 17 12:22 Makefile.in
 -r--r--r--  1 carter  staff    2423 Apr 17 12:21 README
 -r--r--r--  1 carter  staff   26122 Apr 17 12:22 ra.c
--r--r--r--  1 carter  staff   45380 Apr 17 12:22 rabins.c
+-r--r--r--  1 carter  staff   45369 May  7 12:29 rabins.c
 -r--r--r--  1 carter  staff   33567 Apr 18 14:06 racluster.c
 -r--r--r--  1 carter  staff   41495 Apr 17 12:22 racount.c
--r--r--r--  1 carter  staff  118308 Apr 17 12:22 radium.c
+-r--r--r--  1 carter  staff  118392 May  8 17:28 radium.c
 -r--r--r--  1 carter  staff   76181 Apr 17 12:22 ranonymize.c
 -r--r--r--  1 carter  staff    1836 Apr 17 12:22 ranonymize.h
 -r--r--r--  1 carter  staff   13302 Apr 17 12:22 rasort.c
@@ -69,14 +68,14 @@ total 840
 total 4088
 -r--r--r--  1 carter  staff    5471 Apr 17 12:22 Makefile.in
 -r--r--r--  1 carter  staff   17972 Apr 17 12:22 argus_auth.c
--r--r--r--  1 carter  staff  673662 Apr 18 14:18 argus_client.c
+-r--r--r--  1 carter  staff  673662 May  1 13:58 argus_client.c
 -r--r--r--  1 carter  staff  133611 Apr 17 12:22 argus_code.c
 -r--r--r--  1 carter  staff    2106 Apr 17 12:22 argus_debug.h
 -r--r--r--  1 carter  staff   21711 Apr 17 12:22 argus_event.c
 -r--r--r--  1 carter  staff   82972 Apr 17 12:22 argus_filter.c
 -r--r--r--  1 carter  staff    4479 Apr 17 12:22 argus_grep.c
 -r--r--r--  1 carter  staff  130050 Apr 17 12:22 argus_import.c
--r--r--r--  1 carter  staff  117824 Apr 17 12:22 argus_label.c
+-r--r--r--  1 carter  staff  117860 May  8 17:28 argus_label.c
 -r--r--r--  1 carter  staff   13155 Apr 17 12:22 argus_main.c
 -r--r--r--  1 carter  staff   11459 Apr 17 12:22 argus_parser.c
 -r--r--r--  1 carter  staff  820756 Apr 17 12:22 argus_util.c
@@ -90,38 +89,31 @@ total 168
 -r-xr-xr-x  1 carter  staff   5585 Apr 17 12:21 install-sh
 -r-xr-xr-x  1 carter  staff    616 Apr 17 12:21 mkinstalldirs
 
-./doc:
-total 88
--r--r--r--  1 carter  staff   3121 Apr 17 12:21 CHANGES
--r--r--r--  1 carter  staff  24252 Apr 17 12:22 FAQ
--r--r--r--  1 carter  staff  10627 Apr 17 12:22 HOW-TO
--r--r--r--  1 carter  staff   1283 Apr 17 12:22 README
-
 ./examples:
 total 16
 -r--r--r--   1 carter  staff  3684 Apr 17 12:21 Makefile.in
 -r--r--r--   1 carter  staff  3864 Apr 17 12:21 README
-drwxr-xr-x   6 carter  staff   204 Apr 18 14:27 raconvert
-drwxr-xr-x   5 carter  staff   170 Apr 18 14:27 radark
-drwxr-xr-x  57 carter  staff  1938 Apr 18 14:27 radump
-drwxr-xr-x   5 carter  staff   170 Apr 18 14:27 raevent
-drwxr-xr-x   5 carter  staff   170 Apr 18 14:27 rafilter
-drwxr-xr-x   6 carter  staff   204 Apr 18 14:27 ragraph
-drwxr-xr-x   5 carter  staff   170 Apr 18 14:27 ragrep
-drwxr-xr-x   5 carter  staff   170 Apr 18 14:27 rahisto
-drwxr-xr-x   6 carter  staff   204 Apr 18 14:27 rahosts
-drwxr-xr-x   5 carter  staff   170 Apr 18 14:27 ralabel
-drwxr-xr-x   9 carter  staff   306 Apr 18 14:27 ramysql
-drwxr-xr-x   6 carter  staff   204 Apr 18 14:27 rapath
-drwxr-xr-x   5 carter  staff   170 Apr 18 14:27 rapolicy
-drwxr-xr-x   5 carter  staff   170 Apr 18 14:27 raports
-drwxr-xr-x   6 carter  staff   204 Apr 18 14:27 rarpwatch
-drwxr-xr-x   6 carter  staff   204 Apr 18 14:27 raservices
-drwxr-xr-x   5 carter  staff   170 Apr 18 14:27 rastream
-drwxr-xr-x   5 carter  staff   170 Apr 18 14:27 rastrip
-drwxr-xr-x   5 carter  staff   170 Apr 18 14:27 ratemplate
-drwxr-xr-x   5 carter  staff   170 Apr 18 14:27 ratimerange
-drwxr-xr-x   6 carter  staff   204 Apr 18 14:27 ratop
+drwxr-xr-x   6 carter  staff   204 May  8 17:14 raconvert
+drwxr-xr-x   5 carter  staff   170 May  8 17:14 radark
+drwxr-xr-x  57 carter  staff  1938 May  8 17:14 radump
+drwxr-xr-x   5 carter  staff   170 May  8 17:14 raevent
+drwxr-xr-x   5 carter  staff   170 May  8 17:14 rafilter
+drwxr-xr-x   6 carter  staff   204 May  8 17:14 ragraph
+drwxr-xr-x   5 carter  staff   170 May  8 17:14 ragrep
+drwxr-xr-x   5 carter  staff   170 May  8 17:14 rahisto
+drwxr-xr-x   6 carter  staff   204 May  8 17:14 rahosts
+drwxr-xr-x   5 carter  staff   170 May  8 17:14 ralabel
+drwxr-xr-x   9 carter  staff   306 May  8 17:14 ramysql
+drwxr-xr-x   6 carter  staff   204 May  8 17:14 rapath
+drwxr-xr-x   5 carter  staff   170 May  8 17:14 rapolicy
+drwxr-xr-x   5 carter  staff   170 May  8 17:14 raports
+drwxr-xr-x   6 carter  staff   204 May  8 17:14 rarpwatch
+drwxr-xr-x   6 carter  staff   204 May  8 17:14 raservices
+drwxr-xr-x   5 carter  staff   170 May  8 17:14 rastream
+drwxr-xr-x   5 carter  staff   170 May  8 17:14 rastrip
+drwxr-xr-x   5 carter  staff   170 May  8 17:14 ratemplate
+drwxr-xr-x   5 carter  staff   170 May  8 17:14 ratimerange
+drwxr-xr-x   6 carter  staff   204 May  8 17:14 ratop
 
 ./examples/raconvert:
 total 224
@@ -236,14 +228,14 @@ total 40
 total 40
 -r--r--r--  1 carter  staff  3217 Apr 17 12:21 Makefile.in
 -r--r--r--  1 carter  staff   930 Apr 17 12:21 README
--r--r--r--  1 carter  staff  9290 Apr 17 12:22 ralabel.c
+-r--r--r--  1 carter  staff  9552 May  8 17:28 ralabel.c
 
 ./examples/ramysql:
 total 928
 -r--r--r--  1 carter  staff    3642 Apr 17 12:21 Makefile.in
 -r--r--r--  1 carter  staff    2269 Apr 17 12:21 README
 -r--r--r--  1 carter  staff   65169 Apr 18 14:18 rasql.c
--r--r--r--  1 carter  staff  323761 Apr 18 14:25 rasqlinsert.c
+-r--r--r--  1 carter  staff  323761 Apr 18 15:04 rasqlinsert.c
 -r--r--r--  1 carter  staff    6860 Apr 17 12:22 rasqlinsert.h
 -r--r--r--  1 carter  staff   53572 Apr 17 12:22 rasqltimeindex.c
 -r--r--r--  1 carter  staff    4739 Apr 17 12:22 rasqltimeindex.h
@@ -271,7 +263,7 @@ total 24
 total 88
 -r--r--r--  1 carter  staff   3752 Apr 17 12:22 Makefile.in
 -r--r--r--  1 carter  staff    963 Apr 17 12:22 README
--r--r--r--  1 carter  staff  30151 Apr 18 14:26 rarpwatch.c
+-r--r--r--  1 carter  staff  30151 Apr 18 15:04 rarpwatch.c
 -r--r--r--  1 carter  staff   1011 Apr 17 12:22 rarpwatch.h
 
 ./examples/raservices:
@@ -285,7 +277,7 @@ total 112
 total 120
 -r--r--r--  1 carter  staff   3224 Apr 17 12:21 Makefile.in
 -r--r--r--  1 carter  staff   2583 Apr 17 12:21 README
--r--r--r--  1 carter  staff  51302 Apr 17 12:22 rastream.c
+-r--r--r--  1 carter  staff  50544 May  7 12:29 rastream.c
 
 ./examples/rastrip:
 total 48
@@ -347,7 +339,7 @@ drwxr-xr-x  15 carter  staff     510 Apr
 -r--r--r--   1 carter  staff    2457 Apr 17 12:22 argus_udt.h
 -r--r--r--   1 carter  staff  106438 Apr 17 12:22 argus_util.h
 drwxr-xr-x   8 carter  staff     272 Apr 17 12:21 cygwin-include
-drwxr-xr-x   3 carter  staff     102 Apr 17 12:21 net
+drwxr-xr-x   4 carter  staff     136 May  8 16:18 net
 drwxr-xr-x   3 carter  staff     102 Apr 17 12:21 netinet
 -r--r--r--   1 carter  staff    1207 Apr 17 12:22 rabins.h
 -r--r--r--   1 carter  staff    6177 Apr 17 12:22 radium.h
@@ -417,7 +409,8 @@ total 8
 -r--r--r--  1 carter  staff  49 Apr 17 12:21 mbuf.h
 
 ./include/net:
-total 32
+total 40
+-r--r--r--  1 carter  staff   2172 May  8 16:18 etherdefs.h
 -r--r--r--  1 carter  staff  12644 Apr 17 12:21 nff.h
 
 ./include/netinet:
@@ -427,17 +420,17 @@ total 8
 ./lib:
 total 16
 -r--r--r--  1 carter  staff   364 Apr 17 12:22 argus-clients.pc.in
--r--r--r--  1 carter  staff  2049 Apr 17 12:22 argus-clients.spec
+-r--r--r--  1 carter  staff  2051 May  1 13:58 argus-clients.spec
 
 ./man:
 total 0
-drwxr-xr-x  24 carter  staff  816 Apr 18 14:09 man1
+drwxr-xr-x  24 carter  staff  816 Apr 18 15:15 man1
 drwxr-xr-x   7 carter  staff  238 Apr 17 12:21 man5
 drwxr-xr-x   3 carter  staff  102 Apr 17 12:21 man8
 
 ./man/man1:
 total 400
--r--r--r--  1 carter  staff  45315 Apr 17 12:21 ra.1
+-r--r--r--  1 carter  staff  45315 Apr 30 19:34 ra.1
 -r--r--r--  1 carter  staff  17968 Apr 17 12:21 rabins.1
 -r--r--r--  1 carter  staff   8222 Apr 18 14:09 racluster.1
 -r--r--r--  1 carter  staff   2778 Apr 17 12:21 raconvert.1
diff -rupN argus-clients-3.0.6/VERSION argus-clients-3.0.6.new/VERSION
--- argus-clients-3.0.6/VERSION	2012-04-17 12:22:02.000000000 -0400
+++ argus-clients-3.0.6.new/VERSION	2012-05-08 17:38:46.000000000 -0400
@@ -1 +1 @@
-3.0.6
+3.0.6.1
diff -rupN argus-clients-3.0.6/clients/rabins.c argus-clients-3.0.6.new/clients/rabins.c
--- argus-clients-3.0.6/clients/rabins.c	2012-04-17 12:22:02.000000000 -0400
+++ argus-clients-3.0.6.new/clients/rabins.c	2012-05-08 17:38:46.000000000 -0400
@@ -35,9 +35,9 @@
  */
 
 /* 
- * $Id: //depot/argus-3.0.6/clients/clients/rabins.c#1 $
- * $DateTime: 2012/04/17 12:22:02 $
- * $Change: 2368 $
+ * $Id: //depot/argus-3.0.6/clients/clients/rabins.c#3 $
+ * $DateTime: 2012/05/07 12:29:30 $
+ * $Change: 2399 $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -451,6 +451,11 @@ ArgusClientInit (struct ArgusParserStruc
          if ((parser->ArgusAggregator = ArgusParseAggregator(parser, parser->ArgusFlowModelFile, NULL)) == NULL)
             ArgusLog (LOG_ERR, "ArgusClientInit: ArgusParseAggregator error");
 
+         if (parser->ArgusAggregatorFile != NULL) 
+            free(parser->ArgusAggregatorFile);
+
+         parser->ArgusAggregatorFile = strdup(parser->ArgusFlowModelFile);
+
       } else
          if ((parser->ArgusAggregator = ArgusNewAggregator(parser, NULL)) == NULL)
             ArgusLog (LOG_ERR, "ArgusClientInit: ArgusNewAggregator error");
@@ -484,12 +489,11 @@ ArgusClientInit (struct ArgusParserStruc
 
 
 void RaArgusInputComplete (struct ArgusInput *input) { return; }
+int RaDeleteBinProcess(struct ArgusParserStruct *, struct RaBinProcessStruct *);
 
 void
 RaParseComplete (int sig)
 {
-   int startsecs = 0, endsecs = 0, i;
-   
    if (sig >= 0) {
       switch (sig) {
          case SIGINT:
@@ -498,99 +502,13 @@ RaParseComplete (int sig)
       }
       if (!(ArgusParser->RaParseCompleting++)) {
          if (RaBinProcess != NULL) {
-            struct RaBinStruct *bin = NULL;
-            struct ArgusRecordStruct *ns = NULL;
-            int max = ((ArgusParser->tflag && ArgusParser->RaExplicitDate) ? RaBinProcess->nadp.count : RaBinProcess->max) + 1;
-
-            char stimebuf[128], dtimebuf[128], etimebuf[128];
-            int bins;
-
-            if (RaBinProcess->array != NULL) {
-               if (!(ArgusParser->tflag)) {
-                  for (i = 0; i < max; i++) {
-                     if ((bin = RaBinProcess->array[i]) != NULL) {
-                        if (startsecs == 0)
-                           startsecs = bin->stime.tv_sec;
-                        endsecs = bin->etime.tv_sec;
-                     }
-                  }
-
-                  RaBinProcess->startpt.tv_sec = startsecs;
-                  RaBinProcess->scalesecs      = (endsecs - startsecs) + (RaBinProcess->size / 1000000);
-
-                  if ((ArgusParser->RaEndTime.tv_sec >  RaBinProcess->endpt.tv_sec) ||
-                           ((ArgusParser->RaEndTime.tv_sec == RaBinProcess->endpt.tv_sec) &&
-                            (ArgusParser->RaEndTime.tv_usec > RaBinProcess->endpt.tv_usec)))
-                     ArgusParser->RaEndTime = RaBinProcess->endpt;
-
-               } else {
-                  RaBinProcess->startpt.tv_sec  = ArgusParser->startime_t.tv_sec;
-                  RaBinProcess->startpt.tv_usec = ArgusParser->startime_t.tv_usec;
-                  RaBinProcess->endpt.tv_sec    = ArgusParser->lasttime_t.tv_sec;
-                  RaBinProcess->endpt.tv_usec   = ArgusParser->lasttime_t.tv_usec;
-                  RaBinProcess->scalesecs       = ArgusParser->lasttime_t.tv_sec - ArgusParser->startime_t.tv_sec;
-                  RaBinProcess->start           = ArgusParser->startime_t.tv_sec * 1000000LL;
-               }
-
-               if ((ArgusParser->ArgusWfileList == NULL) && (ArgusParser->Gflag)) {
-                  if (ArgusParser->Hstr != NULL) {
-
-                  } else {
-
-                     ArgusPrintTime(ArgusParser, stimebuf, &RaBinProcess->startpt);
-                     ArgusPrintTime(ArgusParser, dtimebuf, &RaBinProcess->endpt);
-                     ArgusPrintTime(ArgusParser, etimebuf, &ArgusParser->RaEndTime);
-
-                     stimebuf[strlen(stimebuf) - 1] = '\0';
-                     dtimebuf[strlen(dtimebuf) - 1] = '\0';
-                     etimebuf[strlen(etimebuf) - 1] = '\0';
-
-                     printf ("StartTime=%s\n", stimebuf);
-                     printf ("StopTime=%s\n",  dtimebuf);
-                     printf ("LastTime=%s\n",  etimebuf);
-                     printf ("Seconds=%d\n", RaBinProcess->scalesecs);
-                     printf ("BinSize=%1.*f\n", ArgusParser->pflag, (RaBinProcess->size * 1.0)/1000000);
-                     bins = ((RaBinProcess->scalesecs + (RaBinProcess->size/1000000 - 1))/(RaBinProcess->size / 1000000));
-                     printf ("Bins=%d\n", bins);
-                  }
-               }
-            }
-
-            for (i = RaBinProcess->index; i < max; i++) {
-               if ((RaBinProcess->array != NULL) && ((bin = RaBinProcess->array[i]) != NULL)) {
-                  struct ArgusAggregatorStruct *agg = bin->agg;
-                  while (agg) {
-                     int rank = 1;
-                     ArgusSortQueue(ArgusSorter, agg->queue);
-                     while ((ns = (struct ArgusRecordStruct *) ArgusPopQueue(agg->queue, ARGUS_NOLOCK)) != NULL) {
-                        ns->rank = rank++;
-                        if ((ArgusParser->eNoflag == 0 ) || ((ArgusParser->eNoflag >= ns->rank) && (ArgusParser->sNoflag <= ns->rank)))
-                           RaSendArgusRecord (ns);
-                        ArgusDeleteRecordStruct(ArgusParser, ns);
-                     }
-                     agg = agg->nxt;
-                  }
-
-               } else {
-                  if (RaBinProcess->nadp.zero && ((i >= RaBinProcess->index) && 
-                          ((((i - RaBinProcess->index) * 1.0) * RaBinProcess->size) < (RaBinProcess->scalesecs * 1000000LL)))) {
-                     long long tval = RaBinProcess->start + (RaBinProcess->size * (i - RaBinProcess->index));
-
-                     ns = ArgusGenerateRecordStruct(NULL, NULL, NULL);
-
-                     ((struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX])->src.start.tv_sec  = tval / 1000000;
-                     ((struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX])->src.start.tv_usec = tval % 1000000;
-
-                     tval += RaBinProcess->size;
-                     ((struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX])->src.end.tv_sec    = tval / 1000000;;
-                     ((struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX])->src.end.tv_usec   = tval % 1000000;
-
-                     RaSendArgusRecord (ns);
-                  }
-               }
-            }
+            RaDeleteBinProcess(ArgusParser, RaBinProcess);
+            RaBinProcess = NULL;
          }
 
+         if (ArgusSorter != NULL)
+            ArgusDeleteSorter(ArgusSorter);
+
 #ifdef ARGUSDEBUG
          ArgusDebug (2, "RaParseComplete(caught signal %d)\n", sig);
 #endif
@@ -684,6 +602,7 @@ ArgusClientTimeout ()
          if (rbps->array != NULL) {
             if ((bin = rbps->array[rbps->index]) != NULL) {
                struct ArgusAggregatorStruct *agg = bin->agg;
+               int count = 0;
                while (agg) {
                   if (agg->queue->count) {
                      int cnt = 0;
@@ -706,33 +625,45 @@ ArgusClientTimeout ()
                            ((struct ArgusRecordStruct *)agg->queue->array[i])->rank = i + 1;
                         RaSendArgusRecord ((struct ArgusRecordStruct *) agg->queue->array[i]);
                      }
-
                      ArgusDeleteRecordStruct(ArgusParser, ArgusParser->ns);
 
                      while((argus = (struct ArgusRecordStruct *)ArgusPopQueue(agg->queue, ARGUS_LOCK)) != NULL)
                         ArgusDeleteRecordStruct(ArgusParser, argus);
-                  }
 
+                     count += cnt;
+                  }
                   agg = agg->nxt;
                }
 
+#ifdef ARGUSDEBUG
+               ArgusDebug (2, "ArgusClientTimeout() RaBinProcess: Bflag %f rtime %lld start %d.%06d size %.06f arraylen %d count %d index %d\n",
+                  ArgusParser->Bflag, rtime, bin->stime.tv_sec, bin->stime.tv_usec, bin->size/1000000.0, rbps->arraylen, count, rbps->index);
+#endif
                RaDeleteBin(ArgusParser, bin);
                rbps->array[rbps->index] = NULL;
 
             } else {
                if (RaBinProcess->nadp.zero) {
                   long long tval = RaBinProcess->start + (RaBinProcess->size * RaBinProcess->index);
+                  struct ArgusTimeObject *btime = NULL;
 
                   ns = ArgusGenerateRecordStruct(NULL, NULL, NULL);
 
-                  ((struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX])->src.start.tv_sec  = tval / 1000000;
-                  ((struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX])->src.start.tv_usec = tval % 1000000;
+                  btime = (struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX];
+                  btime->src.start.tv_sec  = tval / 1000000;
+                  btime->src.start.tv_usec = tval % 1000000;
 
                   tval += RaBinProcess->size;
-                  ((struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX])->src.end.tv_sec    = tval / 1000000;;
-                  ((struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX])->src.end.tv_usec   = tval % 1000000;
+                  btime->src.end.tv_sec    = tval / 1000000;;
+                  btime->src.end.tv_usec   = tval % 1000000;
 
                   RaSendArgusRecord (ns);
+
+#ifdef ARGUSDEBUG
+               ArgusDebug (2, "ArgusClientTimeout() RaBinProcess: Bflag %f rtime %lld start %d.%06d size %.06f arraylen %d count %d index %d\n",
+                  ArgusParser->Bflag, rtime, btime->src.start.tv_sec, btime->src.start.tv_usec, rbps->size/1000000.0, rbps->arraylen, 0, rbps->index);
+#endif
+
 /*
                   ArgusDeleteRecordStruct(ArgusParser, ns);
 */
@@ -768,11 +699,6 @@ ArgusClientTimeout ()
             }
          }
 
-#ifdef ARGUSDEBUG
-         ArgusDebug (2, "ArgusClientTimeout() RaBinProcess: Bflag %f rtime %lld start %lld end %lld size %lld arraylen %d count %d index %d\n",
-            ArgusParser->Bflag, rtime, RaBinProcess->start, RaBinProcess->end,
-            RaBinProcess->size, RaBinProcess->arraylen, RaBinProcess->count, RaBinProcess->index);
-#endif
          rtime += rbps->size;
          rbps->rtime.tv_sec  = rtime / 1000000;
          rbps->rtime.tv_usec = rtime % 1000000;
@@ -988,12 +914,12 @@ RaProcessThisRecord (struct ArgusParserS
 {
    extern struct RaBinProcessStruct *RaBinProcess;
    struct ArgusRecordStruct *tns = NULL;
-   int retn = 0, fretn = -1, lretn = -1;
    extern int ArgusTimeRangeStrategy;
    struct ArgusAggregatorStruct *agg = parser->ArgusAggregator;
    int found = 0, offset, tstrat;
 
    while (agg && !found) {
+      int retn = 0, fretn = -1, lretn = -1;
       if (ArgusParser->tflag) {
          tstrat = ArgusTimeRangeStrategy;
          ArgusTimeRangeStrategy = 1;
@@ -1251,3 +1177,111 @@ RaProcessSplitOptions(struct ArgusParser
    return (retn);
 }
 
+
+int
+RaDeleteBinProcess(struct ArgusParserStruct *parser, struct RaBinProcessStruct *rbps)
+{
+   struct RaBinStruct *bin = NULL;
+   struct ArgusRecordStruct *ns = NULL;
+   int max = ((parser->tflag && parser->RaExplicitDate) ? rbps->nadp.count : rbps->max) + 1;
+   int startsecs = 0, endsecs = 0, i;
+   int retn = 0;
+
+   char stimebuf[128], dtimebuf[128], etimebuf[128];
+   int bins;
+
+   if (rbps->array != NULL) {
+      if (!(parser->tflag)) {
+         for (i = 0; i < max; i++) {
+            if ((bin = rbps->array[i]) != NULL) {
+               if (startsecs == 0)
+                  startsecs = bin->stime.tv_sec;
+               endsecs = bin->etime.tv_sec;
+            }
+         }
+
+         rbps->startpt.tv_sec = startsecs;
+         rbps->scalesecs      = (endsecs - startsecs) + (rbps->size / 1000000);
+
+         if ((parser->RaEndTime.tv_sec >  rbps->endpt.tv_sec) ||
+                  ((parser->RaEndTime.tv_sec == rbps->endpt.tv_sec) &&
+                   (parser->RaEndTime.tv_usec > rbps->endpt.tv_usec)))
+            parser->RaEndTime = rbps->endpt;
+
+      } else {
+         rbps->startpt.tv_sec  = parser->startime_t.tv_sec;
+         rbps->startpt.tv_usec = parser->startime_t.tv_usec;
+         rbps->endpt.tv_sec    = parser->lasttime_t.tv_sec;
+         rbps->endpt.tv_usec   = parser->lasttime_t.tv_usec;
+         rbps->scalesecs       = parser->lasttime_t.tv_sec - parser->startime_t.tv_sec;
+         rbps->start           = parser->startime_t.tv_sec * 1000000LL;
+      }
+
+      if ((parser->ArgusWfileList == NULL) && (parser->Gflag)) {
+         if (parser->Hstr != NULL) {
+
+         } else {
+
+            ArgusPrintTime(parser, stimebuf, &rbps->startpt);
+            ArgusPrintTime(parser, dtimebuf, &rbps->endpt);
+            ArgusPrintTime(parser, etimebuf, &parser->RaEndTime);
+
+            stimebuf[strlen(stimebuf) - 1] = '\0';
+            dtimebuf[strlen(dtimebuf) - 1] = '\0';
+            etimebuf[strlen(etimebuf) - 1] = '\0';
+
+            printf ("StartTime=%s\n", stimebuf);
+            printf ("StopTime=%s\n",  dtimebuf);
+            printf ("LastTime=%s\n",  etimebuf);
+            printf ("Seconds=%d\n", rbps->scalesecs);
+            printf ("BinSize=%1.*f\n", parser->pflag, (rbps->size * 1.0)/1000000);
+            bins = ((rbps->scalesecs + (rbps->size/1000000 - 1))/(rbps->size / 1000000));
+            printf ("Bins=%d\n", bins);
+         }
+      }
+   }
+
+   for (i = rbps->index; i < max; i++) {
+      if ((rbps->array != NULL) && ((bin = rbps->array[i]) != NULL)) {
+         struct ArgusAggregatorStruct *agg = bin->agg;
+         while (agg) {
+            int rank = 1;
+            ArgusSortQueue(ArgusSorter, agg->queue);
+            while ((ns = (struct ArgusRecordStruct *) ArgusPopQueue(agg->queue, ARGUS_NOLOCK)) != NULL) {
+               ns->rank = rank++;
+               if ((parser->eNoflag == 0 ) || ((parser->eNoflag >= ns->rank) && (parser->sNoflag <= ns->rank)))
+                  RaSendArgusRecord (ns);
+               ArgusDeleteRecordStruct(parser, ns);
+            }
+            agg = agg->nxt;
+         }
+
+      } else {
+         if (rbps->nadp.zero && ((i >= rbps->index) && 
+                 ((((i - rbps->index) * 1.0) * rbps->size) < (rbps->scalesecs * 1000000LL)))) {
+            long long tval = rbps->start + (rbps->size * (i - rbps->index));
+
+            ns = ArgusGenerateRecordStruct(NULL, NULL, NULL);
+
+            ((struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX])->src.start.tv_sec  = tval / 1000000;
+            ((struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX])->src.start.tv_usec = tval % 1000000;
+
+            tval += rbps->size;
+            ((struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX])->src.end.tv_sec    = tval / 1000000;;
+            ((struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX])->src.end.tv_usec   = tval % 1000000;
+
+            RaSendArgusRecord (ns);
+         }
+      }
+   }
+
+   for (i = rbps->index; i < max; i++) {
+      if ((rbps->array != NULL) && ((bin = rbps->array[i]) != NULL)) {
+         RaDeleteBin(parser, bin);
+      }
+   }
+
+   if (rbps->array != NULL) ArgusFree(rbps->array);
+   ArgusFree(rbps);
+   return (retn);
+}
diff -rupN argus-clients-3.0.6/clients/radium.c argus-clients-3.0.6.new/clients/radium.c
--- argus-clients-3.0.6/clients/radium.c	2012-04-17 12:22:02.000000000 -0400
+++ argus-clients-3.0.6.new/clients/radium.c	2012-05-08 17:38:46.000000000 -0400
@@ -20,9 +20,9 @@
  */
 
 /* 
- * $Id: //depot/argus-3.0.6/clients/clients/radium.c#1 $
- * $DateTime: 2012/04/17 12:22:02 $
- * $Change: 2368 $
+ * $Id: //depot/argus-3.0.6/clients/clients/radium.c#2 $
+ * $DateTime: 2012/05/08 17:28:00 $
+ * $Change: 2403 $
  */
 
 /*
@@ -399,6 +399,8 @@ usage ()
 void
 RaProcessRecord (struct ArgusParserStruct *parser, struct ArgusRecordStruct *argus)
 {
+   struct ArgusRecordStruct *ns = NULL;
+
    switch (argus->hdr.type & 0xF0) {
       case ARGUS_MAR: {
          struct ArgusRecord *rec = (struct ArgusRecord *)argus->dsrs[0];
@@ -523,23 +525,23 @@ RaProcessRecord (struct ArgusParserStruc
       }
    }
 
-   if (parser->ArgusLabeler != NULL) 
-      ArgusLabelRecord(parser, argus);
+   if ((ns = ArgusCopyRecordStruct(argus)) != NULL) {
+      if (parser->ArgusLabeler != NULL) 
+         ArgusLabelRecord(parser, ns);
 
-   ArgusPushBackList(parser->ArgusOutput->ArgusOutputList,
-              (struct ArgusListRecord *)ArgusCopyRecordStruct(argus), ARGUS_LOCK);
+      ArgusPushBackList(parser->ArgusOutput->ArgusOutputList, (struct ArgusListRecord *) ns, ARGUS_LOCK);
 
 #if defined(ARGUS_THREADS)
-   pthread_cond_signal(&parser->ArgusOutput->ArgusOutputList->cond); 
-
-   if (parser->ArgusOutput->ArgusOutputList->count > 10000) {
-      struct timespec tsbuf = {0, 10000000}, *ts = &tsbuf;
-      nanosleep (ts, NULL);
-   }
+      pthread_cond_signal(&parser->ArgusOutput->ArgusOutputList->cond); 
 
+      if (parser->ArgusOutput->ArgusOutputList->count > 10000) {
+         struct timespec tsbuf = {0, 10000000}, *ts = &tsbuf;
+         nanosleep (ts, NULL);
+      }
 #else
-   ArgusOutputProcess(parser->ArgusOutput);
+      ArgusOutputProcess(parser->ArgusOutput);
 #endif
+   }
 
 #ifdef ARGUSDEBUG
    ArgusDebug (4, "RaProcessRecord (0x%x, 0x%x) returning", parser, argus); 
@@ -3136,9 +3138,9 @@ mysasl_secprops(int flags)
  */
 
 /* 
- * $Id: //depot/argus-3.0.6/clients/clients/radium.c#1 $
- * $DateTime: 2012/04/17 12:22:02 $
- * $Change: 2368 $
+ * $Id: //depot/argus-3.0.6/clients/clients/radium.c#2 $
+ * $DateTime: 2012/05/08 17:28:00 $
+ * $Change: 2403 $
  */
 
 
diff -rupN argus-clients-3.0.6/common/argus_client.c argus-clients-3.0.6.new/common/argus_client.c
--- argus-clients-3.0.6/common/argus_client.c	2012-04-18 14:18:40.000000000 -0400
+++ argus-clients-3.0.6.new/common/argus_client.c	2012-05-08 17:38:46.000000000 -0400
@@ -28,9 +28,9 @@
  */
 
 /* 
- * $Id: //depot/argus-3.0.6/clients/common/argus_client.c#2 $
- * $DateTime: 2012/04/18 14:18:40 $
- * $Change: 2370 $
+ * $Id: //depot/argus-3.0.6/clients/common/argus_client.c#3 $
+ * $DateTime: 2012/05/01 13:58:52 $
+ * $Change: 2376 $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -11613,8 +11613,8 @@ ArgusParseAggregator (struct ArgusParser
             if (model) {
                if (strlen(model)) {
                   agg->modelstr = strdup(model);
-                  if (ArgusFilterCompile (&agg->filter, agg->filterstr, ArgusParser->Oflag) < 0)
-                     ArgusLog (LOG_ERR, "ArgusNewAggregator ArgusFilterCompile returned error");
+//                if (ArgusFilterCompile (&agg->filter, agg->filterstr, ArgusParser->Oflag) < 0)
+//                   ArgusLog (LOG_ERR, "ArgusNewAggregator ArgusFilterCompile returned error");
                }
             }
 
diff -rupN argus-clients-3.0.6/common/argus_label.c argus-clients-3.0.6.new/common/argus_label.c
--- argus-clients-3.0.6/common/argus_label.c	2012-04-17 12:22:02.000000000 -0400
+++ argus-clients-3.0.6.new/common/argus_label.c	2012-05-08 17:38:46.000000000 -0400
@@ -20,9 +20,9 @@
  */
 
 /*
- * $Id: //depot/argus-3.0.6/clients/common/argus_label.c#1 $
- * $DateTime: 2012/04/17 12:22:02 $
- * $Change: 2368 $
+ * $Id: //depot/argus-3.0.6/clients/common/argus_label.c#2 $
+ * $DateTime: 2012/05/08 17:28:00 $
+ * $Change: 2403 $
  */
 
 /*
@@ -536,16 +536,17 @@ ArgusLabelRecord (struct ArgusParserStru
          struct ArgusAsnStruct *asn = (struct ArgusAsnStruct *) argus->dsrs[ARGUS_ASN_INDEX];
          struct ArgusFlow *flow = (struct ArgusFlow *) argus->dsrs[ARGUS_FLOW_INDEX];
          struct ArgusIcmpStruct *icmp = (void *)argus->dsrs[ARGUS_ICMP_INDEX];
-         struct ArgusCanonRecord *canon = &parser->canon;
 
          if (asn == NULL) {
-            bzero((char *)&canon->asn, sizeof(*asn));
-            canon->asn.hdr.type              = ARGUS_ASN_DSR;
-            canon->asn.hdr.subtype           = ARGUS_ASN_ORIGIN;
-            canon->asn.hdr.argus_dsrvl8.qual = 0;
-            canon->asn.hdr.argus_dsrvl8.len  = 3;
+            if ((asn = ArgusCalloc(1, sizeof(*asn))) == NULL)
+               ArgusLog (LOG_ERR, "RaProcessRecord: ArgusCalloc error %s", strerror(errno));
 
-            argus->dsrs[ARGUS_ASN_INDEX] = (struct ArgusDSRHeader*) &canon->asn;
+            asn->hdr.type              = ARGUS_ASN_DSR;
+            asn->hdr.subtype           = ARGUS_ASN_ORIGIN;
+            asn->hdr.argus_dsrvl8.qual = 0;
+            asn->hdr.argus_dsrvl8.len  = 3;
+
+            argus->dsrs[ARGUS_ASN_INDEX] = (struct ArgusDSRHeader*) asn;
             argus->dsrindex |= (0x01 << ARGUS_ASN_INDEX);
             asn = (struct ArgusAsnStruct *) argus->dsrs[ARGUS_ASN_INDEX];
          }
@@ -585,7 +586,7 @@ ArgusLabelRecord (struct ArgusParserStru
                                        if (sscanf(rstr, "AS%d", &result) == 1)
                                           asn->inode_as = result;
 
-                                       canon->asn.hdr.argus_dsrvl8.len  = 4;
+                                       asn->hdr.argus_dsrvl8.len  = 4;
                                     }
                                  }
                               }
@@ -667,15 +668,17 @@ ArgusLabelRecord (struct ArgusParserStru
       if (lstruct == NULL) {
          int len = 4 * ((strlen(label) + 3)/4);
 
-         lstruct = &parser->canon.label;
-         if ((lstruct->l_un.label = calloc(1, len)) == NULL)
+         if ((lstruct = ArgusCalloc(1, sizeof(*lstruct))) == NULL)
             ArgusLog (LOG_ERR, "RaProcessRecord: ArgusCalloc error %s", strerror(errno));
 
+         if ((lstruct->l_un.label = calloc(1, len)) == NULL)
+            ArgusLog (LOG_ERR, "RaProcessRecord: calloc error %s", strerror(errno));
+
          lstruct->hdr.type             = ARGUS_LABEL_DSR;
          lstruct->hdr.argus_dsrvl8.len = 1 + ((len + 3)/4);
          bcopy (label, lstruct->l_un.label, strlen(label));
 
-         argus->dsrs[ARGUS_LABEL_INDEX] = &lstruct->hdr;
+         argus->dsrs[ARGUS_LABEL_INDEX] = (struct ArgusDSRHeader*) lstruct;
          argus->dsrindex |= (0x1 << ARGUS_LABEL_INDEX);
          retn = 1;
       }
@@ -2729,22 +2732,15 @@ extern void ArgusPrintDstCountryCode (st
 int
 RaCountryCodeLabel (struct ArgusParserStruct *parser, struct ArgusRecordStruct *argus)
 {
-   extern struct ArgusCanonRecord ArgusGenerateCanonBuffer;
    int retn = 0;
 
    if (argus != NULL) {
-      struct ArgusCountryCodeStruct *cocode;
-      struct ArgusCanonRecord  *canon = NULL;
+      struct ArgusCountryCodeStruct *cocode = (struct ArgusCountryCodeStruct *)argus->dsrs[ARGUS_COCODE_INDEX];
 
-      if (argus->input != NULL) {
-         canon = &argus->input->ArgusGenerateRecordCanonBuf;
-      } else {
-         canon = &ArgusGenerateCanonBuffer;
-      }
-
-      argus->dsrs[ARGUS_COCODE_INDEX] = NULL;
+      if (cocode == NULL)
+         if ((cocode = ArgusMalloc(sizeof(*cocode))) == NULL)
+            ArgusLog (LOG_ERR, "RaProcessRecord: ArgusCalloc error %s", strerror(errno));
 
-      cocode = &canon->cocode;
       bzero(cocode, sizeof(*cocode));  
 
       cocode->hdr.type             = ARGUS_COCODE_DSR;
diff -rupN argus-clients-3.0.6/examples/ralabel/ralabel.c argus-clients-3.0.6.new/examples/ralabel/ralabel.c
--- argus-clients-3.0.6/examples/ralabel/ralabel.c	2012-04-17 12:22:02.000000000 -0400
+++ argus-clients-3.0.6.new/examples/ralabel/ralabel.c	2012-05-08 17:38:46.000000000 -0400
@@ -27,9 +27,9 @@
  * written by Carter Bullard
  * QoSient, LLC
  *
- * $Id: //depot/argus-3.0.6/clients/examples/ralabel/ralabel.c#1 $
- * $DateTime: 2012/04/17 12:22:02 $
- * $Change: 2368 $
+ * $Id: //depot/argus-3.0.6/clients/examples/ralabel/ralabel.c#2 $
+ * $DateTime: 2012/05/08 17:28:00 $
+ * $Change: 2403 $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -242,57 +242,61 @@ void
 RaProcessRecord (struct ArgusParserStruct *parser, struct ArgusRecordStruct *argus)
 {
    struct ArgusLabelStruct *lstruct = NULL;
+   struct ArgusRecordStruct *ns = NULL;
    char buf[MAXSTRLEN];
 
-   ArgusLabelRecord(parser, argus);
+   if ((ns = ArgusCopyRecordStruct(argus)) != NULL) {
+      ArgusLabelRecord(parser, ns);
 
-   lstruct = (void *) argus->dsrs[ARGUS_LABEL_INDEX];
+      lstruct = (void *) argus->dsrs[ARGUS_LABEL_INDEX];
 
-   if (parser->ArgusWfileList != NULL) {
-      struct ArgusWfileStruct *wfile = NULL;
-      struct ArgusListObjectStruct *lobj = NULL;
-      int i, count = parser->ArgusWfileList->count;
-
-      if ((lobj = parser->ArgusWfileList->start) != NULL) {
-         for (i = 0; i < count; i++) {
-            if ((wfile = (struct ArgusWfileStruct *) lobj) != NULL) {
-               if ((parser->exceptfile == NULL) || strcmp(wfile->filename, parser->exceptfile)) {
-                  struct ArgusRecord *argusrec = NULL;
-                  static char sbuf[0x10000];
-                  if ((argusrec = ArgusGenerateRecord (argus, 0L, sbuf)) != NULL) {
+      if (parser->ArgusWfileList != NULL) {
+         struct ArgusWfileStruct *wfile = NULL;
+         struct ArgusListObjectStruct *lobj = NULL;
+         int i, count = parser->ArgusWfileList->count;
+
+         if ((lobj = parser->ArgusWfileList->start) != NULL) {
+            for (i = 0; i < count; i++) {
+               if ((wfile = (struct ArgusWfileStruct *) lobj) != NULL) {
+                  if ((parser->exceptfile == NULL) || strcmp(wfile->filename, parser->exceptfile)) {
+                     struct ArgusRecord *argusrec = NULL;
+                     static char sbuf[0x10000];
+                     if ((argusrec = ArgusGenerateRecord (argus, 0L, sbuf)) != NULL) {
 #ifdef _LITTLE_ENDIAN
-                     ArgusHtoN(argusrec);
+                        ArgusHtoN(argusrec);
 #endif
-                     ArgusWriteNewLogfile (parser, argus->input, wfile, argusrec);
+                        ArgusWriteNewLogfile (parser, argus->input, wfile, argusrec);
+                     }
                   }
                }
-            }
 
-            lobj = lobj->nxt;
+               lobj = lobj->nxt;
+            }
          }
-      }
 
-   } else {
-      if (!parser->qflag) {
-         if (parser->Lflag) {
-            if (parser->RaLabel == NULL)
-               parser->RaLabel = ArgusGenerateLabel(parser, argus);
- 
-            if (!(parser->RaLabelCounter++ % parser->Lflag))
-               printf ("%s\n", parser->RaLabel);
- 
-            if (parser->Lflag < 0)
-               parser->Lflag = 0;
-         }
+      } else {
+         if (!parser->qflag) {
+            if (parser->Lflag) {
+               if (parser->RaLabel == NULL)
+                  parser->RaLabel = ArgusGenerateLabel(parser, argus);
+    
+               if (!(parser->RaLabelCounter++ % parser->Lflag))
+                  printf ("%s\n", parser->RaLabel);
+    
+               if (parser->Lflag < 0)
+                  parser->Lflag = 0;
+            }
 
-         *(int *)&buf = 0;
-         ArgusPrintRecord(parser, buf, argus, MAXSTRLEN);
-         if (fprintf (stdout, "%s\n", buf) < 0)
-            RaParseComplete(SIGQUIT);
+            *(int *)&buf = 0;
+            ArgusPrintRecord(parser, buf, argus, MAXSTRLEN);
+            if (fprintf (stdout, "%s\n", buf) < 0)
+               RaParseComplete(SIGQUIT);
+         }
       }
+                    
+      fflush (stdout);
+      ArgusDeleteRecordStruct(parser, ns);
    }
-                 
-   fflush (stdout);
 
 #ifdef ARGUSDEBUG
    ArgusDebug (5, "RaProcessRecord (0x%x) returning\n", argus);
diff -rupN argus-clients-3.0.6/examples/ramysql/rasqlinsert.c argus-clients-3.0.6.new/examples/ramysql/rasqlinsert.c
--- argus-clients-3.0.6/examples/ramysql/rasqlinsert.c	2012-04-18 14:25:02.000000000 -0400
+++ argus-clients-3.0.6.new/examples/ramysql/rasqlinsert.c	2012-05-08 17:38:46.000000000 -0400
@@ -25,9 +25,9 @@
 */
 
 /* 
- * $Id: //depot/argus-3.0.6/clients/examples/ramysql/rasqlinsert.c#1 $
- * $DateTime: 2012/04/17 12:22:02 $
- * $Change: 2368 $
+ * $Id: //depot/argus-3.0.6/clients/examples/ramysql/rasqlinsert.c#2 $
+ * $DateTime: 2012/04/18 15:04:49 $
+ * $Change: 2371 $
  */
 
 #ifdef HAVE_CONFIG_H
diff -rupN argus-clients-3.0.6/examples/rarpwatch/rarpwatch.c argus-clients-3.0.6.new/examples/rarpwatch/rarpwatch.c
--- argus-clients-3.0.6/examples/rarpwatch/rarpwatch.c	2012-04-18 14:26:22.000000000 -0400
+++ argus-clients-3.0.6.new/examples/rarpwatch/rarpwatch.c	2012-05-08 17:38:46.000000000 -0400
@@ -28,9 +28,9 @@
  */
 
 /* 
- * $Id: //depot/argus-3.0.6/clients/examples/rarpwatch/rarpwatch.c#1 $
- * $DateTime: 2012/04/17 12:22:02 $
- * $Change: 2368 $
+ * $Id: //depot/argus-3.0.6/clients/examples/rarpwatch/rarpwatch.c#2 $
+ * $DateTime: 2012/04/18 15:04:49 $
+ * $Change: 2371 $
  */
 
 #ifdef HAVE_CONFIG_H
diff -rupN argus-clients-3.0.6/examples/rastream/rastream.c argus-clients-3.0.6.new/examples/rastream/rastream.c
--- argus-clients-3.0.6/examples/rastream/rastream.c	2012-04-17 12:22:02.000000000 -0400
+++ argus-clients-3.0.6.new/examples/rastream/rastream.c	2012-05-08 17:38:46.000000000 -0400
@@ -34,9 +34,9 @@
  * QoSient, LLC
  *
  * 
- * $Id: //depot/argus-3.0.6/clients/examples/rastream/rastream.c#1 $
- * $DateTime: 2012/04/17 12:22:02 $
- * $Change: 2368 $
+ * $Id: //depot/argus-3.0.6/clients/examples/rastream/rastream.c#2 $
+ * $DateTime: 2012/05/07 12:29:30 $
+ * $Change: 2399 $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -758,15 +758,12 @@ ArgusClientTimeout ()
          if (rbps->array != NULL) {
             if ((bin = rbps->array[rbps->index]) != NULL) {
                struct ArgusAggregatorStruct *agg = bin->agg;
+               int tcnt = 0;
+
                while (agg) {
                   if (agg->queue->count) {
                      int cnt = 0;
 
-#ifdef ARGUSDEBUG
-                     ArgusDebug (1, "ArgusClientTimeout() RaStreamBins: rtime %d start %d end %d size %d items %d\n",
-                        RaStreamBins->rtime.tv_sec, RaStreamBins->startpt.tv_sec, RaStreamBins->endpt.tv_sec,
-                        RaStreamBins->size, agg->queue->count);
-#endif
                      ArgusSortQueue(ArgusSorter, agg->queue);
                      argus = ArgusCopyRecordStruct((struct ArgusRecordStruct *) agg->queue->array[0]);
 
@@ -780,35 +777,39 @@ ArgusClientTimeout ()
                      for (i = 0; i < cnt; i++)
                         RaProcessThisRecord (ArgusParser, (struct ArgusRecordStruct *) agg->queue->array[i]);
 
+                     tcnt += cnt;
                      ArgusDeleteRecordStruct(ArgusParser, ArgusParser->ns);
                      ArgusParser->ns = NULL;
                   }
 
                   agg = agg->nxt;
                }
-
+#ifdef ARGUSDEBUG
+               ArgusDebug (2, "ArgusClientTimeout() RaBinProcess: Bflag %f rtime %lld start %d.%06d size %.06f arraylen %d count %d index %d\n",
+                  ArgusParser->Bflag, rtime, bin->stime.tv_sec, bin->stime.tv_usec, bin->size/1000000.0, rbps->arraylen, tcnt, rbps->index);
+#endif
                RaDeleteBin(ArgusParser, bin);
                rbps->array[rbps->index] = NULL;
 
             } else {
                if (RaStreamBins->nadp.zero && ((i >= RaStreamBins->index) && (((i - RaStreamBins->index) * RaStreamBins->size) < RaStreamBins->scalesecs))) {
                   long long tval = RaBinProcess->start + (RaBinProcess->size * RaBinProcess->index);
+                  struct ArgusTimeObject *btime = NULL;
                   
                   ns = ArgusGenerateRecordStruct(NULL, NULL, NULL);
+                  btime = (struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX];
 
-                  ((struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX])->src.start.tv_sec  = tval / 1000000;
-                  ((struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX])->src.start.tv_usec = tval % 1000000;
+                  btime->src.start.tv_sec  = tval / 1000000;
+                  btime->src.start.tv_usec = tval % 1000000;
             
                   tval += RaBinProcess->size;
-                  ((struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX])->src.end.tv_sec    = tval / 1000000;;
-                  ((struct ArgusTimeObject *)ns->dsrs[ARGUS_TIME_INDEX])->src.end.tv_usec   = tval % 1000000;
-
-                  RaSendArgusRecord (ns);
-
-                  ArgusDeleteRecordStruct(ArgusParser, ns);
+                  btime->src.end.tv_sec    = tval / 1000000;
+                  btime->src.end.tv_usec   = tval % 1000000;
 #ifdef ARGUSDEBUG
-                  ArgusDebug (5, "ArgusClientTimeout() RaBinProcess: creating zero record\n");
+                  ArgusDebug (2, "ArgusClientTimeout() RaBinProcess: Bflag %f rtime %lld start %d.%06d size %.06f arraylen %d count %d index %d\n",
+                     ArgusParser->Bflag, rtime, btime->src.start.tv_sec, bin->stime.tv_usec, rbps->size/1000000.0, rbps->arraylen, 0, rbps->index);
 #endif
+                  RaProcessThisRecord (ArgusParser, ns);
                }
             }
 
@@ -875,19 +876,16 @@ usage ()
 {
    extern char version[];
 
-   fprintf (stdout, "Rasplit Version %s\n", version);
+   fprintf (stdout, "Rastream Version %s\n", version);
    fprintf (stdout, "usage: %s \n", ArgusParser->ArgusProgramName);
-   fprintf (stdout, "usage: %s [options] -S remoteServer  [- filter-expression]\n", ArgusParser->ArgusProgramName);
-   fprintf (stdout, "usage: %s [options] -r argusDataFile [- filter-expression]\n\n", ArgusParser->ArgusProgramName);
+   fprintf (stdout, "usage: %s [options] -S remoteServer  -f rastream.sh [- filter-expression]\n", ArgusParser->ArgusProgramName);
+   fprintf (stdout, "usage: %s [options] -r argusDataFile -f rastream.sh [- filter-expression]\n\n", ArgusParser->ArgusProgramName);
 
-   fprintf (stdout, "options: -b                 dump packet-matching code.\n");
-   fprintf (stdout, "         -C <[host]:port>   specify remote Cisco Netflow source.\n");
+   fprintf (stdout, "options: -B <sec>           Delay time before closing files and processing.\n");
 #if defined (ARGUSDEBUG)
    fprintf (stdout, "         -D <level>         specify debug level\n");
 #endif
-   fprintf (stdout, "         -E <file>          write records that are rejected by the filter\n");
-   fprintf (stdout, "                            into <file>\n");
-   fprintf (stdout, "         -F <conffile>      read configuration from <conffile>.\n");
+   fprintf (stdout, "         -f <script>        run <script> against output file after closing.\n");
    fprintf (stdout, "         -h                 print help.\n");
 
    fprintf (stdout, "         -M <mode>          supported modes of operation:\n");
@@ -896,19 +894,9 @@ usage ()
    fprintf (stdout, "            size n[kmb]\n");
    fprintf (stdout, "            nomodify\n");
 
-   fprintf (stdout, "         -r <file>          read argus data <file>. '-' denotes stdin.\n");
    fprintf (stdout, "         -S <host[:port]>   specify remote argus <host> and optional port\n");
    fprintf (stdout, "                            number.\n");
-   fprintf (stdout, "         -t <timerange>     specify <timerange> for reading records.\n");
-   fprintf (stdout, "                   format:  timeSpecification[-timeSpecification]\n");
-   fprintf (stdout, "                            timeSpecification: [[[yyyy/]mm/]dd.]hh[:mm[:ss]]\n");
-   fprintf (stdout, "                                                 [yyyy/]mm/dd\n");
-   fprintf (stdout, "                                                 -%%d{yMdhms}\n");
-   fprintf (stdout, "         -T <secs>          attach to remote server for T seconds.\n");
-#ifdef ARGUS_SASL
-   fprintf (stdout, "         -U <user/auth>     specify <user/auth> authentication information.\n");
-#endif
-   fprintf (stdout, "         -w <file>          write output to <file>. '-' denotes stdout.\n");
+   fprintf (stdout, "         -w <extended.file> write output to rasplit.1 style output archive.\n");
    fflush (stdout);
 
    exit(1);
@@ -983,7 +971,7 @@ RaProcessRecord (struct ArgusParserStruc
             case ARGUS_EVENT: {
                if ((retn = ArgusCheckTime (parser, ns)) != 0) {
                   tns = ArgusCopyRecordStruct(ns);
-                  if (!(ArgusInsertRecord(parser, RaBinProcess, tns, offset)))
+                  if (!(ArgusInsertRecord(parser, RaStreamBins, tns, offset)))
                      ArgusDeleteRecordStruct(parser, tns);
                }
                break;
@@ -1002,7 +990,8 @@ RaProcessRecord (struct ArgusParserStruc
                            ArgusDeleteRecordStruct(parser, tns);
                      } else
                         ArgusDeleteRecordStruct(parser, tns);
-                  }
+                  } else
+                     ArgusDeleteRecordStruct(parser, tns);
                }
                break;
             }
diff -rupN argus-clients-3.0.6/include/net/etherdefs.h argus-clients-3.0.6.new/include/net/etherdefs.h
--- argus-clients-3.0.6/include/net/etherdefs.h	1969-12-31 19:00:00.000000000 -0500
+++ argus-clients-3.0.6.new/include/net/etherdefs.h	2012-05-08 17:38:46.000000000 -0400
@@ -0,0 +1,71 @@
+/*
+ * Argus Software.  Argus files - main argus processing
+ * Copyright (c) 2000-2011 QoSient, LLC
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+/* 
+ * $Id: //depot/argus/argus/include/net/etherdefs.h#4 $
+ * $DateTime: 2011/01/26 17:31:56 $
+ * $Change: 2094 $
+ */
+#ifndef _NET_ETHERNET_H_
+#define _NET_ETHERNET_H_
+
+#define	ETHER_ADDR_LEN		6
+#define	ETHER_TYPE_LEN		2
+#define	ETHER_CRC_LEN		4
+#define	ETHER_HDR_LEN		(ETHER_ADDR_LEN*2+ETHER_TYPE_LEN)
+#define	ETHER_MIN_LEN		64
+#define	ETHER_MAX_LEN		1518
+ 
+#ifndef	ETHERTYPE_PUP
+#define	ETHERTYPE_PUP		0x0200	/* PUP protocol */
+#endif
+#ifndef	ETHERTYPE_IP
+#define	ETHERTYPE_IP		0x0800	/* IP protocol */
+#endif
+#ifndef ETHERTYPE_ARP
+#define ETHERTYPE_ARP		0x0806	/* Addr. resolution protocol */
+#endif
+#ifndef ETHERTYPE_REVARP
+#define ETHERTYPE_REVARP	0x8035	/* reverse Addr. resolution protocol */
+#endif
+#ifndef	ETHERTYPE_VLAN
+#define	ETHERTYPE_VLAN		0x8100	/* IEEE 802.1Q VLAN tagging */
+#endif
+#ifndef ETHERTYPE_IPV6
+#define ETHERTYPE_IPV6		0x86dd	/* IPv6 */
+#endif
+#ifndef	ETHERTYPE_LOOPBACK
+#define	ETHERTYPE_LOOPBACK	0x9000	/* used to test interfaces */
+#endif
+
+/*
+ * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
+ * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
+ * by an ETHER type (as given above) and then the (variable-length) header.
+ */
+#ifndef	ETHERTYPE_TRAIL
+#define	ETHERTYPE_TRAIL		0x1000		/* Trailer packet */
+#endif
+#ifndef	ETHERTYPE_NTRAILER
+#define	ETHERTYPE_NTRAILER	16
+#endif
+
+#endif /* !_NET_ETHERNET_H_ */
diff -rupN argus-clients-3.0.6/lib/argus-clients.spec argus-clients-3.0.6.new/lib/argus-clients.spec
--- argus-clients-3.0.6/lib/argus-clients.spec	2012-04-17 12:22:02.000000000 -0400
+++ argus-clients-3.0.6.new/lib/argus-clients.spec	2012-05-08 17:38:46.000000000 -0400
@@ -1,7 +1,7 @@
 %define name    argus-clients
 %define ver     3.0
 %if %{?rel:0}%{!?rel:1}
-%define rel     6
+%define rel     6.1
 %endif
 %if %{?srcext:0}%{!?srcext:1}
 %define srcext .gz
