Sean Middleditch | 897e97f | 2009-11-02 11:16:47 -0800 | [diff] [blame^] | 1 | .TH telnet_negotiate 3 LIBTELNET "" "TELNET Library" |
| 2 | |
| 3 | .SH NAME |
| 4 | \fBtelnet_negotiate\fP - TELNET option negotiation |
| 5 | |
| 6 | .SH SYNOPSIS |
| 7 | .PP |
| 8 | \fB#include <libtelnet.h>\fP |
| 9 | .sp |
| 10 | .B "void telnet_negotiate(telnet_t *\fBtelnet\fR, unsigned char \fBcmd\fR, unsigned char \fIopt\fR);" |
| 11 | |
| 12 | .SH DESCRIPTION |
| 13 | .PP |
| 14 | The \fBtelnet_negotiate\fP function is used to request option negotiation. RFC1143 negotiation (Q-method negotiation) is automatically used by libtelnet internally. If the requested option is not already enabled/disabled as desired, negotiation will take place; otherwise, nothing will happen. |
| 15 | |
| 16 | The parameter \fItelnet\fP is a state tracker instance created by a prior call to \fBtelnet_init\fP. |
| 17 | |
| 18 | The parameter \fIcmd\fP must be one of: |
| 19 | .TP |
| 20 | \fBTELNET_WILL\fP |
| 21 | Request permission to enable an option on the local end. |
| 22 | |
| 23 | .TP |
| 24 | \fBTELNET_WONT\fP |
| 25 | Request permission to disable an option on the local end. |
| 26 | |
| 27 | .TP |
| 28 | \fBTELNET_DO\fP |
| 29 | Request for the peer to enable an option on the peer's end. |
| 30 | |
| 31 | .TP |
| 32 | \fBTELNET_DONT\fP |
| 33 | Request for the peer to disable an option on the peer's end. |
| 34 | |
| 35 | .PP |
| 36 | The parameter \fIopt\fP is the TELNET option being negotiated. It should be one of the TELNET_OPTION_* constants. |
| 37 | |
| 38 | .SH SEE ALSO |
| 39 | .PP |
| 40 | \fBlibtelnet\fR(3), \fBtelnet_send\fR(3), \fBtelnet_iac\fR(3) |