Index: flow-tools-0.68/configs/Makefile.in
--- flow-tools-0.68/configs/Makefile.in.orig	2005-05-11 16:20:16 +0200
+++ flow-tools-0.68/configs/Makefile.in	2005-05-15 19:46:26 +0200
@@ -88,10 +88,10 @@
 am__include = @am__include@
 am__quote = @am__quote@
 install_sh = @install_sh@
-ftsymdir = $(localstatedir)/sym
+ftsymdir = $(datadir)
 ftsym_DATA = ip-prot.sym ip-type.sym tcp-port.sym asn.sym tag.sym
 
-ftcfgdir = $(localstatedir)/cfg
+ftcfgdir = $(sysconfdir)
 ftcfg_DATA = map.cfg tag.cfg filter.cfg stat.cfg mask.cfg xlate.cfg
 subdir = configs
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
Index: flow-tools-0.68/configure
--- flow-tools-0.68/configure.orig	2005-05-11 16:15:55 +0200
+++ flow-tools-0.68/configure	2005-05-15 19:45:32 +0200
@@ -1662,7 +1662,6 @@
 
 
 
-CFLAGS="-g -Wall"
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -3204,7 +3203,7 @@
 
 
 if test "x$WHERE_MYSQL" != "x"; then
-  LIBS="-L$WHERE_MYSQL/lib/mysql"
+  LIBS="-L$WHERE_MYSQL/lib/mysql $LIBS"
   echo "$as_me:$LINENO: checking for my_init in -lmysqlclient" >&5
 echo $ECHO_N "checking for my_init in -lmysqlclient... $ECHO_C" >&6
 if test "${ac_cv_lib_mysqlclient_my_init+set}" = set; then
@@ -3345,7 +3344,7 @@
 
 
 if test "x$WHERE_PGSQL" != "x"; then
-  LIBS="-L$WHERE_PGSQL/lib/pgsql"
+  LIBS="-L$WHERE_PGSQL/lib $LIBS"
   echo "$as_me:$LINENO: checking for PQsetdbLogin in -lpq" >&5
 echo $ECHO_N "checking for PQsetdbLogin in -lpq... $ECHO_C" >&6
 if test "${ac_cv_lib_pq_PQsetdbLogin+set}" = set; then
@@ -3402,7 +3401,7 @@
 echo "${ECHO_T}$ac_cv_lib_pq_PQsetdbLogin" >&6
 if test $ac_cv_lib_pq_PQsetdbLogin = yes; then
 
-      PGSQLCFLAGS="-L$WHERE_PGSQL/lib -I$WHERE_PGSQL/include/pgsql"
+      PGSQLCFLAGS="-L$WHERE_PGSQL/lib -I$WHERE_PGSQL/include/postgresql"
       PGSQLLIB="-lpq"
       cat >>confdefs.h <<\_ACEOF
 #define HAVE_PGSQL 1
Index: flow-tools-0.68/docs/flow-capture.1.in
--- flow-tools-0.68/docs/flow-capture.1.in.orig	2004-01-02 22:26:21 +0100
+++ flow-tools-0.68/docs/flow-capture.1.in	2005-05-15 19:45:32 +0200
@@ -123,7 +123,7 @@
 Configure the number of times flow-capture will create a new file per day\&.
 The default is 95, or every 15 minutes\&.
 .IP "-N\fI nesting_level\fP" 10
-Configure the nesting level for storing flow files\&.  The default is 0\&.
+Configure the nesting level for storing flow files\&.  The default is 3\&.
    -3    YYYY/YYYY-MM/YYYY-MM-DD/flow-file
    -2    YYYY-MM/YYYY-MM-DD/flow-file
    -1    YYYY-MM-DD/flow-file
@@ -184,10 +184,9 @@
 .SH "EXAMPLES"
 .PP
 Receive flows from the exporter at 10\&.0\&.0\&.1 port 9800\&.  Maintain 5 Gigabytes
