Hooking Server Numerics                                                     

In addition to the numerous named hooks provided by the client (refer to the
ON command in Section 5), TekNap can hook any numeric reply sent 
by a server. They are treated no differently from named hooks.  Space 
constraints prevent a full discussion of all server numerics, not to mention 
that they tend to differ from network to network.

A small subset of commonly used numerics are provided for convenience. 
A mostly full listing can be found in the napster.txt found on
opennap.sourceforge.net. The README from the opennap server discusses the
server numerics which are specific to opennap.

0	error message [SERVER]

	Format: <message>

2	login [CLIENT]

	Format: <nick> <password> <port> "<client-info>" <link-type> [ <num> ]

	<port> is the port the client is listening on for data transfer.  if
		this value is 0, it means that the client is behind a firewall
		and can only push files outward.  it is expected that requests
		for downloads be made using the 500 message (see below)
	<client-info> is a string containing the client version info
	<link-type> is an integer indicating the client's bandwidth
		0  unknown
		1  14.4 kbps
		2  28.8 kpbs
		3  33.6 kbps
		4  56.7 kbps
		5  64K ISDN
		6  128K ISDN
		7  Cable
		8  DSL
		9  T1
		10 T3 or greater
	<num> build number for the windows client [optional]
		
	Example:

	foo badpass 6699 "nap v0.8" 3

3	login ack [SERVER]

	Format: <email>

	the server sends this message to the client after a succesful
	login (2).  If the nick is registered, the <email> address given at
	registration time is returned.  If the nick is not registered, a
	dummy value is returned.

4       version check [CLIENT]

        Format: <version>

	Server sends [5] if an update is needed. All other responses are
	ignored.

	<version> = string, version 2.0b5a sends "2.0"

5       "auto-upgrade" [SERVER]

        Format: <version> <hostname:filename>

        Napster is out of date, get a new version.
        Or also known as gaping security hole.

        <version>  = string, the new version number.
        <hostname> = string, hostname of upgrade (http) server
        <filename> = string, filename

        Connections are always made to port 80.

        The HTTP Request:
                GET <filename> HTTP/1.0
                Connection: Keep-Alive
                Host: <hostname>

        Expected HTTP Response.
                Content-Length: <size>
                Content-Type: <doesn't matter>
                <data>

        Upgrade file is save as "upgrade.exe".
        And executed as: upgrade.exe UPGRADE "<current.exe>"

        As far as I can tell no confirmation is requested by Napster when it
        receives this message.  And immediately start to "auto-upgrade". To keep
        users informed that Napster is doing something potentially very harmful
        to their computer it displays a message saying it's "auto-upgrading".

        I think this pretty bad, since all someone has to do is hack a napster
        server et voila a zillion clients at your disposal.

        As far as I known this only affects the Win32 2.0b5a Napster client.
        Other clients/versions I don't know.

	[This section was contributed by Thomas van der Heijden <thom@bart.nl>
	-ed]

6	new user login [CLIENT]

	Format: <nick> <pass> <port> "<client-info>" <speed> <email-address>

	This message is used when logging in for the first time to register
	a new nickname.  The client normally checks for an unused nick using
	the "check nickname" (7) message and upon receipt of a "nickname not
	registered" (8) from the server will proceceed to log in with this
	command.

	note: this message is similar to the 0x02 message, with the addition	
	of <email-address> on the end

	Example:

	foo foo 6699 "nap v0.8" 3 email@here.com

7	nick check [CLIENT]

	Format: <nick>

	Queries the server to see if <nick> is already registered.  This
	message is typically used prior to logging in for the first time to
	check for a valid nickname.

	Response to this message is one of 8, 9 or 10

8	nickname not registered [SERVER]

	Format: (empty)

	The server sends this message in response to the "nick check" (7)
	message to indicate that the specified nickname is not already
	registered and is ok to use.

9	nickname already registered [SERVER]

	Format: (empty)

	The server sends this message when the nickname the client has
	requested has already been registered by another user

10	invalid nickname [SERVER]

	Format: (empty)

	This server sends this message in response to the "check nickname"
	(7) messages when the specified nickname is invalid, usually due to
	bad characters such as spaces or other non-printable characters.

11	??? [CLIENT]

	Format: <nick> <pass>

	[returns "parameters are unparsable" -ed]

12	??? [SERVER]

	Format: (empty)

	this message is returned in response to message 11 from the client

