package main // References // https://tools.ietf.org/html/rfc8010 // https://tools.ietf.org/html/rfc8011 // Defined atribute group tags const ( beginAttributeGroupTag = 0x00 operationAttributesTag = 0x01 jobAttributesTag = 0x02 endOfAttributesTag = 0x03 printerAttributesTag = 0x04 unsupportedAttributesTag = 0x05 ) // Defined value tags // from rfc8010 const ( // Out of band unsupportedValueTag = 0x10 unknownValueTag = 0x12 noValueValueTag = 0x13 // Integer values integerValueTag = 0x21 booleanIntegerTag = 0x22 enumValueTag = 0x23 // Character string values textWithoutLanguagageValueTag = 0x41 nameWithoutLanguagageValueTag = 0x42 keywordValueTag = 0x44 uriValueTag = 0x45 uriSchemeValueTag = 0x46 charsetValueTag = 0x47 naturalLanguagageValueTag = 0x48 mimeMediaTypeValueTag = 0x49 memberAttrNameValueTag = 0x4a ) // Operation-id, defined in rfc8011 const ( PrintJob = 0x0002 PrintURI = 0x0003 ValidateJob = 0x0004 CreateJob = 0x0005 SendDocument = 0x0006 SendURI = 0x0007 CancelJob = 0x0008 GetJobAttributes = 0x0009 GetJobs = 0x000a GetPrinterAttributes = 0x000b HoldJob = 0x000c ReleaseJob = 0x000d RestartJob = 0x000e PausePrinter = 0x0010 ResumePrinter = 0x0011 PurgeJobs = 0x0012 ) type ippRequestHeader struct { versionNumber uint16 operationId uint16 requestId uint32 } type ippRequest struct { header ippRequestHeader operationAttributes map[string]string requestedAttributes []string }