-of flow files in /flows/krc4\&.  Mask the source and destination IP addresses
-contained in the flow exports with 255\&.255\&.248\&.0\&.
+of flow files in /flows/krc4\&.
 .PP
-  \fBflow-capture -w /flows/krc4 -m 255\&.255\&.248\&.0 -E5G 0/10\&.0\&.0\&.1/9800\fP
+  \fBflow-capture -w /flows/krc4 -E5G 0/10\&.0\&.0\&.1/9800\fP
 .PP
 Receive flows from any exporter on port 9800\&.  Do not perform any flow
 file space management\&.  Store the exports in /flows/krc4\&.  Emit a stat
Index: flow-tools-0.68/lib/ftpaths.h.in
--- flow-tools-0.68/lib/ftpaths.h.in.orig	2003-11-11 17:49:14 +0100
+++ flow-tools-0.68/lib/ftpaths.h.in	2005-05-15 19:45:32 +0200
@@ -29,17 +29,17 @@
 #ifndef FTPATHS_H
 #define FTPATHS_H
 
-#define FT_PATH_CFG_MAP             "@localstatedir@/cfg/map.cfg"
-#define FT_PATH_CFG_TAG             "@localstatedir@/cfg/tag.cfg"
-#define FT_PATH_CFG_FILTER          "@localstatedir@/cfg/filter.cfg"
-#define FT_PATH_CFG_STAT            "@localstatedir@/cfg/stat.cfg"
-#define FT_PATH_CFG_MASK            "@localstatedir@/cfg/mask.cfg"
-#define FT_PATH_CFG_XLATE           "@localstatedir@/cfg/xlate.cfg"
+#define FT_PATH_CFG_MAP             "@sysconfdir@/map.cfg"
+#define FT_PATH_CFG_TAG             "@sysconfdir@/tag.cfg"
+#define FT_PATH_CFG_FILTER          "@sysconfdir@/filter.cfg"
+#define FT_PATH_CFG_STAT            "@sysconfdir@/stat.cfg"
+#define FT_PATH_CFG_MASK            "@sysconfdir@/mask.cfg"
+#define FT_PATH_CFG_XLATE           "@sysconfdir@/xlate.cfg"
 
-#define FT_PATH_SYM_IP_PROT         "@localstatedir@/sym/ip-prot.sym"
-#define FT_PATH_SYM_IP_TYPE         "@localstatedir@/sym/ip-type.sym"
-#define FT_PATH_SYM_TCP_PORT        "@localstatedir@/sym/tcp-port.sym"
-#define FT_PATH_SYM_ASN             "@localstatedir@/sym/asn.sym"
-#define FT_PATH_SYM_TAG             "@localstatedir@/sym/tag.sym"
+#define FT_PATH_SYM_IP_PROT         "@datadir@/ip-prot.sym"
+#define FT_PATH_SYM_IP_TYPE         "@datadir@/ip-type.sym"
+#define FT_PATH_SYM_TCP_PORT        "@datadir@/tcp-port.sym"
+#define FT_PATH_SYM_ASN             "@datadir@/asn.sym"
+#define FT_PATH_SYM_TAG             "@datadir@/tag.sym"
 
 #endif /* FTPATHS_H */
