cupsdLogMessage(CUPSD_LOG_ERROR,
"Syntax error on line %d of remote.cache.", linenum);
}
+ else if (!strcasecmp(line, "UUID"))
+ {
+ if (value && !strncmp(value, "urn:uuid:", 9))
+ cupsdSetString(&(p->uuid), value);
+ else
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Bad UUID on line %d of remote.cache.", linenum);
+ }
else if (!strcasecmp(line, "Info"))
{
if (value)
cupsFilePrintf(fp, "BrowseTime %d\n", (int)printer->browse_expire);
+ cupsFilePrintf(fp, "UUID %s\n", printer->uuid);
+
if (printer->info)
cupsFilePutConf(fp, "Info", printer->info);
keyvalue[i ][0] = "ty";
keyvalue[i++][1] = p->make_model ? p->make_model : "Unknown";
- snprintf(admin_hostname, sizeof(admin_hostname), "%s.local", DNSSDHostName);
+ snprintf(admin_hostname, sizeof(admin_hostname), "%s.local.", DNSSDHostName);
httpAssembleURIf(HTTP_URI_CODING_ALL, adminurl_str, sizeof(adminurl_str),
"http", NULL, admin_hostname, DNSSDPort, "/%s/%s",
(p->type & CUPS_PRINTER_CLASS) ? "classes" : "printers",
keyvalue[i ][0] = "product";
keyvalue[i++][1] = p->pc && p->pc->product ? p->pc->product : "Unknown";
- snprintf(type_str, sizeof(type_str), "0x%X", p->type | CUPS_PRINTER_REMOTE);
- snprintf(state_str, sizeof(state_str), "%d", p->state);
+ keyvalue[i ][0] = "pdl";
+ keyvalue[i++][1] = p->pdl ? p->pdl : "application/postscript";
- keyvalue[i ][0] = "printer-state";
- keyvalue[i++][1] = state_str;
+ if (get_auth_info_required(p, air_str, sizeof(air_str)))
+ {
+ keyvalue[i ][0] = "air";
+ keyvalue[i++][1] = air_str;
+ }
- keyvalue[i ][0] = "printer-type";
- keyvalue[i++][1] = type_str;
+ keyvalue[i ][0] = "UUID";
+ keyvalue[i++][1] = p->uuid + 9;
+
+#ifdef HAVE_SSL
+ keyvalue[i ][0] = "TLS";
+ keyvalue[i++][1] = "1.2";
+#endif /* HAVE_SSL */
keyvalue[i ][0] = "Transparent";
- keyvalue[i++][1] = "T";
+ keyvalue[i++][1] = "F";
keyvalue[i ][0] = "Binary";
- keyvalue[i++][1] = "T";
+ keyvalue[i++][1] = "F";
keyvalue[i ][0] = "Fax";
keyvalue[i++][1] = (p->type & CUPS_PRINTER_FAX) ? "T" : "F";
keyvalue[i ][0] = "Scan";
keyvalue[i++][1] = (p->type & CUPS_PRINTER_MFP) ? "T" : "F";
- keyvalue[i ][0] = "pdl";
- keyvalue[i++][1] = p->pdl ? p->pdl : "application/postscript";
+ snprintf(type_str, sizeof(type_str), "0x%X", p->type | CUPS_PRINTER_REMOTE);
+ snprintf(state_str, sizeof(state_str), "%d", p->state);
- if (get_auth_info_required(p, air_str, sizeof(air_str)))
- {
- keyvalue[i ][0] = "air";
- keyvalue[i++][1] = air_str;
- }
+ keyvalue[i ][0] = "printer-state";
+ keyvalue[i++][1] = state_str;
+
+ keyvalue[i ][0] = "printer-type";
+ keyvalue[i++][1] = type_str;
/*
* Then pack them into a proper txt record...
/* Local make and model */
cupsd_printer_t *p; /* Printer information */
const char *ipp_options, /* ipp-options value */
- *lease_duration; /* lease-duration value */
+ *lease_duration, /* lease-duration value */
+ *uuid; /* uuid value */
int is_class; /* Is this queue a class? */
hptr = strchr(host, '.');
sptr = strchr(ServerName, '.');
is_class = type & CUPS_PRINTER_CLASS;
+ uuid = cupsGetOption("uuid", num_attrs, attrs);
if (!ServerNameIsIP && sptr != NULL && hptr != NULL)
{
update = 1;
}
+ if (uuid && strcmp(p->uuid, uuid))
+ {
+ cupsdSetString(&p->uuid, uuid);
+ update = 1;
+ }
+
if (location && (!p->location || strcmp(p->location, location)))
{
cupsdSetString(&p->location, location);
(p->type & CUPS_PRINTER_CLASS) ? "/classes/%s" :
"/printers/%s",
p->name);
- snprintf(packet, sizeof(packet), "%x %x %s \"%s\" \"%s\" \"%s\" %s%s\n",
+ snprintf(packet, sizeof(packet),
+ "%x %x %s \"%s\" \"%s\" \"%s\" %s%s uuid=%s\n",
type, p->state, uri, location, info, make_model,
- p->browse_attrs ? p->browse_attrs : "", air);
+ p->browse_attrs ? p->browse_attrs : "", air, p->uuid);
bytes = strlen(packet);
"/printers/%s",
p->name);
snprintf(packet, sizeof(packet),
- "%x %x %s \"%s\" \"%s\" \"%s\" %s%s\n",
+ "%x %x %s \"%s\" \"%s\" \"%s\" %s%s uuid=%s\n",
type, p->state, uri, location, info, make_model,
- p->browse_attrs ? p->browse_attrs : "", air);
+ p->browse_attrs ? p->browse_attrs : "", air, p->uuid);
bytes = strlen(packet);
* the default server name...
*/
- snprintf(packet, sizeof(packet), "%x %x %s \"%s\" \"%s\" \"%s\" %s%s\n",
+ snprintf(packet, sizeof(packet),
+ "%x %x %s \"%s\" \"%s\" \"%s\" %s%s uuid=%s\n",
type, p->state, p->uri, location, info, make_model,
- p->browse_attrs ? p->browse_attrs : "", air);
+ p->browse_attrs ? p->browse_attrs : "", air, p->uuid);
bytes = strlen(packet);
cupsdLogMessage(CUPSD_LOG_DEBUG2,