06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ioctl pNA+ <strong>System</strong> <strong>Calls</strong><br />

Operation Description<br />

SIOCSIFDSTADDR Sets point-to-point address for the interface.<br />

SIOCGIFDSTADDR Gets point-to-point address for the interface.<br />

SIOCSIFMTU Sets the maximum transmission unit of the NI.<br />

SIOCGIFMTU Gets the maximum transmission unit of the NI.<br />

SIOCSIFNETMASK Sets the network mask.<br />

SIOCGIFNETMASK Gets the network mask.<br />

SIOCSIFFLAGS Sets the interface flags field. If the interface is marked down,<br />

any packets currently routed through the interface are rerouted<br />

or dropped, resulting in a send error condition.<br />

IFF_POLL, IFF_EXTLOOPBACK and IFF_UP flags can be set<br />

by using this call.<br />

SIOCGIFFLAGS Gets interface flags.<br />

SIOCGIFCONF Gets the interface configuration list. When this command is<br />

used, arg must point to an ifconf structure (see below).<br />

The ifc_len field initially should be set to the buffer size<br />

pointed to by ifc_buf. On return, ifc_len has the configuration<br />

list length in bytes.<br />

/*<br />

* Structure used in SIOCGIFCONF request.<br />

* Used to retrieve interface configuration<br />

* for machine (useful for programs that must<br />

* know all accessible networks.)<br />

*/<br />

struct ifconf {<br />

int ifc_len; /* size of associated buffer */<br />

union {<br />

char *ifcu_buf;<br />

struct ifreq *ifcu_req;<br />

} ifc_ifcu;<br />

#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */<br />

#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */<br />

};<br />

For all other NI-related operations, arg must point to the following structure:<br />

struct ifreq {<br />

long ifr_ifno; /* Interface number of the NI */<br />

union {<br />

struct sockaddr ifru_addr; /* IP address of the NI */<br />

struct sockaddr ifru_dstaddr; /* Dest addr p-to-p link */<br />

struct sockaddr ifru_broadaddr; /* NI broadcast address */<br />

unsigned long ifru_flags; /* Flags for the NI */<br />

int ifru_mtu; /* Maximum number of<br />

4-24 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!