]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
changes in driverless.c file to list IPPS printers
authornidhijainpnp <12njain06@gmail.com>
Wed, 29 Jul 2020 05:48:12 +0000 (11:18 +0530)
committernidhijainpnp <12njain06@gmail.com>
Wed, 29 Jul 2020 05:48:12 +0000 (11:18 +0530)
utils/driverless.1
utils/driverless.c

index 189a612f5de7cc725f38344e7766e0bcbc02f946..364421725a65da5cbf9a884b21a95453c6fed37b 100644 (file)
@@ -5,7 +5,7 @@
 .SH SYNOPSIS
 .nf
 .fam C
-\fBdriverless\fP [\fB-h\fP | \fB--help\fP | \fB--version\fP] [\fB-d\fP | \fB-v\fP | \fB--debug\fP] [\fBlist\fP] | [\fBcat\fP \fIdriver URI\fP] | [\fIIPP printer URI\fP]
+\fBdriverless\fP [\fB-h\fP | \fB--help\fP | \fB--version\fP] [\fB-d\fP | \fB-v\fP | \fB--debug\fP] [\fBlist\fP] [\fB_ipps._tcp\fP] | [\fBcat\fP \fIdriver URI\fP] | [\fIIPP printer URI\fP]
 
 .fam T
 .fi
@@ -52,6 +52,11 @@ List the driver URIs and metadata for all available IPP printers suitable
 for driverless PPD file generation (to be used by CUPS).
 .TP
 .B
+\fB_ipps._tcp\fP
+List the driver URIs and metadata for all available IPPS printers suitable
+for driverless PPD file generation (to be used by CUPS).
+.TP
+.B
 \fBcat\fP \fIdriver URI\fP
 Generate the PPD file for the supplied \fIdriver URI\fP from the output of "list"
 (to be used by CUPS).
index 869e18a5b5e8ff0cb296d4c87c0975872b809e2b..46ca512a9ae844c3de8671af2f33b8f734d66836 100644 (file)
@@ -90,6 +90,8 @@ list_printers (int mode)
 
   i = 0;
   ippfind_argv[i++] = "ippfind";
+  if(mode == 3)
+    ippfind_argv[i++] = "_ipps._tcp";
   ippfind_argv[i++] = "-T";               /* Bonjour poll timeout */
   ippfind_argv[i++] = "3";                /* 3 seconds */
   ippfind_argv[i++] = "!";                /* ! --txt printer-type */
@@ -384,8 +386,8 @@ list_printers (int mode)
        snprintf(driverless_info, 255, "%s", driverless_support_strs[driverless_support]);
        driverless_info[255] = '\0';
 
-       if (mode == 1)
-         /* Call with "list" argument (PPD generator in list mode */
+       if (mode == 1 || mode == 3)
+         /* Call with "list" argument or with "_ipps._tcp" argument (PPD generator in list mode)   */
          printf("\"driverless:%s\" en \"%s\" \"%s, %s, cups-filters " VERSION
                 "\" \"%s\"\n", service_uri, make, make_and_model, driverless_info, device_id);
        else
@@ -630,6 +632,11 @@ int main(int argc, char*argv[]) {
           driverless printing */
        debug = 1;
        exit(list_printers(1));
+      } else if (!strcasecmp(argv[i], "_ipps._tcp")) {
+       /* List a driver URI and metadata for "IPPS" printer suitable for
+          driverless printing */
+       debug = 1;
+       exit(list_printers(3));
       } else if (!strncasecmp(argv[i], "cat", 3)) {
        /* Generate the PPD file for the given driver URI */
        debug = 1;
@@ -688,6 +695,9 @@ int main(int argc, char*argv[]) {
          "  list                    List the driver URIs and metadata for all available\n"
          "                          IPP printers supporting driverless printing (to be\n"
          "                          used by CUPS).\n"
+    "  _ipps._tcp              List the driver URIs and metadata for all available\n"
+         "                          IPPS printers supporting driverless printing (to be\n"
+         "                          used by CUPS).\n"
          "  cat <driver URI>        Generate the PPD file for the driver URI\n"
          "                          <driver URI> (to be used by CUPS).\n"
          "  <printer URI>           Generate the PPD file for the IPP printer URI\n"