Next: , Previous: Low-Level Network, Up: Processes

38.18 Misc Network Facilities

These additional functions are useful for creating and operating on network connections. Note that they are supported only on some systems.

— Function: network-interface-list

This function returns a list describing the network interfaces of the machine you are using. The value is an alist whose elements have the form (name . address). address has the same form as the local-address and remote-address arguments to make-network-process.

— Function: network-interface-info ifname

This function returns information about the network interface named ifname. The value is a list of the form (addr bcast netmask hwaddr flags).

addr
The Internet protocol address.
bcast
The broadcast address.
netmask
The network mask.
hwaddr
The layer 2 address (Ethernet MAC address, for instance).
flags
The current flags of the interface.

— Function: format-network-address address &optional omit-port

This function converts the Lisp representation of a network address to a string.

A five-element vector [a b c d p] represents an IPv4 address a.b.c.d and port number p. format-network-address converts that to the string "a.b.c.d:p".

A nine-element vector [a b c d e f g h p] represents an IPv6 address along with a port number. format-network-address converts that to the string "[a:b:c:d:e:f:g:h]:p".

If the vector does not include the port number, p, or if omit-port is non-nil, the result does not include the :p suffix.