14	login options [CLIENT]

	NAME:%s ADDRESS:%s CITY:%s STATE:%s PHONE:%s AGE:%s INCOME:%s EDUCATION:%s

	Example:

	NAME: kev  ADDRESS:  CITY: ephrata  STATE: pa  PHONE:  AGE: 60 or older INCOME: $100,000 or more        EDUCATION: Graduate Degree

100	client notification of shared file [CLIENT]

	Format: "<filename>" <md5> <size> <bitrate> <frequency> <time>

	<md5> see section "MD5"
	<size> is bytes
	<bitrate> is kbps
	<frequency> is hz
	<time> is seconds
	
	Example:

	"generic band - generic song.mp3" b92870e0d41bc8e698cf2f0a1ddfeac7 443332 128 44100 60

102	remove file [CLIENT]

	Format: <filename>

	client requests to remove file from shared library

200	client search request [CLIENT]

    [FILENAME CONTAINS "artist name"] MAX_RESULTS <max> [FILENAME CONTAINS
"song"] [LINESPEED <compare> <link-type>] [BITRATE <compare> "<br>"] [FREQ
<compare> "<freq>"]

        The artist name and the song name are, obviously, treated
                the same by the server; confirm this for yourself
                on the windows client.

        max is a number; if it is greater than 100, the server will
                only return 100 results.

        <compare> is one of the following:
                "AT LEAST" "AT BEST" "EQUAL TO"

        <link-type> see 0x02 (client login) for a description

        <br> is a number, in kbps

        <freq> is a sample frequency, in Hz

        The windows client filters by ping time inside the client.
                It pretty much has to, and it's easy to see the
                result by setting ping time to at best 100 ms or
                so, and max search terms to 50.  You'll get back
                like 3 results, but the client will still tell you
                that it found "50 results".

        Examples:
                FILENAME CONTAINS "Sneaker Pimps" MAX_RESULTS 75 FILENAME
                         CONTAINS "tesko suicide" BITRATE "AT LEAST" "128"

                MAX_RESULTS 100 FILENAME CONTAINS "Ventolin" LINESPEED
                        "EQUAL TO" 10

	[Thanks to Ben Byer <bbyer@rice.edu> for this contribution.  -ed]

201	search response [SERVER]

	"<filename>" <md5> <size> <bitrate> <frequency> <length> <nick> <ip> <link-type>

	<md5> see secton "MD5"
	<size> is file size in bytes
	<bitrate> is mp3 bit rate in kbps
	<frequency> is sample rate in hz
	<length> is the play length of the mp3 in seconds
	<nick> the person sharing the file
	<ip> is an unsigned long integer representing the ip address of the
		user with this file
	<link-type> see message client login (2) message for a description

	Example:

	"random band - random song.mp3" 7d733c1e7419674744768db71bff8bcd 2558199 128 44100 159 lefty 3437166285 4

202	end of search response from server [SERVER]

	Format: (empty)

203	download request [CLIENT]

	Format: <nick> "<filename>"

	client requests to download <filename> from <nick>.  client expects
	to make an outgoing connection to <nick> on their specified data
	port.

	Example:

	mred "C:\Program Files\Napster\generic cowboy song.mp3"

	SEE ALSO: 500 alternate download request

204	download ack [SERVER]

	<nick> <ip> <port> "<filename>" <md5> <linespeed>

	server sends this message in response to a 203 request.

	<nick> is the user who has the file
	<ip> is an unsigned long integer representing the ip address
	<port> is the port <nick> is listening on
	<filename> is the file to retrieve
	<md5> is the md5 sum
	<linespeed> is the user's connection speed (see login(2))

	Example:

	lefty 4877911892 6699 "generic band - generic song.mp3" 10fe9e623b1962da85eea61df7ac1f69 3

205	private message to/from another user [CLIENT, SERVER]

	<nick> <message>

	note the same type is used for a client sending a msg or recieving one

	[Commentary: this message causes problems if you consider linking
	servers together.  With the current one server situation, the server
	just rewrites the message it receives with the name of the client that
	sent it and passes it to the recipient client.  However, in the case
	where the recipient and sender are not on the same server, there is
	loss of information without encapsulating it.  It would have been
	better to put both the sender and recipient because if the servers
	are ever linked they will have to make a new message type for this
	situation.  -ed]

206	get error [SERVER]

	<nick> <filename>

	the server sends this message when the file that the user has
	requested to download is unavailable (such as the user is not logged
	in).

