Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/pktsize.c | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/src/pktsize.c b/src/pktsize.c
index e182bd4..41d180a 100644
--- a/src/pktsize.c
+++ b/src/pktsize.c
@@ -171,12 +171,8 @@ void packet_size_breakdown(struct OPTIONS *options, char *ifname,
int ch;
- char buf[MAX_PACKET_SIZE];
- int br;
- char *ipacket;
unsigned int mtu;
- struct sockaddr_ll fromaddr;
int pkt_result;
struct timeval tv;
@@ -279,6 +275,8 @@ void packet_size_breakdown(struct OPTIONS *options, char *ifname,
goto err_close;
}
+ PACKET_INIT(pkt);
+
do {
gettimeofday(&tv, NULL);
now = tv.tv_sec;
@@ -309,7 +307,7 @@ void packet_size_breakdown(struct OPTIONS *options, char *ifname,
&& (((now - starttime) / 60) >= facilitytime))
exitloop = 1;
- getpacket(fd, buf, &fromaddr, &ch, &br, win);
+ packet_get(fd, &pkt, &ch, win);
if (ch != ERR) {
switch (ch) {
@@ -327,17 +325,16 @@ void packet_size_breakdown(struct OPTIONS *options, char *ifname,
exitloop = 1;
}
}
- if (br > 0) {
+ if (pkt.pkt_len > 0) {
pkt_result =
- processpacket(buf, &ipacket, (unsigned int *) &br,
- NULL, NULL, NULL, &fromaddr,
+ packet_process(&pkt, NULL, NULL, NULL,
ofilter,
MATCH_OPPOSITE_USECONFIG, 0);
if (pkt_result != PACKET_OK)
continue;
- update_size_distrib(br, brackets, interval, win);
+ update_size_distrib(pkt.pkt_len, brackets, interval, win);
}
} while (!exitloop);
--
1.7.8.4