Index: flow-tools-0.68/lib/support.c
--- flow-tools-0.68/lib/support.c.orig	2003-02-13 03:38:43 +0100
+++ flow-tools-0.68/lib/support.c	2005-05-15 19:45:32 +0200
@@ -500,26 +500,19 @@
 int write_pidfile(int pid, char *file, u_int16 port)
 {
   int fd, len;
-  char str[16], *c;
+  char str[16];
   
-  if (!(c = (char*)malloc(strlen(file)+16)))
-    return -1;
-
-  sprintf(c, "%s.%d", file, (int)port);
-    
   len = sprintf(str, "%u\n", (unsigned)pid);
 
-  if ((fd = open(c, O_WRONLY|O_CREAT|O_TRUNC, 0644)) < 0 ) {
-    fterr_warn("open(%s)", c);
-    free (c);
+  if ((fd = open(file, O_WRONLY|O_CREAT|O_TRUNC, 0644)) < 0 ) {
+    fterr_warn("open(%s)", file);
     return -1; 
   }
 
 
   if (write(fd, str, len) != len) {
-    fterr_warn("write(%s)", c);
+    fterr_warn("write(%s)", file);
     close (fd);
-    free (c);
     return -1;
   }
 
Index: flow-tools-0.68/src/flow-export.c
--- flow-tools-0.68/src/flow-export.c.orig	2004-03-31 05:11:14 +0200
+++ flow-tools-0.68/src/flow-export.c	2005-05-15 19:45:32 +0200
@@ -51,12 +51,12 @@
 
 #include <mysql.h>
 
-#define DB_DEFAULT_DBHOST "localhost"
-#define DB_DEFAULT_DBNAME "netflow"
-#define DB_DEFAULT_DBPORT 3306
-#define DB_DEFAULT_DBTABLE "raw"
-#define DB_DEFAULT_DBUSER "netflow"
-#define DB_DEFAULT_DBPWD "netflow"
+#define MYSQL_DB_DEFAULT_DBHOST "localhost"
+#define MYSQL_DB_DEFAULT_DBNAME "netflow"
+#define MYSQL_DB_DEFAULT_DBPORT 3306
+#define MYSQL_DB_DEFAULT_DBTABLE "raw"
+#define MYSQL_DB_DEFAULT_DBUSER "netflow"
+#define MYSQL_DB_DEFAULT_DBPWD "netflow"
 
 #endif /* MYSQL */
 
@@ -64,12 +64,12 @@
 
 #include <libpq-fe.h>
 
-#define DB_DEFAULT_DBHOST "localhost"
-#define DB_DEFAULT_DBNAME "netflow"
-#define DB_DEFAULT_DBPORT "5432"
-#define DB_DEFAULT_DBTABLE "raw"
-#define DB_DEFAULT_DBUSER "netflow"
-#define DB_DEFAULT_DBPWD "netflow"
+#define PGSQL_DB_DEFAULT_DBHOST "localhost"
+#define PGSQL_DB_DEFAULT_DBNAME "netflow"
+#define PGSQL_DB_DEFAULT_DBPORT "5432"
+#define PGSQL_DB_DEFAULT_DBTABLE "raw"
+#define PGSQL_DB_DEFAULT_DBUSER "netflow"
+#define PGSQL_DB_DEFAULT_DBPWD "netflow"
 
 #endif /* PGSQL*/
 
@@ -695,12 +695,12 @@
 
   MYSQL mysql;
 
-  db_host = DB_DEFAULT_DBHOST;
-  db_name = DB_DEFAULT_DBNAME;
-  db_port = DB_DEFAULT_DBPORT;
-  db_user = DB_DEFAULT_DBUSER;
-  db_table = DB_DEFAULT_DBTABLE;
-  db_pwd = DB_DEFAULT_DBPWD;
+  db_host = MYSQL_DB_DEFAULT_DBHOST;
+  db_name = MYSQL_DB_DEFAULT_DBNAME;
+  db_port = MYSQL_DB_DEFAULT_DBPORT;
+  db_user = MYSQL_DB_DEFAULT_DBUSER;
+  db_table = MYSQL_DB_DEFAULT_DBTABLE;
+  db_pwd = MYSQL_DB_DEFAULT_DBPWD;
 
   /* parse URI string */
 
@@ -759,10 +759,6 @@
       strcat (query, values);
       strcat (query, ")");
 
-      if (debug)
-        fprintf(stderr, "field=%s\n val=%s\n query=%s\n", fields, values,
-          query);
-
       if (mysql_real_query(&mysql, query, strlen(query)) != 0) 
         fterr_warnx("mysql_real_query(): %s", mysql_error(&mysql));
 
@@ -872,12 +868,12 @@
   PGconn     *conn;
   PGresult   *res;
 
-  db_host = DB_DEFAULT_DBHOST;
-  db_name = DB_DEFAULT_DBNAME;
-  db_port = DB_DEFAULT_DBPORT;
-  db_user = DB_DEFAULT_DBUSER;
-  db_table = DB_DEFAULT_DBTABLE;
-  db_pwd = DB_DEFAULT_DBPWD;
+  db_host = PGSQL_DB_DEFAULT_DBHOST;
+  db_name = PGSQL_DB_DEFAULT_DBNAME;
+  db_port = PGSQL_DB_DEFAULT_DBPORT;
+  db_user = PGSQL_DB_DEFAULT_DBUSER;
+  db_table = PGSQL_DB_DEFAULT_DBTABLE;
+  db_pwd = PGSQL_DB_DEFAULT_DBPWD;
 
   /* parse URI string */
 
@@ -930,10 +926,6 @@
       strcat (query, values);
       strcat (query, ")");
 
-      if (debug)
-        fprintf(stderr, "field=%s\n val=%s\n query=%s\n", fields, values,
-          query);
-
       res = PQexec(conn, query);
       if (!res || PQresultStatus(res) != PGRES_COMMAND_OK) {
         PQclear(res);
Index: flow-tools-0.68/src/flow-fanout.c
--- flow-tools-0.68/src/flow-fanout.c.orig	2005-05-10 17:52:52 +0200
+++ flow-tools-0.68/src/flow-fanout.c	2005-05-15 19:49:06 +0200
@@ -498,7 +498,7 @@
     /* unicast bind -- multicast support */
     if (bind(ftnet.fd, (struct sockaddr*)&ftnet.loc_addr,
       sizeof(ftnet.loc_addr)) < 0)
-      fterr_err(1, "bind(loc_addr)");
+      fterr_err(1, "bind(%s)", inet_ntoa(ftnet.loc_addr.sin_addr));
 
   } /* not multicast group */
 
@@ -511,7 +511,7 @@
   /* unicast bind -- no multicast support */
   if (bind(ftnet.fd, (struct sockaddr*)&ftnet.loc_addr,
     sizeof(ftnet.loc_addr)) < 0)
-    fterr_err(1, "bind(loc_addr)");
+    fterr_err(1, "bind(%s)", inet_ntoa(ftnet.loc_addr.sin_addr));
 
 #endif /* IP_ADD_MEMBERSHIP */
 
Index: flow-extract/grammar.y
--- flow-extract/grammar.y.orig	2006-11-29 16:55:44 +0100
+++ flow-extract/grammar.y	2006-12-01 14:01:56 +0100
@@ -25,6 +25,9 @@
 #include "timesub.h"
 #include "stdunix.h"
 
+void yyerror(char *msg);
+unsigned long getmask(unsigned long addr);
+
 extern int parse_error;
 #define TCPDATA 6
 #define UDPDATA 17
@@ -1159,15 +1162,15 @@
      { (char *)0, 0 }
      };
 
-int
-yyerror()
+void
+yyerror(char *msg)
 {
-     fprintf(stderr, "\"%s\", line %d: syntax error.\n",
-	     getfilename(), getlinenum());
+     fprintf(stderr, "\"%s\", line %d: syntax error: %s\n",
+	     getfilename(), getlinenum(), msg);
      parse_error = 1;
 }
 
-int
+unsigned long
 getmask(unsigned long addr)
 {
      if(IN_CLASSA(addr))
Index: flow-extract/hosts.c
--- flow-extract/hosts.c.orig	2006-11-28 17:28:54 +0100
+++ flow-extract/hosts.c	2006-12-01 13:56:18 +0100
@@ -23,7 +23,7 @@
 static int hnc_init = 0;
 static unsigned long hit = 0, miss = 0, coll = 0;
 
-sigusr1()
+void sigusr1(int sig)
 {
      printf("Hit/Miss: %lu/%lu, Collisions: %lu\n",
 	    hit, miss,coll);
Index: flow-extract/interp.c
--- flow-extract/interp.c.orig	2006-11-28 18:24:39 +0100
+++ flow-extract/interp.c	2006-12-01 13:56:18 +0100
@@ -108,10 +108,11 @@
                break;
 	  case TIME:
 	       if(!rectime){
+		    time_t t;
                     ftt = ftltime(genrec->sysUpTime, genrec->unix_secs,
                                   genrec->unix_nsecs, genrec->First);
-		    /* tmb = localtime(&ftt.secs); */
-		    tmb = localtime((time_t *)(&ftt.secs));
+		    t = (time_t)ftt.secs;
+		    tmb = localtime(&t);
 		    rectime = tmb->tm_hour*3600 + tmb->tm_min*60 + tmb->tm_sec;
 	       }
 	       return rectime;
Index: flow-extract/timeval.c
--- flow-extract/timeval.c.orig	2006-11-28 19:36:11 +0100
+++ flow-extract/timeval.c	2006-12-01 13:56:18 +0100
@@ -7,8 +7,10 @@
 {
      struct tm *tm;
      static char buf[50];
+     time_t t;
 
-     tm = localtime((time_t *)(&tp.secs));
+     t = (time_t)tp.secs;
+     tm = localtime(&t);
 
      sprintf(buf, "%02d/%02d/%04d %02d:%02d:%02d",
              tm->tm_mon+1,
Index: flow-tools-0.68/lib/ftfile.c
--- flow-tools-0.68/lib/ftfile.c.orig	2003-02-13 03:38:42 +0100
+++ flow-tools-0.68/lib/ftfile.c	2005-07-22 16:42:39 +0200
@@ -417,12 +417,14 @@
   long gmt_val;
   char gmt_sign;
   int tm_gmtoff;
+  time_t t;
   
-  if (!(tm = localtime ((time_t*)&ftime))) {
+  t = (time_t)ftime;
+  if (!(tm = localtime (&t))) {
     snprintf(buf, bsize, ".");
   }
 
-  tm_gmtoff = get_gmtoff(ftime);
+  tm_gmtoff = get_gmtoff(t);
 
   /* compute GMT offset */
   if (tm_gmtoff >= 0) {
@@ -503,6 +505,7 @@
 {
   struct tm *tm;
   char buf[32];
+  time_t t;
 
   /* no directories */
   if (nest == 0)
@@ -512,7 +515,8 @@
   if ((nest > 3) || (nest < -3))
     return -1;
 
-  if (!(tm = localtime ((time_t*)&ftime)))
+  t = (time_t)ftime;
+  if (!(tm = localtime (&t)))
     return -1;
 
   if (nest == -1)
Index: flow-tools-0.68/lib/ftlib.h
--- flow-tools-0.68/lib/ftlib.h.orig	2005-05-10 17:51:33 +0200
+++ flow-tools-0.68/lib/ftlib.h	2006-10-09 09:53:10 +0200
@@ -3026,10 +3026,13 @@
 int ftxfield_parse(char *line, u_int64 *xfields);
 
 #ifndef IN_CLASSD_SSM
-#define IN_CLASSD_SSM(i) (((u_int32_t)(i) & 0xff000000) == 0xe8000000)
+#define IN_CLASSD_SSM(i) (((u_int32)(i) & 0xff000000) == 0xe8000000)
 #endif /* IN_CLASSD_SSM */
 
 /* MACHINE DEPENDANT */
 #define fmt_uint fmt_uint32
 
+/* workaround GCC 4.0 "lvalue" constraints */
+#define CPTR_ADD(ptr,add) { char *_cp = (char *)(ptr); _cp += (add); (ptr) = _cp; }
+
 #endif /* FTLIB_H */

Index: flow-tools-0.68/lib/ftio.c
--- flow-tools-0.68/lib/ftio.c.orig	2003-02-24 01:51:47 +0100
+++ flow-tools-0.68/lib/ftio.c	2005-09-27 14:37:18 +0200
@@ -2267,7 +2267,7 @@
         break;
 
       nleft -= nread;
-      (char*)ptr += nread;
+      CPTR_ADD(ptr, nread)
   }
   return (nbytes - nleft);
 } /* readn */
@@ -2292,7 +2292,7 @@
       return(nwritten); /* error */
 
     nleft -= nwritten;
-    (char*)ptr += nwritten;
+    CPTR_ADD(ptr, nwritten)
   }
   return(nbytes - nleft);
 } /* writen */
Index: flow-tools-0.68/lib/fttlv.c
--- flow-tools-0.68/lib/fttlv.c.orig	2003-02-13 03:38:43 +0100
+++ flow-tools-0.68/lib/fttlv.c	2005-09-27 14:35:25 +0200
@@ -68,10 +68,10 @@
   }
 
   bcopy(&t, buf, 2);
-  (char*)buf+= 2;
+  CPTR_ADD(buf, 2);
 
   bcopy(&len, buf, 2);
-  (char*)buf+= 2;
+  CPTR_ADD(buf, 2);
 
   bcopy(&v, buf, 4);
 
@@ -107,10 +107,10 @@
   }
 
   bcopy(&t, buf, 2);
-  (char*)buf+= 2;
+  CPTR_ADD(buf, 2);
 
   bcopy(&len, buf, 2);
-  (char*)buf+= 2;
+  CPTR_ADD(buf, 2);
 
   bcopy(&v, buf, 2);
 
@@ -145,10 +145,10 @@
   }
 
   bcopy(&t, buf, 2);
-  (char*)buf+= 2;
+  CPTR_ADD(buf, 2);
 
   bcopy(&len, buf, 2);
-  (char*)buf+= 2;
+  CPTR_ADD(buf, 2);
 
   bcopy(&v, buf, 1);
 
@@ -183,10 +183,10 @@
   }
 
   bcopy(&t, buf, 2);
