Right now on every received packet we get the interface name
on which it arrived. This is not needed and is slow.
Make use of ifindex and retrieve interface name only when needed
(when capturing on "All interfaces").
v3:
- use c99 initializers (mixed with code)
- don't check return value from close()
v2:
- hostmon(): bugfix: ifname --> ifnamebuf
- get rid of passing buffer space (must be always at least IFNAMSIZ)
- C style fixes
- always check for errors from system/library calls (socket(), ioctl(), ...)
v1:
- initial version
Vitezslav Samel (2):
get the interface name only when needed
remove unused params from getpacket() and processpacket()
src/hostmon.c | 20 ++++++++++++++--
src/ifaces.c | 50 ++++++++++++++++++++++++++++++++++++++++++
src/ifaces.h | 2 +
src/ifstats.c | 66 ++++++++++++++++++++++++++++---------------------------
src/ifstats.h | 1 +
src/itrafmon.c | 20 ++++++++++++++--
src/packet.c | 16 +------------
src/packet.h | 4 +-
src/pktsize.c | 6 +---
src/serv.c | 5 +--
10 files changed, 129 insertions(+), 61 deletions(-)
--
1.7.8.4