DEVINFO(8)

NAME
devinfo - Fetch information from a network device

SYNOPSIS
devinfo -t field device

DESCRIPTION

The devinfo program retrieves information about the configuration for a particular network device. It permits a script to enquire about the device flags, netmask, IP address, broadcast address, and various other parameters which are available from the device configuration.

The primary focus for this program is as an aid to a shell script. It will write the answer to the request to the stdout file. The exit code is zero for success, one for a failure. The nature of the failure is written to the stderr file.

This program should not cause problems with your system as it permits the information to be read only. There is no provision for changing the items obtained by this program.

OPTIONS

-t field
    Specify the field desired from the network device. This field is required. The field is one of the keys defined in the section labeled FIELDS.

DEVICE
This field contains the name of the network device. This is the simple name, and the list of valid names for your specific host may be obtained by looking at the file /proc/net/dev. Example device names are: eth0, lo, sl0, ppp0.

FIELDS

flags
    The flags for the device. This is written as a decimal number.

addr
    The IP address for the device. This is written as a dotted decimal number.

dstaddr
    The IP address of the destination (peer) for a point-to-point link. This address is mutually exclusive with the broadcast address. This is written as a dotted decimal number.

brdaddr
    The IP address for broadcast messages. This address is mutually exclusive with the dstaddr field. This is written as a dotted decimal number.

netmask
    The netmask field for the device. This is written as a dotted decimal number.

metric
    The routing metric field when the using the device. This is written as a decimal number.

mtu The maximum transmission unit when frames are sent to this device. This is written as a decimal number.

hwaddr
    The hardware address for the device. This is written as a hexadecimal number sequence without separators.

slave
    The slave name used for the device. The name is written as a string.

SECURITY
The program issues ioctl operations to retrieve the information from the device. Some of these operations require root access. There are no expected security traps and it should pose no security issue if the program is secured for suid root.

SEE ALSO
netmath will manipulate the IP addresses for common operations such as logical and, or, and exclusive or.

netmath(8), gethost(8)

COPYRIGHT
The devinfo program is in public domain. This is not the GNU public license.

WARRENTY
No warranty is expressed or implied. If it breaks then you get to keep both pieces.

AUTHOR
Al Longyear <longyear@netcom.com>