How to detect the network cable status with c programming on AIX


 
Thread Tools Search this Thread
Operating Systems AIX How to detect the network cable status with c programming on AIX
# 1  
Old 09-15-2011
Question How to detect the network cable status with c programming on AIX

Hello,

Is there any API or any other approach to detect whether the network cable is connected to the network adapter, say, en0, en1 or en2?

The OS is AIX6.1.

Thank you.

Last edited by zephyrbj; 09-15-2011 at 09:52 PM.. Reason: provide more info
# 2  
Old 09-16-2011
Often, the man page for a command will refer to the system call that got the information. If all else fails, popen() your favorite network status command and parse the output.
# 3  
Old 09-16-2011
Disclaimer: I have absolutely no experience with AIX.

Most systems provide this type of information via ioctl on a socket fd.

Regards,
Alister
# 4  
Old 09-16-2011
Running a command that gets what you want through strace/truss/tusc can tell you what it called.
# 5  
Old 11-06-2011
I am not sure about API but you could entstat command
like entstat -d ent0 |grep Status
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

AIX server do not detect LUN from HP storage

ssssssssssss (0 Replies)
Discussion started by: sampathenjoy
0 Replies

2. Solaris

No network cable But Network interface is UP and Running

I've one Netra 240 After changing main board and system configuration card reader, Network is not accessible any more, Network interfaces are always UP and Running even when there is no cable connected to Network interfaces. I tried to restart and plumb/unplumb with no luck. ifconfig -a... (7 Replies)
Discussion started by: samer.odeh
7 Replies

3. AIX

AIX 7.1 don't detect my DataDomain Library

Hi. I have 2 libraries (overland + data domain). My AIX 7.1 detect all "rmt" of the overland but none of the data domain. I have the Atape driver 12.3.9. During cfgmgr, I have this message : cfgmgr: 0514-621 WARNING: The following device packages are required for device support... (2 Replies)
Discussion started by: stephnane
2 Replies

4. Programming

How detect TCP/IP socket shutdown when ethernet cable is disconnected

Hi, I want to code TCP/IP client/server in linux application capable to fastly detect ethernet cable disconnection in any condition. So I have activate SO_KEEPALIVE options and set TCP_KEEPCNT, TCP_KEEPIDLE and TCP_KEEPINTVL to 1. When I disconnect ethernet cable I have the following... (5 Replies)
Discussion started by: jeje_clb
5 Replies

5. Shell Programming and Scripting

set a variable and detect error status...

Hi there, I'm driven crazy by a new problem. It seems very complex to me and I see no way to come around. In my script, I receive the path to a tgz file and I want to output the md5 sum of the file inside the tgz. I want a way to detect if tar fails. I'm using the following command tar... (7 Replies)
Discussion started by: chebarbudo
7 Replies

6. Shell Programming and Scripting

how to detect port open status?

I write a script which will stop an application, then restart it. Sometimes it is succesful, sometimes not. The problem is, when stop the application, some ports are still listenning (or not released). When start the application, it reports that ports are used, and can't continues. I use... (1 Reply)
Discussion started by: rdcwayx
1 Replies

7. IP Networking

How to handle unplugging ethernet cable in socket programming

Hi, I am trying to implement a server-client socket communication. My server and clients are in different PCs. During communications if the ethernet cable is removed from the server side it shows broken pipe due to unable to write on the socket. I want to know how to check whether the ethernet... (0 Replies)
Discussion started by: JagadishB
0 Replies

8. AIX

need AIX console cable

Hello ... I am newbie and will be very grateful for any help. I need a serial console cable for my AIX boxes (seems we have lost the one we had!). However I am confused about the one one to order - UK based if possible. I wonder if anyone can point me at a specific one or the exact spec i need to... (0 Replies)
Discussion started by: tim441
0 Replies

9. Solaris

Solaris 9 on x86- Can't detect network interface

Hi All, I recently installed Solaris 9 on my Compaq Presario V2000 Series (V2069CL) laptop. Everything is working fine except that Solaris is not able to detect the Network Interface after boot. While the system is booting, it shows that it has detected "Xircom Pocket Ethernet parallel port... (3 Replies)
Discussion started by: com2com
3 Replies

10. UNIX for Advanced & Expert Users

Network Status

Hi, My system ( Solaris 2.6, Entrerprise 250 ) shows lot of connections in TIME_WAIT status against service localhost.8007 and localhost.45221 What are these services and where can I get the cross references. I have checked up in /etc/services and there is no such entry. Infact... (5 Replies)
Discussion started by: shibz
5 Replies
Login or Register to Ask a Question