207	add hotlist entry [CLIENT]

	<user>

	This message is used to add additional entries to the client's
	hotlist.  The server will send 209 and 210 messages when a user
	on the hotlist has logged in or out, respectively.

208	hotlist [CLIENT]

	<user>

	This message is used to send the initial list of hotlist entries
	during the initial login process.  It is normally send prior to
	to the add file (100) commands.  To add more entries to the hotlist
	after the initial list is sent, clients should use the 207 message
	instead.

209	user signon [SERVER]

	<user> <speed>

	server is notifying client that a user in their hotlist, <user>,
	has signed on the server with link <speed>

210	user signoff [SERVER]

	<user>

	server is notifying client that a user on their hotlist, <user>, has
	signed off the server.

	this message is also sent by the server when the client attempts to
	browse a nonexistent client.  [why don't they just use 404 for
	this? -ed]

211	browse a user's files [CLIENT]

	<nick>

	the client sends this message when it wants to get a list of the files
	shared by a specific client

212	browse response [SERVER]

	<nick> "<filename>" <md5> <size> <bitrate> <frequency> <time>

	<nick> is the user contributing the file
	<filename> is the mp3 file contributed
	<md5> is the has of the mp3 file
	<size> is the file size in bytes
	<bitrate> is the mp3 bitrate in kbps
	<frequence> is the sampling frequency in Hz
	<time> is the play time in seconds

	Example:

	foouser "generic band - generic song.mp3" b92870e0d41bc8e698cf2f0a1ddfeac7 443332 128 44100 60

213	end of browse list [SERVER]

	<nick>

	indicates no more entries in the browse list for <user>

214	server stats [CLIENT, SERVER]

	client: no data
	server: <users> <# files> <size>

	<size> is approximate total library size in gigabytes
	this message is sent by the server occasionaly without request

	Example:

	553 64692 254

215	request resume [CLIENT]

	<checksum> <filesize>

	client is requesting a list of all users which have the file with
	the characteristics.  the server responds with a list of 216 messages
	for each match, followed by a 217 message to terminate the list

216	resume search response [SERVER]

	<user> <ip> <port> <filename> <checksum> <size> <speed>

	this message contains the matches for the resume request (215).  the
	list is terminated by a 217 message.

217	end of resume search list [SERVER]

	no data.

	this messag terminates a list of 216 messages initiated by a 215
	client request

218	downloading file [CLIENT]

	no body.

	client sends this message to the server to indicate they are in the
	process of downloading a file.  this adds 1 to the download count
	which the server maintains.

219	download complete [CLIENT]

	no body.

	client sends this message to the server to indicate they have
	completed the file for which a prior 218 message was sent.  this
	subtracts one from the download count the server maintains

220	uploading file [CLIENT]

	no body.

	client sends this message to indicate they are uploading a file.
	this adds one to the upload count maintained by the server.

221	upload complete [CLIENT]

	no body.

	client sends this message when they are finished uploading a file.
	this subtracts one from the upload count maintained by the server.

300	optional ports [CLIENT]

	<port>

	This command allows the client to specify optional ports to try for
	data connections if the one currently in use is unreachable by other
	parties.

301	hotlist ack [SERVER]

	<user>

	server is notifying client that <user> has successfully be added to
	their hotlist

302	hotlist error [SERVER]

	<user>

	server is notifying client that it was unable to add <user> to their
	hotlist.  [can you only add registered nicks to your hotlist? -ed]

303	remove user from hotlist [CLIENT]

	<user>

	client is notifying the server that it no longer wishes to request
	notifications about <user> when they sign on or off the server.  no
	response is sent in return.

310	??? [CLIENT, SERVER]

	client: no data
	server: 0

	unknown command.  server returns 0 regardless of any parameters

316	??? [CLIENT, SERVER]

	client: no data
	server: 0

	unknown command.  server returns 0 regardless of any parameters

320	user ignore list [CLIENT, SERVER]

	client: no data
	server: <count>

	client request to display the list of ignored users.
	server returns the number of users being ignored

321	user ignore list entry [SERVER]

	<user>

	server sends each ignored nick in response to a 320 request.  the
	list is terminated by a 320 message with the number of ignored users.

322	add user to ignore list [CLIENT, SERVER]

	<user>

	server acks the request by returning the nick

323	remove user from ignore list [CLIENT]

	<user>

	server acks the request by returning the nick to be removed from
	the ignore list.

324	user is not ignored [SERVER]

	<user>

	server indicates that <user> is not currently ignored in response to
	a 323 request.

