NAME

uriassist — URI method assistance.

synopsis

::wyrm::uriassist scanname block offset

::wyrm::uriassist protocol tcp-channel variable value... {state-glob line-glob case-script...}

::wyrm::uriassist parameter element

::wyrm::uriassist channel channel [ label ]

::wyrm::uriassist puts channel line

::wyrm::uriassist log line

::wyrm::uriassist closeclose tcp-channel-1 tcp-channel-2

description

The uriassist command provides additional services to help implement URI methods.

uriassist scanname
Read a host name from a DNS response block. Returns a pair list of the name and final offset.
uriassist protocol
Drive the ASCII-Telnet protocol used by many of the access methods. The protocol maintains a collection of variables as the current state. Some of the variables have special meaning:
line
The last input line read in.
state
The state name.
async
Asynchronous response script.
logging
If true, log the transaction to stderr.
output
If defined, the output of the protocol. If defined and the async script is not empty, this is list appended to the script before evaluation.
As full lines become available, the state-glob and line-glob patterns are compared to the state name and gotten line. If the channel is at end of file, "!" is prepended to the state name, and the gotten line is set to "EOF". On I/O error, "!" is prepended to the state name, and the gotten line is set to "ERR error-message". On the first matching pair, the state variables are defined and the script is evaluated. If no pair matches, it is an error. Any changes to the variables are saved to the next evaluation of the protocol scripts. The final state name is "!QUIT!"; when the state variable is set to this, the protocol evaluator terminates. If async is not empty, the output (if defined) and error message (if an error occurred) are list appended and the script evaluated. Channel blocking is set based on whether there is an async script.
uriassist channel
When called from a protocol, change the input channel. It will change the input to blocking or non-blocking based on whether it is an async protocol.
uriassist puts
Puts the line. If called from a logging protocol, also puts to stderr.
uriassist log
If called from a logging protocol, puts to stderr.
uriassist closeclose
Close the second channel when the first closes.

SEE ALSO

urispace (4WY), uri (1WY).