Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arne Øslebø
mapi
Commits
898e73c5
Commit
898e73c5
authored
Aug 31, 2006
by
Browse files
Fixed some more warnings...
git-svn-id:
file:///home/svn/mapi/trunk@868
8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent
79f336c3
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/ipfixflib/ipfixprobe.c
View file @
898e73c5
...
...
@@ -44,7 +44,7 @@ static struct {
}
rec_types
[]
=
{
{
"IPFIX"
,
rec_type_ipfix
},
{
"NETFLOW_V5"
,
rec_type_nf_v5
},
{
"NETFLOW_V9"
,
rec_type_nf_v9
}
,
{
"NETFLOW_V9"
,
rec_type_nf_v9
}
};
...
...
@@ -60,9 +60,8 @@ ifp_instance(mapidflib_function_instance_t *instance,
return 0;
};*/
static
int
ifp_init
(
mapidflib_function_instance_t
*
fi
,
MAPI_UNUSED
flist_t
*
flist
)
static
int
ifp_init
(
mapidflib_function_instance_t
*
fi
,
MAPI_UNUSED
int
fd
)
{
ifp_t
*
ifp
;
ifp_idata_t
*
idata
;
...
...
@@ -164,8 +163,8 @@ ifp_write_shm(const void *ctxt, const void *buffer, u_int32_t buf_len)
static
int
ifp_process
(
mapidflib_function_instance_t
*
instance
,
MAPI_UNUSED
const
unsigned
char
*
dev_pkt
,
const
unsigned
char
*
link_pkt
,
MAPI_UNUSED
unsigned
char
*
dev_pkt
,
unsigned
char
*
link_pkt
,
mapid_pkthdr_t
*
pkt_head
)
{
nprobeProcessPacket
(((
ifp_idata_t
*
)
instance
->
internal_data
)
->
npctxt
,
...
...
src/ipfixflib/npctxt.h
View file @
898e73c5
...
...
@@ -198,7 +198,7 @@ typedef struct ipV4Fragment {
#define TEMPLATE_LIST_LEN 45
typedef
struct
{
typedef
struct
np_ctxt_t
{
void
*
mapi_ctxt
;
/* MAPI shared memory context */
pthread_t
dequeueThread
;
pthread_t
walkHashThread
;
...
...
src/ipfixflib/npktproc.c
View file @
898e73c5
...
...
@@ -352,7 +352,7 @@ nprobeProcessPacket(void *ctxt, mapid_pkthdr_t *pkt_head, const void *pkt)
if
(
MSS
==
-
1
)
sprintf
(
_MSS
,
"_MSS"
);
else
snprintf
(
_MSS
,
sizeof
(
_MSS
),
"%04X"
,
MSS
);
snprintf
(
fingerprint
,
sizeof
(
fingerprint
),
snprintf
(
(
char
*
)
fingerprint
,
sizeof
(
fingerprint
),
"%04X%s%02X%s%d%d%d%d%c%02X"
,
tcpWindowSize
,
_MSS
,
(
int
)
ttlPredictor
(
ip
.
ip_ttl
),
WSS
,
S
,
N
,
D
,
T
,
(
tp
.
th_flags
&
TH_ACK
)
?
'A'
:
'S'
,
tcpUdpLen
);
...
...
src/ipfixflib/nprobe.c
View file @
898e73c5
...
...
@@ -961,7 +961,7 @@ exportBucketToNetflowV9(np_ctxt_t *npctxt, HashBucket *myBucket,
if
(
myBucket
->
pktRcvd
==
0
)
return
(
0
);
/* Nothing to export */
}
flowPrintf
(
npctxt
,
npctxt
->
v9TemplateList
,
npctxt
->
npBuffer
,
&
flowBufBegin
,
&
flowBufMax
,
flowPrintf
(
npctxt
,
npctxt
->
v9TemplateList
,
(
char
*
)
npctxt
->
npBuffer
,
&
flowBufBegin
,
&
flowBufMax
,
&
numElements
,
0
,
myBucket
,
direction
,
0
);
npctxt
->
bufferLen
=
flowBufBegin
;
...
...
@@ -995,7 +995,7 @@ exportBucketToNetflow(np_ctxt_t *npctxt, HashBucket *myBucket, int direction)
if
(
rc
)
{
if
(
npctxt
->
traceMode
)
printFlow
(
npctxt
,
myBucket
,
direction
);
if
(
npctxt
->
flowFd
&&
npctxt
->
textFormat
)
nprintf
(
npctxt
->
flowFd
,
npctxt
->
textFormat
,
myBucket
,
direction
);
nprintf
(
npctxt
->
flowFd
,
(
char
*
)
npctxt
->
textFormat
,
myBucket
,
direction
);
npctxt
->
numFlows
++
,
npctxt
->
totFlows
++
,
npctxt
->
flowSequence
++
;
checkNetFlowExport
(
npctxt
,
0
);
...
...
@@ -1052,7 +1052,7 @@ exportBucketTonFlow(np_ctxt_t *npctxt, HashBucket *myBucket, int direction)
if
(
npctxt
->
traceMode
)
printFlow
(
npctxt
,
myBucket
,
direction
);
if
(
npctxt
->
flowFd
&&
npctxt
->
textFormat
)
nprintf
(
npctxt
->
flowFd
,
npctxt
->
textFormat
,
myBucket
,
direction
);
nprintf
(
npctxt
->
flowFd
,
(
char
*
)
npctxt
->
textFormat
,
myBucket
,
direction
);
npctxt
->
numFlows
++
,
npctxt
->
totFlows
++
,
npctxt
->
flowSequence
++
;
checknFlowExport
(
npctxt
,
0
);
...
...
src/ipfixflib/services.c
View file @
898e73c5
#include <mapi.h>
#include "debug.h"
#include "nprobe.h"
#include "nprobe-priv.h"
...
...
@@ -24,7 +26,7 @@ char *torrent_strings[TOR_STRINGS_NUM]=
int
torrent_lens
[
TOR_STRINGS_NUM
]
=
{
20
,
100
,
100
,
20
,
20
,
50
,
50
,
50
,
50
,
50
,
50
,
50
,
50
,
50
};
int
isDc
(
np_ctxt_t
*
npctxt
,
unsigned
char
*
pkt
,
unsigned
int
len
,
u_short
sport
,
u_short
dport
)
int
isDc
(
np_ctxt_t
*
npctxt
,
unsigned
char
*
pkt
,
unsigned
int
len
,
MAPI_UNUSED
u_short
sport
,
MAPI_UNUSED
u_short
dport
)
{
int
i
;
...
...
@@ -43,7 +45,7 @@ int isDc(np_ctxt_t *npctxt, unsigned char *pkt, unsigned int len, u_short sport,
continue
;
if
(
len
>=
100
)
{
if
(
mSearch
((
unsigned
char
*
)(
pkt
),
100
,
dc_strings
[
i
],
strlen
(
dc_strings
[
i
]),
if
(
mSearch
((
char
*
)(
pkt
),
100
,
dc_strings
[
i
],
strlen
(
dc_strings
[
i
]),
npctxt
->
service_dc
->
skip
[
i
],
npctxt
->
service_dc
->
shift
[
i
]))
{
...
...
@@ -51,7 +53,7 @@ int isDc(np_ctxt_t *npctxt, unsigned char *pkt, unsigned int len, u_short sport,
}
}
else
{
if
(
mSearch
((
unsigned
char
*
)(
pkt
),
len
,
dc_strings
[
i
],
strlen
(
dc_strings
[
i
]),
if
(
mSearch
((
char
*
)(
pkt
),
len
,
dc_strings
[
i
],
strlen
(
dc_strings
[
i
]),
npctxt
->
service_dc
->
skip
[
i
],
npctxt
->
service_dc
->
shift
[
i
]))
{
...
...
@@ -84,7 +86,7 @@ int isTorrent(np_ctxt_t *npctxt, unsigned char *pkt, unsigned int len, u_short s
}
}
if
(
len
>
torrent_lens
[
0
]
&&
pkt
[
0
]
==
19
&&
(
memcmp
(
&
pkt
[
1
],
torrent_strings
[
0
],
19
)
==
0
))
if
(
(
int
)
len
>
torrent_lens
[
0
]
&&
pkt
[
0
]
==
19
&&
(
memcmp
(
&
pkt
[
1
],
torrent_strings
[
0
],
19
)
==
0
))
return
0
;
for
(
i
=
1
;
i
<
TOR_STRINGS_NUM
;
i
++
)
{
...
...
@@ -92,14 +94,14 @@ int isTorrent(np_ctxt_t *npctxt, unsigned char *pkt, unsigned int len, u_short s
continue
;
if
(
npctxt
->
service_torrent
->
search_len
[
i
]
>
len
)
{
if
(
mSearch
((
unsigned
char
*
)(
pkt
),
len
,
torrent_strings
[
i
],
strlen
(
torrent_strings
[
i
]),
if
(
mSearch
((
char
*
)(
pkt
),
len
,
torrent_strings
[
i
],
strlen
(
torrent_strings
[
i
]),
npctxt
->
service_torrent
->
skip
[
i
],
npctxt
->
service_torrent
->
shift
[
i
]))
{
return
i
;
}
}
else
{
if
(
mSearch
((
unsigned
char
*
)(
pkt
),
npctxt
->
service_torrent
->
search_len
[
i
],
torrent_strings
[
i
],
strlen
(
torrent_strings
[
i
]),
if
(
mSearch
((
char
*
)(
pkt
),
npctxt
->
service_torrent
->
search_len
[
i
],
torrent_strings
[
i
],
strlen
(
torrent_strings
[
i
]),
npctxt
->
service_torrent
->
skip
[
i
],
npctxt
->
service_torrent
->
shift
[
i
])){
return
i
;
...
...
@@ -113,7 +115,7 @@ int isTorrent(np_ctxt_t *npctxt, unsigned char *pkt, unsigned int len, u_short s
int
serviceClassification
(
struct
np_ctxt_t
*
npctxt
,
u_short
proto
,
u_short
sport
,
int
serviceClassification
(
struct
np_ctxt_t
*
npctxt
,
MAPI_UNUSED
u_short
proto
,
u_short
sport
,
u_short
dport
,
u_char
*
payload
,
int
payloadLen
)
{
if
(
isDc
((
np_ctxt_t
*
)
npctxt
,
payload
,
payloadLen
,
sport
,
dport
)
>=
0
)
return
1
;
...
...
src/ipfixflib/util.c
View file @
898e73c5
...
...
@@ -1575,7 +1575,7 @@ void flowPrintf(np_ctxt_t *npctxt, V9TemplateId **templateList,
while
(
templateList
[
idx
]
!=
NULL
)
{
handleTemplate
(
npctxt
,
templateList
[
idx
],
outBuffer
,
outBufferBegin
,
outBufferMax
,
outBuffer
,
(
unsigned
int
*
)
outBufferBegin
,
(
unsigned
int
*
)
outBufferMax
,
buildTemplate
,
numElements
,
theFlow
,
direction
,
addTypeLen
);
idx
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment