summaryrefslogtreecommitdiff
path: root/acme/bin/source/acd/cddbproto
blob: d1a278318f1a1fdcaf0f932ca9def2f059750285 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
<html><html>
<head>
<title>::freedb.org::</title>
</head>

<body bgcolor="#FFFFFF" text="#000000" link="#101070" vlink="#101070">

<center>

<table cellpadding=0 cellspacing=0 border=0 width="99%" align=center><tr><td align=left>
<a href="/">
<table border=0>
<td bgcolor="#ffffff">
 <table border=0 width=100% cellpadding=0 cellspacing=0>
  <td bgcolor=#101070>
   <table border=0>
    <td bgcolor=#ffffff><font face="Arial,Helvetica,Lucida" color="#101070" size=8><b>freedb</b></td>
    <td bgcolor=#101070><font face="Arial,Helvetica,Lucida" color="#ffffff" size=8><b>.org</b></td>
   </table>
  </td>
  <tr>
  <td align=right><font face="Arial,Helvetica,Lucida" color="#101070" size=2><b>a free approach to cddbp
 </table>
</td>
</table>
</a>
</td><td align=right width=100%>
	<form action="search.php" method=post>
	<font face=Arial,Helvetica size=2><input type=name name=query width=20 size=20 length=20>
	</td>
	<td align=right>&nbsp;&nbsp;<input type=image src=images/menu/english/search.gif border=0 align=middle></td>
	</form>

</td></tr></table><br>
<table cellpadding=0 cellspacing=0 border=0 width="99%" bgcolor=101070><tr><td>
<table cellpadding=5 cellspacing=1 border=0 width="100%" bgcolor=FFFFFF><tr><td>
<font face=Lucida,Verdana,Arial,Helvetica size=2>freedb.org - a free approach to cddbp</td></tr></table></td></tr></table><P>

<table width="99%" align=center cellpadding=0 cellspacing=0 border=0><tr>
	<td valign=top rowspan=5>

<table border=0><tr><td>

	<table width="115" border="0" cellpadding="0" cellspacing="0"><tr valign="top" bgcolor="#101070">
                 <td bgcolor="#FFFFFF"><img src="themes/SlashOcean/pix.gif" width="3" height="3"></td>
                 <td><img src="themes/SlashOcean/cl.gif" width="7" height="10"></td>
                 <td><font face="verdana,helvetica,arial" size="1" color="#ffffff"><B>Main Menu</B></font></td>
                 <td align="right"><img src="themes/SlashOcean/cr.gif" width="7" height="10" alt=""></td>
                 <td bgcolor="#FFFFFF" align="right"><img src="themes/SlashOcean/pix.gif" width="3" height="3"></td>
	</tr></table>
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr bgcolor="#101070"><td colspan="3"><img src="themes/SlashOcean/pix.gif" width="1" height="1"></td></tr>
	<tr bgcolor="#ffffff">
		<td background="themes/SlashOcean/sl.gif"><img src="themes/SlashOcean/pix.gif" width="3" height="3" alt=""></td>
		<td width="100%">
		<table width="100%" border="0" cellpadding="5" cellspacing="0"><tr>
		<td><font face="verdana,helvetica,arial" size="1">
		<li><a href=index.php>Home</a>
<li><a href=topics.php>News-Topics</a>
<li><a href=sections.php?op=listarticles&secid=1>About</a>
<li><a href=sections.php?op=listarticles&secid=2>Developers</a>
<li><a href=sections.php?op=listarticles&secid=3>Applications</a>
<li><a href=sections.php?op=listarticles&secid=7>Download</a>
<li><a href=forum/index.php>Forum</a>
<li><a href=http://freedb.music.sk/search/>Web-based Search</a>
<li><a href=links.php>Web Links</a>
<li><a href=user.php>Your Account</a>
<li><a href=submit.php>Submit News</a>

		</font></td>
		</tr></table>

		
	</td><td background="themes/SlashOcean/sr.gif" align="right"><img src="themes/SlashOcean/pix.gif" width="3" height="3" alt=""></td>
      </tr>
	<tr bgcolor="#101070"><td colspan="3"><img src="themes/SlashOcean/pix.gif" width="1" height="1"></td></tr>
	</table>
	</td>






