Ioctl

Read syntax diagramSkip visual syntax diagram SOCKET ( ' IOCTL ' , socketid , icmd ,ivalue )

Purpose

Use the Ioctl function to control the operating characteristics of a socket.

Parameters

socketid
is the identifier of the socket.
icmd
is the operating characteristics command to be issued:
Command
Description
FIONBIO
Sets or clears nonblocking for socket I/O. You specify On or Off in ivalue.
FIONREAD
Gets the number of immediately readable bytes of data for the socket and returns it in the return string.
SIOCATMARK
Determines if the current location in the input data is pointing to out-of-band data. Yes or No is returned in the return string.
SIOCDINTERFACE
Removes an interface. You specify the network interface in ivalue. If the interface is inactive, the interface configuration information is removed from the TCP/IP server.
SIOCGIFADDR
Gets the network interface address. You specify the network interface in ivalue. The address is returned in the return string in the format interface domain port IP_address.
SIOCGIFBRDADDR
Gets the network interface broadcast address. You specify the network interface in ivalue. The address is returned in the return string in the format interface domain port IP_address.
SIOCGIFCONF
Gets the network interface configuration. You specify the maximum number of interfaces to be returned in ivalue. The list of interfaces is returned in the return string, each in the format interface domain port IP_address.
SIOCGIFDSTADDR
Gets the network interface destination address. You specify the network interface in ivalue. The address is returned in the return string in the format interface domain port IP_address.
SIOCGIFFLAGS
Gets the network interface flags. You specify the network interface in ivalue. The network interface is returned in the return string, followed by the flag settings as four hexadecimal digits, followed by the symbolic names of the enabled flags.
SIOCGIFMETRIC
Gets the network interface routing metric. You specify the network interface in ivalue. The network interface and the metric integer are returned in the return string.
SIOCGIFNETMASK
Gets the network interface network mask. You specify the network interface in ivalue. The network interface is returned in the return string, followed by the network mask in the format interface domain port IP_address.
SIOCSIFMETRIC
Sets the network interface routing metric. You specify a string containing the interface name followed by the new metric in ivalue.
ivalue
is the operating characteristics value. This value depends on the value specified for icmd. The ivalue parameter can be used as input or output or both on the same call.

Return Values

If successful, this function returns a string containing return code 0 and operating characteristics information. If unsuccessful, this function returns a string containing a nonzero return code, an error name, and an error message.

Examples

Call
Return Values
Socket('Ioctl',5,'FionBio','On')
'0'
Socket('Ioctl',5,'FionRead')
'0 8192'
Socket('Ioctl',5,'SiocAtMark')
'0 No'
Socket('Ioctl',5,'Siocdinterface','eth1')
'0'
Socket('Ioctl',5,'SiocGifAddr','TR1')
'0 TR1 AF_INET 0 9.4.3.2'
Socket('Ioctl',5,'SiocGifConf',2)
'0 TR1 AF_INET 0 9.4.3.2 TR2 AF_INET 0 9.4.3.3'
Socket('Ioctl',5,'SiocGifFlags','TR1')
'0 TR1 0063 IFF_UP IFF_BROADCAST IFF_NOTRAILERS IFF_RUNNING'
Socket('Ioctl',5,'SiocGifMetric','TR1')
'0 TR1 0'
Socket('Ioctl',5,'SiocGifNetMask','TR1')
'0 TR1 AF_INET 0 255.255.255.0'

The C socket call is: ioctl(s, cmd, data)

Messages and Return Codes

For a list of REXX Sockets system messages, see REXX Sockets System Messages. For a list of REXX Sockets return codes, see REXX Sockets Return Codes.