blob: 1c7f11ec4321c59c05827742e57a4606dafddecc [file] [log] [blame]
Sean Middleditch897e97f2009-11-02 11:16:47 -08001.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
14The \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
16The parameter \fItelnet\fP is a state tracker instance created by a prior call to \fBtelnet_init\fP.
17
18The parameter \fIcmd\fP must be one of:
19.TP
20\fBTELNET_WILL\fP
21Request permission to enable an option on the local end.
22
23.TP
24\fBTELNET_WONT\fP
25Request permission to disable an option on the local end.
26
27.TP
28\fBTELNET_DO\fP
29Request for the peer to enable an option on the peer's end.
30
31.TP
32\fBTELNET_DONT\fP
33Request for the peer to disable an option on the peer's end.
34
35.PP
36The 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)