325	user is already ignored [SERVER]

	<user>

	server indicates the specified user is already on the user's ignore
	list

326	clear ignore list [CLIENT, SERVER]

	client: no data.
	server: <count>

	client requests the server clear its ignore list.  server returns the
	number of entries removed from the ignore list.

330	blocked ip list [CLIENT]

332	block ip [CLIENT]

333	unblock ip [CLIENT]

400	join channel [CLIENT]

	<channel-name>

	the client sends this command to join a channel

401	part channel [CLIENT, SERVER]

	<channel-name>

	The client sends this command to part a channel.  Server sends this
	message to indicate that the client has parted the channel.  Note
	that this is sometimes sent even when the client has not requested,
	so a client _must_ be prepared to accept it at any time.

402	send public message [CLIENT]

	<channel> <message>

403	public message [SERVER]

	<channel> <nick> <text>

	this message is sent by the server when a client sends a public message
	to a channel.

	Example:

	80's espinozaf hello...hola

404	error message [SERVER]

	<text>

	This message is used to send general error messages to a client that
	is logged in.  Note: Message 0 is only sent during the login process.

	Examples:

	User nosuchuser is not currently online.
	Channel #nosuchchannel does not exist!
	permission denied
	ping failed, blah is not online

405	join acknowledge [SERVER]

	<channel>

	the server sends this message to the client to acknowlege that it
	has joined the requested channel (400)
	
406	join message [SERVER]

	<channel> <user> <sharing> <link-type>

	<user> has joined <channel>

	Example:

	80's WilmaFlinstone 12 2

407	user parted channel [SERVER]

	<channel> <nick> <sharing> <linespeed>

	Example:

	80's DLongley 23 7

408	channel user list entry [SERVER]

	this message is identical to the join (406) message.  the server will
	send the list of users in the channel prior to the client join command
	in this message.  joins that occur after the client has joined will
	be noted by a 406 message.

409	end of channel user list [SERVER]

	<channel>

	this message is sent by the server to indicate it has sent all informati	about the users in a channel

410	channel topic [CLIENT, SERVER]

	<channel> <topic>

	sent when joining a channel or a new topic is set.  a client requesting
	topic change also uses this message.

	[why didn't they put a field to indicate WHO changed the topic?  as
	it is now you can only tell that it was changed.  -ed]

420	channel ban list [CLIENT]

	<channel>

421	channel ban list entry [SERVER]

422	channel ban [CLIENT]

	<channel> <user|ip> [ "<reason>" ]

423	channel unban [CLIENT]

	<channel> <user|ip> [ "<reason>" ]

424	channel ban clear

	<channel>

500	alternate download request [CLIENT]

	<nick> "<filename>"

	requests that <nick> make an outgoing connection to the requesters
	client and send <filename>.  this message is for use when the
	person sharing the file can only make an outgoing tcp connection
	because of firewalls blocking incoming messages.  this message should
	be used to request files from users who have specified their data
	port as 0 in their login message

501	alternate download ack [SERVER]

	<nick> <ip> <port> "<filename>" <md5> <speed>

	this message is sent to the uploader when their data port is set to
	0 to indicate they are behind a firewall and need to push all data
	outware.  the uploader is responsible for connecting to the
	downloader to transfer the file.

600	request user's link speed [CLIENT]

	<nick>

601	link speed response [SERVER]

	<nick> <linespeed>

602	??? [CLIENT]

	<?>

	server returns a 404 with "*gulp* Drink milk, it does a body good!"

603	whois request [CLIENT]

	<nick>

604	whois response [SERVER]

	<nick> "<user-level>" <time> "<channels>" "<status>" <shared>
	<downloads> <uploads> <link-type> "<client-info>" [ <total downloads>
	<total_uploads> <ip> <connecting port> <data port> <email> ]

	<user-level> is one of "User", "Moderator", "Admin" or "Elite"
	<time> is seconds this user has been connected
	<channels> is the list of channels the client is a member of, each
		separated by a space (ASCII 32)
	<status> is one of "Active", "Inactive" (offline) or "Remote" (on a
		different server)
	<shared> is number of files user has available for download
	<downloads> is the current number of downloads in progress
	<uploads> is the current number of uploads in progress
	<link-type> see 0x02 (client login) above
	<client-info> see 0x02 (client login) above

	The following fields are displayed for user level moderator and
	above:

	<total uploads>
	<total downloads>
	<ip>			note: can be "unavailable"
	<connecting port>
	<data port>
	<email>			note: can be unavailable

	Example:

	lefty "User" 1203 "80's " "Active" 0 0 0 3 "nap v0.8"

