more man pages

This commit is contained in:
Sean Middleditch 2009-11-02 11:16:47 -08:00
parent db128164ba
commit 897e97f725
6 changed files with 120 additions and 3 deletions

View File

@ -1,7 +1,8 @@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libtelnet.pc
dist_man_MANS = libtelnet.3 telnet_init.3 telnet_free.3
dist_man_MANS = libtelnet.3 telnet_init.3 telnet_free.3 telnet_send.3 \
telnet_recv.3 telnet_iac.3 telnet_negotiate.3
libtelnet_includedir = $(includedir)
libtelnet_include_HEADERS = libtelnet.h

View File

@ -37,5 +37,5 @@ RFC1572 - http://www.faqs.org/rfcs/rfc1572.html
.SH SEE ALSO
.PP
\fBtelnet_init\fR(3), \fBtelnet_free\fR(3), \fBtelnet_send\fR,
\fBtelnet_recv\fR
\fBtelnet_init\fR(3), \fBtelnet_free\fR(3), \fBtelnet_send\fR(3),
\fBtelnet_recv\fR(3), \fBtelnet_iac\fR(3), \fBtelnet_negotiate\fR(3)

28
telnet_iac.3 Normal file
View File

@ -0,0 +1,28 @@
.TH telnet_iac 3 LIBTELNET "" "TELNET Library"
.SH NAME
\fBtelnet_iac\fP - sends any TELNET command code
.SH SYNOPSIS
.PP
\fB#include <libtelnet.h>\fP
.sp
.B "void telnet_iac(telnet_t *\fBtelnet\fR, unsigned char\fBcmd\fR);"
.SH DESCRIPTION
.PP
The \fBtelnet_iac\fP function sends any TELNET command code with the IAC (0xFF) command marker automatically prepended.
The parameter \fItelnet\fP is a state tracker instance created by a prior call to \fBtelnet_init\fP.
The parameter \fIcmd\fP is the TELNET command code to send.
.SH NOTES
.PP
Most TELNET commands are best use with more specialized libtelnet functions. The primary uses of the \fBtelnet_iac\fP function is to send simple commands like TELNET_GA (GO-AHEAD).
For option negotiation, always use \fBtelnet_negotiate\fP.
.SH SEE ALSO
.PP
\fBlibtelnet\fR(3), \fBtelnet_send\fR(3), \fBtelnet_negotiate\fR(3)

40
telnet_negotiate.3 Normal file
View File

@ -0,0 +1,40 @@
.TH telnet_negotiate 3 LIBTELNET "" "TELNET Library"
.SH NAME
\fBtelnet_negotiate\fP - TELNET option negotiation
.SH SYNOPSIS
.PP
\fB#include <libtelnet.h>\fP
.sp
.B "void telnet_negotiate(telnet_t *\fBtelnet\fR, unsigned char \fBcmd\fR, unsigned char \fIopt\fR);"
.SH DESCRIPTION
.PP
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.
The parameter \fItelnet\fP is a state tracker instance created by a prior call to \fBtelnet_init\fP.
The parameter \fIcmd\fP must be one of:
.TP
\fBTELNET_WILL\fP
Request permission to enable an option on the local end.
.TP
\fBTELNET_WONT\fP
Request permission to disable an option on the local end.
.TP
\fBTELNET_DO\fP
Request for the peer to enable an option on the peer's end.
.TP
\fBTELNET_DONT\fP
Request for the peer to disable an option on the peer's end.
.PP
The parameter \fIopt\fP is the TELNET option being negotiated. It should be one of the TELNET_OPTION_* constants.
.SH SEE ALSO
.PP
\fBlibtelnet\fR(3), \fBtelnet_send\fR(3), \fBtelnet_iac\fR(3)

24
telnet_recv.3 Normal file
View File

@ -0,0 +1,24 @@
.TH telnet_recv 3 LIBTELNET "" "TELNET Library"
.SH NAME
\fBtelnet_recv\fP - process received protocol data
.SH SYNOPSIS
.PP
\fB#include <libtelnet.h>\fP
.sp
.B "void telnet_recv( telnet_t *\fItelnet\fP, const char *\fIbuffer\fP, size_t \fIsize\fP );"
.SH DESCRIPTION
.PP
The \fBtelnet_recv\fP function must be called by the host application whenever data is received on the underlying network socket associated with the TELNET connection. The received data is passed in, processed by the \fBlibtelnet\fP library, and events are generated corresponding to the parsed input.
The parameter \fItelnet\fP is a state tracker instance created by a prior call to \fBtelnet_init\fP.
The parameter \fIbuffer\fP is the byte buffer into which received data has been read, usually by a called to \fBrecv\fP.
The parameter \fIsize\fP is the number of bytes in the \fIbuffer\fP parameter, which is the same as the positive return value of \fBrecv\fP.
.SH SEE ALSO
.PP
\fBlibtelnet\fR(3), \fBtelnet_send\fR(3), \fBrecv\fR(3)

24
telnet_send.3 Normal file
View File

@ -0,0 +1,24 @@
.TH telnet_send 3 LIBTELNET "" "TELNET Library"
.SH NAME
\fBtelnet_send\fP - sends data with proper protocol escaping
.SH SYNOPSIS
.PP
\fB#include <libtelnet.h>\fP
.sp
.B "void telnet_send(telnet_t *\fBtelnet\fR, const char *\fBbuffer\fR, size_t \fIsize\fR);"
.SH DESCRIPTION
.PP
The \fBtelnet_recv\fP function must be called by the host application whenever data is received on the underlying network socket associated with the TELNET connection. The received data is passed in, processed by the \fBlibtelnet\fP library, and events are generated corresponding to the parsed input.
The parameter \fItelnet\fP is a state tracker instance created by a prior call to \fBtelnet_init\fP.
The parameter \fIbuffer\fP is the byte buffer into which received data has been read, usually by a called to \fBrecv\fP.
The parameter \fIsize\fP is the number of bytes in the \fIbuffer\fP parameter, which is the same as the positive return value of \fBrecv\fP.
.SH SEE ALSO
.PP
\fBlibtelnet\fR(3), \fBtelnet_recv\fR(3), \fBsend\fR(3)