Hi :)
Sorry, I really forgot to attach patch :(
Now everything must be Ok :)
Mike Hunter wrote:
On Mar 24 at 13:30, "Artem Hodlevskyy" wrote:
Thank you, Vivek, you put me to the right way :)
So, some digging in source code gives me idea look to the
ftlib.h, where i found everything what i need.
Later, when I try to get flow-export working with PostgreSQL, I
found several mistakes in functions format5() and fmt_xfields_val().
In format5() was a mistake in pointer name (db_tmp instead of
db_port).
In fmt_xfields_val() some values for SQL request was ?quoted?
with (") symbol, but must be with ('). If in requst use (') MySQL
will work too.
So I made patch for flow-export.c, look in attachment.
Unfortunately there was no attachment. Can you send it again or put the
patch in the body of the message?
Now export to PostgreSQL working :)
Congrats!
And some questions:
Can I hope that this cahnges will be conformed to release?
Are you have Bugzilla, CVS or SVN ? I think that this tools will
make life match better for developers and users :)
I don't think there is a public cvs or bugzilla, everything goes through
the author, but he is slow to respond lately.
Sorry for poor English, studying...
Everything you said was understood so I think you're doing great :) And
it's much better than my Ukrainian :) I hope all the political stuff
there works out ok.
Mike
--
Artem Hodlevskyy , LCA
E-mail: [EMAIL PROTECTED]
Web: http://lca.lviv.ua/
--- src/flow-tools-0.68/src/flow-export.c 2004-03-31 06:11:14.000000000 +0300
+++ flow-export.c 2006-03-24 13:18:15.000000000 +0200
@@ -892,7 +892,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;
}
@@ -1200,10 +1200,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;
}
@@ -1258,28 +1258,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;
}
@@ -1376,19 +1376,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;
}
_______________________________________________
Flow-tools mailing list
[EMAIL PROTECTED]
http://mailman.splintered.net/mailman/listinfo/flow-tools