Vitezslav Samel <vitezslav(a)samel.cz> writes:
Since we have struct sockaddr_ll in struct pkt_hdr now,
remove pkt_ifindex, pkt_hatype and pkt_pkttype members from
struct pkt_hdr and modify all their uses.
Leave pkt_protocol untouched, because it caches the protocol
number in host order (no need for another htons()/ntohs() in other
code).
Also remove pkt_halen and pkt_addr members, they are unused.
Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/detstats.c | 4 ++--
src/hostmon.c | 12 ++++++------
src/ifstats.c | 2 +-
src/itrafmon.c | 6 +++---
src/othptab.c | 6 +++---
src/packet.c | 5 +----
src/packet.h | 5 -----
7 files changed, 16 insertions(+), 24 deletions(-)
diff --git a/src/itrafmon.c b/src/itrafmon.c
index 2400e60..37c3229 100644
--- a/src/itrafmon.c
+++ b/src/itrafmon.c
@@ -964,7 +964,7 @@ void ipmon(time_t facilitytime, char *ifptr)
/* we're capturing on "All interfaces", */
/* so get the name of the interface */
/* of this packet */
- int r = dev_get_ifname(pkt.pkt_ifindex, ifnamebuf);
+ int r = dev_get_ifname(pkt.from->sll_ifindex, ifnamebuf);
if (r != 0) {
write_error("Unable to get interface name");
break; /* error getting interface name, get out! */
@@ -1052,13 +1052,13 @@ void ipmon(time_t facilitytime, char *ifptr)
if (pkt.iphdr)
updateentry(&table, tcpentry, transpacket,
- pkt.pkt_buf, pkt.pkt_hatype,
+ pkt.pkt_buf, pkt.from->sll_hatype,
pkt.pkt_len, br, pkt.iphdr->frag_off,
logging, &revlook, rvnfd,
logfile);
else
updateentry(&table, tcpentry, transpacket,
- pkt.pkt_buf, pkt.pkt_hatype,
+ pkt.pkt_buf, pkt.from->sll_hatype,
pkt.pkt_len, pkt.pkt_len, 0, logging,
&revlook, rvnfd,
logfile);
updateentry() new has quite a lot of members of pkt. Marking that to my
TODO list to just pass pkt pointer instead of opening struct.
--
Nikola