Debian Codegraph @

op.go

raw symbols SCIP
1 /* Go IPP - IPP core protocol implementation in pure Go
2 *
3 * Copyright (C) 2020 and up by Alexander Pevzner ([email protected])
4 * See LICENSE for license terms and conditions
5 *
6 * IPP Operation Codes
7 */
8
9 package goipp
10
11 import (
12 "fmt"
13 )
14
15 // Op represents an IPP Operation Code
16 type Op Code
17
18 const (
19 OpPrintJob Op = 0x0002 // Print-Job: Print a single file
20 OpPrintURI Op = 0x0003 // Print-URI: Print a single URL
21 OpValidateJob Op = 0x0004 // Validate-Job: Validate job values prior to submission
22 OpCreateJob Op = 0x0005 // Create-Job: Create an empty print job
23 OpSendDocument Op = 0x0006 // Send-Document: Add a file to a job
24 OpSendURI Op = 0x0007 // Send-URI: Add a URL to a job
25 OpCancelJob Op = 0x0008 // Cancel-Job: Cancel a job
26 OpGetJobAttributes Op = 0x0009 // Get-Job-Attribute: Get information about a job
27 OpGetJobs Op = 0x000a // Get-Jobs: Get a list of jobs
28 OpGetPrinterAttributes Op = 0x000b // Get-Printer-Attributes: Get information about a printer
29 OpHoldJob Op = 0x000c // Hold-Job: Hold a job for printing
30 OpReleaseJob Op = 0x000d // Release-Job: Release a job for printing
31 OpRestartJob Op = 0x000e // Restart-Job: Reprint a job
32
33 OpPausePrinter Op = 0x0010 // Pause-Printer: Stop a printer
34 OpResumePrinter Op = 0x0011 // Resume-Printer: Start a printer
35 OpPurgeJobs Op = 0x0012 // Purge-Jobs: Delete all jobs
36 OpSetPrinterAttributes Op = 0x0013 // Set-Printer-Attributes: Set printer values
37 OpSetJobAttributes Op = 0x0014 // Set-Job-Attributes: Set job values
38 OpGetPrinterSupportedValues Op = 0x0015 // Get-Printer-Supported-Values: Get supported values
39 OpCreatePrinterSubscriptions Op = 0x0016 // Create-Printer-Subscriptions: Create one or more printer subscriptions
40 OpCreateJobSubscriptions Op = 0x0017 // Create-Job-Subscriptions: Create one of more job subscriptions
41 OpGetSubscriptionAttributes Op = 0x0018 // Get-Subscription-Attributes: Get subscription information
42 OpGetSubscriptions Op = 0x0019 // Get-Subscriptions: Get list of subscriptions
43 OpRenewSubscription Op = 0x001a // Renew-Subscription: Renew a printer subscription
44 OpCancelSubscription Op = 0x001b // Cancel-Subscription: Cancel a subscription
45 OpGetNotifications Op = 0x001c // Get-Notifications: Get notification events
46 OpSendNotifications Op = 0x001d // Send-Notifications: Send notification events
47 OpGetResourceAttributes Op = 0x001e // Get-Resource-Attributes: Get resource information
48 OpGetResourceData Op = 0x001f // Get-Resource-Data: Get resource data
49
50 OpGetResources Op = 0x0020 // Get-Resources: Get list of resources
51 OpGetPrintSupportFiles Op = 0x0021 // Get-Printer-Support-Files: Get printer support files
52 OpEnablePrinter Op = 0x0022 // Enable-Printer: Accept new jobs for a printer
53 OpDisablePrinter Op = 0x0023 // Disable-Printer: Reject new jobs for a printer
54 OpPausePrinterAfterCurrentJob Op = 0x0024 // Pause-Printer-After-Current-Job: Stop printer after the current job
55 OpHoldNewJobs Op = 0x0025 // Hold-New-Jobs: Hold new jobs
56 OpReleaseHeldNewJobs Op = 0x0026 // Release-Held-New-Jobs: Release new jobs that were previously held
57 OpDeactivatePrinter Op = 0x0027 // Deactivate-Printer: Stop a printer and do not accept jobs
58 OpActivatePrinter Op = 0x0028 // Activate-Printer: Start a printer and accept jobs
59 OpRestartPrinter Op = 0x0029 // Restart-Printer: Restart a printer
60 OpShutdownPrinter Op = 0x002a // Shutdown-Printer: Turn a printer off
61 OpStartupPrinter Op = 0x002b // Startup-Printer: Turn a printer on
62 OpReprocessJob Op = 0x002c // Reprocess-Job: Reprint a job
63 OpCancelCurrentJob Op = 0x002d // Cancel-Current-Job: Cancel the current job
64 OpSuspendCurrentJob Op = 0x002e // Suspend-Current-Job: Suspend the current job
65 OpResumeJob Op = 0x002f // Resume-Job: Resume the current job
66
67 OpPromoteJob Op = 0x0030 // Promote-Job: Promote a job to print sooner
68 OpScheduleJobAfter Op = 0x0031 // Schedule-Job-After: Schedule a job to print after another
69 OpCancelDocument Op = 0x0033 // Cancel-Document: Cancel a document
70 OpGetDocumentAttributes Op = 0x0034 // Get-Document-Attributes: Get document information
71 OpGetDocuments Op = 0x0035 // Get-Documents: Get a list of documents in a job
72 OpDeleteDocument Op = 0x0036 // Delete-Document: Delete a document
73 OpSetDocumentAttributes Op = 0x0037 // Set-Document-Attributes: Set document values
74 OpCancelJobs Op = 0x0038 // Cancel-Jobs: Cancel all jobs (administrative)
75 OpCancelMyJobs Op = 0x0039 // Cancel-My-Jobs: Cancel a user's jobs
76 OpResubmitJob Op = 0x003a // Resubmit-Job: Copy and reprint a job
77 OpCloseJob Op = 0x003b // Close-Job: Close a job and start printing
78 OpIdentifyPrinter Op = 0x003c // Identify-Printer: Make the printer beep, flash, or display a message for identification
79 OpValidateDocument Op = 0x003d // Validate-Document: Validate document values prior to submission
80 OpAddDocumentImages Op = 0x003e // Add-Document-Images: Add image(s) from the specified scanner source
81 OpAcknowledgeDocument Op = 0x003f // Acknowledge-Document: Acknowledge processing of a document
82
83 OpAcknowledgeIdentifyPrinter Op = 0x0040 // Acknowledge-Identify-Printer: Acknowledge action on an Identify-Printer request
84 OpAcknowledgeJob Op = 0x0041 // Acknowledge-Job: Acknowledge processing of a job
85 OpFetchDocument Op = 0x0042 // Fetch-Document: Fetch a document for processing
86 OpFetchJob Op = 0x0043 // Fetch-Job: Fetch a job for processing
87 OpGetOutputDeviceAttributes Op = 0x0044 // Get-Output-Device-Attributes: Get printer information for a specific output device
88 OpUpdateActiveJobs Op = 0x0045 // Update-Active-Jobs: Update the list of active jobs that a proxy has processed
89 OpDeregisterOutputDevice Op = 0x0046 // Deregister-Output-Device: Remove an output device
90 OpUpdateDocumentStatus Op = 0x0047 // Update-Document-Status: Update document values
91 OpUpdateJobStatus Op = 0x0048 // Update-Job-Status: Update job values
92 OpupdateOutputDeviceAttributes Op = 0x0049 // Update-Output-Device-Attributes: Update output device values
93 OpGetNextDocumentData Op = 0x004a // Get-Next-Document-Data: Scan more document data
94 OpAllocatePrinterResources Op = 0x004b // Allocate-Printer-Resources: Use resources for a printer
95 OpCreatePrinter Op = 0x004c // Create-Printer: Create a new service
96 OpDeallocatePrinterResources Op = 0x004d // Deallocate-Printer-Resources: Stop using resources for a printer
97 OpDeletePrinter Op = 0x004e // Delete-Printer: Delete an existing service
98 OpGetPrinters Op = 0x004f // Get-Printers: Get a list of services
99
100 OpShutdownOnePrinter Op = 0x0050 // Shutdown-One-Printer: Shutdown a service
101 OpStartupOnePrinter Op = 0x0051 // Startup-One-Printer: Start a service
102 OpCancelResource Op = 0x0052 // Cancel-Resource: Uninstall a resource
103 OpCreateResource Op = 0x0053 // Create-Resource: Create a new (empty) resource
104 OpInstallResource Op = 0x0054 // Install-Resource: Install a resource
105 OpSendResourceData Op = 0x0055 // Send-Resource-Data: Upload the data for a resource
106 OpSetResourceAttributes Op = 0x0056 // Set-Resource-Attributes: Set resource object attributes
107 OpCreateResourceSubscriptions Op = 0x0057 // Create-Resource-Subscriptions: Create event subscriptions for a resource
108 OpCreateSystemSubscriptions Op = 0x0058 // Create-System-Subscriptions: Create event subscriptions for a system
109 OpDisableAllPrinters Op = 0x0059 // Disable-All-Printers: Stop accepting new jobs on all services
110 OpEnableAllPrinters Op = 0x005a // Enable-All-Printers: Start accepting new jobs on all services
111 OpGetSystemAttributes Op = 0x005b // Get-System-Attributes: Get system object attributes
112 OpGetSystemSupportedValues Op = 0x005c // Get-System-Supported-Values: Get supported values for system object attributes
113 OpPauseAllPrinters Op = 0x005d // Pause-All-Printers: Stop all services immediately
114 OpPauseAllPrintersAfterCurrentJob Op = 0x005e // Pause-All-Printers-After-Current-Job: Stop all services after processing the current jobs
115 OpRegisterOutputDevice Op = 0x005f // Register-Output-Device: Register a remote service
116
117 OpRestartSystem Op = 0x0060 // Restart-System: Restart all services
118 OpResumeAllPrinters Op = 0x0061 // Resume-All-Printers: Start job processing on all services
119 OpSetSystemAttributes Op = 0x0062 // Set-System-Attributes: Set system object attributes
120 OpShutdownAllPrinters Op = 0x0063 // Shutdown-All-Printers: Shutdown all services
121 OpStartupAllPrinters Op = 0x0064 // Startup-All-Printers: Startup all services
122
123 OpCupsGetDefault Op = 0x4001 // CUPS-Get-Default: Get the default printer
124 OpCupsGetPrinters Op = 0x4002 // CUPS-Get-Printers: Get a list of printers and/or classes
125 OpCupsAddModifyPrinter Op = 0x4003 // CUPS-Add-Modify-Printer: Add or modify a printer
126 OpCupsDeletePrinter Op = 0x4004 // CUPS-Delete-Printer: Delete a printer
127 OpCupsGetClasses Op = 0x4005 // CUPS-Get-Classes: Get a list of classes
128 OpCupsAddModifyClass Op = 0x4006 // CUPS-Add-Modify-Class: Add or modify a class
129 OpCupsDeleteClass Op = 0x4007 // CUPS-Delete-Class: Delete a class
130 OpCupsAcceptJobs Op = 0x4008 // CUPS-Accept-Jobs: Accept new jobs on a printer
131 OpCupsRejectJobs Op = 0x4009 // CUPS-Reject-Jobs: Reject new jobs on a printer
132 OpCupsSetDefault Op = 0x400a // CUPS-Set-Default: Set the default printer
133 OpCupsGetDevices Op = 0x400b // CUPS-Get-Devices: Get a list of supported devices
134 OpCupsGetPpds Op = 0x400c // CUPS-Get-PPDs: Get a list of supported drivers
135 OpCupsMoveJob Op = 0x400d // CUPS-Move-Job: Move a job to a different printer
136 OpCupsAuthenticateJob Op = 0x400e // CUPS-Authenticate-Job: Authenticate a job
137 OpCupsGetPpd Op = 0x400f // CUPS-Get-PPD: Get a PPD file
138
139 OpCupsGetDocument Op = 0x4027 // CUPS-Get-Document: Get a document file
140 OpCupsCreateLocalPrinter Op = 0x4028 // CUPS-Create-Local-Printer: Create a local (temporary) printer
141
142 )
143
144 // String() returns a Status name, as defined by RFC 8010
145 func (op Op) String() string {
146 switch op {
147 case OpPrintJob:
148 return "Print-Job"
149 case OpPrintURI:
150 return "Print-URI"
151 case OpValidateJob:
152 return "Validate-Job"
153 case OpCreateJob:
154 return "Create-Job"
155 case OpSendDocument:
156 return "Send-Document"
157 case OpSendURI:
158 return "Send-URI"
159 case OpCancelJob:
160 return "Cancel-Job"
161 case OpGetJobAttributes:
162 return "Get-Job-Attribute"
163 case OpGetJobs:
164 return "Get-Jobs"
165 case OpGetPrinterAttributes:
166 return "Get-Printer-Attributes"
167 case OpHoldJob:
168 return "Hold-Job"
169 case OpReleaseJob:
170 return "Release-Job"
171 case OpRestartJob:
172 return "Restart-Job"
173 case OpPausePrinter:
174 return "Pause-Printer"
175 case OpResumePrinter:
176 return "Resume-Printer"
177 case OpPurgeJobs:
178 return "Purge-Jobs"
179 case OpSetPrinterAttributes:
180 return "Set-Printer-Attributes"
181 case OpSetJobAttributes:
182 return "Set-Job-Attributes"
183 case OpGetPrinterSupportedValues:
184 return "Get-Printer-Supported-Values"
185 case OpCreatePrinterSubscriptions:
186 return "Create-Printer-Subscriptions"
187 case OpCreateJobSubscriptions:
188 return "Create-Job-Subscriptions"
189 case OpGetSubscriptionAttributes:
190 return "Get-Subscription-Attributes"
191 case OpGetSubscriptions:
192 return "Get-Subscriptions"
193 case OpRenewSubscription:
194 return "Renew-Subscription"
195 case OpCancelSubscription:
196 return "Cancel-Subscription"
197 case OpGetNotifications:
198 return "Get-Notifications"
199 case OpSendNotifications:
200 return "Send-Notifications"
201 case OpGetResourceAttributes:
202 return "Get-Resource-Attributes"
203 case OpGetResourceData:
204 return "Get-Resource-Data"
205 case OpGetResources:
206 return "Get-Resources"
207 case OpGetPrintSupportFiles:
208 return "Get-Printer-Support-Files"
209 case OpEnablePrinter:
210 return "Enable-Printer"
211 case OpDisablePrinter:
212 return "Disable-Printer"
213 case OpPausePrinterAfterCurrentJob:
214 return "Pause-Printer-After-Current-Job"
215 case OpHoldNewJobs:
216 return "Hold-New-Jobs"
217 case OpReleaseHeldNewJobs:
218 return "Release-Held-New-Jobs"
219 case OpDeactivatePrinter:
220 return "Deactivate-Printer"
221 case OpActivatePrinter:
222 return "Activate-Printer"
223 case OpRestartPrinter:
224 return "Restart-Printer"
225 case OpShutdownPrinter:
226 return "Shutdown-Printer"
227 case OpStartupPrinter:
228 return "Startup-Printer"
229 case OpReprocessJob:
230 return "Reprocess-Job"
231 case OpCancelCurrentJob:
232 return "Cancel-Current-Job"
233 case OpSuspendCurrentJob:
234 return "Suspend-Current-Job"
235 case OpResumeJob:
236 return "Resume-Job"
237 case OpPromoteJob:
238 return "Promote-Job"
239 case OpScheduleJobAfter:
240 return "Schedule-Job-After"
241 case OpCancelDocument:
242 return "Cancel-Document"
243 case OpGetDocumentAttributes:
244 return "Get-Document-Attributes"
245 case OpGetDocuments:
246 return "Get-Documents"
247 case OpDeleteDocument:
248 return "Delete-Document"
249 case OpSetDocumentAttributes:
250 return "Set-Document-Attributes"
251 case OpCancelJobs:
252 return "Cancel-Jobs"
253 case OpCancelMyJobs:
254 return "Cancel-My-Jobs"
255 case OpResubmitJob:
256 return "Resubmit-Job"
257 case OpCloseJob:
258 return "Close-Job"
259 case OpIdentifyPrinter:
260 return "Identify-Printer"
261 case OpValidateDocument:
262 return "Validate-Document"
263 case OpAddDocumentImages:
264 return "Add-Document-Images"
265 case OpAcknowledgeDocument:
266 return "Acknowledge-Document"
267 case OpAcknowledgeIdentifyPrinter:
268 return "Acknowledge-Identify-Printer"
269 case OpAcknowledgeJob:
270 return "Acknowledge-Job"
271 case OpFetchDocument:
272 return "Fetch-Document"
273 case OpFetchJob:
274 return "Fetch-Job"
275 case OpGetOutputDeviceAttributes:
276 return "Get-Output-Device-Attributes"
277 case OpUpdateActiveJobs:
278 return "Update-Active-Jobs"
279 case OpDeregisterOutputDevice:
280 return "Deregister-Output-Device"
281 case OpUpdateDocumentStatus:
282 return "Update-Document-Status"
283 case OpUpdateJobStatus:
284 return "Update-Job-Status"
285 case OpupdateOutputDeviceAttributes:
286 return "Update-Output-Device-Attributes"
287 case OpGetNextDocumentData:
288 return "Get-Next-Document-Data"
289 case OpAllocatePrinterResources:
290 return "Allocate-Printer-Resources"
291 case OpCreatePrinter:
292 return "Create-Printer"
293 case OpDeallocatePrinterResources:
294 return "Deallocate-Printer-Resources"
295 case OpDeletePrinter:
296 return "Delete-Printer"
297 case OpGetPrinters:
298 return "Get-Printers"
299 case OpShutdownOnePrinter:
300 return "Shutdown-One-Printer"
301 case OpStartupOnePrinter:
302 return "Startup-One-Printer"
303 case OpCancelResource:
304 return "Cancel-Resource"
305 case OpCreateResource:
306 return "Create-Resource"
307 case OpInstallResource:
308 return "Install-Resource"
309 case OpSendResourceData:
310 return "Send-Resource-Data"
311 case OpSetResourceAttributes:
312 return "Set-Resource-Attributes"
313 case OpCreateResourceSubscriptions:
314 return "Create-Resource-Subscriptions"
315 case OpCreateSystemSubscriptions:
316 return "Create-System-Subscriptions"
317 case OpDisableAllPrinters:
318 return "Disable-All-Printers"
319 case OpEnableAllPrinters:
320 return "Enable-All-Printers"
321 case OpGetSystemAttributes:
322 return "Get-System-Attributes"
323 case OpGetSystemSupportedValues:
324 return "Get-System-Supported-Values"
325 case OpPauseAllPrinters:
326 return "Pause-All-Printers"
327 case OpPauseAllPrintersAfterCurrentJob:
328 return "Pause-All-Printers-After-Current-Job"
329 case OpRegisterOutputDevice:
330 return "Register-Output-Device"
331 case OpRestartSystem:
332 return "Restart-System"
333 case OpResumeAllPrinters:
334 return "Resume-All-Printers"
335 case OpSetSystemAttributes:
336 return "Set-System-Attributes"
337 case OpShutdownAllPrinters:
338 return "Shutdown-All-Printers"
339 case OpStartupAllPrinters:
340 return "Startup-All-Printers"
341 case OpCupsGetDefault:
342 return "CUPS-Get-Default"
343 case OpCupsGetPrinters:
344 return "CUPS-Get-Printers"
345 case OpCupsAddModifyPrinter:
346 return "CUPS-Add-Modify-Printer"
347 case OpCupsDeletePrinter:
348 return "CUPS-Delete-Printer"
349 case OpCupsGetClasses:
350 return "CUPS-Get-Classes"
351 case OpCupsAddModifyClass:
352 return "CUPS-Add-Modify-Class"
353 case OpCupsDeleteClass:
354 return "CUPS-Delete-Class"
355 case OpCupsAcceptJobs:
356 return "CUPS-Accept-Jobs"
357 case OpCupsRejectJobs:
358 return "CUPS-Reject-Jobs"
359 case OpCupsSetDefault:
360 return "CUPS-Set-Default"
361 case OpCupsGetDevices:
362 return "CUPS-Get-Devices"
363 case OpCupsGetPpds:
364 return "CUPS-Get-PPDs"
365 case OpCupsMoveJob:
366 return "CUPS-Move-Job"
367 case OpCupsAuthenticateJob:
368 return "CUPS-Authenticate-Job"
369 case OpCupsGetPpd:
370 return "CUPS-Get-PPD"
371 case OpCupsGetDocument:
372 return "CUPS-Get-Document"
373 case OpCupsCreateLocalPrinter:
374 return "CUPS-Create-Local-Printer"
375 }
376
377 return fmt.Sprintf("0x%4.4x", int(op))
378 }