Autore: Isaac Dunham Data: To: tilt! CC: dng Oggetto: Re: [DNG] netman GIT project
On Wed, Aug 26, 2015 at 02:27:57PM +0200, tilt! wrote: > On 08/26/2015 01:36 PM, Irrwahn wrote:
> >[...]
> >Or, even better, you could easily pass the IF name as an additional
> >parameter to the backend (and possily even use it as additional component
> >to construct the interface file names).
>
> An easy way to obtain a list of interface names on Linux is:
>
> awk 'NR>2{gsub(/:/,"");print $1}' /proc/net/dev
Or "ls /sys/class/net".
For listing non-loopback devices only, use
ls -d /sys/class/net/*/device | cut -d/ -f5
For wireless, check for the files "phy80211" or "wireless".
The equivalent can be done trivially in C with readdir(); ask if you'd like
an example.