</tr></td></table>
<br>
<table border=0><tr><td>

	<table width="115" border="0" cellpadding="0" cellspacing="0"><tr valign="top" bgcolor="#101070">
                 <td bgcolor="#FFFFFF"><img src="themes/SlashOcean/pix.gif" width="3" height="3"></td>
                 <td><img src="themes/SlashOcean/cl.gif" width="7" height="10"></td>
                 <td><font face="verdana,helvetica,arial" size="1" color="#ffffff"><B>FAQ</B></font></td>
                 <td align="right"><img src="themes/SlashOcean/cr.gif" width="7" height="10" alt=""></td>
                 <td bgcolor="#FFFFFF" align="right"><img src="themes/SlashOcean/pix.gif" width="3" height="3"></td>
	</tr></table>
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr bgcolor="#101070"><td colspan="3"><img src="themes/SlashOcean/pix.gif" width="1" height="1"></td></tr>
	<tr bgcolor="#ffffff">
		<td background="themes/SlashOcean/sl.gif"><img src="themes/SlashOcean/pix.gif" width="3" height="3" alt=""></td>
		<td width="100%">
		<table width="100%" border="0" cellpadding="5" cellspacing="0"><tr>
		<td><font face="verdana,helvetica,arial" size="1">
		Our FAQ can be found <a href="http://freedb.freedb.org/sections.php?op=viewarticle&artid=26">here</a>.<br>
Please read the FAQ before asking questions via email.		</font></td>
		</tr></table>

		
	</td><td background="themes/SlashOcean/sr.gif" align="right"><img src="themes/SlashOcean/pix.gif" width="3" height="3" alt=""></td>
      </tr>
	<tr bgcolor="#101070"><td colspan="3"><img src="themes/SlashOcean/pix.gif" width="1" height="1"></td></tr>
	</table>
	</td>

</tr></td></table>
<br>
<table border=0><tr><td>

	<table width="115" border="0" cellpadding="0" cellspacing="0"><tr valign="top" bgcolor="#101070">
                 <td bgcolor="#FFFFFF"><img src="themes/SlashOcean/pix.gif" width="3" height="3"></td>
                 <td><img src="themes/SlashOcean/cl.gif" width="7" height="10"></td>
                 <td><font face="verdana,helvetica,arial" size="1" color="#ffffff"><B>Contact</B></font></td>
                 <td align="right"><img src="themes/SlashOcean/cr.gif" width="7" height="10" alt=""></td>
                 <td bgcolor="#FFFFFF" align="right"><img src="themes/SlashOcean/pix.gif" width="3" height="3"></td>
	</tr></table>
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr bgcolor="#101070"><td colspan="3"><img src="themes/SlashOcean/pix.gif" width="1" height="1"></td></tr>
	<tr bgcolor="#ffffff">
		<td background="themes/SlashOcean/sl.gif"><img src="themes/SlashOcean/pix.gif" width="3" height="3" alt=""></td>
		<td width="100%">
		<table width="100%" border="0" cellpadding="5" cellspacing="0"><tr>
		<td><font face="verdana,helvetica,arial" size="1">
		General questions:<br>
<a href="mailto:info@freedb.org">info@freedb.org</a><hr>
Databaseupdates:<br>
<a href="mailto:updates@freedb.org">updates@freedb.org</a><br>
(<b>NOT</b> for submission!)<hr>
Please keep in mind that we are NOT the Nero-Support and please do not send CD-submits to the adresses above.<br>
Submits have to go to:<br>
<a href="mailto:freedb-submit@freedb.org">freedb-submit@freedb.org</a>		</font></td>
		</tr></table>

		
	</td><td background="themes/SlashOcean/sr.gif" align="right"><img src="themes/SlashOcean/pix.gif" width="3" height="3" alt=""></td>
      </tr>
	<tr bgcolor="#101070"><td colspan="3"><img src="themes/SlashOcean/pix.gif" width="1" height="1"></td></tr>
	</table>
	</td>

