Преглед изворни кода

Added man pages for btcli, btinfo, and btpd.

Lars Nooden originally put these together for OpenBSD.
They contain the same information from --help and the README.
master
Marq Schneider пре 14 година
родитељ
комит
034ba1a5e4
4 измењених фајлова са 382 додато и 1 уклоњено
  1. +2
    -1
      Makefile.am
  2. +199
    -0
      doc/btcli.1
  3. +47
    -0
      doc/btinfo.1
  4. +134
    -0
      doc/btpd.1

+ 2
- 1
Makefile.am Прегледај датотеку

@@ -4,12 +4,13 @@ AM_LDFLAGS=@openssl_LDFLAGS@

bin_PROGRAMS=btpd/btpd cli/btcli cli/btinfo
noinst_LIBRARIES=misc/libmisc.a evloop/libevloop.a
dist_man1_MANS=doc/btcli.1 doc/btinfo.1 doc/btpd.1

EXTRA_DIST=COPYRIGHT CHANGES

# btpd
btpd_btpd_SOURCES=\
btpd/active.c btpd/active.h btpd/addrinfo.c\
btpd/active.c btpd/active.h btpd/addrinfo.c\
btpd/btpd.c btpd/btpd.h\
btpd/cli_if.c btpd/content.c btpd/content.h\
btpd/download.c btpd/download_subr.c btpd/download.h\


+ 199
- 0
doc/btcli.1 Прегледај датотеку

@@ -0,0 +1,199 @@
.TH BTCLI "1" "2010\-07\-15" "BitTorrent Protocol Daemon 0.15" "User Commands"
.\" disable hyphenation
.nh
.\" adjust text to left margin only
.ad l
.\" -----------------------------------------------------------------
.\" MAIN CONTENT
.\" -----------------------------------------------------------------
.SH "NAME"
btcli \- command line interface to btpd
.SH "SYNOPSIS"
.B btcli
\fIOPERATION\fR [\fIOPERATION_OPTIONS\fR]
.SH "DESCRIPTION"
.PP
\fBbtcli\fR is a utility that interacts with a running btpd daemon.
It has several different modes of operation.
.SH "OPERATIONS"
.PP
One of the following operations must be specified when running btcli:
.TP
\fBadd\fR \- Add torrents to btpd.
.TP
\fBdel\fR \- Remove torrents from btpd.
.TP
\fBkill\fR \- Shut down btpd.
.TP
\fBlist\fR \- List torrents.
.TP
\fBstart\fR \- Activate torrents.
.TP
\fBstat\fR \- Display stats for active torrents.
.TP
\fBstop\fR \- Deactivate torrents.
.TP
\fB\-\-help\fR \fIOPERATION\fR Show help for the specified operation.
.SH "ADD OPTIONS"
.TP
\fB\-d\fR dir
Specifies the directory in which the files in the torrent will be downloaded;
It does not specify \fBbtpd\fR's "work" directory.
That is gathered from the environment variable \fI$HOME\fR.
.TP
\fB\-N, \-\-nostart\fR
Do not start the torrent immediately after adding it.
.TP
\fB\-T, \-\-topdir\fR
Append the torrent top directory (if any) to the content path.
.TP
\fB\-n\fR name
Specifies the name to be displayed for this torrent.
.SH "LIST OPTIONS"
.TP
\fB\-a\fR
List active torrents.
.TP
\fB\-i\fR
List inactive torrents.
.SH "STAT OPTIONS"
.TP
\fB\-i\fR
Display individual lines for each torrent.
.TP
\fB\-n\fR
Display the name of each torrent. Implies '-i'.
.SH "STOP OPTIONS"
.TP
\fB\-a\fR
Deactivate all torrents.
.SH "USAGE"
.PP
btpd must be started before btcli can be used. See \fBbtpd\fR(1) for help with starting btpd.
.PP
To start sharing a torrent with btpd, the torrent needs to be added to btpd. This is done with \fBbtcli add\fR. Unless otherwise specified, btpd automatically starts to share the torrent and download any missing data. If the content directory you specify when adding a torrent does not exist, btpd will create it.
.PP
You can see which torrents have been added to btpd with \fBbtcli list\fR. The list mode also displays a number for each added torrent. This number can be used to specify the target torrent for the btcli modes, so you don't have to keep the torrent file after adding it.
.PP
The up\- and download progress can be followed by using the \fBbtcli stat\fR mode. Both the list and stat modes use the following indicators to display the state of a torrent:
.RS 4
.TP 4
\fB+\fR
The torrent is starting. This may take time if btpd needs to test the content of this torrent or one started before it.
.TP 4
\fB\-\fR
The torrent is being stopped.
.TP 4
\fBI\fR
The torrent is inactive.
.TP 4
\fBS\fR
btpd is seeding the torrent.
.TP 4
\fBL\fR
btpd is leeching the torrent.
.RE
.PP
You can stop an active torrent with \fBbtcli stop\fR. You can start an inactive torrent by using \fBbtcli start\fR.
.PP
.B Note:
Torrents can be specified either with its number or its file.
.PP
The \fBbtcli del\fR mode should only be used when you're totally finished with sharing a torrent. The mode will remove the torrent and its associated data from btpd. It is a bad idea to remove a not fully downloaded torrent and then add it again, since btpd has lost information on the not fully downloaded pieces and will need to download the data again.
.PP
To shut down btpd use \fBbtcli kill\fR.