-  (char*)buf+= 2;
+  CPTR_ADD(buf, 2);
 
   bcopy(&len, buf, 2);
-  (char*)buf+= 2;
+  CPTR_ADD(buf, 2);
 
   bcopy(v, buf, len);
 
@@ -230,16 +230,16 @@
     return -1;
 
   bcopy(&t, buf, 2);
-  (char*)buf+= 2;
+  CPTR_ADD(buf, 2);
 
   bcopy(&len, buf, 2);
-  (char*)buf+= 2;
+  CPTR_ADD(buf, 2);
 
   bcopy(&ip, buf, 4);
-  (char*)buf += 4;
+  CPTR_ADD(buf, 4);
 
   bcopy(&ifIndex, buf, 2);
-  (char*)buf += 2;
+  CPTR_ADD(buf, 2);
 
   bcopy(name, buf, n);
 
@@ -287,19 +287,19 @@
   }
 
   bcopy(&t, buf, 2);
-  (char*)buf+= 2;
+  CPTR_ADD(buf, 2);
 
   bcopy(&len, buf, 2);
-  (char*)buf+= 2;
+  CPTR_ADD(buf, 2);
 
   bcopy(&ip, buf, 4);
-  (char*)buf += 4;
+  CPTR_ADD(buf, 4);
 
   bcopy(&entries, buf, 2);