</tr></td></table>
<br>
<table border=0><tr><td>

	<table width="115" border="0" cellpadding="0" cellspacing="0"><tr valign="top" bgcolor="#101070">
                 <td bgcolor="#FFFFFF"><img src="themes/SlashOcean/pix.gif" width="3" height="3"></td>
                 <td><img src="themes/SlashOcean/cl.gif" width="7" height="10"></td>
                 <td><font face="verdana,helvetica,arial" size="1" color="#ffffff"><B>Downloads</B></font></td>
                 <td align="right"><img src="themes/SlashOcean/cr.gif" width="7" height="10" alt=""></td>
                 <td bgcolor="#FFFFFF" align="right"><img src="themes/SlashOcean/pix.gif" width="3" height="3"></td>
	</tr></table>
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr bgcolor="#101070"><td colspan="3"><img src="themes/SlashOcean/pix.gif" width="1" height="1"></td></tr>
	<tr bgcolor="#ffffff">
		<td background="themes/SlashOcean/sl.gif"><img src="themes/SlashOcean/pix.gif" width="3" height="3" alt=""></td>
		<td width="100%">
		<table width="100%" border="0" cellpadding="5" cellspacing="0"><tr>
		<td><font face="verdana,helvetica,arial" size="1">
		The link to the database downloads is <a href="/sections.php?op=viewarticle&artid=12">here</a>		</font></td>
		</tr></table>

		
	</td><td background="themes/SlashOcean/sr.gif" align="right"><img src="themes/SlashOcean/pix.gif" width="3" height="3" alt=""></td>
      </tr>
	<tr bgcolor="#101070"><td colspan="3"><img src="themes/SlashOcean/pix.gif" width="1" height="1"></td></tr>
	</table>
	</td>


</tr></td></table>
<td>&nbsp;</td><td valign="top" width="100%">

<!-- columna de inicio -->
<center>
	<table border=0 cellpadding=1 cellspacing=0 width=100% bgcolor=000000><tr><td>
	<table border=0 cellpadding=8 cellspacing=0 width=100% bgcolor=FFFFFF>
	<tr><td align=left><font face=Arial,Helvetica size=3>
	<b>CDDB-protocol documentation</b><br>
	<font size=2>
	<br><br>
	<pre>
				CDDB Protocol

			  By Steve Scherf and Ti Kan
		          --------------------------

Revision: $Id: CDDBPROTO,v 1.6 1997/05/14 07:53:52 steve Exp steve $


Notation:
-&gt; : client to server
&lt;- : server to client