605	whowas response [SERVER]

	<user> <level> <last-seen>

	if the user listed in a 603 request is not currently online, the
	server sends this message.

	<user> is the user for which information was requested
	<level> is the user's last known userlevel (user/mod/admin)
	<last-seen> is the last time at which this user was seen, measured
		as seconds since 12:00am on January 1, 1970 (UNIX time_t).

606	change user level [CLIENT]

	<nick> <level>

	changes the privileges for <nick> to <level>.  client must be admin
	level to execute this request

	[I have not verified this message since I don't have admin status
	on any of the servers.  -ed]

607	upload request [SERVER]

	<nick> "<filename>"

	this message is used to notify the client that user <nick> has
	requested upload of <filename>

	Example:

	lefty "generic band - generic song.mp3"

608	accept upload request [CLIENT]

	<nick> "<filename>"

	client is notifying server that upload of <filename> to <nick> is
	accepted, and that the requesting client may begin download

	Example:

	lefty "generic band - generic song.mp3"

609     get error [SERVER]      (same as [206])

        <nick> <filename>

        the server sends this message when the file that the user has
        requested to download is unavailable (such as the user is not logged
        in).

610	kill (disconnect) a user [CLIENT]

	<nick>

	client request to disconnect a user.

611	nuke a user [CLIENT]

	<nick>

	client request to delete account for <nick>

612	ban user [CLIENT]

	<nick | ip> [ "<reason>" ]

	client request to place a ban on either a specific nickname or
	an ip address

613	set data port for user [CLIENT, SERVER]

	client: <user> <port>
	server: <port>

	This command is used by administrators to request that another
	client set the port used for data transfers to <port>.  The server
	sends a message with the requested port number to the target
	client.  NOTE: the target client can change its port number to
	whatever it wishes using the 703 command.

614	unban user [CLIENT]

	Format: <nick | ip> [ "<reason>" ]

615	show bans for server [CLIENT]

	Format: (empty)

	client requests the list of banned ips for the current server

616	(ip?) ban list entry [SERVER]

	Format: <ip> <nick> "<reason>" <time> <n>

	<ip> is the string version of the ip banned
	<nick> is the user setting the ban
	<reason> is the reason given
	<time> is the time_t when the ban was set
	<n> is ???.  value is either 0 or 1

	This message is sent in response to the 615 client request, one
	for each ban.  The list is terminated with a 0 length 615 message
	from the server.

	Example:
	
	207.172.245. valkyrie "DoS exploit" 947304224 0

617	list channels [CLIENT, SERVER]

	Format: (empty)

	client requests a list of channels on the server.  server responds
	with 618/617

	server indicates end of channel list using this message.

618	channel list entry [SERVER]

	Format: <channel-name> <number-of-users> <topic>

	this is the server response to a 617 client request, one for each
	channel.

	Example:

	Help 50 OpenNap help channel

619	queue limit [CLIENT]

	Format: <nick> "<filename>" <n>

	a client may limit the number of downloads from a particular client.
	once the limit for a particular user has been reached, the uploading
	client can send this message to notify the downloader that they
	have hit the limit and can't have any more simultaneous downloads.
	<nick> is the user who hit the limit, <filename> is the file they
	were trying to download when they hit the limit, and <n> is the
	number of simultaneous downloads allowed.

	Example:

	joebob "C:\MP3\Generic Band - Generic Song.mp3" 3

620	queue limit [SERVER]

	<nick> "<filename>" <filesize> <digit>

	This message is sent by the server in response to the 619 client
	request, when one user needs to notify another that they have
	reached the maximum allowed simultaneous downloads.  When the server
	recieves the 619 request from the uploading client, it sends the 620
	message to the downloading client.  The only difference in format is
	the addition of the <nick> field in the 620 message which specifies
	the username of the uploading agent which is notifying the
	downloader that the queue is full.

	Example:

	joebob "C:\MP3\Generic Band - Generic Song.mp3" 1234567 3

621	message of the day [CLIENT, SERVER]

	<text>

	Server: each 621 message contains a single line of text

	Client: client sends a 621 command with no data to request the
	motd be sent.  The server will usually send this automatically after
	a user logs in, so this command allows a user to reread it upon
	request.

622	muzzle a user [CLIENT]

	<nick> [ "<reason>" ]

	client requests that <nick> not be allowed to send public messages