.SH "EXAMPLES"
Display a list btpd's torrents and their number, size, status, etc.
.RS 4
.B $ btcli list
.RE
.PP
Same as above, but only for torrent 12 and my.little.torrent.
.br
.RS 4
.B $ btcli list 12 my.little.torrent
.RE
.PP
Same as above but only for active torrents.
.br
.RS 4
.B $ btcli list \-a
.RE
.PP
Add foo.torrent, with content dir foo.torrent.d, and start it.
.br
.RS 4
.B $ btcli add \-d foo.torrent.d foo.torrent
.RE
.PP
Same as above without starting it.
.br
.RS 4
.B $ btcli add \-\-no\-start \-d foo.torrent.d foo.torrent
.RE
.PP
Start bar.torrent and torrent number 7.
.br
.RS 4
.B $ btcli start bar.torrent 7
.RE
.PP
Stop torrent number 7.
.br
.RS 4
.B $ btcli stop 7
.RE
.PP
Stop all active torrents.
.br
.RS 4
.B $ btcli stop \-a
.RE
.PP
Remove bar.torrent and it's associated information from btpd.
.br
.RS 4
.B $ btcli del bar.torrent
.RE
.PP
Display a summary of up/download stats for the active torrents.
.br
.RS 4
.B $ btcli stat
.RE
.PP
Display the summary once every five seconds.
.br
.RS 4
.B $ btcli stat \-w 5
.RE
.PP
Same as above, but also display individual stats for each active torrent.
.br
.RS 4
.B $ btcli stat \-w 5 \-i
.RE
.PP
Shut down btpd.
.br
.RS 4
.B $ btcli kill
.RE
.SH "BUGS"
Known bugs are listed at \fIhttp://github.com/queueRAM/btpd/issues\fR
.sp
Before submitting a bug report, please verify that you are running the latest version of btpd.
.SH "AUTHORS"
.sp
Current maintainers:
.sp
\- Marq Schneider <\fIqueueRAM@gmail.com\fR>
.sp
Past contributors:
.sp
\- Richard Nyberg <\fIbtpd@murmeldjur.se\fR>
.SH "SEE ALSO"
.BR \fBbtpd\fR(1)
.BR \fBbtinfo\fR(1)


+ 47
- 0
doc/btinfo.1 Прегледај датотеку

