#include "includes.h"
#include "printing.h"
+#include "printing/pcap.h"
#ifdef HAVE_IPRINT
#include <cups/cups.h>
*/
if (name != NULL && !secure && smb_enabled)
- pcap_cache_add(name, info);
+ pcap_cache_add(name, info, NULL);
}
out:
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
- slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(), PRINTERNAME(snum));
+ slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(),
+ lp_printername(snum));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
* Do the request and get back a response...
*/
- slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s", PRINTERNAME(snum));
+ slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s",
+ lp_printername(snum));
if ((response = cupsDoRequest(http, request, httpPath)) != NULL) {
if (response->request.status.status_code >= IPP_OK_CONFLICT) {
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
- slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(), PRINTERNAME(snum));
+ slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(),
+ lp_printername(snum));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
* Do the request and get back a response...
*/
- slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s", PRINTERNAME(snum));
+ slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s",
+ lp_printername(snum));
if ((response = cupsDoRequest(http, request, httpPath)) != NULL) {
if (response->request.status.status_code >= IPP_OK_CONFLICT) {
ipp_attribute_t *attr; /* Current attribute */
cups_lang_t *language = NULL; /* Default language */
char uri[HTTP_MAX_URI]; /* printer-uri attribute */
- const char *clientname = NULL; /* hostname of client for job-originating-host attribute */
- char addr[INET6_ADDRSTRLEN];
DEBUG(5,("iprint_job_submit(%d, %p (%d))\n", snum, pjob, pjob->sysjob));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
- slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(), PRINTERNAME(snum));
+ slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(),
+ lp_printername(snum));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
NULL, pjob->user);
- clientname = client_name(get_client_fd());
- if (strcmp(clientname, "UNKNOWN") == 0) {
- clientname = client_addr(get_client_fd(),addr,sizeof(addr));
- }
-
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"job-originating-host-name", NULL,
- clientname);
+ pjob->clientmachine);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
pjob->jobname);
* Do the request and get back a response...
*/
- slprintf(uri, sizeof(uri) - 1, "/ipp/%s", PRINTERNAME(snum));
+ slprintf(uri, sizeof(uri) - 1, "/ipp/%s", lp_printername(snum));
if ((response = cupsDoFileRequest(http, request, uri, pjob->filename)) != NULL) {
if (response->request.status.status_code >= IPP_OK_CONFLICT) {
- DEBUG(0,("Unable to print file to %s - %s\n", PRINTERNAME(snum),
+ DEBUG(0,("Unable to print file to %s - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
} else {
ret = 0;
}
} else {
- DEBUG(0,("Unable to print file to `%s' - %s\n", PRINTERNAME(snum),
+ DEBUG(0,("Unable to print file to `%s' - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
}
int job_id; /* job-id attribute */
int job_k_octets; /* job-k-octets attribute */
time_t job_time; /* time-at-creation attribute */
- time_t printer_current_time = 0; /* printer's current time */
time_t printer_up_time = 0; /* printer's uptime */
ipp_jstate_t job_status; /* job-status attribute */
int job_priority; /* job-priority attribute */
IPP_TAG_TEXT)) != NULL)
fstrcpy(status->message, attr->values[0].string.text);
- if ((attr = ippFindAttribute(response, "printer-current-time",
- IPP_TAG_DATE)) != NULL)
- printer_current_time = ippDateToTime(attr->values[0].date);
-
if ((attr = ippFindAttribute(response, "printer-up-time",
IPP_TAG_INTEGER)) != NULL)
printer_up_time = attr->values[0].integer;
continue;
}
- temp->job = job_id;
+ temp->sysjob = job_id;
temp->size = job_k_octets * 1024;
temp->status = job_status == IPP_JOB_PENDING ? LPQ_QUEUED :
job_status == IPP_JOB_STOPPED ? LPQ_PAUSED :