![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems . |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| interface may off | fredginting | SUN Solaris | 7 | 05-22-2008 06:50 AM |
| how i prepare a c++ code(c code) for implementing my own protocol format | amitpansuria | High Level Programming | 1 | 09-06-2007 08:09 PM |
| Network interface Qfe, ce, bge ... | unclefab | SUN Solaris | 1 | 10-30-2006 04:37 AM |
| SSH key code versus server key code | Texan | Security | 1 | 04-12-2006 08:57 AM |
| sco GUI interface | qphillips | SCO | 1 | 09-27-2005 03:16 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Is there a way to use code to get the interface names for a Solaris machine. I can easily see them on a command line with the "ifconfig -a" command. I could write a script that parses these out of a the ifconfig result and outputs them to a file, and then I run the script with the system command from code, and open the resulting file from code.
It seems there should be an easier way for a program to get these names. On some of the Solaris boxes I use, these names are bge0, bge1,... depending on how many ethernet cards are installed. On others the names are ce0, ce1,... If you know how I can get these names from code directly, please let me know. TIA, Herb Miller |
| Forum Sponsor | ||
|
|
|
|||
|
use can use prtconf -D |grep network to see each interfaces' instances. and of course, if you need only the active interface, you can use ifconfig or the combination of both, depending on how stylish you want your script to report it out with the output
|
|
|||
|
Getting interface names using code
I may be in the wrong forum.
I was hoping to do this from code (C++ or C, most likely). I can use the ifconfig command from code and pipe the result of a file and open the file and parse it. This seems cumbersome, but it does work. I was hoping to just make some calls (or series of calls) from software to get this information rather that relying on the "system_ command from software, and writing and reading a file. I can not be sure that the code I am writing will be run in an environment where writing a file is permitted. Thanks, Herb |