Download man pages section 7: Device and Network Interfaces

Transcript
if_tcp(7P)
SIOCTONLINK
Test if the address is directly reachable, for example,
that it can be reached without going through a router.
This request takes an sioc_addrreq structure (see
below) as a value-result parameter. The sa_addr field
should be set to the address to test. The sa_res field
will contain a non-zero value if the address is onlink.
SIOCTMYSITE
Test if the address is part of the same site as this node.
This request takes an sioc_addrreq structure (see
below) as a value-result parameter. The sa_addr field
should be set to the address to test. The sa_res field
will contain a non-zero value if the address is in the
same site.
The lifconf structure has the form:
/*
* Structure used in SIOCGLIFCONF request.
* Used to retrieve interface configuration
* for machine (useful for programs which
* must know all networks accessible).
*/
struct lifconf {
sa_family_t
lifc_family;
int
lifc_flags;
/* request specific interfaces */
int
lifc_len;
/* size of associated buffer */
union {
caddr_t
lifcu_buf;
struct ifreq *lifcu_req;
} lifc_lifcu;
#define lifc_buf lifc_lifcu.lifcu_buf
#define lifc_req lifc_lifcu.lifcu_req
};
/* buffer address */
/* array of structures returned */
The sioc_addrreq structure has the form:
/* Structure used in SIOCGLIFNUM request. */
struct lifnum {
sa_family_t
lifn_family;
int
lifn_flags;
/* request specific interfaces */
int
lifn_count;
/* Result */
};
/*
* Argument structure for SIOCT* address testing ioctls.
*/
struct sioc_addrreq {
struct sockaddr_storage sa_addr; /* Address to test */
int
sa_res; /* Result - 0/1 */
};
Device and Network Interfaces
261