]> git.ipfire.org Git - thirdparty/cups.git/blob - doc/help/spec-browsing.html
Merge changes from CUPS 1.4svn-r8628.
[thirdparty/cups.git] / doc / help / spec-browsing.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- SECTION: Specifications -->
4 <head>
5 <title>CUPS Browse Protocol</title>
6 <meta name='keywords' content='Programming'>
7 <LINK REL="STYLESHEET" TYPE="text/css" HREF="../cups-printable.css">
8 </head>
9 <body>
10 <!--
11 "$Id$"
12
13 CUPS Browse Protocol specification for the Common UNIX Printing System (CUPS).
14
15 Copyright 2008 by Apple Inc.
16 Copyright 1997-2005 by Easy Software Products.
17
18 These coded instructions, statements, and computer programs are the
19 property of Apple Inc. and are protected by Federal copyright
20 law. Distribution and use rights are outlined in the file "LICENSE.txt"
21 which should have been included with this file. If this file is
22 file is missing or damaged, see the license at "http://www.cups.org/".
23 -->
24
25 <H1 CLASS="title">CUPS Browse Protocol</H1>
26
27 <h2><a name='INTRO'>Introduction</a></h2>
28
29 <p>This specification describes the CUPS browsing protocol which is used for
30 printer sharing. The protocol is a UDP/IP-based broadcast service that
31 operates on IP service port 631 by default. Each broadcast packet describes
32 a single printer or class being shared.</p>
33
34 <p>For simple networks with a single subnet, a CUPS system sharing a printer
35 (the <em>server</em>) will periodically broadcast that printer's availability
36 and status information to the subnet. Every other CUPS system on the subnet
37 (the <em>clients</em>) will receive the broadcast and make that printer
38 available to local users. If a client stops receiving broadcasts from the
39 server, or if the server sends a special "deleted" broadcast message, the
40 client will remove its copy of the printer.</p>
41
42 <p>For larger networks with multiple subnets, a relay configuration can be used
43 where one or more client systems poll the server and then broadcast the
44 availability and status information for the server's shared printers to the
45 clients' local subnets.</p>
46
47 <p>A key feature of CUPS printer sharing is support for <em>implicit
48 classes</em>, which are automatically-created classes for printers that are
49 shared by multiple servers. These implicit classes provide automatic load
50 balancing and fail-safe printing functionality transparently to the user.</p>
51
52
53 <h2><a name='SECURITY'>Security Considerations</a></h2>
54
55 <p>Like most discovery protocols, CUPS browse packets are not encrypted or
56 signed, so it is possible for malicious systems on a network to advertise
57 or remove printers on that network to cause denial of service or information
58 disclosure. In order to combat this, CUPS logs incoming browse packets and
59 provides access controls to limit browse packet reception to known hosts.</p>
60
61
62 <h2><a name='FORMAT'>Browse Packet Format</a></h2>
63
64 <p>Each broadcast packet is an ASCII text string of up to 1450 bytes ending
65 with a line feed (0x0a). The general format is:</p>
66
67 <p class='summary'>
68 printer-type printer-state printer-uri "printer-location" "printer-info"
69 "printer-make-and-model" name=value name2=value2 ...
70 </p>
71
72 <p>Each of the fields contains the value of the corresponding IPP attribute.
73 The trailing "name=value" information is used to convey default job template
74 attribute values (job-sheets-default, media-default, etc.), authentication
75 requirements (auth-info-required), and additional IPP URI options that are
76 requested by the server (ipp-options).</p>
77
78 <h3>ABNF Definition</h3>
79
80 <p>The following ABNF definition [RFC4234, RFC3986] defines the format of each
81 browse packet:</p>
82
83 <pre class='command'>
84 PACKET = TYPE WSP STATE WSP URI WSP LOCATION WSP INFO WSP
85 MAKE-AND-MODEL WSP *[ WSP ATTR-NAME "=" ATTR-VALUE ] LF
86
87 TYPE = 1*HEXDIG
88
89 STATE = "3" / "4" / "5"
90
91 URI = "ipp://" ( 1*NAMECHAR / IP-literal / IPv4address )
92 [ ":" 1*DIGIT ] ( "/printers/" / "/classes/" ) 1*NAMECHAR
93 NAMECHAR = %x21.22.24.26-2E.30-7E / %x25 HEXDIG HEXDIG
94 IP-literal = See RFC 3986
95 IPv4address = See RFC 3986
96
97 LOCATION = QUOTED-STRING
98 INFO = QUOTED-STRING
99 MAKE-AND-MODEL = QUOTED-STRING
100
101 ATTR-NAME = 1*( ALPHA / DIGIT / "-" / "." )
102 ATTR-VALUE = QUOTED-STRING / 1*UNQUOTE-CHAR
103
104 QUOTED-STRING = DQUOTE *QUOTED-CHAR DQUOTE
105 QUOTED-CHAR = %x20.21.23-5B.5D-7E / UTF8-CHAR / %x5C %x5C / %x5C %x22
106 UNQUOTE-CHAR = %x21.23-26.28-5B.5D-7E / UTF8-CHAR
107 UTF8-CHAR = %xC0.DF %x80.BF / %xE0.EF %x80.BF %x80.BF /
108 %xF0.F7 %x80.BF %x80.BF %x80.BF
109 </pre>
110
111 </body>
112 </html>