2

I want to get all the information about the network interfaces available on the AIX. Like on linux, we can get it from /sys/class/net files. Is there any files on AIX where I can find relevant information?

I am also trying to access it using "/dev/kmem" file. Which structure should I use to capture the information of network interface like in case of system information we use struct sysinfo. I am trying to get information for "ifnet" symbol. Can I get information like MTU, hardware address of the network interface from here?

2

On AIX, stuff like this is held in the ODM, but the easiest way to get to it, is to use operating system commands. For network interfaces,

ifconfig -a for logical information. lscfg, lsdev and lsattr for physical details (or pseudo-physical in some cases).

Examples,

$ifconfig -a
en1: flags=5e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(INACTIVE),PSEG,LARGESEND,CHAIN>
        inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
en0: flags=5e080822,c0<BROADCAST,NOTRAILERS,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),PSEG,LARGESEND,CHAIN>
en2: flags=4e080822,80<BROADCAST,NOTRAILERS,SIMPLEX,MULTICAST,GROUPRT,64BIT,PSEG,CHAIN>
en3: flags=4e080822,80<BROADCAST,NOTRAILERS,SIMPLEX,MULTICAST,GROUPRT,64BIT,PSEG,CHAIN>
lo0: flags=e08084b<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT>
        inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
        inet6 ::1/0
         tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1

$lsdev -Cl en1
en1 Available 10-78 Standard Ethernet Network Interface

$lscfg -vl ent1
  ent1             P1-I5/E1  10/100 Mbps Ethernet PCI Adapter II (1410ff01)

      10/100 Mbps Ethernet PCI Adapter II:
        Part Number.................09P5023
        FRU Number..................09P5023
        EC Level....................H10971A
        Manufacture ID..............YL1021
        Network Address.............0002556AF7A9
        ROM Level.(alterable).......SCU001
        Product Specific.(Z0).......A5204205
        Hardware Location Code......P1-I5/E1

$lsattr -El ent1
alt_addr        0x000000000000  Alternate Ethernet Address                    True
busintr         14              Bus interrupt level                           False
busmem          0xc0284000      Bus memory address                            False
chksum_offload  yes             Enable hardware transmit and receive checksum True
intr_priority   3               Interrupt priority                            False
ipsec_offload   no              IPsec Offload                                 True
large_send      yes             Enable TCP Large Send Offload                 True
media_speed     100_Full_Duplex Media Speed                                   True
poll_link       no              Enable Link Polling                           True
poll_link_timer 500             Time interval for Link Polling                True
rom_mem         0xc0200000      ROM memory address                            False
rx_hog          1000            RX Descriptors per RX Interrupt               True
rxbuf_pool_sz   1024            Receive Buffer Pool Size                      True
rxdesc_que_sz   512             RX Descriptor Queue Size                      True
slih_hog        10              Interrupt Events per Interrupt                True
tx_preload      1520            TX Preload Value                              True
tx_que_sz       8192            Software TX Queue Size                        True
txdesc_que_sz   512             TX Descriptor Queue Size                      True
use_alt_addr    no              Enable Alternate Ethernet Address             True

It seems you want to do this via an API. The ODM is the best bet then. I have no idea how up-to-date this is, but here's the IBM ODM API documentation link.

The ODM files are generally in /etc/objrepos, although a lot of files are symlinks to /usr/lib/objrepos. Some products can install ODM files in other locations as well, for example, HACMP (now PowerHA System Mirror or something).

  • I want to access this information through C language, is there any API for it? – diago Aug 14 '14 at 8:16
  • Probably, but I don't do development on AIX. – EightBitTony Aug 14 '14 at 9:39
  • thanks for suggesting ODM, but I want to read it from any file or available API, is this network information is stored in files anywhere on AIX? – diago Aug 25 '14 at 10:39
  • The ODM is a set of files. The API gives access to those files. So they both meet your needs. 'The ODM files are generally in /etc/objrepos'` as in the answer. – EightBitTony Aug 25 '14 at 14:16
0

ODM is how a user wants a system to be configured. It is read at boot time and by mkdev, cfgmgr, etc. But AIX allows direct manipulation of the attributes very much like a BSD system does. e.g. you can change the IP address of an interface with ifconfig en0 10.10.10.10 just like you would on BSD. The ODM does not change in that case. Or, you can do it with chdev -l en0 -a netaddr=10.10.10.10 which updates ODM and the current setting. Or, you can add a -P flag to the chdev and update only ODM so it takes affect upon reboot.

The ODM interfaces are documented in the standard IBM pubs http://www-01.ibm.com/support/knowledgecenter/ssw_aix_61/com.ibm.aix.base/kc_welcome_61.htm. All the various ways to access the current settings like ifconfig or netstat does are also documented. A copy of the Stephens books or other BSD reference material can start you towards accessing the current settings. I believe there are samples on AIX that demonstrate how to muck about with ODM.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.