]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Update documentation on backends and filters to make it explicit that you don't run
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 13 Apr 2012 16:54:44 +0000 (16:54 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 13 Apr 2012 16:54:44 +0000 (16:54 +0000)
them directly.

Add snmpbackend man page documenting the one exception to that rule.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10403 7a7537e8-13f0-0310-91df-b6672ffda945

configure.in
doc/Makefile
doc/help/ref-snmp-conf.html
man/Makefile
man/backend.man
man/filter.man
man/snmpbackend.man.in [new file with mode: 0644]
scheduler/job.c

index fe47cbf56663792d0e2219263fd6c2d7d4ed9fc8..9094573dd2a662c43cd5ceb141e8f81012fa6671 100644 (file)
@@ -78,6 +78,7 @@ AC_OUTPUT(Makedefs
          man/cupsd.conf.man
          man/cupsd.man
          man/lpoptions.man
+         man/snmpbackend.man
          scheduler/cups-lpd.xinetd
          scheduler/cups.sh
          scheduler/cups.xml
index ec7414eb2b62416af1dc15b803bace77a2fb0313..81ed705d5e62007be79f9925a897c2ec520c28c3 100644 (file)
@@ -94,6 +94,7 @@ HELPFILES     =       \
                        help/man-ppdi.html \
                        help/man-ppdmerge.html \
                        help/man-ppdpo.html \
+                       help/man-snmpbackend.html \
                        help/network.html \
                        help/options.html \
                        help/overview.html \
index db4aacee53796b8bce66c9d25d932468ead160df..4cab237e84e0980d98988b2ac242598997eb3504 100644 (file)
@@ -55,9 +55,8 @@ Community BigCorp
 <H3>Description</H3>
 
 <P>The <CODE>Community</CODE> directive specifies a community
-name to use when discovering printers. Multiple
-<CODE>Community</CODE> lines can be provided to scan different
-SNMP communities.</P>
+name to use when discovering printers and reporting status and supply
+levels for network printers.</P>
 
 <P>The default community is "public".</P>
 
index 1ec8389f488d52ce54f12f5da5115fccad08c801..d0155acf1df48f170c6892bbfe841322946067ee 100644 (file)
@@ -64,7 +64,8 @@ MAN8  =       cupsaccept.$(MAN8EXT) \
                lpadmin.$(MAN8EXT) \
                lpinfo.$(MAN8EXT) \
                lpmove.$(MAN8EXT) \
-               lpc.$(MAN8EXT)
+               lpc.$(MAN8EXT) \
+               snmpbackend.$(MAN8EXT)
 
 
 #
index 832f366266bc473ec682d79486bb3673ee772be3..a263f7199936935fcfb7f14add5bb13e6c7d2c68 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   Backend man page for CUPS.
 .\"
-.\"   Copyright 2007-2011 by Apple Inc.
+.\"   Copyright 2007-2012 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
 .\"   which should have been included with this file.  If this file is
 .\"   file is missing or damaged, see the license at "http://www.cups.org/".
 .\"
-.TH backend 7 "CUPS" "15 April 2011" "Apple Inc."
+.TH backend 7 "CUPS" "13 April 2012" "Apple Inc."
 
 .SH NAME
 backend \- cups backend transmission interfaces
-
 .SH SYNOPSIS
 .B backend
 .br
@@ -24,34 +23,43 @@ backend \- cups backend transmission interfaces
 job user title num-copies options [
 .I filename
 ]
-
 .SH DESCRIPTION
 Backends are a special type of \fIfilter(7)\fR which is used to
 send print data to and discover different devices on the system.
-
 .LP
 Like filters, backends must be capable of reading from a filename
 on the command-line or from the standard input, copying the
 standard input to a temporary file as required by the physical
 interface.
-
 .LP
 The command name (argv[0]) is set to the device URI of the destination printer.
 Starting with CUPS 1.1.22, any authentication information in argv[0] is removed,
 so backend developers are urged to use the DEVICE_URI environment variable
 whenever authentication information is required. The CUPS API includes a
 \fIcupsBackendDeviceURI\fR function for retrieving the correct device URI.
-
 .LP
 Back-channel data from the device should be relayed to the job
 filters by writing to file descriptor 3. The CUPS API includes
 the \fIcupsBackChannelWrite\fR function for this purpose.
-
+.SH WARNING
+CUPS backends are not generally design to be run directly by the user. Aside
+from the device URI issue (argv[0] and DEVICE_URI environment variable contain
+the device URI), CUPS backends also expect specific environment variables and
+file descriptors, and typically run in a user session that (on OS X) has
+additional restrictions that affect how it runs. Backends can also be installed
+with restricted permissions (0500 or 0700) that tell the scheduler to run them
+as the "root" user instead of an unprivileged user (typically "lp") on the
+system.
+.LP
+Unless you are a developer and know what you are doing, please do not run
+backends directly. Instead, use the \fIlp(1)\fR or \fIlpr(1)\fR programs to send
+a print job or \fIlpinfo(8)\fR program to query for available printers using the
+backend. The one exception is the SNMP backend - see \fIsnmpbackend(8)\fR for
+more information.
 .SH DEVICE DISCOVERY
-When run with no arguments, the backend should list the devices
-and schemes it supports or is advertising to stdout. The output
-consists of zero or more lines consisting of any of the following
-forms:
+When run with no arguments, the backend should list the devices and schemes it
+supports or is advertising to stdout. The output consists of zero or more lines
+consisting of any of the following forms:
 
 .nf
     device-class scheme "Unknown" "device-info"
@@ -59,138 +67,107 @@ forms:
     device-class device-uri "device-make-and-model" "device-info" "device-id"
     device-class device-uri "device-make-and-model" "device-info" "device-id" "device-location"
 .fi
-
 .LP
 The \fIdevice-class\fR field is one of the following values:
-
 .TP 5
 direct
 .br
-The device-uri refers to a specific direct-access device with no
-options, such as a parallel, USB, or SCSI device.
-
+The device-uri refers to a specific direct-access device with no options, such
+as a parallel, USB, or SCSI device.
 .TP 5
 file
 .br
 The device-uri refers to a file on disk.
-
 .TP 5
 network
 .br
-The device-uri refers to a networked device and conforms to the
-general form for network URIs.
-
+The device-uri refers to a networked device and conforms to the general form for
+network URIs.
 .TP 5
 serial
 .br
-The device-uri refers to a serial device with configurable baud
-rate and other options. If the device-uri contains a baud value,
-it represents the maximum baud rate supported by the device.
-
+The device-uri refers to a serial device with configurable baud rate and other
+options. If the device-uri contains a baud value, it represents the maximum baud
+rate supported by the device.
 .LP
-The \fIscheme\fR field provides the URI scheme that is supported
-by the backend. Backends should use this form only when the
-backend supports any URI using that scheme. The \fIdevice-uri\fR
-field specifies the full URI to use when communicating with the
-device.
-
+The \fIscheme\fR field provides the URI scheme that is supported by the backend.
+Backends should use this form only when the backend supports any URI using that
+scheme. The \fIdevice-uri\fR field specifies the full URI to use when
+communicating with the device.
 .LP
-The \fIdevice-make-and-model\fR field specifies the make and
-model of the device, e.g. "Acme Foojet 2000". If the make and
-model is not known, you must report "Unknown".
-
+The \fIdevice-make-and-model\fR field specifies the make and model of the
+device, e.g. "Example Foojet 2000". If the make and model is not known, you must
+report "Unknown".
 .LP
-The \fIdevice-info\fR field specifies additional information
-about the device. Typically this includes the make and model
-along with the port number or network address, e.g. "Acme Foojet
-2000 USB #1".
-
+The \fIdevice-info\fR field specifies additional information about the device.
+Typically this includes the make and model along with the port number or network
+address, e.g. "Example Foojet 2000 USB #1".
 .LP
-The optional \fIdevice-id\fR field specifies the IEEE-1284 device
-ID string for the device, which is used to select a matching
-driver.
-
+The optional \fIdevice-id\fR field specifies the IEEE-1284 device ID string for
+the device, which is used to select a matching driver.
 .LP
 The optional \fIdevice-location\fR field specifies the physical location of
 the device, which is often used to pre-populate the printer-location attribute
 when adding a printer.
-
 .SH PERMISSIONS
-Backends without world execute permissions are run as the root
-user. Otherwise, the backend is run using the unprivileged user
-account, typically "lp".
-
+Backends without world execute permissions are run as the root user. Otherwise,
+the backend is run using an unprivileged user account, typically "lp".
 .SH EXIT CODES
-The following exit codes are defined for backends; C API
-constants defined in the <cups/backend.h> header file are defined
-in parenthesis:
-
+The following exit codes are defined for backends; C API constants defined in
+the <cups/backend.h> header file are defined in parenthesis:
 .TP 5
 0 (CUPS_BACKEND_OK)
 .br
-The print file was successfully transmitted to the device or
-remote server.
-
+The print file was successfully transmitted to the device or remote server.
 .TP 5
 1 (CUPS_BACKEND_FAILED)
 .br
-The print file was not successfully transmitted to the device or
-remote server. The scheduler will respond to this by canceling
-the job, retrying the job, or stopping the queue depending on the
-state of the error-policy attribute.
-
+The print file was not successfully transmitted to the device or remote server.
+The scheduler will respond to this by canceling the job, retrying the job, or
+stopping the queue depending on the state of the error-policy attribute.
 .TP 5
 2 (CUPS_BACKEND_AUTH_REQUIRED)
 .br
-The print file was not successfully transmitted because valid
-authentication information is required. The scheduler will
-respond to this by holding the job and adding the
-authentication-required job-reasons keyword.
-
+The print file was not successfully transmitted because valid authentication
+information is required. The scheduler will respond to this by holding the job
+and adding the "cups-held-for-authentication" keyword to the "job-reasons"
+attribute.
 .TP 5
 3 (CUPS_BACKEND_HOLD)
 .br
-The print file was not successfully transmitted because it cannot
-be printed at this time. The scheduler will respond to this by
-holding the job.
-
+The print file was not successfully transmitted because it cannot be printed at
+this time. The scheduler will respond to this by holding the job.
 .TP 5
 4 (CUPS_BACKEND_STOP)
 .br
-The print file was not successfully transmitted because it cannot
-be printed at this time. The scheduler will respond to this by
-stopping the queue.
-
+The print file was not successfully transmitted because it cannot be printed at
+this time. The scheduler will respond to this by stopping the queue.
 .TP 5
 5 (CUPS_BACKEND_CANCEL)
 .br
-The print file was not successfully transmitted because one or
-more attributes are not supported. The scheduler will respond to
-this by canceling the job.
-
+The print file was not successfully transmitted because one or more attributes
+are not supported or the job was canceled at the printer. The scheduler will
+respond to this by canceling the job.
 .TP 5
 6 (CUPS_BACKEND_RETRY)
 .br
 The print file was not successfully transmitted because of a temporary issue.
 The scheduler will retry the job at a future time - other jobs may print before
 this one.
-
 .TP 5
 7 (CUPS_BACKEND_RETRY_CURRENT)
 .br
 The print file was not successfully transmitted because of a temporary issue.
 The scheduler will retry the job immediately without allowing intervening jobs.
-
 .PP
 All other exit code values are reserved.
-
 .SH SEE ALSO
-\fIcupsd(8)\fR, \fIcupsd.conf(5)\fR, \fIfilter(7)\fR,
+\fIcupsd(8)\fR, \fIcupsd.conf(5)\fR, \fIfilter(7)\fR, \fIlpinfo(8)\fR,
+\fIsnmpbackend(8)\fR,
 .br
 http://localhost:631/help
-
 .SH COPYRIGHT
-Copyright 2007-2011 by Apple Inc.
+Copyright 2007-2012 by Apple Inc.
 .\"
 .\" End of "$Id$".
 .\"
index ceb60faf02c30359d1dcf64409aa0cd2d3de3602..59fcd297193db35e61de006fbac24ab8632ee257 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   filter man page for CUPS.
 .\"
-.\"   Copyright 2007-2011 by Apple Inc.
+.\"   Copyright 2007-2012 by Apple Inc.
 .\"   Copyright 1997-2007 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -12,7 +12,7 @@
 .\"   which should have been included with this file.  If this file is
 .\"   file is missing or damaged, see the license at "http://www.cups.org/".
 .\"
-.TH filter 7 "CUPS" "13 May 2009" "Apple Inc."
+.TH filter 7 "CUPS" "13 April 2012" "Apple Inc."
 .SH NAME
 filter \- cups file conversion filter interface
 .SH SYNOPSIS
@@ -33,7 +33,14 @@ standard output.
 .LP
 The command name (argv[0]) is set to the name of the destination printer but is
 also available in the PRINTER environment variable.
-
+.SH WARNING
+CUPS filters are not meant to be run directly by the user. Aside from the legacy
+System V interface issues (argv[0] is the printer name), CUPS filters also
+expect specific environment variables and file descriptors, and typically run in
+a user session that (on OS X) has additional restrictions that affect how it
+runs. Unless you are a developer and know what you are doing, please do not run
+filters directly. Instead, use the \fIcupsfilter(8)\fR program to use the
+appropriate filters to do the conversions you need.
 .SH OPTIONS
 Options passed on the command-line typically do not include the default choices
 the printer's PPD file. In addition, some options may be specified in multiple
@@ -48,67 +55,59 @@ Raster filters should use option choices set through the raster page header, as
 those reflect the options in effect for a given page. Options specified on the
 command-line determine the default values for the entire job, which can be
 overridden on a per-page basis.
-
 .SH LOG MESSAGES
 Messages sent to stderr are generally logged to
 printer-state-message attribute and the current \fIErrorLog\fR.
 Each line begins with a standard prefix:
-
 .TP 5
 ALERT: message
 .br
 Sets the printer-state-message attribute and adds the specified
 message to the current \fIErrorLog\fR using the "alert" log level.
-
 .TP 5
 ATTR: attribute=value [attribute=value]
 .br
-Sets the named job attribute(s). Typically this will be used to
-set the job-remote-id attribute.
-
+Sets the named job or printer attribute(s). The following job attributes can be
+set: "job-media-progress". The following printer attributes can be set:
+"auth-info-required", "marker-colors", "marker-high-levels", "marker-levels",
+"marker-low-levels", "marker-message", "marker-names", "marker-types",
+"printer-alert", and "printer-alert-description".
 .TP 5
 CRIT: message
 .br
 Sets the printer-state-message attribute and adds the specified
 message to the current \fIErrorLog\fR using the "critical" log level.
-
 .TP 5
 DEBUG: message
 .br
 Sets the printer-state-message attribute and adds the specified
 message to the current \fIErrorLog\fR using the "debug" log level.
-
 .TP 5
 DEBUG2: message
 .br
 Sets the printer-state-message attribute and adds the specified
 message to the current \fIErrorLog\fR using the "debug2" log level.
-
 .TP 5
 EMERG: message
 .br
 Sets the printer-state-message attribute and adds the specified
 message to the current \fIErrorLog\fR using the "emergency" log level.
-
 .TP 5
 ERROR: message
 .br
 Sets the printer-state-message attribute and adds the specified
 message to the current \fIErrorLog\fR using the "error" log level.
-
 .TP 5
 INFO: message
 .br
 Sets the printer-state-message attribute. If the current \fILogLevel\fR
 is set to "debug2", also adds the specified message to the
 current \fIErrorLog\fR using the "info" log level.
-
 .TP 5
 NOTICE: message
 .br
 Sets the printer-state-message attribute and adds the specified
 message to the current \fIErrorLog\fR using the "notice" log level.
-
 .TP 5
 PAGE: page-number #-copies
 .TP 5
@@ -117,14 +116,12 @@ PAGE: total #-pages
 Adds an entry to the current \fIPageLog\fR. The first form adds
 #-copies to the job-media-sheets-completed attribute. The second
 form sets the job-media-sheets-completed attribute to #-pages.
-
 .TP 5
 PPD: Keyword=Value ... KeywordN=Value
 .br
 Sets the named keywords in the printer's PPD file. This is typically
 used to update default option keywords such as DefaultPageSize and
 the various installable options in the PPD file.
-
 .TP 5
 STATE: printer-state-reason [printer-state-reason ...]
 .TP 5
@@ -135,122 +132,102 @@ STATE: - printer-state-reason [printer-state-reason ...]
 Sets, adds, or removes printer-state-reason keywords to the
 current queue. Typically this is used to indicate media, ink, and
 toner conditions on a printer.
-
 .TP 5
 WARNING: message
 .br
 Sets the printer-state-message attribute and adds the specified
 message to the current \fIErrorLog\fR using the "warning" log level.
-
 .SH ENVIRONMENT VARIABLES
 The following environment variables are defined by the CUPS
 server when executing the filter:
-
 .TP 5
 CHARSET
 .br
 The default text character set, typically utf-8.
-
 .TP 5
 CLASS
 .br
 When a job is submitted to a printer class, contains the name of
 the destination printer class. Otherwise this environment
 variable will not be set.
-
 .TP 5
 CONTENT_TYPE
 .br
 The MIME type associated with the file (e.g.
 application/postscript).
-
 .TP 5
 CUPS_CACHEDIR
 .br
 The directory for semi-persistent cache files can be found.
-
 .TP 5
 CUPS_DATADIR
 .br
 The directory where data files can be found.
-
 .TP 5
 CUPS_FILETYPE
 .br
 The type of file being printed: "job-sheet" for a banner page and "document"
 for a regular print file.
-
 .TP 5
 CUPS_SERVERROOT
 .br
 The root directory of the server.
-
 .TP 5
 DEVICE_URI
 .br
 The device-uri associated with the printer.
-
 .TP 5
 FINAL_CONTENT_TYPE
 .br
 The MIME type associated with the printer (e.g.
 application/vnd.cups-postscript).
-
 .TP 5
 LANG
 .br
 The default language locale (typically C or en).
-
 .TP 5
 PATH
 .br
 The standard execution path for external programs that may be run by
 the filter.
-
 .TP 5
 PPD
 .br
 The full pathname of the PostScript Printer Description (PPD)
 file for this printer.
-
 .TP 5
 PRINTER
 .br
 The name of the printer.
-
 .TP 5
 RIP_CACHE
 .br
 The recommended amount of memory to use for Raster Image
 Processors (RIPs).
-
 .TP 5
 SOFTWARE
 .br
 The name and version number of the server (typically CUPS/1.2).
-
 .TP 5
 TZ
 .br
 The timezone of the server.
-
 .TP 5
 USER
 .br
 The user executing the filter, typically "lp" or "root"; consult the
 \fIcupsd.conf(5)\fR file for the current setting.
-
 .SH COMPATIBILITY
 While the filter interface is compatible with System V interface
 scripts, it will only work with the System V interface script as the
 only filter.  Typically the interface script will be provided via the
 \fIlpadmin(8)\fR command using the \fI-i\fR option.
 .SH SEE ALSO
-\fIbackend(7)\fR, \fIcupsd(8)\fR,
+\fIbackend(7)\fR, \fIcupsd(8)\fR, \fIcupsfilter(8)\fR,
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2011 by Apple Inc.
+Copyright 2007-2012 by Apple Inc.
 .\"
 .\" End of "$Id$".
 .\"
diff --git a/man/snmpbackend.man.in b/man/snmpbackend.man.in
new file mode 100644 (file)
index 0000000..b112381
--- /dev/null
@@ -0,0 +1,97 @@
+.\"
+.\" "$Id$"
+.\"
+.\"   SNMP backend man page for CUPS.
+.\"
+.\"   Copyright 2012 by Apple Inc.
+.\"
+.\"   These coded instructions, statements, and computer programs are the
+.\"   property of Apple Inc. and are protected by Federal copyright
+.\"   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+.\"   which should have been included with this file.  If this file is
+.\"   file is missing or damaged, see the license at "http://www.cups.org/".
+.\"
+.TH snmpbackend 8 "CUPS" "13 April 2012" "Apple Inc."
+
+.SH NAME
+snmpbackend \- cups snmp backend
+.SH SYNOPSIS
+.B @CUPS_SERVERBIN@/backend/snmp
+.I ip-address-or-hostname
+.br
+.B lpinfo -v --include-schemes snmp
+.SH DESCRIPTION
+The CUPS SNMP backend provides legacy discovery and identification of network
+printers using SNMPv1. When used for discovery through the scheduler, the
+backend will list all printers that respond to a broadcast SNMPv1 query with the
+"public" community name. Additional queries are then sent to printers that
+respond in order to determine the correct device URI, make and model, and other
+information needed for printing.
+.LP
+In the first form, the SNMP backend is run directly by the user to look up the
+device URI and other information when you have an IP address or hostname. This
+can be used for programs that need to configure print queues where the user has
+supplied an address but nothing else.
+.LP
+In the second form, the SNMP backend is run indirectly using the \fIlpinfo(8)\fR
+command. The output provides all printers detected via SNMP on the configured
+broadcast addresses. \fBNote\fR: no broadcast addresses are configured by
+default.
+.SH CONFIGURATION
+The SNMP backend reads the @CUPS_SERVERROOT@/snmp.conf configuration file, if
+present, to set the default broadcast address, community name, and logging
+level. Each line consists of a directive followed by whitespace and any values
+associated with the directive:
+.TP 5
+Address @IF(name)
+.TP 5
+Address @LOCAL
+.TP 5
+Address ip-address-or-hostname
+.br
+Specifies a (broadcast) address for discovery. "@LOCAL" adds all of the IPv4 and
+IPv6 broadcast addresses for active, non-point-to-point network interfaces,
+while "@IF(name)" adds the IPv4 and IPv6 broadcast addresses associated with the
+named interface. There is no default address.
+.TP 5
+Community name
+.br
+Specifies the community name to use. Only a single community name may be
+specified. The default community name is "public".
+.TP 5
+DebugLevel number
+.br
+Specifies the logging level from 0 (none) to 3 (everything). Typically only used
+for debugging (thus the name). The default debug level is 0. The
+CUPS_DEBUG_LEVEL environment variable can be used to override the default value.
+.TP 5
+DeviceURI "regular expression" device-uri [... device-uri]
+.br
+Specifies one or more device URIs that should be used for a given make and model
+string. The regular expression is used to match the detected make and model, and
+the device URI strings must be of the form "scheme://%s[:port]/[path]", where
+"%s" represents the detected address or hostname. There are no default device
+URI matching rules.
+.TP 5
+HostNameLookups on
+.TP 5
+HostNameLookups off
+.br
+Specifies whether the backend tries to do a reverse lookup of the detected
+printer's address. The default is off.
+.TP 5
+MaxRunTime seconds
+.br
+Specifies the maximum amount of time the backend will wait for a response. The
+default is 120 seconds (2 minutes). The CUPS_MAX_RUN_TIME environment variable
+can be used to override the default value.
+.SH SEE ALSO
+\fIbackend(7)\fR, \fIcupsd(8)\fR, \fIcupsd.conf(5)\fR, \fIfilter(7)\fR,
+\fIlpinfo(8)\fR,
+.br
+http://localhost:631/help
+.SH COPYRIGHT
+Copyright 2007-2012 by Apple Inc.
+.\"
+.\" End of "$Id$".
+.\"
index b3e177f8aac2b0763939e1d83726e96ad28d4955..f5df2566c4cf4fff8a5465c93f33c976d04e43fc 100644 (file)
@@ -14,7 +14,7 @@
  *
  * Contents:
  *
-*   cupsdAddJob()           - Add a new job to the job queue.
+ *   cupsdAddJob()             - Add a new job to the job queue.
  *   cupsdCancelJobs()         - Cancel all jobs for the given
  *                               destination/user.
  *   cupsdCheckJobs()          - Check the pending jobs and start any if the