/*
- * "$Id: ipp-support.c 5246 2006-03-08 13:22:09Z mike $"
+ * "$Id: ipp-support.c 7460 2008-04-16 02:19:54Z mike $"
*
* Internet Printing Protocol support functions for the Common UNIX
* Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 2007 by Apple Inc.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
- * property of Easy Software Products 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 missing or damaged please contact Easy Software Products
- * at:
- *
- * Attn: CUPS Licensing Information
- * Easy Software Products
- * 44141 Airport View Drive, Suite 204
- * Hollywood, Maryland 20636 USA
- *
- * Voice: (301) 373-9600
- * EMail: cups-info@cups.org
- * WWW: http://www.cups.org
+ * 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/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
"CUPS-Get-Devices",
"CUPS-Get-PPDs",
"CUPS-Move-Job",
- "CUPS-Authenticate-Job"
+ "CUPS-Authenticate-Job",
+ "CUPS-Get-PPD"
+ },
+ * const ipp_cups_ops2[] =
+ {
+ "CUPS-Get-Document"
};
return (ipp_status_oks[error]);
else if (error == IPP_REDIRECTION_OTHER_SITE)
return ("redirection-other-site");
+ else if (error == CUPS_SEE_OTHER)
+ return ("cups-see-other");
else if (error >= IPP_BAD_REQUEST && error <= IPP_PRINT_SUPPORT_FILE_NOT_FOUND)
return (ipp_status_400s[error - IPP_BAD_REQUEST]);
else if (error >= IPP_INTERNAL_ERROR && error <= IPP_PRINTER_IS_DEACTIVATED)
if (!strcasecmp(name, "redirection-other-site"))
return (IPP_REDIRECTION_OTHER_SITE);
+ if (!strcasecmp(name, "cups-see-other"))
+ return (CUPS_SEE_OTHER);
+
for (i = 0; i < (sizeof(ipp_status_400s) / sizeof(ipp_status_400s[0])); i ++)
if (!strcasecmp(name, ipp_status_400s[i]))
return ((ipp_status_t)(i + 0x400));
return (ipp_std_ops[op]);
else if (op == IPP_PRIVATE)
return ("windows-ext");
- else if (op >= CUPS_GET_DEFAULT && op <= CUPS_AUTHENTICATE_JOB)
+ else if (op >= CUPS_GET_DEFAULT && op <= CUPS_GET_PPD)
return (ipp_cups_ops[op - CUPS_GET_DEFAULT]);
+ else if (op == CUPS_GET_DOCUMENT)
+ return (ipp_cups_ops2[0]);
/*
* No, build an "unknown-xxxx" operation string...
if (!strcasecmp(name, ipp_cups_ops[i]))
return ((ipp_op_t)(i + 0x4001));
+ for (i = 0; i < (sizeof(ipp_cups_ops2) / sizeof(ipp_cups_ops2[0])); i ++)
+ if (!strcasecmp(name, ipp_cups_ops2[i]))
+ return ((ipp_op_t)(i + 0x4027));
+
if (!strcasecmp(name, "CUPS-Add-Class"))
return (CUPS_ADD_MODIFY_CLASS);
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
+ DEBUG_puts("ippPort()");
+
+ if (!cg->ipp_port)
+ {
+ /*
+ * See if the server definition includes the port number...
+ */
+
+ DEBUG_puts("ippPort: Not initialized...");
+
+ cupsServer();
+
+#ifdef DEBUG
+ if (cg->ipp_port)
+ DEBUG_puts(("ippPort: Set via cupsServer()..."));
+#endif /* DEBUG */
+ }
+
if (!cg->ipp_port)
{
if ((ipp_port = getenv("IPP_PORT")) != NULL)
+ {
+ DEBUG_puts("ippPort: Set via IPP_PORT...");
portnum = atoi(ipp_port);
+ }
else if ((port = getservbyname("ipp", NULL)) == NULL)
+ {
+ DEBUG_puts("ippPort: Set via CUPS_DEFAULT_IPP_PORT...");
portnum = CUPS_DEFAULT_IPP_PORT;
+ }
else
+ {
+ DEBUG_puts("ippPort: Set via ipp service entry...");
portnum = ntohs(port->s_port);
+ }
if (portnum > 0)
cg->ipp_port = portnum;
}
+ DEBUG_printf(("ippPort: Returning %d...\n", cg->ipp_port));
+
return (cg->ipp_port);
}
void
ippSetPort(int p) /* I - Port number to use */
{
+ DEBUG_printf(("ippSetPort(p=%d)\n", p));
+
_cupsGlobals()->ipp_port = p;
}
/*
- * End of "$Id: ipp-support.c 5246 2006-03-08 13:22:09Z mike $".
+ * End of "$Id: ipp-support.c 7460 2008-04-16 02:19:54Z mike $".
*/