623	unmuzzle a user [CLIENT]

	<nick> [ "<reason>" ]

	client requests that the enforced silence on <nick> be lifted

624	un-nuke a user [CLIENT]

	<user>

625	change a user's linespeed [CLIENT]

	<user> <speed>

626	data port error [CLIENT, SERVER]

	<user>

	When a downloading client detects that the uploader's data port
	is unreachable, it should send a 626 message to the server with
	the nick of the user for which the connection failed.  The server
	then relays the message to the uploader, substituing the
	downloader's nickname in the message.

627	operator message [CLIENT, SERVER]

	client: <text>
	server: <nick> <text>

	client request to send a message to all admins/moderators

628	global message [CLIENT, SERVER]

	client: <text>
	server: <nick> <text>

	client request send a message to all users

629	banned users [SERVER]

	Format: <nick>

	when displaying the ban list for the server, this message is used
	to indicate banned nicknames.

630-649	missing

650-651	??? [CLIENT]

	permission denied.

652	cloak user [CLIENT]

	sets the current user to "invisible"

653-699	missing.

700	change link speed [CLIENT]

	<speed>

	client is notifying server that its correct link speed is <speed>,
	in the range 0-10 (see the login message for details).

701	change user password [CLIENT]

	<password>

	client wishes to change their password

702	change email address [CLIENT]

	<email address>

	client wishes to change their email address

703	change data port [CLIENT]

	<port>

	client is changing the data port being listened on for file
	transfers

704-747	missing.

748	login attempt [SERVER]

	the server sends this message to a logged in client when another
	client attempts to log in with the same nickname.

749	missing.

750	server ping [CLIENT, SERVER]

        server: none
        client: <user>

        Napster 2.0b5a sends the username in a response to a 750 from the
	server.

	[server returns an empty 750 command in response. server ping? -ed]

751	ping user [CLIENT, SERVER]

	<user>

	client is attempting to determine if <user>'s connection is alive

752	pong response [CLIENT, SERVER]

	<user>

	this message is sent in response to the the 751 (PING) requeset

753	change password for another user [CLIENT]

	<user> <password> "<reason>"

	allows an administrator to change the password for another user

754-769	missing.

770	??? [CLIENT]

	permission denied.

771	??? [CLIENT]

	permission denied.

772-799	missing.

800	reload config [CLIENT]

	<config variable>

	resets configuration parameter to its default value

801	server version [CLIENT]

	no data.

	client request's a server's version

802-804	missing.

805	???

	[returns permission denied. -ed]

810	set config [CLIENT]

	<config string>

	request a change in server configuration variables

811	???

	[returns permission denied. -ed]

820	clear channel

	<channel>

	remove all users from the specified channel

821	??? [CLIENT, SERVER]

	client: <user> <?> <?>
	server: <?> <?>
	
	[no idea what this is for.  it sends the two arguments after the
	nick to <user>.  all additional parameters seem to be dropped.  -ed]

822	??? [CLIENT, SERVER]

	client: <user> <?>
	server: <?>

823	??? [CLIENT]

	<channel> <?> ...?

	unknown command.  takes at least one additional argument besides the
	channel name.  no obvious effect

824	emote [CLIENT, SERVER]

	client: <channel> "<text>"
	server: <channel> <user> "<text>"

	A variation of the public message command to indicate an action by
	the user.  Often implemented as the "/me" command in IRC clients.

825	user list entry [SERVER]

	<channel> <user> <files shared> <speed>

	an 825 message is sent for each user in the channel specified by the
	830 message

	Example:

	Help testor3 0 3

	[This appears to be exactly the same format as the 408 message.  -ed]

826	channel limit [CLIENT]

	<channel> <limit>

	sets the maximum number of users that may enter a channel.  <limit>
	is an integer value between 0 and 999999999.  setting it higher that
	this results in the limit being set to -1.  by default, created
	channels have a limit of 200.  there appears to be no restriction on
	any channel member changing the limit, and no notification is given

827	show all channels [CLIENT, SERVER]

	no data.

	client request to show all channels, including "hidden" channels.
	the server also sends this message to terminate

828	channel list [SERVER]

	<channel> <users> <n1> <level> <limit> "<topic>"

	the server sends a list of 828 commands, one for each channel,
	including "hidden" channels that don't show up in the normal channel
	list.

	<level> is the mimimum user level required for entry into a channel
	<limit> is the max number of users allowed in a channel

	<n1> is either 0 or 1.  seems to be 1 if the channel was user
	created, or 0 if a predefined channel???

