Re: network device driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 14 Oct 2001, Mehta, Phoram Kirtikumar (UMKC-Student) wrote:

> 1. how does ifconfig and netstat get teh net statistics, where can i get
> the source to that funtion or source file.

They are from /proc/net/.

> 2. is there any funtion in the network device driver source by accessing
> which i can get the packets received or the type of packets. if not can
> anybody gimme some tips on how can i write it.

You can use a packet filter.

> i am trying to write or modify the eth device driver(3c509.c) in such a
> way that i can statistics of the traffic and then i also want to
> identify teh traffic. in short i want to incorporate a function in my
> driver which when acceseed would act as a sniffer/protocol analyzer .
> any help or advise will be appreciated.

Do it in userspace with packet filters. Look at tcpdump for example 
code.

Rasmus

-- 
-- [ Rasmus 'Møffe' Bøg Hansen ] ---------------------------------------
[...] Note that 120 sec is defined in the protocol as the maximum
possible RTT.  I guess we'll have to use something other than TCP
to talk to the University of Mars.
--------------------------------- [ moffe at amagerkollegiet dot dk ] --

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux