xref: /plan9/acme/bin/source/acd/cddbproto (revision 9a747e4fd48b9f4522c70c07e8f882a15030f964)
1<html><html>
2<head>
3<title>::freedb.org::</title>
4</head>
5
6<body bgcolor="#FFFFFF" text="#000000" link="#101070" vlink="#101070">
7
8<center>
9
10<table cellpadding=0 cellspacing=0 border=0 width="99%" align=center><tr><td align=left>
11<a href="/">
12<table border=0>
13<td bgcolor="#ffffff">
14 <table border=0 width=100% cellpadding=0 cellspacing=0>
15  <td bgcolor=#101070>
16   <table border=0>
17    <td bgcolor=#ffffff><font face="Arial,Helvetica,Lucida" color="#101070" size=8><b>freedb</b></td>
18    <td bgcolor=#101070><font face="Arial,Helvetica,Lucida" color="#ffffff" size=8><b>.org</b></td>
19   </table>
20  </td>
21  <tr>
22  <td align=right><font face="Arial,Helvetica,Lucida" color="#101070" size=2><b>a free approach to cddbp
23 </table>
24</td>
25</table>
26</a>
27</td><td align=right width=100%>
28	<form action="search.php" method=post>
29	<font face=Arial,Helvetica size=2><input type=name name=query width=20 size=20 length=20>
30	</td>
31	<td align=right>&nbsp;&nbsp;<input type=image src=images/menu/english/search.gif border=0 align=middle></td>
32	</form>
33
34</td></tr></table><br>
35<table cellpadding=0 cellspacing=0 border=0 width="99%" bgcolor=101070><tr><td>
36<table cellpadding=5 cellspacing=1 border=0 width="100%" bgcolor=FFFFFF><tr><td>
37<font face=Lucida,Verdana,Arial,Helvetica size=2>freedb.org - a free approach to cddbp</td></tr></table></td></tr></table><P>
38
39<table width="99%" align=center cellpadding=0 cellspacing=0 border=0><tr>
40	<td valign=top rowspan=5>
41
42<table border=0><tr><td>
43
44	<table width="115" border="0" cellpadding="0" cellspacing="0"><tr valign="top" bgcolor="#101070">
45                 <td bgcolor="#FFFFFF"><img src="themes/SlashOcean/pix.gif" width="3" height="3"></td>
46                 <td><img src="themes/SlashOcean/cl.gif" width="7" height="10"></td>
47                 <td><font face="verdana,helvetica,arial" size="1" color="#ffffff"><B>Main Menu</B></font></td>
48                 <td align="right"><img src="themes/SlashOcean/cr.gif" width="7" height="10" alt=""></td>
49                 <td bgcolor="#FFFFFF" align="right"><img src="themes/SlashOcean/pix.gif" width="3" height="3"></td>
50	</tr></table>
51	<table width="100%" border="0" cellpadding="0" cellspacing="0">
52	<tr bgcolor="#101070"><td colspan="3"><img src="themes/SlashOcean/pix.gif" width="1" height="1"></td></tr>
53	<tr bgcolor="#ffffff">
54		<td background="themes/SlashOcean/sl.gif"><img src="themes/SlashOcean/pix.gif" width="3" height="3" alt=""></td>
55		<td width="100%">
56		<table width="100%" border="0" cellpadding="5" cellspacing="0"><tr>
57		<td><font face="verdana,helvetica,arial" size="1">
58		<li><a href=index.php>Home</a>
59<li><a href=topics.php>News-Topics</a>
60<li><a href=sections.php?op=listarticles&secid=1>About</a>
61<li><a href=sections.php?op=listarticles&secid=2>Developers</a>
62<li><a href=sections.php?op=listarticles&secid=3>Applications</a>
63<li><a href=sections.php?op=listarticles&secid=7>Download</a>
64<li><a href=forum/index.php>Forum</a>
65<li><a href=http://freedb.music.sk/search/>Web-based Search</a>
66<li><a href=links.php>Web Links</a>
67<li><a href=user.php>Your Account</a>
68<li><a href=submit.php>Submit News</a>
69
70		</font></td>
71		</tr></table>
72
73
74	</td><td background="themes/SlashOcean/sr.gif" align="right"><img src="themes/SlashOcean/pix.gif" width="3" height="3" alt=""></td>
75      </tr>
76	<tr bgcolor="#101070"><td colspan="3"><img src="themes/SlashOcean/pix.gif" width="1" height="1"></td></tr>
77	</table>
78	</td>
79
80
81
82
83
84
85</tr></td></table>
86<br>
87<table border=0><tr><td>
88
89	<table width="115" border="0" cellpadding="0" cellspacing="0"><tr valign="top" bgcolor="#101070">
90                 <td bgcolor="#FFFFFF"><img src="themes/SlashOcean/pix.gif" width="3" height="3"></td>
91                 <td><img src="themes/SlashOcean/cl.gif" width="7" height="10"></td>
92                 <td><font face="verdana,helvetica,arial" size="1" color="#ffffff"><B>FAQ</B></font></td>
93                 <td align="right"><img src="themes/SlashOcean/cr.gif" width="7" height="10" alt=""></td>
94                 <td bgcolor="#FFFFFF" align="right"><img src="themes/SlashOcean/pix.gif" width="3" height="3"></td>
95	</tr></table>
96	<table width="100%" border="0" cellpadding="0" cellspacing="0">
97	<tr bgcolor="#101070"><td colspan="3"><img src="themes/SlashOcean/pix.gif" width="1" height="1"></td></tr>
98	<tr bgcolor="#ffffff">
99		<td background="themes/SlashOcean/sl.gif"><img src="themes/SlashOcean/pix.gif" width="3" height="3" alt=""></td>
100		<td width="100%">
101		<table width="100%" border="0" cellpadding="5" cellspacing="0"><tr>
102		<td><font face="verdana,helvetica,arial" size="1">
103		Our FAQ can be found <a href="http://freedb.freedb.org/sections.php?op=viewarticle&artid=26">here</a>.<br>
104Please read the FAQ before asking questions via email.		</font></td>
105		</tr></table>
106
107
108	</td><td background="themes/SlashOcean/sr.gif" align="right"><img src="themes/SlashOcean/pix.gif" width="3" height="3" alt=""></td>
109      </tr>
110	<tr bgcolor="#101070"><td colspan="3"><img src="themes/SlashOcean/pix.gif" width="1" height="1"></td></tr>
111	</table>
112	</td>
113
114</tr></td></table>
115<br>
116<table border=0><tr><td>
117
118	<table width="115" border="0" cellpadding="0" cellspacing="0"><tr valign="top" bgcolor="#101070">
119                 <td bgcolor="#FFFFFF"><img src="themes/SlashOcean/pix.gif" width="3" height="3"></td>
120                 <td><img src="themes/SlashOcean/cl.gif" width="7" height="10"></td>
121                 <td><font face="verdana,helvetica,arial" size="1" color="#ffffff"><B>Contact</B></font></td>
122                 <td align="right"><img src="themes/SlashOcean/cr.gif" width="7" height="10" alt=""></td>
123                 <td bgcolor="#FFFFFF" align="right"><img src="themes/SlashOcean/pix.gif" width="3" height="3"></td>
124	</tr></table>
125	<table width="100%" border="0" cellpadding="0" cellspacing="0">
126	<tr bgcolor="#101070"><td colspan="3"><img src="themes/SlashOcean/pix.gif" width="1" height="1"></td></tr>
127	<tr bgcolor="#ffffff">
128		<td background="themes/SlashOcean/sl.gif"><img src="themes/SlashOcean/pix.gif" width="3" height="3" alt=""></td>
129		<td width="100%">
130		<table width="100%" border="0" cellpadding="5" cellspacing="0"><tr>
131		<td><font face="verdana,helvetica,arial" size="1">
132		General questions:<br>
133<a href="mailto:info@freedb.org">info@freedb.org</a><hr>
134Databaseupdates:<br>
135<a href="mailto:updates@freedb.org">updates@freedb.org</a><br>
136(<b>NOT</b> for submission!)<hr>
137Please keep in mind that we are NOT the Nero-Support and please do not send CD-submits to the adresses above.<br>
138Submits have to go to:<br>
139<a href="mailto:freedb-submit@freedb.org">freedb-submit@freedb.org</a>		</font></td>
140		</tr></table>
141
142
143	</td><td background="themes/SlashOcean/sr.gif" align="right"><img src="themes/SlashOcean/pix.gif" width="3" height="3" alt=""></td>
144      </tr>
145	<tr bgcolor="#101070"><td colspan="3"><img src="themes/SlashOcean/pix.gif" width="1" height="1"></td></tr>
146	</table>
147	</td>
148
149</tr></td></table>
150<br>
151<table border=0><tr><td>
152
153	<table width="115" border="0" cellpadding="0" cellspacing="0"><tr valign="top" bgcolor="#101070">
154                 <td bgcolor="#FFFFFF"><img src="themes/SlashOcean/pix.gif" width="3" height="3"></td>
155                 <td><img src="themes/SlashOcean/cl.gif" width="7" height="10"></td>
156                 <td><font face="verdana,helvetica,arial" size="1" color="#ffffff"><B>Downloads</B></font></td>
157                 <td align="right"><img src="themes/SlashOcean/cr.gif" width="7" height="10" alt=""></td>
158                 <td bgcolor="#FFFFFF" align="right"><img src="themes/SlashOcean/pix.gif" width="3" height="3"></td>
159	</tr></table>
160	<table width="100%" border="0" cellpadding="0" cellspacing="0">
161	<tr bgcolor="#101070"><td colspan="3"><img src="themes/SlashOcean/pix.gif" width="1" height="1"></td></tr>
162	<tr bgcolor="#ffffff">
163		<td background="themes/SlashOcean/sl.gif"><img src="themes/SlashOcean/pix.gif" width="3" height="3" alt=""></td>
164		<td width="100%">
165		<table width="100%" border="0" cellpadding="5" cellspacing="0"><tr>
166		<td><font face="verdana,helvetica,arial" size="1">
167		The link to the database downloads is <a href="/sections.php?op=viewarticle&artid=12">here</a>		</font></td>
168		</tr></table>
169
170
171	</td><td background="themes/SlashOcean/sr.gif" align="right"><img src="themes/SlashOcean/pix.gif" width="3" height="3" alt=""></td>
172      </tr>
173	<tr bgcolor="#101070"><td colspan="3"><img src="themes/SlashOcean/pix.gif" width="1" height="1"></td></tr>
174	</table>
175	</td>
176
177
178</tr></td></table>
179<td>&nbsp;</td><td valign="top" width="100%">
180
181<!-- columna de inicio -->
182<center>
183	<table border=0 cellpadding=1 cellspacing=0 width=100% bgcolor=000000><tr><td>
184	<table border=0 cellpadding=8 cellspacing=0 width=100% bgcolor=FFFFFF>
185	<tr><td align=left><font face=Arial,Helvetica size=3>
186	<b>CDDB-protocol documentation</b><br>
187	<font size=2>
188	<br><br>
189	<pre>
190				CDDB Protocol
191
192			  By Steve Scherf and Ti Kan
193		          --------------------------
194
195Revision: $Id: CDDBPROTO,v 1.6 1997/05/14 07:53:52 steve Exp steve $
196
197
198Notation:
199-&gt; : client to server
200&lt;- : server to client
201
202terminating marker: `.' character in the beginning of a line
203
204
205Server response code (three digit code):
206
207First digit:
2081xx	Informative message
2092xx	Command OK
2103xx	Command OK so far, continue
2114xx	Command OK, but cannot be performed for some specified reasons
2125xx	Command unimplemented, incorrect, or program error
213
214Second digit:
215x0x	Ready for further commands
216x1x	More server-to-client output follows (until terminating marker)
217x2x	More client-to-server input follows (until terminating marker)
218x3x	Connection will close
219
220Third digit:
221xx[0-9]	Command-specific code
222
223
224CDDB Protocol Level 1:
225----------------------
226
227Server sign-on banner:
228----------------------
229&lt;- code hostname CDDBP server version ready at date
230
231    code:
232	200	OK, read/write allowed
233	201	OK, read only
234	432	No connections allowed: permission denied
235	433	No connections allowed: X users allowed, Y currently active
236	434	No connections allowed: system load too high
237    hostname:
238	Server host name.  Example: xyz.fubar.com
239    version:
240	Version number of server software.  Example: v1.0PL0
241    date:
242	Current date and time.  Example: Wed Mar 13 00:41:34 1996
243
244
245Initial client-server handshake:
246--------------------------------
247Note: This handshake must occur before other cddb commands
248      are accepted by the server.
249
250Client command:
251-&gt; cddb hello username hostname clientname version
252
253    username:
254	Login name of user.  Example: johndoe
255    hostname:
256	Host name of client.  Example: abc.fubar.com
257    clientname:
258	The name of the connecting client.  Example: xmcd, cda, EasyCD,
259	et cetera. Do not use the name of another client which already
260	exists.
261    version:
262	Version number of client software.  Example: v1.0PL0
263
264Server response:
265&lt;- code hello and welcome username@hostname running clientname version
266
267    code:
268	200	Handshake successful
269	431	Handshake not successful, closing connection
270	402	Already shook hands
271
272
273CDDB query:
274-----------
275Client command:
276-&gt; cddb query discid ntrks off1 off2 ... nsecs
277
278    discid:
279	CD disc ID number.  Example: f50a3b13
280    ntrks:
281	Total number of tracks on CD.
282    off1, off2, ...:
283	Frame offset of the starting location of each track.
284    nsecs:
285	Total playing length of CD in seconds.
286
287Server response:
288&lt;- code categ discid dtitle
289	or
290&lt;- code close matches found
291&lt;- categ discid dtitle
292&lt;- categ discid dtitle
293&lt;- (more matches...)
294&lt;- .
295
296    code:
297	200	Found exact match
298	211	Found inexact matches, list follows (until terminating marker)
299	202	No match found
300	403	Database entry is corrupt
301	409	No handshake
302    categ:
303	CD category.  Example: rock
304    discid:
305	CD disc ID number of the found entry.  Example: f50a3b13
306    dtitle:
307	The Disc Artist and Disc Title (The DTITLE line).  For example:
308	Pink Floyd / The Dark Side of the Moon
309
310
311CDDB read:
312----------
313Client command:
314-&gt; cddb read categ discid
315
316    categ:
317	CD category.  Example: rock
318    discid:
319	CD disc ID number.  Example: f50a3b13
320
321Server response:
322&lt;- code categ discid
323&lt;- # xmcd 2.0 CD database file
324&lt;- # ...
325&lt;- (CDDB data...)
326&lt;- .
327	or
328&lt;- code categ discid No such CD entry in database
329
330    code:
331	210	OK, CDDB database entry follows (until terminating marker)
332	401	Specified CDDB entry not found.
333	402	Server error.
334	403	Database entry is corrupt.
335	409	No handshake.
336    categ:
337	CD category.  Example: rock
338    discid:
339	CD disc ID number.  Example: f50a3b13
340
341
342CDDB search: (command not yet implemented in freedb-serversoftware!)
343------------
344Client command:
345-&gt; cddb srch key search_type ... search_type
346
347    key:
348	Pseudo-regular expression to match. Expressions should meet the
349	following description:
350
351	- No white space.
352	- Printable characters only.
353	- Case is ignored.
354    search_type:
355	CDDB fields to search through.  Example: title
356	Supported types: artist, title, extd, ext, trk
357    categ:
358	CD category.  Example: rock
359
360Server response:
361&lt;- code matches found
362&lt;- categ discid dtitle
363&lt;- categ discid dtitle
364&lt;- (more matches...)
365&lt;- .
366
367    code:
368	210	OK, matches found, list follows (until terminating marker)
369	401	No match found.
370	409	No handshake.
371    categ:
372	CD category.  Example: rock
373    dtitle:
374	The Disc Artist and Disc Title (The DTITLE line).  For example:
375	Pink Floyd / The Dark Side of the Moon
376
377
378CDDB write:
379-----------
380Client command:
381-&gt; cddb write categ discid
382
383    categ:
384	CD category.  Example: rock
385    discid:
386	CD disc ID number.  Example: f50a3b13
387
388Server response:
389&lt;- code categ discid
390
391    code:
392	320	OK, input CDDB data (until terminating marker)
393	401	Permission denied.
394	402	Server file system full/file access failed.
395	409	No handshake.
396	501	Entry rejected: reason for rejection.
397    categ:
398	CD category.  Example: rock
399    discid:
400	CD disc ID number.  Example: f50a3b13
401
402Client data:
403-&gt; # xmcd 2.0 CD database file
404-&gt; # ...
405-&gt; (CDDB data)
406-&gt; .
407
408Server response:
409&lt;- code message
410
411    code:
412	200	CDDB entry accepted
413	401	CDDB entry rejected: reason why
414    message:
415	Message string to indicate write status:
416	CDDB entry accepted, or CDDB entry rejected.
417
418
419Help information:
420-----------------
421Client command:
422-&gt; help
423	or
424-&gt; help cmd
425
426    cmd:
427	CDDB command.  Example: quit
428
429	or
430
431-&gt; help cmd subcmd
432
433    cmd:
434	CDDB command.  Example: cddb
435    subcmd:
436	CDDB command argument.  Example: query
437
438Server response:
439&lt;- code Help information follows
440&lt;- (help data ...)
441&lt;- .
442	or
443&lt;- code no help information available
444
445    code:
446	210	OK, help information follows (until terminating marker)
447	401	No help information available
448
449
450Log statistics:
451---------------
452Client command:
453-&gt; log [[-l lines] [start date [end date]] | [day [days]] | [get"]]
454
455    lines:
456	The maximum number of lines to print for each data list in the
457	log statistics.
458    start date:
459	The date after which statistics should be calculated. Date is
460	of the format: hh[mm[ss[MM[DD[[CC]YY]]]]]
461
462	E.g.:	201200053196 for 8:12 PM on May 31, 1996.
463		20120005312096 for 8:12 PM on May 31, 2096.
464		080530 for today at at 8:15 and 30 seconds.
465
466	If the century ("CC") is omitted, a reasonable guess is made. If
467	this argument is omitted, all messages are considered.
468    end date:
469	The date after which statistics should not be calculated. If
470	omitted, the end date is assumed to be the current date.
471    day:
472	The string "day". This solitary argument will cause a log search
473	of messages generated within the last day.
474    days:
475	A positive numerical argument which modifies the number of days'
476        messages to searh. If this argument is left out, the default is 1.
477    get:
478	The string "get". This solitary argument will cause the server
479	to send the contents of the log file.
480
481Server response:
482&lt;- code Log summary follows
483&lt;- (log stats)
484&lt;- .
485	or
486&lt;- code Log follows
487&lt;- (log stats)
488&lt;- .
489
490    code:
491	210	OK, log summary follows (until terminating marker)
492	211	OK, log follows (until terminating marker)
493	401	Permission denied
494	402	No log information available
495	501	Invalid start/end date
496
497
498Message of the day:
499------------------
500Client command:
501-&gt; motd
502
503Server response:
504&lt;- code Last modified: date MOTD follows (until terminating marker)
505&lt;- (message text)
506&lt;- .
507
508    code:
509	210	Last modified: 05/31/96 06:31:14 MOTD follows (until terminating marker)
510	401	No message of the day available
511    date:
512	The date the text of the message of the day was modified. The date
513	appears in the following format:
514
515		05/31/96 06:31:14
516
517	This value may be used by client software as a message timestamp
518	for purposes of determining if it has already been displayed. This
519	format was chosen because it is more easily parsed than the standard
520	ctime() format.
521
522
523Server protocol level:
524----------------------
525Client command:
526-&gt; proto [level]
527
528    level:
529	The (numerical) protocol level to set the server to.
530
531Server response:
532&lt;- code CDDB protocol level: current cur_level, supported supported_level
533	or
534&lt;- code OK, protocol version now: cur_level
535
536    code:
537	200	CDDB protocol level: current cur_level, supported supp_level
538	201	OK, protocol version now: cur_level
539	501	Illegal protocol level.
540	502	Protocol level already cur_level.
541    cur_level:
542	The current protocol level at which the server is running.
543    supported_level:
544	The maximum supported protocol level.
545
546
547Server sites:
548--------------
549Client command:
550-&gt; sites
551
552Server response:
553&lt;- code OK, site information follows (until terminating `.')
554&lt;- (data)
555&lt;- .
556
557    code:
558	210	Ok, site information follows
559	401	No site information available.
560
561    The data format is as follows:
562	site port latitude longitude description
563
564    The fields are as follows:
565	site:
566	    The Internet address of the remote site.
567	port:
568	    The port at which the server resides on that site.
569	latitude:
570	    The latitude of the server site. The format is as follows:
571		CDDD.MM
572	    Where "C" is the compass direction (N, S), "DDD" is the
573	    degrees, and "MM" is the minutes.
574	longitude:
575	    The longitude of the server site. Format is as above, except
576	    the compass direction must be one of (E, W).
577	description:
578	    A short description of the geographical location of the site.
579
580    Example:
581	cddb.moonsoft.com 888 N037.23 W122.01 Fremont, CA USA
582
583
584Server status:
585--------------
586Client command:
587-&gt; stat
588
589Server response:
590&lt;- code OK, status information follows (until terminating `.')
591&lt;- (data)
592&lt;- .
593
594    code:
595	210	Ok, status information follows
596
597    The possible data is as follows:
598	current proto: &lt;current_level&gt;
599	    An integer representing the server's current operating protocol
600	    level.
601	max proto:     &lt;max_level&gt;
602	    The maximum supported protocol level.
603	gets:          &lt;yes | no&gt;
604	    Whether or not the client is allowed to get log information,
605	    according to the string "yes" or "no".
606	updates:       &lt;yes | no&gt;
607	    Whether or not the client is allowed to initiate a database
608	    update, according to the string "yes" or "no".
609	posting:       &lt;yes | no&gt;
610	    Whether or not the client is allowed to post new entries,
611	    according to the string "yes" or "no".
612	quotes:        &lt;yes | no&gt;
613	    Whether or not quoted arguments are enabled, according to
614	    the string "yes" or "no".
615	current users: &lt;num_users&gt;
616	    The number of users currently connected to the server.
617	max users:     &lt;num_max_users&gt;
618	    The number of users that can concurrently connect to the server.
619	strip ext:	&lt;yes | no&gt;
620	    Whether or not extended data is stripped by the server before
621	    presented to the user.
622	Database entries: &lt;num_db_entries&gt;
623	    The total number of entries in the database.
624	Database entries by category:
625	    This field is followed by a list of catgories and the number
626	    of entries in that category. Each entry is of the following
627	    format:
628
629		&lt;white space&gt;catgory: &lt;num_db_entries&gt;
630
631	    The list of entries is terminated by the first line that does
632	    not begin with white space.
633
634	Pending file transmissions:
635	    This field is followed by a list of sites that are fed new
636	    database entries at periodic intervals, and the number of
637	    entries that have yet to be transmitted to that site.
638	    Each entry is of the following format:
639
640		&lt;white space&gt;site: &lt;num_db_entries&gt;
641
642	    The list of entries is terminated by the first line that does
643	    not begin with white space.
644
645	This list may grow as needed, so clients must expect possible
646	unrecognizable data. Also, additional fields may be added to
647	the currently existing lines, although no existing fields will
648	be removed or change position.
649
650
651Server version:
652---------------
653Client command:
654-&gt; ver
655
656Server response:
657&lt;- code servername version copyright
658	or
659&lt;- code Version information follows
660
661    code:
662	200	Version information.
663	211	OK, version information follows (until terminating marker)
664    version:
665	Server version.  Example: v1.0PL0
666    copyright:
667	Copyright string.  Example: Copyright (c) 1996 Steve Scherf
668
669
670Database update:
671----------------
672Client command:
673-&gt; update
674
675Server response:
676&lt;- code Updating the database.
677	or
678&lt;- code Permission denied.
679	or
680&lt;- code Unable to update the database.
681
682    code:
683	200 Updating the database.
684	401 Permission denied.
685	402 Unable to update the database.
686
687
688Server users:
689-------------
690Client command:
691-&gt; whom
692
693Server response:
694&lt;- code User list follows
695
696    code:
697	210	OK, user list follows (until terminating marker)
698	401	No user information available.
699
700
701Client sign-off:
702----------------
703Client command:
704-&gt; quit
705
706Server response:
707&lt;- code hostname closing connection.  Goodbye.
708
709    code:
710	230	OK, goodbye.
711    hostname:
712	Server host name.  Example: xyz.fubar.com
713
714
715General errors:
716---------------
717
718Server response:
719&lt;- code error
720    code:
721	402	Server error.
722	408	CGI environment error.
723	500	Command syntax error, command unknown, command unimplemented.
724	530	Server error, server timeout.
725
726
727Reserved errors:
728----------------
729
730The following error codes are reserved, and will never be returned as a
731response to a CDDB protocol command. They are intended to be used internally
732by clients that have a need for generating pseudo-responses.
733
734	600-699
735
736
737CDDB Protocol Level 2:
738----------------------
739
740In all respects, protocol level 2 is the same as level 1, with the exceptions
741listed below.
742
743Arguments to commands may be surrounded by double quotes. All characters
744within the quotes, including white space, are included in the argument. All
745white space is replaced by the `_' (2Dh) character by the server. White space
746is defined as ` ' (20h) and `^I' (control-I, or 09h).
747
748Arguments containing quotes that should not be interpreted with the special
749meaning described above should be escaped with a preceding backslash character,
750or '' (5Ch). If an actual backslash appears in an argument, it should be
751escaped with a preceding backslash. In both cases, the preceding backslash
752will be removed from the input before being interpreted.
753
754
755CDDB Protocol Level 3:
756----------------------
757
758Protocol level 3 is the same as level 2, with the exception listed below.
759
760The output of the "sites" command has changed to meet the folowing description:
761
762    The data format is as follows:
763	site protocol port address latitude longitude description
764
765    The fields are as follows:
766	site:
767	    The Internet address of the remote site.
768	protocol:
769	    The transfer protocol used to access the site.
770	port:
771	    The port at which the server resides on that site.
772	address:
773	    Any additional addressing information needed to access the
774	    server. For example, for HTTP protocol servers, this would be
775	    the path to the CDDB server CGI script. This field will be
776	    "-" if no additional addressing information is needed.
777	latitude:
778	    The latitude of the server site. The format is as follows:
779		CDDD.MM
780	    Where "C" is the compass direction (N, S), "DDD" is the
781	    degrees, and "MM" is the minutes.
782	longitude:
783	    The longitude of the server site. Format is as above, except
784	    the compass direction must be one of (E, W).
785	description:
786	    A short description of the geographical location of the site.
787
788    Example:
789	cddb.moonsoft.com cddbp 888 - N037.23 W122.01 Fremont, CA USA
790	cddb.moonsoft.com http 80 /~cddb/cddb.cgi N037.23 W122.01 Fremont,CA USA
791
792Note that a site may appear once for each type of protocol it supports for
793accessing the server.
794
795
796Addendum A: Proper use of CDDBP:
797--------------------------------
798
799There are a few guidelines that must be followed in order to make proper use
800of CDDBP:
801
802- When handshaking with the server via the "cddb hello" command, the client
803  must specify its own name and version, not that of some other client (such
804  as xmcd). Also, the "username" and "hostname" must be that of the actual
805  user running the program, not some hardwired value.
806
807- Before performing a "cddb read", the client program MUST perform a
808  "cddb query". Failure to do so may result in the client program receiving
809  incorrect CDDB data from the server. Also, without performing a query, the
810  client program will not benefit from close matches in the event of the
811  lack of an exact match in the database.
812
813- For accounting purposes, it is best if client programs only perform a single
814  "cddb query" for a particular disc before performing a "cddb read" for that
815  disc.
816
817
818Addendum B: CDDBP under HTTP:
819-----------------------------
820
821Accessing a server as a CGI script is done in much the same way as through
822direct interaction. The command set is identical, though the method of
823communication is through CDDBP commands encapsulated in the HTTP protocol.
824The only limitation is that a single command may be executed per connection,
825since HTTP is not truly interactive. For the server to be accessed in this
826way, it must reside on the target host at a known URL which is accessible by
827the host HTTP server. The client program must connect to the HTTP server on
828the target host and issue an HTTP command with the appropriate CDDBP command
829encapsulated within.
830
831Commands may be submitted to servers in CGI mode using either the "GET" or
832"POST" HTTP commands. Both methods are supported, and there is no real
833difference between how both are to be used other than the syntactical
834difference between the two methods. The "POST" method may provide the ability
835to issue longer commands, though, depending on the architecture of the system
836on which the server resides.
837
838The server command must be sent as part of the "Request-URI" in the case
839of the "GET" method, and as the "Entity-Body" in the case of the "POST"
840method. In both cases, the command must be of the following form:
841
842cmd=server+command&amp;hello=joe+my.host.com+clientname+version&amp;proto=1
843
844Where the text following the "cmd=" represents the CDDBP command to be
845executed, the text following the "hello=" represents the arguments to
846the "cddb hello" command that is implied by this operation, and the
847text following the "proto=" represents the argument to the "proto" command
848that is implied by this operation.
849
850The "+" characters in the input represent spaces, and will be translated
851by the server before performing the request. Special characters may be
852represented by the sequence "%XX" where "XX" is a two-digit hex number
853corresponding to the ASCII (ISO-8859-1) sequence of that character. The
854"&amp;" characters denote separations between the command, hello and proto
855arguments. Newlines and carriage returns must not appear anywhere in the
856string except at the end.
857
858All CDDBP commands are supported under HTTP, except for "cddb hello",
859"cddb write", "proto" and "quit".
860
861For example, should user "joe" on system "my.host.com" be running xmcd 2.1,
862a read request for his currenly playing CD might look like this:
863
864cmd=cddb+read+rock+12345678&amp;hello=joe+my.host.com+xmcd+2.1&amp;proto=1
865
866The server will perform the implied "proto" and "cddb hello" commands,
867and then perform the requested "cddb read" command.
868
869Server response to the command is encapsulated in the HTTP server response,
870and appears in the "Entity-Body" exactly as it would appear using the CDDBP
871protocol. Note that the HTTP response "Entity-Header" is not guaranteed to
872contain a "Content-Length" field, so clients should be prepared to accept
873variable length input. This is no different from operation under CDDBP. The
874header will always contain a Mime "Content-Type" field which describes the
875body of data as "text/plain".
876
877For more detailed information on HTTP and Mime, see RFC 1945 and RFC 1521.
878</pre>
879	</tr></td>
880	<tr><td align=center><font face=Arial,Helvetica>
881	&nbsp;
882	</tr></td>
883	</table></tr></td></table></center></td><td>&nbsp;</td>
884
885
886</tr></table></td></tr></table><br><br>
887
888<font face=Arial,Helvetica size=1><center>
889<br>
890<br>
891<br>
892<br>
893</body>
894</html>
895