-  (char*)buf += 2;
+  CPTR_ADD(buf, 2);
 
   bcopy(ifIndex_list, buf, esize);
-  (char*)buf += esize;
+  CPTR_ADD(buf, esize);
 
   bcopy(name, buf, n);
 
Index: flow-tools-0.68/lib/ftchash.c
--- flow-tools-0.68/lib/ftchash.c.orig	2003-08-12 20:04:25 +0200
+++ flow-tools-0.68/lib/ftchash.c	2005-09-27 14:35:52 +0200
@@ -326,7 +326,7 @@
       (char*)ftch->traverse_chunk->base+ftch->traverse_chunk->next) {
 
       ret = ftch->traverse_rec;
-      (char*)ftch->traverse_rec += ftch->d_size;
+      CPTR_ADD(ftch->traverse_rec, ftch->d_size);
       return ret;
 
     } else {
Index: flow-tools-0.68/lib/ftxlate.c
--- flow-tools-0.68/lib/ftxlate.c.orig	2005-05-11 16:03:30.000000000 +0200
+++ flow-tools-0.68/lib/ftxlate.c	2005-10-14 11:30:05.597516466 +0200
@@ -66,15 +66,15 @@
 #endif
 
 struct cryptopan {
-  u_int8_t m_key[16]; /* 128 bit secret key */
-  u_int8_t m_pad[16]; /* 128 bit secret pad */
+  u_int8 m_key[16]; /* 128 bit secret key */
+  u_int8 m_pad[16]; /* 128 bit secret pad */
 #ifdef HAVE_OPENSSL
   EVP_CIPHER_CTX *cipher_ctx; /* openssl cipher context */
 #endif /* HAVE_OPENSSL */
 };
 
-static int cryptopan_anon(struct cryptopan *cp, u_int32_t orig_addr,
-  u_int32_t *new_addr);
+static int cryptopan_anon(struct cryptopan *cp, u_int32 orig_addr,
+  u_int32 *new_addr);
 static int cryptopan_free(struct cryptopan *cp);
 static int cryptopan_init(struct cryptopan *cp, unsigned char *key);
 
@@ -2095,12 +2095,12 @@
  * returns: 0 okay
  *         -1 fail
  */
-static int cryptopan_anon(struct cryptopan *cp, u_int32_t orig_addr, u_int32_t *new_addr)
+static int cryptopan_anon(struct cryptopan *cp, u_int32 orig_addr, u_int32 *new_addr)
 {
-  u_int8_t rin_output[16];
-  u_int8_t rin_input[16];
-  u_int8_t *m_pad;
-  u_int32_t result, first4bytes_pad, first4bytes_input;
+  u_int8 rin_output[16];
+  u_int8 rin_input[16];
+  u_int8 *m_pad;
+  u_int32 result, first4bytes_pad, first4bytes_input;
   int i, pos;
 
   result = 0;
@@ -2108,10 +2108,10 @@
 
   bcopy(m_pad, rin_input, 16);
 
-  first4bytes_pad = (((u_int32_t) m_pad[0]) << 24) +
-                    (((u_int32_t) m_pad[1]) << 16) +
-                    (((u_int32_t) m_pad[2]) << 8) +
-                    (u_int32_t) m_pad[3]; 
+  first4bytes_pad = (((u_int32) m_pad[0]) << 24) +
+                    (((u_int32) m_pad[1]) << 16) +
+                    (((u_int32) m_pad[2]) << 8) +
+                    (u_int32) m_pad[3]; 
 
   /*
    * For each prefixes with length from 0 to 31, generate a bit using the
@@ -2134,10 +2134,10 @@
       first4bytes_input = ((orig_addr >> (32-pos)) << (32-pos)) |
         ((first4bytes_pad<<pos) >> pos);
 
-    rin_input[0] = (u_int8_t) (first4bytes_input >> 24);
-    rin_input[1] = (u_int8_t) ((first4bytes_input << 8) >> 24);
-    rin_input[2] = (u_int8_t) ((first4bytes_input << 16) >> 24);
-    rin_input[3] = (u_int8_t) ((first4bytes_input << 24) >> 24);
+    rin_input[0] = (u_int8) (first4bytes_input >> 24);
+    rin_input[1] = (u_int8) ((first4bytes_input << 8) >> 24);
+    rin_input[2] = (u_int8) ((first4bytes_input << 16) >> 24);
+    rin_input[3] = (u_int8) ((first4bytes_input << 24) >> 24);
 
     /*
      * Encryption: The Rijndael cipher is used as pseudorandom function.
