aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Middleditch <sean@middleditch.us>2009-11-02 11:16:47 -0800
committerSean Middleditch <sean@middleditch.us>2009-11-02 11:16:47 -0800
commit897e97f72597ce5ea2c034977042b60f01dd59e8 (patch)
tree8a05b46cbbf10c8bf19f3c63e9b93ec2aa5b3f42
parentdb128164ba15b5da14c0c9ce834e0584b22f2725 (diff)
more man pages
-rw-r--r--Makefile.am3
-rw-r--r--libtelnet.34
-rw-r--r--telnet_iac.328
-rw-r--r--telnet_negotiate.340
-rw-r--r--telnet_recv.324
-rw-r--r--telnet_send.324
6 files changed, 120 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index 60ebd2f..193ecf8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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
diff --git a/libtelnet.3 b/libtelnet.3
index f73dc84..78afe21 100644
--- a/libtelnet.3
+++ b/libtelnet.3
@@ -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)
diff --git a/telnet_iac.3 b/telnet_iac.3
new file mode 100644
index 0000000..7a30bdc
--- /dev/null
+++ b/telnet_iac.3
@@ -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)
diff --git a/telnet_negotiate.3 b/telnet_negotiate.3
new file mode 100644
index 0000000..1c7f11e
--- /dev/null
+++ b/telnet_negotiate.3
@@ -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)
diff --git a/telnet_recv.3 b/telnet_recv.3
new file mode 100644
index 0000000..d9a1037
--- /dev/null
+++ b/telnet_recv.3
@@ -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)
diff --git a/telnet_send.3 b/telnet_send.3
new file mode 100644
index 0000000..af39f47
--- /dev/null
+++ b/telnet_send.3
@@ -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)