@@ -0,0 +1,47 @@
.TH BTINFO "1" "2010\-07\-15" "BitTorrent Protocol Daemon 0.15" "User Commands"
.\" disable hyphenation
.nh
.\" adjust text to left margin only
.ad l
.\" -----------------------------------------------------------------
.\" MAIN CONTENT
.\" -----------------------------------------------------------------
.SH "NAME"
btinfo \- BitTorrent Protocol Daemon information
.SH "SYNOPSIS"
.B btinfo
\fIfile\fR
.SH "EXAMPLE"
List the torrent information for \fBosol\-0906\-x86.iso.torrent\fR
.PP
.nf
.B $ btinfo /var/torrents/osol\-0906\-x86.iso.torrent
Name: osol\-0906\-x86.iso
Info hash: 58aca632a9f68427a8ac8f58cafa7a72ca067dba
Tracker URLs: [ [ http://dlc.sun.com:6969/announce ] [ http://dlc.sun.com:16969/announce ] ]
Number of pieces: 1354
Piece size: 524288
Total size: 709871616
Number of files: 1
Files:
osol-0906-x86.iso (709871616)
.fi
.SH "TROUBLESHOOTING"
If \fBbtpd\fR has shut down for some unknown reason, check the logfile for possible clues.
.SH "BUGS"
Known bugs are listed at \fIhttp://github.com/queueRAM/btpd/issues\fR
.sp
Before submitting a bug report, please verify that you are running the latest version of btpd.
.SH "AUTHORS"
.sp
Current maintainers:
.sp
\- Marq Schneider <\fIqueueRAM@gmail.com\fR>
.sp
Past contributors:
.sp
\- Richard Nyberg <\fIbtpd@murmeldjur.se\fR>
.SH "SEE ALSO"
.BR \fBbtpd\fR(1)
.BR \fBbtcli\fR(1)


+ 134
- 0
doc/btpd.1 Прегледај датотеку

@@ -0,0 +1,134 @@
.TH BTPD "1" "2010\-07\-15" "BitTorrent Protocol Daemon 0.15" "User Commands"
.\" disable hyphenation
.nh
.\" adjust text to left margin only
.ad l
.\" -----------------------------------------------------------------
.\" MAIN CONTENT
.\" -----------------------------------------------------------------
.SH "NAME"
btpd \- BitTorrent Protocol Daemon
.SH "SYNOPSIS"
.B btpd
[\fB\-d\fR \fIdir\fR]
[\fB\-p\fR \fIport\fR]
[\fBOPTIONS\fR...]
.SH "DESCRIPTION"
Btpd is a utility for sharing files over the BitTorrent network protocol. It runs in daemon mode, thus needing no controlling terminal or gui. Instead, the daemon is controlled by \fBbtcli\fR, its control utility, or other programs capable of sending commands and queries on the control socket.
.PP
btpd consists of the following programs:
.RS 4
\fBbtpd\fR \- The bittorrent client.
.br
\fBbtcli\fR \- Command line interface to btpd.
.br
\fBbtinfo\fR \- Shows information from a torrent file.
.RE
.PP
All programs accept the \fB\-\-help\fR option.

.SH "OPTIONS"
.TP
\fB\-d\fR \fIdir\fR
The path for the btpd directory. Default is \fI$HOME/.btpd\fR.
.TP
\fB\-p\fR \fIn\fR, \fB\-\-port\fR \fIn\fR
Listen at port \fIn\fR. Default is 6881.
.TP
\fB\-\-help\fR [\fImode\fR]
Show this text or help for the specified mode.
.TP
.B \-4
Use IPv4. If given in conjunction with \fB\-6\fR, both versions are used.
.TP
.B \-6
Use IPv6. By default IPv4 is used.
Unfortunately enabling both IPv6 and IPv4 in btpd is less useful than it should be. The problem is that some sites have trackers for both versions and it's likely that the IPv6 one, which probably has less peers, will be used in favour of the IPv4 one.
.TP
.B \-\-bw\-in \fIn\fR
Limit incoming BitTorrent traffic to \fIn\fR kB/s. Default is 0 which means unlimited.
.TP
.B \-\-bw\-out \fIn\fR
Limit outgoing BitTorrent traffic to \fIn\fR kB/s. Default is 0 which means unlimited.
.TP
.B \-\-empty\-start
Start btpd without any active torrents.
.TP
.B \-\-ip \fIaddr\fR
Let the tracker distribute the given address instead of the one it sees btpd connect from.
.TP
.B \-\-ipcprot \fImode\fR
Set the protection mode of the command socket. The mode is specified by an octal number. Default is 0600.
.TP
.B \-\-logfile \fIfile\fR
Where to put the logfile. By default it's put in the btpd dir.
.TP
.B \-\-max-peers \fIn\fR
Limit the amount of peers to \fIn\fR.
.TP
.B \-\-max\-uploads n
Controls the number of simultaneous uploads. The possible values are:
.RS
\fIn\fR < \-1 : Choose \fIn\fR >= 2 based on \fB\-\-bw\-out\fR (default).
.br
\fIn\fR = \-1 : Upload to every interested peer.
.br
\fIn\fR = 0 : Dont't upload to anyone.
.br
\fIn\fR > 0 : Upload to at most n peers simultaneously.
.RE
.TP
.B \-\-no\-daemon
Keep the btpd process in the foregorund and log to std{out,err}. This option is intended for debugging purposes.
.TP
.B \-\-prealloc \fIn\fR
Preallocate disk space in chunks of \fIn\fR kB. Default is 2048. Note that \fIn\fR will be rounded up to the closest multiple of the torrent piece size. If \fIn\fR is zero no preallocation will be done.
.SH "STARTING BTPD"
To start btpd with default settings you only need to run it. However, there are many useful options you may want to use. To see a full list run \fBbtpd \-\-help\fR. If you didn't specify otherwise, btpd starts with the same set of active torrents as it had the last time it was shut down.
.PP
\fBbtdp\fR will store information and write its log in \fI$HOME/.btpd\fR. Therefore it needs to be able to write there during its execution. You can specify another directory via the \fB\-d\fR option or the \fI$BTPD_HOME\fR variable.
.PP
It is recommended to specifiy the maximum number of uploads. Bittorrent employs a tit for tat algorithm, so uploading at good rates allows for downloading. Try to find a balance between uploads/outgoing bandwidth and the number of active torrents.
.PP
.B Note:
You should only need one instance of btpd regardless of how many torrents you want to share.
.SH "EXAMPLES"
Start btpd with all options set to their default values.
.RS 4
.nf
.B $ btpd
.fi
.RE
.PP
Start btpd as above, but with torrent data in the directory /var/torrents
.RS 4
.nf
.B $ btpd \-d /var/torrents
.fi
.RE
.PP
Start btpd and make it listen on port 12345, limit outgoing bandwidth to 200kB/s, limit the number of peers to 40 and not start any torrents that were active the last time btpd was shut down.
.RS 4
.nf
.B $ btpd \-p 12345 \-\-bw\-out 200 \-\-max\-peers 40 \-\-empty\-start
.fi
.RE
.SH "TROUBLESHOOTING"
If \fBbtpd\fR has shut down for some unknown reason, check the logfile for possible clues.
.SH "BUGS"
Known bugs are listed at \fIhttp://github.com/queueRAM/btpd/issues\fR
.sp
Before submitting a bug report, please verify that you are running the latest version of btpd.
.SH "AUTHORS"
.sp
Current maintainers:
.sp
\- Marq Schneider <\fIqueueRAM@gmail.com\fR>
.sp
Past contributors:
.sp
\- Richard Nyberg <\fIbtpd@murmeldjur.se\fR>
.SH "SEE ALSO"
.BR \fBbtcli\fR(1)
.BR \fBbtinfo\fR(1)


Loading…
Откажи
Сачувај