829	kick user from channel [CLIENT]

	<channel> <user> [ "<reason>" ]

830	list users in channel [CLIENT, SERVER]

	<channel>

	client requests a list of all users in <channel>.  server responds
	with a 825 response for each user, followed by an 830 response with
	no data [why didn't they just use the 409 message? -ed]

831	global user list [CLIENT]

	[returns permission denied.  -ed]

832-869	missing.

870	??? [CLIENT]

	<?> ...?

	takes at least one argument.  no apparent effect.

871-899	missing.

900     connection test [SERVER]

        <ip> <port> <data>

        <ip>   - string,  ip address to connect to.
        <port> - integer, port to connect to
        <data> - string,  data to send to server.

        Try to connect to <ip> on <port> for atmost 1000 seconds.  If the
        connection succeeds send the <data> to target.

	[reported by Thomas van der Heijden <thom@bart.nl>]

901     listen test [SERVER]

        <port> <timeout> <data>

        <port>    - integer, port to listen on
        <timeout> - integer, time to wait for connection in seconds
        <data>    - string,  data to send after connection has been made.

        Listen on <port> for <timeout> seconds. If a connection arrives,
        return <data> to sender.

	[reported by Thomas van der Heijden <thom@bart.nl>]

902-1030	missing.




Opennap specific extensions

* Extensions to messages

200	search [CLIENT]

	TYPE <mime-type>

		OpenNap supports other media types besides mp3.  By default,
		searches will only match mp3 files.  A client can however
		search for other media types by specifying a
		partial MIME content-type (audio, video, text, application,
		image).  (See message 10300 for adding media to the database).
		The special keyword `any' will match any media type in the
		database.

		The results of the search are returned as with mp3, except
		the fields for bitrate, sample frequency and length are
		meaningless (and are set to 0 in this implmentation).  The
		client can then download as they would any other mp3 file.

* Non-standard messages

The following messages are not present in the official napster servers, but
are implemented as additional functionality in the opennap server.

10000	client quit [SERVER]

	<nick>

	the message is sent to peer servers when a client connection has
	closed

10010	server login [SERVER]

	<server-name> <nonce> <compression>

	<server-name>	the dns name of the server wishing to connect
	<nonce>		a random string to use for authentication
	<compression>	the maximum zip (LZ77) compression level

	this message is sent when a connection wishes to identify itself as
	a peer server.  when a server receives this message, it will send its
	own login command to the peer to initial mutual authentication

10011	server login ack [SERVER]

	<hash-response>

	to authenticate itself, the server will hash the value
		<peer-nonce><nonce><server-pass>
	using the MD5 algorithm.  this allows the servers to mutually
	authenticate without the plaintext passwords traversing the network

10013	user ip [SERVER] (deprecated, this info is now appended to msg 2)

	<user> <ip> <port> <server>

	this message is used for a server to pass the ip address of a
	locally connected client to its peer servers, since that information
	is not available in the login message.  <ip> is an unsigned long
	integer specifying the ip address for <user>

10014	registration info [SERVER]

	<user> <pass> <level> <email> <created> <last-seen>

	<pass>		user's password
	<level>		user's default level
	<email>		user's email address
	<created>	time at which the account was created
	<last-seen>	last time the user logged into a server

	When a server detects that the user table is out of sync between
	servers, it will send its notion of what the entry should look like
	to all the other servers.  If a receiving server has a matching
	user, it checks the <created> time to see which is the oldest
	entry and updates accordingly.

10018	encapsulated message [SERVER]

	:<sender> <recip> <message>

	This command allows a server to send a private message to a user on
	a remote server.  <message> should be a well-formed Napster message,
	complete with tag and length header.

10019	server link info [SERVER]

	<server> <port> <server> <port> <hops> <bufsize>

	This message is used by servers to share information about the
	topology of the linked servers.  when a server joins, a message is
	sent to all other nodes in the cluster.  <hops> is incremented each
	time the message is relayed so that each server knows how far away
	the others are.

10020	server quit [SERVER]

	:<server> <server> "<reason>"

	This message is used to notify other servers in the group that a
	server has delinked.  The server with the peer connection to the
	server that has quit should send this message.

10021	notify mods [SERVER]

	:<server> <loglevel> "<message>"

	allows a server to send a message to all logged in moderators.
	primarily used to propogate ban messages when not all servers
	see the connection or login.

10100	server connect [CLIENT]

	<server> <port> [ <remote_server> ]

	attempts to link the current server to <server>:<port>.  if
	<remote_server> is given, then that server attempts to make the
	link.  this command can be executed by admin level and higher.

10101	server disconnect [CLIENT]

	<server> <reason> [ <remote-server> ]

	delink current server from <server>.
	must be admin or high level to execute this command

10110	kill server [CLIENT]

	<server> <reason>

	cause the server to shutdown.  must be elite level to execute
	this command.

10111	remove server [CLIENT]

	<server> <reason>

	reqeusts that <server> be removed from the table of allowed links.
	must be elite to execute this command

10112	show server links [CLIENT, SERVER]

	client: no data
	server: <host> <host> <hops>

	This command is used to show information about the links a
	server has to other servers.  The list is terminated by a 10112
	message with no data (0 length).

10115	show server stats [CLIENT, SERVER]

	client: no data
	server: <clients> <servers> <files> <gigs> <channels> <time>
	<uptime> <memory> <numusers>

	This command is used by administrators to get information about the
	state of the server.

	<clients>	number of locally connected clients
	<servers>	number of locally connected servers
	<users>		total number of global users
	<files>		number of files in the db
	<gigs>		total size of all files shared
	<channels>	number of active channels
	<time>		time at which the server was started
	<uptime>	number of seconds of uptime
	<memory>	if debugging is enabled, this will show the memory
			currently in use, otherwise it will be -1
	<numusers>	number of registered users		

10201	set channel level [CLIENT]

	Format: <channel> <level>

	sets the minimum user level required to enter <channel> to <level>.

	Example:

	Operators Moderator

	sets channel "Operators" such that only users with level moderator
	or above may join the channel.

10203	set user mode [CLIENT]

	[-]{ALL,MUZZLE,BAN,KILL,PORT,WALLOP} [ ... ]

10204	set channel op [CLIENT]

	Format: <channel> <user> [user ...]

	enable <user> to kick/ban users on <channel>

10205	remove channel op [CLIENT]

	Format: <channel> <user> [user ...]

	remove <user> as operator on <channel>

10206	channel op list

	Format: <channel>

	returns the list of defined channel operators for the given channel

10207	drop channel [CLIENT]

	Format: <channel> [ "<reason>" ]

	marks the specified channel as being user created such that its
	state is not stored in the persistent channels file and will
	disappear once all users part from it.

10208	send message to channel ops [CLIENT]

	Format: <channel> <message>

	sends <message> to all operators and mods+ on <channel>

10209	change channel mode [CLIENT, SERVER]

	Format: <channel> [mode]

	if specified, [mode] is of the form

		(+|-)STRING

	where STRING is one of

		PRIVATE		- makes the channel not show up in the list
		MODERATED	- only ops and mods+ can speak in public
		INVITE		- channel is invite only
		TOPIC		- if set, any user may change the topic

10210	invite user to a channel [CLIENT, SERVER]

	Format: <channel> <user>

	when a channel is +INVITE, this sends an invitation to a user to
	join the specified channel.  the user issuing the invite must be
	a member of the channel.

10211	give voice to speak in moderated channel [CLIENT]

	Format: <channel> [user [user ...]]

10212	remove voice to speak in moderated channel [CLIENT]

	Format: <channel> [user [user ...]]

10213	muzzle a user in a specific channel [CLIENT]

	Format: <channel> <user> ["reason"]

10214	unmuzzle a user in specific channel [CLIENT]

	Format: <channel> <user> ["reason"]

10300	share generic media file [CLIENT]

	Format: "<filename>" <size> <md5> <content-type>

	<content-type> is the MIME type defined for what the data is.  This
			should be of the form TYPE/SUBTYPE, where TYPE is
			one of: audio, video, text, image, application

	Examples:

	"C:\IMAGES\Grand Canyon.jpg" 54187 bc938fdc0ef63772bfbdbf57aabb0860-54187 image/jpeg
	"\home\drscholl\src\opennap-0.11.tar.gz" 102161 51c07734811a26853b1a2a87b67c68a1-102161 application/x-gunzip

10301	new browse [CLIENT]

	Format: <nick>

10302	new browse result [CLIENT]

	Format: <nick> "<path>" <filename> <md5> <size> <bitrate>
		<frequency> <time> [ <filename> ... ]

* References

RFC1459, the IRC protocol was helpful in implementing many features.

