[cups.general] problems with airprint to cups server

Douglas Kosovic doug at uq.edu.au
Wed Apr 17 06:27:42 PDT 2013


Hi Christoph,


> Now I try to print from my iPhone with airprint. The iPhone searches for printers and finds them. I can select one of the printers and select print. The iPhone prepares and executes the print. But the data is not sent to the cups server ... no errors in error_log, no job log, no error message on the iPhone, nothing at all. I did a tcpdump on the cups server looking for the iPhones ip address: While searching and selecting the printer on the iPhone, there is lots of IPP protocol communication between the phone and the cups server. Pressing "print" there is no data at all.
> 
> The following announcements are made via DNS:
> $ORIGIN uni-koblenz.de.
> _services._dns-sd._udp          PTR    _ipp._tcp
> _ipp._tcp                       PTR    presse._ipp._tcp
> _universal._sub._ipp._tcp       IN PTR presse._ipp._tcp
> _cups._sub._ipp._tcp            IN PTR presse._ipp._tcp
> presse._ipp._tcp                SRV    0 0 631 printhost
> presse._ipp._tcp                TXT   "txtvers=1" "qtotl=1" "rp=printers/presse" "ty=presse" "product=(RICOH Aficio MP C5501 PS)" "transparent=t" "copies=t" "duplex=t" "color=t" "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/urf" "URF=DM3" "air=username,password" "adminurl=http://printhost.uni-koblenz.de:631/printers/presse" "note=A 019" "printer-type=0x480901c"
> 
> Because of "air=username,password" I would expect that, pressing "print", the iPhone asks me for my username and password. But no dialog appears.

printer-type=0x480901c is the bitwise OR of the following:
   CUPS_PRINTER_BW
   CUPS_PRINTER_COLOR
   CUPS_PRINTER_DUPLEX
   CUPS_PRINTER_SMALL
   CUPS_PRINTER_VARIABLE
   CUPS_PRINTER_COMMANDS
   CUPS_PRINTER_MFP

I think you need to OR with CUPS_PRINTER_AUTHENTICATED (0x400000), i.e. printer-type= 0x4C0901C.

I previously wrote a C program attached at the end of this email that breaks down the printer-type value when you provide a hex or decimal printer-type value as a command-line argument.


Cheers,
Doug


#include <stdio.h>
#include <ctype.h>
#include <cups/cups.h>

int main(int argc, char *argv[]) {
  int cups_ptype = 0;
  if (argc != 2) {
      printf("Usage: %s {integer}\n", argv[0]);
      exit(1);
  }
  if (strstr(argv[1], "x")) {
    sscanf(argv[1], "%x", &cups_ptype);
  } else {
    cups_ptype = atoi(argv[1]);
  }

  if (CUPS_PRINTER_LOCAL & cups_ptype)
      printf("CUPS_PRINTER_LOCAL\n");
  if (CUPS_PRINTER_CLASS & cups_ptype)
      printf("CUPS_PRINTER_CLASS\n");
  if (CUPS_PRINTER_REMOTE & cups_ptype)
      printf("CUPS_PRINTER_REMOTE\n");
  if (CUPS_PRINTER_BW & cups_ptype)
      printf("CUPS_PRINTER_BW\n");
  if (CUPS_PRINTER_COLOR & cups_ptype)
      printf("CUPS_PRINTER_COLOR\n");
  if (CUPS_PRINTER_DUPLEX & cups_ptype)
      printf("CUPS_PRINTER_DUPLEX\n");
  if (CUPS_PRINTER_STAPLE & cups_ptype)
      printf("CUPS_PRINTER_STAPLE\n");
  if (CUPS_PRINTER_COPIES & cups_ptype)
      printf("CUPS_PRINTER_COPIES\n");
  if (CUPS_PRINTER_COLLATE & cups_ptype)
      printf("CUPS_PRINTER_COLLATE\n");
  if (CUPS_PRINTER_PUNCH & cups_ptype)
      printf("CUPS_PRINTER_PUNCH\n");
  if (CUPS_PRINTER_COVER & cups_ptype)
      printf("CUPS_PRINTER_COVER\n");
  if (CUPS_PRINTER_BIND & cups_ptype)
      printf("CUPS_PRINTER_BIND\n");
  if (CUPS_PRINTER_SORT & cups_ptype)
      printf("CUPS_PRINTER_SORT\n");
  if (CUPS_PRINTER_SMALL & cups_ptype)
      printf("CUPS_PRINTER_SMALL\n");
  if (CUPS_PRINTER_MEDIUM & cups_ptype)
      printf("CUPS_PRINTER_MEDIUM\n");
  if (CUPS_PRINTER_LARGE & cups_ptype)
      printf("CUPS_PRINTER_LARGE\n");
  if (CUPS_PRINTER_VARIABLE & cups_ptype)
      printf("CUPS_PRINTER_VARIABLE\n");
  if (CUPS_PRINTER_IMPLICIT & cups_ptype)
      printf("CUPS_PRINTER_IMPLICIT\n");

  if (CUPS_PRINTER_DEFAULT & cups_ptype)
      printf("CUPS_PRINTER_DEFAULT\n");
  if (CUPS_PRINTER_FAX & cups_ptype)
      printf("CUPS_PRINTER_FAX\n");
  if (CUPS_PRINTER_REJECTING & cups_ptype)
      printf("CUPS_PRINTER_REJECTING\n");
  if (CUPS_PRINTER_DELETE & cups_ptype)
      printf("CUPS_PRINTER_DELETE\n");

  if (CUPS_PRINTER_NOT_SHARED & cups_ptype)
      printf("CUPS_PRINTER_NOT_SHARED\n");
  if (CUPS_PRINTER_AUTHENTICATED & cups_ptype)
      printf("CUPS_PRINTER_AUTHENTICATED\n");
  if (CUPS_PRINTER_COMMANDS & cups_ptype)
      printf("CUPS_PRINTER_COMMANDS\n");
  if (CUPS_PRINTER_DISCOVERED & cups_ptype)
      printf("CUPS_PRINTER_DISCOVERED\n");

  if (CUPS_PRINTER_SCANNER & cups_ptype)
      printf("CUPS_PRINTER_SCANNER\n");
  if (CUPS_PRINTER_MFP & cups_ptype)
      printf("CUPS_PRINTER_MFP\n");

  return(0);
} 








More information about the cups mailing list