1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
$NetBSD: patch-ak,v 1.2 2005/02/18 10:08:33 seb Exp $
--- src/flow-export.c.orig 2003-12-04 05:55:31.000000000 +0000
+++ src/flow-export.c
@@ -115,18 +115,18 @@ void usage(void);
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]);
- debug = 0;
format_index = 0;
bzero(&opt, sizeof opt);
ascii_mask = 0;
@@ -864,7 +864,7 @@ int format5(struct ftio *ftio, struct op
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_host, *db_name, *db_table, *db_user, *db_pwd, *tmp;
char *db_port;
int len;
@@ -891,7 +891,7 @@ int format5(struct ftio *ftio, struct op
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_name || !db_table) {
fterr_warnx("Missing field in dbaseURI, expecting user:pwd:host:port:name:table.");
return -1;
}
@@ -1199,10 +1199,10 @@ int fmt_xfields_val(char *fmt_buf, char
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 @@ int fmt_xfields_val(char *fmt_buf, char
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 @@ int fmt_xfields_val(char *fmt_buf, char
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;
}
|