ioctl Specifics
The dlpi driver supports the ioctl operations.
The dlpi driver supports the following ioctl operations:
- DL_ROUTE
- DL_TUNE_LLC
- DL_ZERO_STATS
- DL_SET_REMADDR
These commands and their associated data structures are described in the /usr/include/sys/dlpi_aix.h header file.
int
istr(int fd, int cmd, char *data, int len) {
struct strioctl ic;
ic.cmd = cmd;
ic.timout = -1;
ic.dp = data;
ic.dp = data;
ic.len = len;
return ioctl(fd, I_STR, &ic);
}
| Item | Description |
|---|---|
| DL_ROUTE | Disables the source routing on the current stream, queries
the Dynamic Route Discovery for a
source route, or statically assigns a source route to this stream.
It is only accepted when the stream is idle (DL_IDLE).
As an example, the following code can be used to discover
the source route for an arbitrary address:
|
| DL_TUNE_LLC | Allows the DLS user to alter the default LLC tunable parameters.
The argument must point to an llctune_t data structure. The flags field is examined to determine which, if any, parameters should be changed. Each bit in the flags field corresponds to a similarly named field in the llctune_t; if the bit is set, the corresponding parameter is set to the value in llctune_t. Only the current stream is affected, and changes are discarded when the stream is closed. If the F_LLC_SET flag is set and the user has root authority, the altered parameters are saved as the new default parameters for all new streams. This command returns as its argument an update of the current tunable parameters. For example, to double
the t1 value, the following code might be used:
To query the tunables, issue DL_TUNE_LLC with the flags field set to zero. This will alter no parameters and return the current tunable values. |
| DL_ZERO_STATS | Resets the statistics counters to zero. The driver maintains
two independent sets of statistics, one for each stream (local), and
another that is the cumulative statistics for all streams (global).
This command accepts a simple boolean argument. If the argument is True (nonzero), the global statistics are zeroed. Otherwise, only the current stream's statistics are zeroed. For example, to
zero the statistics counters on the current stream, the following
code might be used:
|
| DL_SET_REMADDR | Allows XID/TEST exchange on connection-oriented streams while
still in the DL_IDLE state. The dlpi driver uses both the source (remote) address and the dl_sap to determine where to route incoming messages for connection-oriented streams. The remote address is ordinarily specified in DL_CONNECT_REQ. If the DLS user needs to exchange XID or TEST messages before connecting to the remote station, DL_SET_REMADDR must be used. Note: Note that this
command is not necessary if XID and TEST messages are to be
exchanged only when the state is DL_DATAXFER.
The
argument to this command is the remote MAC address. One possible code
fragment might be:
|