terminating marker: `.' character in the beginning of a line


Server response code (three digit code):

First digit:
1xx	Informative message
2xx	Command OK
3xx	Command OK so far, continue
4xx	Command OK, but cannot be performed for some specified reasons
5xx	Command unimplemented, incorrect, or program error
 
Second digit:
x0x	Ready for further commands
x1x	More server-to-client output follows (until terminating marker)
x2x	More client-to-server input follows (until terminating marker)
x3x	Connection will close

Third digit:
xx[0-9]	Command-specific code


CDDB Protocol Level 1:
----------------------

Server sign-on banner:
----------------------
&lt;- code hostname CDDBP server version ready at date

    code:
	200	OK, read/write allowed
	201	OK, read only
	432	No connections allowed: permission denied
	433	No connections allowed: X users allowed, Y currently active
	434	No connections allowed: system load too high
    hostname:
	Server host name.  Example: xyz.fubar.com
    version:
	Version number of server software.  Example: v1.0PL0
    date:
	Current date and time.  Example: Wed Mar 13 00:41:34 1996


Initial client-server handshake:
--------------------------------
Note: This handshake must occur before other cddb commands
      are accepted by the server.

Client command:
-&gt; cddb hello username hostname clientname version

    username:
	Login name of user.  Example: johndoe
    hostname:
	Host name of client.  Example: abc.fubar.com
    clientname:
	The name of the connecting client.  Example: xmcd, cda, EasyCD,
	et cetera. Do not use the name of another client which already
	exists.
    version:
	Version number of client software.  Example: v1.0PL0

Server response:
&lt;- code hello and welcome username@hostname running clientname version

    code:
	200	Handshake successful
	431	Handshake not successful, closing connection
	402	Already shook hands


CDDB query:
-----------
Client command:
-&gt; cddb query discid ntrks off1 off2 ... nsecs

    discid:
	CD disc ID number.  Example: f50a3b13
    ntrks:
	Total number of tracks on CD.
    off1, off2, ...:
	Frame offset of the starting location of each track.
    nsecs:
	Total playing length of CD in seconds.

Server response:
&lt;- code categ discid dtitle
	or
&lt;- code close matches found
&lt;- categ discid dtitle
&lt;- categ discid dtitle
&lt;- (more matches...)
&lt;- .

    code:
	200	Found exact match
	211	Found inexact matches, list follows (until terminating marker)
	202	No match found
	403	Database entry is corrupt
	409	No handshake
    categ:
	CD category.  Example: rock
    discid:
	CD disc ID number of the found entry.  Example: f50a3b13
    dtitle:
	The Disc Artist and Disc Title (The DTITLE line).  For example:
	Pink Floyd / The Dark Side of the Moon


CDDB read:
----------
Client command:
-&gt; cddb read categ discid

    categ:
	CD category.  Example: rock
    discid:
	CD disc ID number.  Example: f50a3b13

Server response:
&lt;- code categ discid
&lt;- # xmcd 2.0 CD database file
&lt;- # ...
&lt;- (CDDB data...)
&lt;- .
	or
&lt;- code categ discid No such CD entry in database

    code:
	210	OK, CDDB database entry follows (until terminating marker)
	401	Specified CDDB entry not found.
	402	Server error.
	403	Database entry is corrupt.
	409	No handshake.
    categ:
	CD category.  Example: rock
    discid:
	CD disc ID number.  Example: f50a3b13


CDDB search: (command not yet implemented in freedb-serversoftware!)
------------
Client command:
-&gt; cddb srch key search_type ... search_type

    key:
	Pseudo-regular expression to match. Expressions should meet the
	following description:

	- No white space.
	- Printable characters only.
	- Case is ignored.
    search_type:
	CDDB fields to search through.  Example: title
	Supported types: artist, title, extd, ext, trk
    categ:
	CD category.  Example: rock

Server response:
&lt;- code matches found
&lt;- categ discid dtitle
&lt;- categ discid dtitle
&lt;- (more matches...)
&lt;- .

    code:
	210	OK, matches found, list follows (until terminating marker)
	401	No match found.
	409	No handshake.
    categ:
	CD category.  Example: rock
    dtitle:
	The Disc Artist and Disc Title (The DTITLE line).  For example:
	Pink Floyd / The Dark Side of the Moon


CDDB write:
-----------
Client command:
-&gt; cddb write categ discid

    categ:
	CD category.  Example: rock
    discid:
	CD disc ID number.  Example: f50a3b13

Server response:
&lt;- code categ discid

    code:
	320	OK, input CDDB data (until terminating marker)
	401	Permission denied.
	402	Server file system full/file access failed.
	409	No handshake.
	501	Entry rejected: reason for rejection.
    categ:
	CD category.  Example: rock
    discid:
	CD disc ID number.  Example: f50a3b13

Client data:
-&gt; # xmcd 2.0 CD database file
-&gt; # ...
-&gt; (CDDB data)
-&gt; .

Server response:
&lt;- code message

    code:
	200	CDDB entry accepted
	401	CDDB entry rejected: reason why
    message:
	Message string to indicate write status:
	CDDB entry accepted, or CDDB entry rejected.


Help information:
-----------------
Client command:
-&gt; help
	or
-&gt; help cmd

    cmd:
	CDDB command.  Example: quit

	or

-&gt; help cmd subcmd

    cmd:
	CDDB command.  Example: cddb
    subcmd:
	CDDB command argument.  Example: query

Server response:
&lt;- code Help information follows
&lt;- (help data ...)
&lt;- .
	or
&lt;- code no help information available

    code:
	210	OK, help information follows (until terminating marker)
	401	No help information available


Log statistics:
---------------
Client command:
-&gt; log [[-l lines] [start date [end date]] | [day [days]] | [get"]]

    lines:
	The maximum number of lines to print for each data list in the
	log statistics.
    start date:
	The date after which statistics should be calculated. Date is
	of the format: hh[mm[ss[MM[DD[[CC]YY]]]]]

	E.g.:	201200053196 for 8:12 PM on May 31, 1996.
		20120005312096 for 8:12 PM on May 31, 2096.
		080530 for today at at 8:15 and 30 seconds.

	If the century ("CC") is omitted, a reasonable guess is made. If
	this argument is omitted, all messages are considered.
    end date:
	The date after which statistics should not be calculated. If
	omitted, the end date is assumed to be the current date.
    day:
	The string "day". This solitary argument will cause a log search
	of messages generated within the last day.
    days:
	A positive numerical argument which modifies the number of days'
        messages to searh. If this argument is left out, the default is 1.
    get:
	The string "get". This solitary argument will cause the server
	to send the contents of the log file.

Server response:
&lt;- code Log summary follows
&lt;- (log stats)
&lt;- .
	or
&lt;- code Log follows
&lt;- (log stats)
&lt;- .

    code:
	210	OK, log summary follows (until terminating marker)
	211	OK, log follows (until terminating marker)
	401	Permission denied
	402	No log information available
	501	Invalid start/end date


Message of the day:
------------------
Client command:
-&gt; motd

Server response:
&lt;- code Last modified: date MOTD follows (until terminating marker)
&lt;- (message text)
&lt;- .

    code:
	210	Last modified: 05/31/96 06:31:14 MOTD follows (until terminating marker)
	401	No message of the day available
    date:
	The date the text of the message of the day was modified. The date
	appears in the following format:

		05/31/96 06:31:14

	This value may be used by client software as a message timestamp
	for purposes of determining if it has already been displayed. This
	format was chosen because it is more easily parsed than the standard
	ctime() format.


Server protocol level:
----------------------
Client command:
-&gt; proto [level]

    level:
	The (numerical) protocol level to set the server to.

Server response:
&lt;- code CDDB protocol level: current cur_level, supported supported_level
	or
&lt;- code OK, protocol version now: cur_level

    code:
	200	CDDB protocol level: current cur_level, supported supp_level
	201	OK, protocol version now: cur_level
	501	Illegal protocol level.
	502	Protocol level already cur_level.
    cur_level:
	The current protocol level at which the server is running.
    supported_level:
	The maximum supported protocol level.


Server sites:
--------------
Client command:
-&gt; sites

Server response:
&lt;- code OK, site information follows (until terminating `.')
&lt;- (data)
&lt;- .

    code:
	210	Ok, site information follows
	401	No site information available.

    The data format is as follows:
	site port latitude longitude description

    The fields are as follows:
	site:
	    The Internet address of the remote site.
	port:
	    The port at which the server resides on that site.
	latitude:
	    The latitude of the server site. The format is as follows:
		CDDD.MM
	    Where "C" is the compass direction (N, S), "DDD" is the
	    degrees, and "MM" is the minutes.
	longitude:
	    The longitude of the server site. Format is as above, except
	    the compass direction must be one of (E, W).
	description:
	    A short description of the geographical location of the site.

    Example:
	cddb.moonsoft.com 888 N037.23 W122.01 Fremont, CA USA


