tcpdump mailing list archives

TODO


From: "Rodrigo Roldan" <roldyx () gmail com>
Date: Thu, 16 Oct 2008 10:00:08 -0300

I need include the device interface when I run "tcpdump -i any" for example:
#tcpdump -i any
eth0 09:55:30.559977 IP 10.30.65.66.netbios-ns > 10.30.65.255.netbios-ns:
NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST
ppp0 09:55:30.572739 IP satan.pepe.com.ar.54026 > ns1int.pepe.com.ar.domain:
15547+ PTR? 255.65.30.10.in-addr.arpa. (43)

Thanks.. I m trying developer it but I cant do it...
pcap_read_packet(pcap_t *handle, pcap_handler callback, u_char *userdata)
{
.........
........
       if (packet_len == -1) {
                if (errno == EAGAIN)
                        return 0;       /* no packet there */
                else {
                        snprintf(handle->errbuf, sizeof(handle->errbuf),
                                 "recvfrom: %s", pcap_strerror(errno));
                        return -1;
                }
        }
####MY CODE####
      {
               struct sockaddr_ll *pinfo;

               char *ifname[200];
               //printf("\n hola ifname=&s",ifname);
               pinfo = (struct sockaddr_ll *)bp;

               if_indextoname(ntohl(pinfo->sll_ifindex), *ifname);

               printf("\niface index = %u, name = %s \n",
ntohl(pinfo->sll_ifindex), ifname);

       }
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: