1

Possible Duplicate:
Solaris: Programmatic interface to ifconfig?

How do I get the list of all "/dev/net0 /dev/bge0, Network Interface device file", using C program.

Community
  • 1
  • 1
Manya K
  • 33
  • 2
  • Not really. Both are different by all means. May be I will get something better than this to get all the files listed. – Manya K Nov 29 '12 at 12:55
  • 1
    If you're looking for network interfaces, the only sensible way is to actually ask the operating system -- if you THEN want the files, from the interface info you can CONSTRUCT the filename. Otherwise you'll never know if your list is complete. – Volker Stolz Nov 29 '12 at 13:23

1 Answers1

0

Do I understand you correctly, you need all presented network devices files in /dev? Then just run

ls /dev/net* /dev/bge*

and parse results.

Oleksandr Kravchuk
  • 5,963
  • 1
  • 20
  • 31