Server status:
--------------
Client command:
-&gt; stat

Server response:
&lt;- code OK, status information follows (until terminating `.')
&lt;- (data)
&lt;- .

    code:
	210	Ok, status information follows

    The possible data is as follows:
	current proto: &lt;current_level&gt;
	    An integer representing the server's current operating protocol
	    level.
	max proto:     &lt;max_level&gt;
	    The maximum supported protocol level.
	gets:          &lt;yes | no&gt;
	    Whether or not the client is allowed to get log information,
	    according to the string "yes" or "no".
	updates:       &lt;yes | no&gt;
	    Whether or not the client is allowed to initiate a database
	    update, according to the string "yes" or "no".
	posting:       &lt;yes | no&gt;
	    Whether or not the client is allowed to post new entries,
	    according to the string "yes" or "no".
	quotes:        &lt;yes | no&gt;
	    Whether or not quoted arguments are enabled, according to
	    the string "yes" or "no".
	current users: &lt;num_users&gt;
	    The number of users currently connected to the server.
	max users:     &lt;num_max_users&gt;
	    The number of users that can concurrently connect to the server.
	strip ext:	&lt;yes | no&gt;
	    Whether or not extended data is stripped by the server before
	    presented to the user.
	Database entries: &lt;num_db_entries&gt;
	    The total number of entries in the database.
	Database entries by category:
	    This field is followed by a list of catgories and the number
	    of entries in that category. Each entry is of the following
	    format:

		&lt;white space&gt;catgory: &lt;num_db_entries&gt;

	    The list of entries is terminated by the first line that does
	    not begin with white space.

	Pending file transmissions:
	    This field is followed by a list of sites that are fed new
	    database entries at periodic intervals, and the number of
	    entries that have yet to be transmitted to that site.
	    Each entry is of the following format:

		&lt;white space&gt;site: &lt;num_db_entries&gt;

	    The list of entries is terminated by the first line that does
	    not begin with white space.

	This list may grow as needed, so clients must expect possible
	unrecognizable data. Also, additional fields may be added to
	the currently existing lines, although no existing fields will
	be removed or change position.
	

Server version:
---------------
Client command:
-&gt; ver

Server response:
&lt;- code servername version copyright
	or
&lt;- code Version information follows

    code:
	200	Version information.
	211	OK, version information follows (until terminating marker)
    version:
	Server version.  Example: v1.0PL0
    copyright:
	Copyright string.  Example: Copyright (c) 1996 Steve Scherf


Database update:
----------------
Client command:
-&gt; update

Server response:
&lt;- code Updating the database.
	or
&lt;- code Permission denied.
	or
&lt;- code Unable to update the database.

    code:
	200 Updating the database.
	401 Permission denied.
	402 Unable to update the database.


Server users:
-------------
Client command:
-&gt; whom

Server response:
&lt;- code User list follows

    code:
	210	OK, user list follows (until terminating marker)
	401	No user information available.


Client sign-off:
----------------
Client command:
-&gt; quit

Server response:
&lt;- code hostname closing connection.  Goodbye.

    code:
	230	OK, goodbye.
    hostname:
	Server host name.  Example: xyz.fubar.com


General errors:
---------------

Server response:
&lt;- code error
    code:
	402	Server error.
	408	CGI environment error.
	500	Command syntax error, command unknown, command unimplemented.
	530	Server error, server timeout.


Reserved errors:
----------------

The following error codes are reserved, and will never be returned as a
response to a CDDB protocol command. They are intended to be used internally
by clients that have a need for generating pseudo-responses.

	600-699


CDDB Protocol Level 2:
----------------------

In all respects, protocol level 2 is the same as level 1, with the exceptions
listed below.

Arguments to commands may be surrounded by double quotes. All characters
within the quotes, including white space, are included in the argument. All
white space is replaced by the `_' (2Dh) character by the server. White space
is defined as ` ' (20h) and `^I' (control-I, or 09h).

Arguments containing quotes that should not be interpreted with the special
meaning described above should be escaped with a preceding backslash character,
or '' (5Ch). If an actual backslash appears in an argument, it should be
escaped with a preceding backslash. In both cases, the preceding backslash
will be removed from the input before being interpreted.


CDDB Protocol Level 3:
----------------------

Protocol level 3 is the same as level 2, with the exception listed below.

The output of the "sites" command has changed to meet the folowing description:

    The data format is as follows:
	site protocol port address latitude longitude description

    The fields are as follows:
	site:
	    The Internet address of the remote site.
	protocol:
	    The transfer protocol used to access the site.
	port:
	    The port at which the server resides on that site.
	address:
	    Any additional addressing information needed to access the
	    server. For example, for HTTP protocol servers, this would be
	    the path to the CDDB server CGI script. This field will be
	    "-" if no additional addressing information is needed.
	latitude:
	    The latitude of the server site. The format is as follows:
		CDDD.MM
	    Where "C" is the compass direction (N, S), "DDD" is the
	    degrees, and "MM" is the minutes.
	longitude:
	    The longitude of the server site. Format is as above, except
	    the compass direction must be one of (E, W).
	description:
	    A short description of the geographical location of the site.

    Example:
	cddb.moonsoft.com cddbp 888 - N037.23 W122.01 Fremont, CA USA
	cddb.moonsoft.com http 80 /~cddb/cddb.cgi N037.23 W122.01 Fremont,CA USA

Note that a site may appear once for each type of protocol it supports for
accessing the server.


Addendum A: Proper use of CDDBP:
--------------------------------

There are a few guidelines that must be followed in order to make proper use
of CDDBP:

- When handshaking with the server via the "cddb hello" command, the client
  must specify its own name and version, not that of some other client (such
  as xmcd). Also, the "username" and "hostname" must be that of the actual
  user running the program, not some hardwired value.

- Before performing a "cddb read", the client program MUST perform a
  "cddb query". Failure to do so may result in the client program receiving
  incorrect CDDB data from the server. Also, without performing a query, the
  client program will not benefit from close matches in the event of the
  lack of an exact match in the database.

- For accounting purposes, it is best if client programs only perform a single
  "cddb query" for a particular disc before performing a "cddb read" for that
  disc.


Addendum B: CDDBP under HTTP:
-----------------------------

Accessing a server as a CGI script is done in much the same way as through
direct interaction. The command set is identical, though the method of
communication is through CDDBP commands encapsulated in the HTTP protocol.
The only limitation is that a single command may be executed per connection,
since HTTP is not truly interactive. For the server to be accessed in this
way, it must reside on the target host at a known URL which is accessible by
the host HTTP server. The client program must connect to the HTTP server on
the target host and issue an HTTP command with the appropriate CDDBP command
encapsulated within.

Commands may be submitted to servers in CGI mode using either the "GET" or
"POST" HTTP commands. Both methods are supported, and there is no real
difference between how both are to be used other than the syntactical
difference between the two methods. The "POST" method may provide the ability
to issue longer commands, though, depending on the architecture of the system
on which the server resides.

The server command must be sent as part of the "Request-URI" in the case
of the "GET" method, and as the "Entity-Body" in the case of the "POST"
method. In both cases, the command must be of the following form:

cmd=server+command&amp;hello=joe+my.host.com+clientname+version&amp;proto=1

Where the text following the "cmd=" represents the CDDBP command to be
executed, the text following the "hello=" represents the arguments to
the "cddb hello" command that is implied by this operation, and the
text following the "proto=" represents the argument to the "proto" command
that is implied by this operation.

The "+" characters in the input represent spaces, and will be translated
by the server before performing the request. Special characters may be
represented by the sequence "%XX" where "XX" is a two-digit hex number
corresponding to the ASCII (ISO-8859-1) sequence of that character. The
"&amp;" characters denote separations between the command, hello and proto
arguments. Newlines and carriage returns must not appear anywhere in the
string except at the end.

All CDDBP commands are supported under HTTP, except for "cddb hello",
"cddb write", "proto" and "quit".

For example, should user "joe" on system "my.host.com" be running xmcd 2.1,
a read request for his currenly playing CD might look like this:

cmd=cddb+read+rock+12345678&amp;hello=joe+my.host.com+xmcd+2.1&amp;proto=1

The server will perform the implied "proto" and "cddb hello" commands,
and then perform the requested "cddb read" command.

Server response to the command is encapsulated in the HTTP server response,
and appears in the "Entity-Body" exactly as it would appear using the CDDBP
protocol. Note that the HTTP response "Entity-Header" is not guaranteed to
contain a "Content-Length" field, so clients should be prepared to accept
variable length input. This is no different from operation under CDDBP. The
header will always contain a Mime "Content-Type" field which describes the
body of data as "text/plain".

For more detailed information on HTTP and Mime, see RFC 1945 and RFC 1521.
</pre>
	</tr></td>
	<tr><td align=center><font face=Arial,Helvetica>
	&nbsp;
	</tr></td>
	</table></tr></td></table></center></td><td>&nbsp;</td>


</tr></table></td></tr></table><br><br>

<font face=Arial,Helvetica size=1><center>
<br>
<br>
<br>
<br>
</body>
</html>