Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Oct 2004 16:10:19 GMT
From:      "Yuri Y. Bushmelev" <jay-dev@simcom.ru>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/73285: flow-tools port improvements
Message-ID:  <200410291610.i9TGAJbm070123@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/73285; it has been noted by GNATS.

From: "Yuri Y. Bushmelev" <jay-dev@simcom.ru>
To: freebsd-gnats-submit@FreeBSD.org, jay-dev@simcom.ru
Cc:  
Subject: Re: ports/73285: flow-tools port improvements
Date: Fri, 29 Oct 2004 20:02:27 +0400

 Hmm... flow-tools postgresql support seems more buggy..
 
 I rewrite first and last patches:
 
 ====== /usr/ports/net-mgmt/flow-tools/Makefile patch ======
 --- Makefile.orig       Fri Oct 29 16:08:11 2004
 +++ Makefile    Fri Oct 29 19:55:35 2004
 @@ -25,6 +25,18 @@
         flow-tag.1 flow-tools.1 flow-tools-examples.1           \
         flow-xlate.1
 
 +.if defined(WITH_PGSQL)
 +CONFIGURE_ARGS+=       --with-pgsql=${PREFIX}
 +POSTGRESQL_PORT?=      databases/postgresql7
 +LIB_DEPENDS=           pq.3:${PORTSDIR}/${POSTGRESQL_PORT}
 +.endif
 +
 +.if defined(WITH_MYSQL)
 +CONFIGURE_ARGS+=       --with-mysql=${PREFIX}
 +USE_MYSQL=             yes
 +DEFAULT_MYSQL_VER=     323
 +.endif
 +
  post-patch:
         ${TOUCH} -r ${WRKSRC}/configure.in.orig ${WRKSRC}/configure.in
         ${REINPLACE_CMD}\
 ====== end of patch ======
 
 
 ====== /usr/ports/net-mgmt/flow-tools/files/patch-flow-export.c patch ======
 --- flow-export.c.orig	Fri Oct 29 19:27:49 2004
 +++ flow-export.c	Fri Oct 29 19:31:02 2004
 @@ -115,13 +115,14 @@
  struct jump format[] = {{format0}, {format1}, {format2}, {format3},
                          {format4}, {format5}};
  
 +int debug=0;
 +
  int main(int argc, char **argv)
  {
    int i, format_index, ret, ascii_mask;
    struct ftio ftio;
    struct ftprof ftp;
    struct options opt;
 -  int debug;
  
    /* init fterr */
    fterr_setid(argv[0]);
 @@ -864,8 +865,7 @@
    struct ftver ftv;
    char fields[1024], values[1024], query[3*1024];
    char *rec;
 -  char *db_host, *db_name, *db_table, *db_user, *db_pwd, *db_tmp, *tmp;
 -  char *db_port;
 +  char *db_host, *db_name, *db_table, *db_user, *db_pwd, *db_port, *tmp;
    int len;
  
    PGconn     *conn;
 @@ -891,7 +891,7 @@
      db_name = strsep(&tmp, ":");
      db_table = strsep(&tmp, ":");
  
 -    if (!db_user || !db_pwd || !db_host || !db_tmp || !db_name || !db_table) {
 +    if (!db_user || !db_pwd || !db_host || !db_port || !db_name || !db_table) {
        fterr_warnx("Missing field in dbaseURI, expecting user:pwd:host:port:name:table.");
        return -1;
      }
 @@ -1199,10 +1199,10 @@
  
    if (xfields & FT_XFIELD_EXADDR) {
      if (comma) fmt_buf[len++] = ',';
 -    if (quote) fmt_buf[len++] = '"';
 +    if (quote) fmt_buf[len++] = '\'';
      len += fmt_ipv4(fmt_buf+len, *((u_int32*)(rec+fo->exaddr)),
        FMT_JUST_LEFT);
 -    if (quote) fmt_buf[len++] = '"';
 +    if (quote) fmt_buf[len++] = '\'';
      comma = 1;
    }
  
 @@ -1257,28 +1257,28 @@
  
    if (xfields & FT_XFIELD_SRCADDR) {
      if (comma) fmt_buf[len++] = ',';
 -    if (quote) fmt_buf[len++] = '"';
 +    if (quote) fmt_buf[len++] = '\'';
      len += fmt_ipv4(fmt_buf+len, *((u_int32*)(rec+fo->srcaddr)),
        FMT_JUST_LEFT);
 -    if (quote) fmt_buf[len++] = '"';
 +    if (quote) fmt_buf[len++] = '\'';
      comma = 1;
    }
  
    if (xfields & FT_XFIELD_DSTADDR) {
      if (comma) fmt_buf[len++] = ',';
 -    if (quote) fmt_buf[len++] = '"';
 +    if (quote) fmt_buf[len++] = '\'';
      len += fmt_ipv4(fmt_buf+len, *((u_int32*)(rec+fo->dstaddr)),
        FMT_JUST_LEFT);
 -    if (quote) fmt_buf[len++] = '"';
 +    if (quote) fmt_buf[len++] = '\'';
      comma = 1;
    }
  
    if (xfields & FT_XFIELD_NEXTHOP) {
      if (comma) fmt_buf[len++] = ',';
 -    if (quote) fmt_buf[len++] = '"';
 +    if (quote) fmt_buf[len++] = '\'';
      len += fmt_ipv4(fmt_buf+len, *((u_int32*)(rec+fo->nexthop)),
        FMT_JUST_LEFT);
 -    if (quote) fmt_buf[len++] = '"';
 +    if (quote) fmt_buf[len++] = '\'';
      comma = 1;
    }
  
 @@ -1375,19 +1375,19 @@
  
    if (xfields & FT_XFIELD_PEER_NEXTHOP) {
      if (comma) fmt_buf[len++] = ',';
 -    if (quote) fmt_buf[len++] = '"';
 +    if (quote) fmt_buf[len++] = '\'';
      len += fmt_ipv4(fmt_buf+len, *((u_int32*)(rec+fo->peer_nexthop)),
        FMT_JUST_LEFT);
 -    if (quote) fmt_buf[len++] = '"';
 +    if (quote) fmt_buf[len++] = '\'';
      comma = 1;
    }
  
    if (xfields & FT_XFIELD_ROUTER_SC) {
      if (comma) fmt_buf[len++] = ',';
 -    if (quote) fmt_buf[len++] = '"';
 +    if (quote) fmt_buf[len++] = '\'';
      len += fmt_ipv4(fmt_buf+len, *((u_int32*)(rec+fo->router_sc)),
        FMT_JUST_LEFT);
 -    if (quote) fmt_buf[len++] = '"';
 +    if (quote) fmt_buf[len++] = '\'';
      comma = 1;
    }
 ====== end of patch ======
 
 -- 
 WBR, Jay



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200410291610.i9TGAJbm070123>