2 * Routines for PTP/IP (Picture Transfer Protocol) packet dissection
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 * [1] CIPA DC-X005-2005 - PTP-IP
28 * [2] BS ISO 15740:2008 - Photography Electronic still picture imaging - Picture transfer protocol (PTP)
29 * for digital still photography devices
30 * [3] gPhoto's Reversed Engineered PTP/IP documentation - http://gphoto.sourceforge.net/doc/ptpip.php
31 * [4] gPhoto's ptp2 header file https://gphoto.svn.sourceforge.net/svnroot/gphoto/trunk/libgphoto2/camlibs/ptp2/ptp.h
38 #include <epan/packet.h>
42 /*String Names of packet types [3] & [4]
43 * Opcode 0x1000 - 0x1025 defined in Table 22 of [2]
44 * Remainder of Opcodes from [4]. Enums reformatted from [4] ptp.h*/
46 /* PTP v1.0 operation codes */
47 PTP_OC_Undefined
= 0x1000,
48 PTP_OC_GetDeviceInfo
= 0x1001,
49 PTP_OC_OpenSession
= 0x1002,
50 PTP_OC_CloseSession
= 0x1003,
51 PTP_OC_GetStorageIDs
= 0x1004,
52 PTP_OC_GetStorageInfo
= 0x1005,
53 PTP_OC_GetNumObjects
= 0x1006,
54 PTP_OC_GetObjectHandles
= 0x1007,
55 PTP_OC_GetObjectInfo
= 0x1008,
56 PTP_OC_GetObject
= 0x1009,
57 PTP_OC_GetThumb
= 0x100A,
58 PTP_OC_DeleteObject
= 0x100B,
59 PTP_OC_SendObjectInfo
= 0x100C,
60 PTP_OC_SendObject
= 0x100D,
61 PTP_OC_InitiateCapture
= 0x100E,
62 PTP_OC_FormatStore
= 0x100F,
63 PTP_OC_ResetDevice
= 0x1010,
64 PTP_OC_SelfTest
= 0x1011,
65 PTP_OC_SetObjectProtection
= 0x1012,
66 PTP_OC_PowerDown
= 0x1013,
67 PTP_OC_GetDevicePropDesc
= 0x1014,
68 PTP_OC_GetDevicePropValue
= 0x1015,
69 PTP_OC_SetDevicePropValue
= 0x1016,
70 PTP_OC_ResetDevicePropValue
= 0x1017,
71 PTP_OC_TerminateOpenCapture
= 0x1018,
72 PTP_OC_MoveObject
= 0x1019,
73 PTP_OC_CopyObject
= 0x101A,
74 PTP_OC_GetPartialObject
= 0x101B,
75 PTP_OC_InitiateOpenCapture
= 0x101C,
76 /* PTP v1.1 operation codes */
77 PTP_OC_StartEnumHandles
= 0x101D,
78 PTP_OC_EnumHandles
= 0x101E,
79 PTP_OC_StopEnumHandles
= 0x101F,
80 PTP_OC_GetVendorExtensionMaps
= 0x1020,
81 PTP_OC_GetVendorDeviceInfo
= 0x1021,
82 PTP_OC_GetResizedImageObject
= 0x1022,
83 PTP_OC_GetFilesystemManifest
= 0x1023,
84 PTP_OC_GetStreamInfo
= 0x1024,
85 PTP_OC_GetStream
= 0x1025,
87 /* Eastman Kodak extension Operation Codes */
88 PTP_OC_EK_GetSerial
= 0x9003,
89 PTP_OC_EK_SetSerial
= 0x9004,
90 PTP_OC_EK_SendFileObjectInfo
= 0x9005,
91 PTP_OC_EK_SendFileObject
= 0x9006,
92 PTP_OC_EK_SetText
= 0x9008,
94 /* Canon extension Operation Codes */
95 PTP_OC_CANON_GetPartialObjectInfo
= 0x9001,
96 /* 9002 - sends 2 uint32, nothing back */
97 PTP_OC_CANON_SetObjectArchive
= 0x9002,
98 PTP_OC_CANON_KeepDeviceOn
= 0x9003,
99 PTP_OC_CANON_LockDeviceUI
= 0x9004,
100 PTP_OC_CANON_UnlockDeviceUI
= 0x9005,
101 PTP_OC_CANON_GetObjectHandleByName
= 0x9006,
102 /* no 9007 observed yet */
103 PTP_OC_CANON_InitiateReleaseControl
= 0x9008,
104 PTP_OC_CANON_TerminateReleaseControl
= 0x9009,
105 PTP_OC_CANON_TerminatePlaybackMode
= 0x900A,
106 PTP_OC_CANON_ViewfinderOn
= 0x900B,
107 PTP_OC_CANON_ViewfinderOff
= 0x900C,
108 PTP_OC_CANON_DoAeAfAwb
= 0x900D,
110 /* 900e - send nothing, gets 5 uint16t in 32bit entities back in 20byte datablob */
111 PTP_OC_CANON_GetCustomizeSpec
= 0x900E,
112 PTP_OC_CANON_GetCustomizeItemInfo
= 0x900F,
113 PTP_OC_CANON_GetCustomizeData
= 0x9010,
114 PTP_OC_CANON_SetCustomizeData
= 0x9011,
115 PTP_OC_CANON_GetCaptureStatus
= 0x9012,
116 PTP_OC_CANON_CheckEvent
= 0x9013,
117 PTP_OC_CANON_FocusLock
= 0x9014,
118 PTP_OC_CANON_FocusUnlock
= 0x9015,
119 PTP_OC_CANON_GetLocalReleaseParam
= 0x9016,
120 PTP_OC_CANON_SetLocalReleaseParam
= 0x9017,
121 PTP_OC_CANON_AskAboutPcEvf
= 0x9018,
122 PTP_OC_CANON_SendPartialObject
= 0x9019,
123 PTP_OC_CANON_InitiateCaptureInMemory
= 0x901A,
124 PTP_OC_CANON_GetPartialObjectEx
= 0x901B,
125 PTP_OC_CANON_SetObjectTime
= 0x901C,
126 PTP_OC_CANON_GetViewfinderImage
= 0x901D,
127 PTP_OC_CANON_GetObjectAttributes
= 0x901E,
128 PTP_OC_CANON_ChangeUSBProtocol
= 0x901F,
129 PTP_OC_CANON_GetChanges
= 0x9020,
130 PTP_OC_CANON_GetObjectInfoEx
= 0x9021,
131 PTP_OC_CANON_InitiateDirectTransfer
= 0x9022,
132 PTP_OC_CANON_TerminateDirectTransfer
= 0x9023,
133 PTP_OC_CANON_SendObjectInfoByPath
= 0x9024,
134 PTP_OC_CANON_SendObjectByPath
= 0x9025,
135 PTP_OC_CANON_InitiateDirectTansferEx
= 0x9026,
136 PTP_OC_CANON_GetAncillaryObjectHandles
= 0x9027,
137 PTP_OC_CANON_GetTreeInfo
= 0x9028,
138 PTP_OC_CANON_GetTreeSize
= 0x9029,
139 PTP_OC_CANON_NotifyProgress
= 0x902A,
140 PTP_OC_CANON_NotifyCancelAccepted
= 0x902B,
141 /* 902c: no parms, read 3 uint32 in data, no response parms */
142 PTP_OC_CANON_902C
= 0x902C,
143 PTP_OC_CANON_GetDirectory
= 0x902D,
144 PTP_OC_CANON_SetPairingInfo
= 0x9030,
145 PTP_OC_CANON_GetPairingInfo
= 0x9031,
146 PTP_OC_CANON_DeletePairingInfo
= 0x9032,
147 PTP_OC_CANON_GetMACAddress
= 0x9033,
148 /* 9034: 1 param, no parms returned */
149 PTP_OC_CANON_SetDisplayMonitor
= 0x9034,
150 PTP_OC_CANON_PairingComplete
= 0x9035,
151 PTP_OC_CANON_GetWirelessMAXChannel
= 0x9036,
152 /* 9101: no args, 8 byte data (01 00 00 00 00 00 00 00), no resp data. */
153 PTP_OC_CANON_EOS_GetStorageIDs
= 0x9101,
155 * = 0x28 bytes of data:
156 00000000: 34 00 00 00 02 00 02 91 0a 00 00 00 04 00 03 00
157 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
158 00000020: 00 00 ff ff ff ff 03 43 00 46 00 00 00 03 41 00
159 00000030: 3a 00 00 00
162 PTP_OC_CANON_EOS_GetStorageInfo
= 0x9102,
163 PTP_OC_CANON_EOS_GetObjectInfo
= 0x9103,
164 PTP_OC_CANON_EOS_GetObject
= 0x9104,
165 PTP_OC_CANON_EOS_DeleteObject
= 0x9105,
166 PTP_OC_CANON_EOS_FormatStore
= 0x9106,
167 PTP_OC_CANON_EOS_GetPartialObject
= 0x9107,
168 PTP_OC_CANON_EOS_GetDeviceInfoEx
= 0x9108,
171 * 3 cmdargs: 1,= 0xffffffff,00 00 10 00;
173 00000000: 48 00 00 00 02 00 09 91 12 00 00 00 01 00 00 00
174 00000010: 38 00 00 00 00 00 00 30 01 00 00 00 01 30 00 00
175 00000020: 01 00 00 00 10 00 00 00 00 00 00 00 00 00 00 20
176 00000030: 00 00 00 30 44 43 49 4d 00 00 00 00 00 00 00 00 DCIM
177 00000040: 00 00 00 00 cc c3 01 46
178 * 2 respargs: = 0x0, = 0x3c
182 00000000: 18 00 00 00 01 00 09 91 15 00 00 00 01 00 00 00
183 00000010: 00 00 00 30 00 00 10 00
185 00000000: 48 00 00 00 02 00 09 91 15 00 00 00 01 00 00 00
186 00000010: 38 00 00 00 00 00 9c 33 01 00 00 00 01 30 00 00
187 00000020: 01 00 00 00 10 00 00 00 00 00 00 00 00 00 00 30
188 00000030: 00 00 9c 33 32 33 31 43 41 4e 4f 4e 00 00 00 00 231CANON
189 00000040: 00 00 00 00 cc c3 01 46
192 PTP_OC_CANON_EOS_GetObjectInfoEx
= 0x9109,
193 PTP_OC_CANON_EOS_GetThumbEx
= 0x910A,
194 PTP_OC_CANON_EOS_SendPartialObject
= 0x910B,
195 PTP_OC_CANON_EOS_SetObjectAttributes
= 0x910C,
196 PTP_OC_CANON_EOS_GetObjectTime
= 0x910D,
197 PTP_OC_CANON_EOS_SetObjectTime
= 0x910E,
199 /* 910f: no args, no data, 1 response arg (0). */
200 PTP_OC_CANON_EOS_RemoteRelease
= 0x910F,
201 /* Marcus: looks more like "Set DeviceProperty" in the trace.
204 * data phase (= 0xc, = 0xd11c, = 0x1)
207 PTP_OC_CANON_EOS_SetDevicePropValueEx
= 0x9110,
208 PTP_OC_CANON_EOS_GetRemoteMode
= 0x9113,
209 /* 9114: 1 arg (= 0x1), no data, no resp data. */
210 PTP_OC_CANON_EOS_SetRemoteMode
= 0x9114,
211 /* 9115: 1 arg (= 0x1), no data, no resp data. */
212 PTP_OC_CANON_EOS_SetEventMode
= 0x9115,
213 /* 9116: no args, data phase, no resp data. */
214 PTP_OC_CANON_EOS_GetEvent
= 0x9116,
215 PTP_OC_CANON_EOS_TransferComplete
= 0x9117,
216 PTP_OC_CANON_EOS_CancelTransfer
= 0x9118,
217 PTP_OC_CANON_EOS_ResetTransfer
= 0x9119,
219 /* 911a: 3 args (= 0xfffffff7, = 0x00001000, = 0x00000001), no data, no resp data. */
220 /* 911a: 3 args (= 0x001dfc60, = 0x00001000, = 0x00000001), no data, no resp data. */
221 PTP_OC_CANON_EOS_PCHDDCapacity
= 0x911A,
223 /* 911b: no cmd args, no data, no resp args */
224 PTP_OC_CANON_EOS_SetUILock
= 0x911B,
225 /* 911c: no cmd args, no data, no resp args */
226 PTP_OC_CANON_EOS_ResetUILock
= 0x911C,
227 PTP_OC_CANON_EOS_KeepDeviceOn
= 0x911D,
228 PTP_OC_CANON_EOS_SetNullPacketMode
= 0x911E,
229 PTP_OC_CANON_EOS_UpdateFirmware
= 0x911F,
230 PTP_OC_CANON_EOS_TransferCompleteDT
= 0x9120,
231 PTP_OC_CANON_EOS_CancelTransferDT
= 0x9121,
232 PTP_OC_CANON_EOS_SetWftProfile
= 0x9122,
233 PTP_OC_CANON_EOS_GetWftProfile
= 0x9122,
234 PTP_OC_CANON_EOS_SetProfileToWft
= 0x9124,
235 PTP_OC_CANON_EOS_BulbStart
= 0x9125,
236 PTP_OC_CANON_EOS_BulbEnd
= 0x9126,
237 PTP_OC_CANON_EOS_RequestDevicePropValue
= 0x9127,
239 /* = 0x9128 args (= 0x1/= 0x2, = 0x0), no data, no resp args */
240 PTP_OC_CANON_EOS_RemoteReleaseOn
= 0x9128,
241 /* = 0x9129 args (= 0x1/= 0x2), no data, no resp args */
242 PTP_OC_CANON_EOS_RemoteReleaseOff
= 0x9129,
243 PTP_OC_CANON_EOS_InitiateViewfinder
= 0x9151,
244 PTP_OC_CANON_EOS_TerminateViewfinder
= 0x9152,
245 PTP_OC_CANON_EOS_GetViewFinderData
= 0x9153,
246 PTP_OC_CANON_EOS_DoAf
= 0x9154,
247 PTP_OC_CANON_EOS_DriveLens
= 0x9155,
248 PTP_OC_CANON_EOS_DepthOfFieldPreview
= 0x9156,
249 PTP_OC_CANON_EOS_ClickWB
= 0x9157,
250 PTP_OC_CANON_EOS_Zoom
= 0x9158,
251 PTP_OC_CANON_EOS_ZoomPosition
= 0x9159,
252 PTP_OC_CANON_EOS_SetLiveAfFrame
= 0x915a,
253 PTP_OC_CANON_EOS_AfCancel
= 0x9160,
254 PTP_OC_CANON_EOS_FAPIMessageTX
= 0x91FE,
255 PTP_OC_CANON_EOS_FAPIMessageRX
= 0x91FF,
257 /* Nikon extension Operation Codes */
258 PTP_OC_NIKON_GetProfileAllData
= 0x9006,
259 PTP_OC_NIKON_SendProfileData
= 0x9007,
260 PTP_OC_NIKON_DeleteProfile
= 0x9008,
261 PTP_OC_NIKON_SetProfileData
= 0x9009,
262 PTP_OC_NIKON_AdvancedTransfer
= 0x9010,
263 PTP_OC_NIKON_GetFileInfoInBlock
= 0x9011,
264 PTP_OC_NIKON_Capture
= 0x90C0, /* 1 param, no data */
265 PTP_OC_NIKON_AfDrive
= 0x90C1, /* no params, no data */
266 PTP_OC_NIKON_SetControlMode
= 0x90C2, /* 1 param, no data */
267 PTP_OC_NIKON_DelImageSDRAM
= 0x90C3, /* no params, no data */
268 PTP_OC_NIKON_GetLargeThumb
= 0x90C4,
269 PTP_OC_NIKON_CurveDownload
= 0x90C5, /* 1 param, data in */
270 PTP_OC_NIKON_CurveUpload
= 0x90C6, /* 1 param, data out */
271 PTP_OC_NIKON_CheckEvent
= 0x90C7, /* no params, data in */
272 PTP_OC_NIKON_DeviceReady
= 0x90C8, /* no params, no data */
273 PTP_OC_NIKON_SetPreWBData
= 0x90C9, /* 3 params, data out */
274 PTP_OC_NIKON_GetVendorPropCodes
= 0x90CA, /* 0 params, data in */
275 PTP_OC_NIKON_AfCaptureSDRAM
= 0x90CB, /* no params, no data */
276 PTP_OC_NIKON_GetPictCtrlData
= 0x90CC,
277 PTP_OC_NIKON_SetPictCtrlData
= 0x90CD,
278 PTP_OC_NIKON_DelCstPicCtrl
= 0x90CE,
279 PTP_OC_NIKON_GetPicCtrlCapability
= 0x90CF,
281 /* Nikon Liveview stuff */
282 PTP_OC_NIKON_GetPreviewImg
= 0x9200,
283 PTP_OC_NIKON_StartLiveView
= 0x9201,
284 PTP_OC_NIKON_EndLiveView
= 0x9202,
285 PTP_OC_NIKON_GetLiveViewImg
= 0x9203,
286 PTP_OC_NIKON_MfDrive
= 0x9204,
287 PTP_OC_NIKON_ChangeAfArea
= 0x9205,
288 PTP_OC_NIKON_AfDriveCancel
= 0x9206,
289 PTP_OC_NIKON_GetDevicePTPIPInfo
= 0x90E0,
291 /* Casio EX-F1 (from http://code.google.com/p/exf1ctrl/ ) */
292 PTP_OC_CASIO_STILL_START
= 0x9001,
293 PTP_OC_CASIO_STILL_STOP
= 0x9002,
294 PTP_OC_CASIO_FOCUS
= 0x9007,
295 PTP_OC_CASIO_CF_PRESS
= 0x9009,
296 PTP_OC_CASIO_CF_RELEASE
= 0x900A,
297 PTP_OC_CASIO_GET_OBJECT_INFO
= 0x900C,
298 PTP_OC_CASIO_SHUTTER
= 0x9024,
299 PTP_OC_CASIO_GET_STILL_HANDLES
= 0x9027,
300 PTP_OC_CASIO_STILL_RESET
= 0x9028,
301 PTP_OC_CASIO_HALF_PRESS
= 0x9029,
302 PTP_OC_CASIO_HALF_RELEASE
= 0x902A,
303 PTP_OC_CASIO_CS_PRESS
= 0x902B,
304 PTP_OC_CASIO_CS_RELEASE
= 0x902C,
305 PTP_OC_CASIO_ZOOM
= 0x902D,
306 PTP_OC_CASIO_CZ_PRESS
= 0x902E,
307 PTP_OC_CASIO_CZ_RELEASE
= 0x902F,
308 PTP_OC_CASIO_MOVIE_START
= 0x9041,
309 PTP_OC_CASIO_MOVIE_STOP
= 0x9042,
310 PTP_OC_CASIO_MOVIE_PRESS
= 0x9043,
311 PTP_OC_CASIO_MOVIE_RELEASE
= 0x9044,
312 PTP_OC_CASIO_GET_MOVIE_HANDLES
= 0x9045,
313 PTP_OC_CASIO_MOVIE_RESET
= 0x9046,
314 PTP_OC_CASIO_GET_OBJECT
= 0x9025,
315 PTP_OC_CASIO_GET_THUMBNAIL
= 0x9026,
317 /* Microsoft / MTP extension codes */
318 PTP_OC_MTP_GetObjectPropsSupported
= 0x9801,
319 PTP_OC_MTP_GetObjectPropDesc
= 0x9802,
320 PTP_OC_MTP_GetObjectPropValue
= 0x9803,
321 PTP_OC_MTP_SetObjectPropValue
= 0x9804,
322 PTP_OC_MTP_GetObjPropList
= 0x9805,
323 PTP_OC_MTP_SetObjPropList
= 0x9806,
324 PTP_OC_MTP_GetInterdependendPropdesc
= 0x9807,
325 PTP_OC_MTP_SendObjectPropList
= 0x9808,
326 PTP_OC_MTP_GetObjectReferences
= 0x9810,
327 PTP_OC_MTP_SetObjectReferences
= 0x9811,
328 PTP_OC_MTP_UpdateDeviceFirmware
= 0x9812,
329 PTP_OC_MTP_Skip
= 0x9820,
332 * Windows Media Digital Rights Management for Portable Devices
333 * Extension Codes (microsoft.com/WMDRMPD: 10.1)
335 PTP_OC_MTP_WMDRMPD_GetSecureTimeChallenge
= 0x9101,
336 PTP_OC_MTP_WMDRMPD_GetSecureTimeResponse
= 0x9102,
337 PTP_OC_MTP_WMDRMPD_SetLicenseResponse
= 0x9103,
338 PTP_OC_MTP_WMDRMPD_GetSyncList
= 0x9104,
339 PTP_OC_MTP_WMDRMPD_SendMeterChallengeQuery
= 0x9105,
340 PTP_OC_MTP_WMDRMPD_GetMeterChallenge
= 0x9106,
341 PTP_OC_MTP_WMDRMPD_SetMeterResponse
= 0x9107,
342 PTP_OC_MTP_WMDRMPD_CleanDataStore
= 0x9108,
343 PTP_OC_MTP_WMDRMPD_GetLicenseState
= 0x9109,
344 PTP_OC_MTP_WMDRMPD_SendWMDRMPDCommand
= 0x910A,
345 PTP_OC_MTP_WMDRMPD_SendWMDRMPDRequest
= 0x910B,
348 * Windows Media Digital Rights Management for Portable Devices
349 * Extension Codes (microsoft.com/WMDRMPD: 10.1)
350 * Below are operations that have no public documented identifier
351 * associated with them "Vendor-defined Command Code"
353 PTP_OC_MTP_WMDRMPD_SendWMDRMPDAppRequest
= 0x9212,
354 PTP_OC_MTP_WMDRMPD_GetWMDRMPDAppResponse
= 0x9213,
355 PTP_OC_MTP_WMDRMPD_EnableTrustedFilesOperations
= 0x9214,
356 PTP_OC_MTP_WMDRMPD_DisableTrustedFilesOperations
= 0x9215,
357 PTP_OC_MTP_WMDRMPD_EndTrustedAppSession
= 0x9216,
361 * Microsoft Advanced Audio/Video Transfer
362 * Extensions (microsoft.com/AAVT: 1.0)
364 PTP_OC_MTP_AAVT_OpenMediaSession
= 0x9170,
365 PTP_OC_MTP_AAVT_CloseMediaSession
= 0x9171,
366 PTP_OC_MTP_AAVT_GetNextDataBlock
= 0x9172,
367 PTP_OC_MTP_AAVT_SetCurrentTimePosition
= 0x9173,
370 * Windows Media Digital Rights Management for Network Devices
371 * Extensions (microsoft.com/WMDRMND: 1.0) MTP/IP?
373 PTP_OC_MTP_WMDRMND_SendRegistrationRequest
= 0x9180,
374 PTP_OC_MTP_WMDRMND_GetRegistrationResponse
= 0x9181,
375 PTP_OC_MTP_WMDRMND_GetProximityChallenge
= 0x9182,
376 PTP_OC_MTP_WMDRMND_SendProximityResponse
= 0x9183,
377 PTP_OC_MTP_WMDRMND_SendWMDRMNDLicenseRequest
= 0x9184,
378 PTP_OC_MTP_WMDRMND_GetWMDRMNDLicenseResponse
= 0x9185,
381 * Windows Media Player Portiable Devices
382 * Extension Codes (microsoft.com/WMPPD: 11.1)
384 PTP_OC_MTP_WMPPD_ReportAddedDeletedItems
= 0x9201,
385 PTP_OC_MTP_WMPPD_ReportAcquiredItems
= 0x9202,
386 PTP_OC_MTP_WMPPD_PlaylistObjectPref
= 0x9203,
389 * Undocumented Zune Operation Codes
390 * maybe related to WMPPD extension set?
392 PTP_OC_MTP_ZUNE_GETUNDEFINED001
= 0x9204,
394 /* WiFi Provisioning MTP Extension Codes (microsoft.com/WPDWCN: 1.0) */
395 PTP_OC_MTP_WPDWCN_ProcessWFCObject
= 0x9122,
397 /* Olympus E series commands */
398 PTP_OC_OLYMPUS_Capture
= 0x9101,
399 PTP_OC_OLYMPUS_SelfCleaning
= 0x9103,
400 PTP_OC_OLYMPUS_SetRGBGain
= 0x9106,
401 PTP_OC_OLYMPUS_SetPresetMode
= 0x9107,
402 PTP_OC_OLYMPUS_SetWBBiasAll
= 0x9108,
403 PTP_OC_OLYMPUS_GetCameraControlMode
= 0x910a,
404 PTP_OC_OLYMPUS_SetCameraControlMode
= 0x910b,
405 PTP_OC_OLYMPUS_SetWBRGBGain
= 0x910c,
406 PTP_OC_OLYMPUS_GetDeviceInfo
= 0x9301,
407 PTP_OC_OLYMPUS_Init1
= 0x9302,
408 PTP_OC_OLYMPUS_SetDateTime
= 0x9402,
409 PTP_OC_OLYMPUS_GetDateTime
= 0x9482,
410 PTP_OC_OLYMPUS_SetCameraID
= 0x9501,
411 PTP_OC_OLYMPUS_GetCameraID
= 0x9581,
413 /* Proprietary vendor extension operations mask */
414 PTP_OC_EXTENSION_MASK
= 0xF000,
415 PTP_OC_EXTENSION
= 0x9000
418 static const value_string ptp_opcode_names
[] = {
419 { PTP_OC_GetDeviceInfo
, "GetDeviceInfo" },
420 { PTP_OC_OpenSession
, "OpenSession" },
421 { PTP_OC_CloseSession
, "CloseSession" },
422 { PTP_OC_GetStorageIDs
, "GetStorageIDs" },
423 { PTP_OC_GetStorageInfo
, "GetStorageInfo" },
424 { PTP_OC_GetNumObjects
, "GetNumObjects" },
425 { PTP_OC_GetObjectHandles
, "GetObjectHandles" },
426 { PTP_OC_GetObjectInfo
, "GetObjectInfo" },
427 { PTP_OC_GetObject
, "GetObject" },
428 { PTP_OC_DeleteObject
, "DeleteObject" },
429 { PTP_OC_SendObjectInfo
, "SendObjectInfo" },
430 { PTP_OC_SendObject
, "SendObject" },
431 { PTP_OC_InitiateCapture
, "InitiateCapture" },
432 { PTP_OC_FormatStore
, "FormatStore" },
433 { PTP_OC_ResetDevice
, "ResetDevice" },
434 { PTP_OC_SelfTest
, "SelfTest" },
435 { PTP_OC_SetObjectProtection
, "SetObjectProtection" },
436 { PTP_OC_PowerDown
, "PowerDown" },
437 { PTP_OC_GetDevicePropDesc
, "GetDevicePropDesc" },
438 { PTP_OC_GetDevicePropValue
, "GetDevicePropValue" },
439 { PTP_OC_SetDevicePropValue
, "SetDevicePropValue" },
440 { PTP_OC_ResetDevicePropValue
, "ResetDevicePropValue" },
441 { PTP_OC_TerminateOpenCapture
, "TerminateOpenCapture" },
442 { PTP_OC_MoveObject
, "MoveObject" },
443 { PTP_OC_CopyObject
, "CopyObject" },
444 { PTP_OC_GetPartialObject
, "GetPartialObject" },
445 { PTP_OC_InitiateOpenCapture
, "InitiateOpenCapture" },
446 { PTP_OC_StartEnumHandles
, "StartEnumHandles" },
447 { PTP_OC_EnumHandles
, "EnumHandles" },
448 { PTP_OC_StopEnumHandles
, "StopEnumHandles" },
449 { PTP_OC_GetVendorExtensionMaps
, "GetVendorExtensionMaps" },
450 { PTP_OC_GetVendorDeviceInfo
, "GetVendorDeviceInfo" },
451 { PTP_OC_GetResizedImageObject
, "GetResizedImageObject" },
452 { PTP_OC_GetFilesystemManifest
, "GetFilesystemManifest" },
453 { PTP_OC_GetStreamInfo
, "GetStreamInfo" },
454 { PTP_OC_GetStream
, "GetStream" },
455 { PTP_OC_EK_GetSerial
, "EK_GetSerial" },
456 { PTP_OC_EK_SetSerial
, "EK_SetSerial" },
457 { PTP_OC_EK_SendFileObjectInfo
, "EK_SendFileObjectInfo" },
458 { PTP_OC_EK_SendFileObject
, "EK_SendFileObject" },
459 { PTP_OC_EK_SetText
, "EK_SetText" },
460 { PTP_OC_CANON_GetPartialObjectInfo
, "CANON_GetPartialObjectInfo" },
461 { PTP_OC_CANON_SetObjectArchive
, "CANON_SetObjectArchive" },
462 { PTP_OC_CANON_KeepDeviceOn
, "CANON_KeepDeviceOn" },
463 { PTP_OC_CANON_LockDeviceUI
, "CANON_LockDeviceUI" },
464 { PTP_OC_CANON_UnlockDeviceUI
, "CANON_UnlockDeviceUI" },
465 { PTP_OC_CANON_GetObjectHandleByName
, "CANON_GetObjectHandleByName" },
466 { PTP_OC_CANON_InitiateReleaseControl
, "CANON_InitiateReleaseControl" },
467 { PTP_OC_CANON_TerminateReleaseControl
, "CANON_TerminateReleaseControl" },
468 { PTP_OC_CANON_TerminatePlaybackMode
, "CANON_TerminatePlaybackMode" },
469 { PTP_OC_CANON_ViewfinderOn
, "CANON_ViewfinderOn" },
470 { PTP_OC_CANON_ViewfinderOff
, "CANON_ViewfinderOff" },
471 { PTP_OC_CANON_DoAeAfAwb
, "CANON_DoAeAfAwb" },
472 { PTP_OC_CANON_GetCustomizeSpec
, "CANON_GetCustomizeSpec" },
473 { PTP_OC_CANON_GetCustomizeItemInfo
, "CANON_GetCustomizeItemInfo" },
474 { PTP_OC_CANON_GetCustomizeData
, "CANON_GetCustomizeData" },
475 { PTP_OC_CANON_SetCustomizeData
, "CANON_SetCustomizeData" },
476 { PTP_OC_CANON_GetCaptureStatus
, "CANON_GetCaptureStatus" },
477 { PTP_OC_CANON_CheckEvent
, "CANON_CheckEvent" },
478 { PTP_OC_CANON_FocusLock
, "CANON_FocusLock" },
479 { PTP_OC_CANON_FocusUnlock
, "CANON_FocusUnlock" },
480 { PTP_OC_CANON_GetLocalReleaseParam
, "CANON_GetLocalReleaseParam" },
481 { PTP_OC_CANON_SetLocalReleaseParam
, "CANON_SetLocalReleaseParam" },
482 { PTP_OC_CANON_AskAboutPcEvf
, "CANON_AskAboutPcEvf" },
483 { PTP_OC_CANON_SendPartialObject
, "CANON_SendPartialObject" },
484 { PTP_OC_CANON_InitiateCaptureInMemory
, "CANON_InitiateCaptureInMemory" },
485 { PTP_OC_CANON_GetPartialObjectEx
, "CANON_GetPartialObjectEx" },
486 { PTP_OC_CANON_SetObjectTime
, "CANON_SetObjectTime" },
487 { PTP_OC_CANON_GetViewfinderImage
, "CANON_GetViewfinderImage" },
488 { PTP_OC_CANON_GetObjectAttributes
, "CANON_GetObjectAttributes" },
489 { PTP_OC_CANON_ChangeUSBProtocol
, "CANON_ChangeUSBProtocol" },
490 { PTP_OC_CANON_GetChanges
, "CANON_GetChanges" },
491 { PTP_OC_CANON_GetObjectInfoEx
, "CANON_GetObjectInfoEx" },
492 { PTP_OC_CANON_InitiateDirectTransfer
, "CANON_InitiateDirectTransfer" },
493 { PTP_OC_CANON_TerminateDirectTransfer
, "CANON_TerminateDirectTransfer" },
494 { PTP_OC_CANON_SendObjectInfoByPath
, "CANON_SendObjectInfoByPath" },
495 { PTP_OC_CANON_SendObjectByPath
, "CANON_SendObjectByPath" },
496 { PTP_OC_CANON_InitiateDirectTansferEx
, "CANON_InitiateDirectTansferEx" },
497 { PTP_OC_CANON_GetAncillaryObjectHandles
, "CANON_GetAncillaryObjectHandles" },
498 { PTP_OC_CANON_GetTreeInfo
, "CANON_GetTreeInfo" },
499 { PTP_OC_CANON_GetTreeSize
, "CANON_GetTreeSize" },
500 { PTP_OC_CANON_NotifyProgress
, "CANON_NotifyProgress" },
501 { PTP_OC_CANON_NotifyCancelAccepted
, "CANON_NotifyCancelAccepted" },
502 { PTP_OC_CANON_902C
, "CANON_902C" },
503 { PTP_OC_CANON_SetPairingInfo
, "CANON_SetPairingInfo" },
504 { PTP_OC_CANON_GetPairingInfo
, "CANON_GetPairingInfo" },
505 { PTP_OC_CANON_DeletePairingInfo
, "CANON_DeletePairingInfo" },
506 { PTP_OC_CANON_GetMACAddress
, "CANON_GetMACAddress" },
507 { PTP_OC_CANON_SetDisplayMonitor
, "CANON_SetDisplayMonitor" },
508 { PTP_OC_CANON_PairingComplete
, "CANON_PairingComplete" },
509 { PTP_OC_CANON_GetWirelessMAXChannel
, "CANON_GetWirelessMAXChannel" },
510 { PTP_OC_CANON_EOS_GetStorageIDs
, "CANON_EOS_GetStorageIDs" },
511 { PTP_OC_CANON_EOS_GetStorageInfo
, "CANON_EOS_GetStorageInfo" },
512 { PTP_OC_CANON_EOS_GetObjectInfo
, "CANON_EOS_GetObjectInfo" },
513 { PTP_OC_CANON_EOS_GetObject
, "CANON_EOS_GetObject" },
514 { PTP_OC_CANON_EOS_DeleteObject
, "CANON_EOS_DeleteObject" },
515 { PTP_OC_CANON_EOS_FormatStore
, "CANON_EOS_FormatStore" },
516 { PTP_OC_CANON_EOS_GetPartialObject
, "CANON_EOS_GetPartialObject" },
517 { PTP_OC_CANON_EOS_GetDeviceInfoEx
, "CANON_EOS_GetDeviceInfoEx" },
518 { PTP_OC_CANON_EOS_GetObjectInfoEx
, "CANON_EOS_GetObjectInfoEx" },
519 { PTP_OC_CANON_EOS_GetThumbEx
, "CANON_EOS_GetThumbEx" },
520 { PTP_OC_CANON_EOS_SendPartialObject
, "CANON_EOS_SendPartialObject" },
521 { PTP_OC_CANON_EOS_SetObjectAttributes
, "CANON_EOS_SetObjectAttributes" },
522 { PTP_OC_CANON_EOS_GetObjectTime
, "CANON_EOS_GetObjectTime" },
523 { PTP_OC_CANON_EOS_SetObjectTime
, "CANON_EOS_SetObjectTime" },
524 { PTP_OC_CANON_EOS_RemoteRelease
, "CANON_EOS_RemoteRelease" },
525 { PTP_OC_CANON_EOS_SetDevicePropValueEx
, "CANON_EOS_SetDevicePropValueEx" },
526 { PTP_OC_CANON_EOS_GetRemoteMode
, "CANON_EOS_GetRemoteMode" },
527 { PTP_OC_CANON_EOS_SetRemoteMode
, "CANON_EOS_SetRemoteMode" },
528 { PTP_OC_CANON_EOS_SetEventMode
, "CANON_EOS_SetEventMode" },
529 { PTP_OC_CANON_EOS_GetEvent
, "CANON_EOS_GetEvent" },
530 { PTP_OC_CANON_EOS_TransferComplete
, "CANON_EOS_TransferComplete" },
531 { PTP_OC_CANON_EOS_CancelTransfer
, "CANON_EOS_CancelTransfer" },
532 { PTP_OC_CANON_EOS_ResetTransfer
, "CANON_EOS_ResetTransfer" },
533 { PTP_OC_CANON_EOS_PCHDDCapacity
, "CANON_EOS_PCHDDCapacity" },
534 { PTP_OC_CANON_EOS_SetUILock
, "CANON_EOS_SetUILock" },
535 { PTP_OC_CANON_EOS_ResetUILock
, "CANON_EOS_ResetUILock" },
536 { PTP_OC_CANON_EOS_KeepDeviceOn
, "CANON_EOS_KeepDeviceOn" },
537 { PTP_OC_CANON_EOS_SetNullPacketMode
, "CANON_EOS_SetNullPacketMode" },
538 { PTP_OC_CANON_EOS_UpdateFirmware
, "CANON_EOS_UpdateFirmware" },
539 { PTP_OC_CANON_EOS_TransferCompleteDT
, "CANON_EOS_TransferCompleteDT" },
540 { PTP_OC_CANON_EOS_CancelTransferDT
, "CANON_EOS_CancelTransferDT" },
541 { PTP_OC_CANON_EOS_SetWftProfile
, "CANON_EOS_SetWftProfile" },
542 { PTP_OC_CANON_EOS_GetWftProfile
, "CANON_EOS_GetWftProfile" },
543 { PTP_OC_CANON_EOS_SetProfileToWft
, "CANON_EOS_SetProfileToWft" },
544 { PTP_OC_CANON_EOS_BulbStart
, "CANON_EOS_BulbStart" },
545 { PTP_OC_CANON_EOS_BulbEnd
, "CANON_EOS_BulbEnd" },
546 { PTP_OC_CANON_EOS_RequestDevicePropValue
, "CANON_EOS_RequestDevicePropValue" },
547 { PTP_OC_CANON_EOS_RemoteReleaseOn
, "CANON_EOS_RemoteReleaseOn" },
548 { PTP_OC_CANON_EOS_RemoteReleaseOff
, "CANON_EOS_RemoteReleaseOff" },
549 { PTP_OC_CANON_EOS_InitiateViewfinder
, "CANON_EOS_InitiateViewfinder" },
550 { PTP_OC_CANON_EOS_TerminateViewfinder
, "CANON_EOS_TerminateViewfinder" },
551 { PTP_OC_CANON_EOS_GetViewFinderData
, "CANON_EOS_GetViewFinderData" },
552 { PTP_OC_CANON_EOS_DoAf
, "CANON_EOS_DoAf" },
553 { PTP_OC_CANON_EOS_DriveLens
, "CANON_EOS_DriveLens" },
554 { PTP_OC_CANON_EOS_DepthOfFieldPreview
, "CANON_EOS_DepthOfFieldPreview" },
555 { PTP_OC_CANON_EOS_ClickWB
, "CANON_EOS_ClickWB" },
556 { PTP_OC_CANON_EOS_Zoom
, "CANON_EOS_Zoom" },
557 { PTP_OC_CANON_EOS_ZoomPosition
, "CANON_EOS_ZoomPosition" },
558 { PTP_OC_CANON_EOS_SetLiveAfFrame
, "CANON_EOS_SetLiveAfFrame" },
559 { PTP_OC_CANON_EOS_AfCancel
, "CANON_EOS_AfCancel" },
560 { PTP_OC_CANON_EOS_FAPIMessageTX
, "CANON_EOS_FAPIMessageTX" },
561 { PTP_OC_CANON_EOS_FAPIMessageRX
, "CANON_EOS_FAPIMessageRX" },
562 { PTP_OC_NIKON_GetProfileAllData
, "NIKON_GetProfileAllData" },
563 { PTP_OC_NIKON_SendProfileData
, "NIKON_SendProfileData" },
564 { PTP_OC_NIKON_SendProfileData
, "NIKON_SendProfileData" },
565 { PTP_OC_NIKON_DeleteProfile
, "NIKON_DeleteProfile" },
566 { PTP_OC_NIKON_SetProfileData
, "NIKON_SetProfileData" },
567 { PTP_OC_NIKON_AdvancedTransfer
, "NIKON_AdvancedTransfer" },
568 { PTP_OC_NIKON_GetFileInfoInBlock
, "NIKON_GetFileInfoInBlock" },
569 { PTP_OC_NIKON_Capture
, "NIKON_Capture" },
570 { PTP_OC_NIKON_AfDrive
, "NIKON_AfDrive" },
571 { PTP_OC_NIKON_SetControlMode
, "NIKON_SetControlMode" },
572 { PTP_OC_NIKON_DelImageSDRAM
, "NIKON_DelImageSDRAM" },
573 { PTP_OC_NIKON_GetLargeThumb
, "NIKON_GetLargeThumb" },
574 { PTP_OC_NIKON_CurveDownload
, "NIKON_CurveDownload" },
575 { PTP_OC_NIKON_CurveUpload
, "NIKON_CurveUpload" },
576 { PTP_OC_NIKON_CheckEvent
, "NIKON_CheckEvent" },
577 { PTP_OC_NIKON_DeviceReady
, "NIKON_DeviceReady" },
578 { PTP_OC_NIKON_SetPreWBData
, "NIKON_SetPreWBData" },
579 { PTP_OC_NIKON_GetVendorPropCodes
, "NIKON_GetVendorPropCodes" },
580 { PTP_OC_NIKON_AfCaptureSDRAM
, "NIKON_AfCaptureSDRAM" },
581 { PTP_OC_NIKON_GetPictCtrlData
, "NIKON_GetPictCtrlData" },
582 { PTP_OC_NIKON_SetPictCtrlData
, "NIKON_SetPictCtrlData" },
583 { PTP_OC_NIKON_DelCstPicCtrl
, "NIKON_DelCstPicCtrl" },
584 { PTP_OC_NIKON_GetPicCtrlCapability
, "NIKON_GetPicCtrlCapability" },
585 { PTP_OC_NIKON_GetPreviewImg
, "NIKON_GetPreviewImg" },
586 { PTP_OC_NIKON_StartLiveView
, "NIKON_StartLiveView" },
587 { PTP_OC_NIKON_EndLiveView
, "NIKON_EndLiveView" },
588 { PTP_OC_NIKON_GetLiveViewImg
, "NIKON_GetLiveViewImg" },
589 { PTP_OC_NIKON_MfDrive
, "NIKON_MfDrive" },
590 { PTP_OC_NIKON_ChangeAfArea
, "NIKON_ChangeAfArea" },
591 { PTP_OC_NIKON_AfDriveCancel
, "NIKON_AfDriveCancel" },
592 { PTP_OC_NIKON_GetDevicePTPIPInfo
, "NIKON_GetDevicePTPIPInfo" },
593 { PTP_OC_CASIO_STILL_START
, "CASIO_STILL_START" },
594 { PTP_OC_CASIO_STILL_STOP
, "CASIO_STILL_STOP" },
595 { PTP_OC_CASIO_FOCUS
, "CASIO_FOCUS" },
596 { PTP_OC_CASIO_CF_PRESS
, "CASIO_CF_PRESS" },
597 { PTP_OC_CASIO_CF_RELEASE
, "CASIO_CF_RELEASE" },
598 { PTP_OC_CASIO_GET_OBJECT_INFO
, "CASIO_GET_OBJECT_INFO" },
599 { PTP_OC_CASIO_SHUTTER
, "CASIO_SHUTTER" },
600 { PTP_OC_CASIO_GET_STILL_HANDLES
, "CASIO_GET_STILL_HANDLES" },
601 { PTP_OC_CASIO_STILL_RESET
, "CASIO_STILL_RESET" },
602 { PTP_OC_CASIO_HALF_PRESS
, "CASIO_HALF_PRESS" },
603 { PTP_OC_CASIO_HALF_RELEASE
, "CASIO_HALF_RELEASE" },
604 { PTP_OC_CASIO_CS_PRESS
, "CASIO_CS_PRESS" },
605 { PTP_OC_CASIO_CS_RELEASE
, "CASIO_CS_RELEASE" },
606 { PTP_OC_CASIO_ZOOM
, "CASIO_ZOOM" },
607 { PTP_OC_CASIO_CZ_PRESS
, "CASIO_CZ_PRESS" },
608 { PTP_OC_CASIO_CZ_RELEASE
, "CASIO_CZ_RELEASE" },
609 { PTP_OC_CASIO_MOVIE_START
, "CASIO_MOVIE_START" },
610 { PTP_OC_CASIO_MOVIE_STOP
, "CASIO_MOVIE_STOP" },
611 { PTP_OC_CASIO_MOVIE_PRESS
, "CASIO_MOVIE_PRESS" },
612 { PTP_OC_CASIO_MOVIE_RELEASE
, "CASIO_MOVIE_RELEASE" },
613 { PTP_OC_CASIO_GET_MOVIE_HANDLES
, "CASIO_GET_MOVIE_HANDLES" },
614 { PTP_OC_CASIO_MOVIE_RESET
, "CASIO_MOVIE_RESET" },
615 { PTP_OC_CASIO_GET_OBJECT
, "CASIO_GET_OBJECT" },
616 { PTP_OC_CASIO_GET_THUMBNAIL
, "CASIO_GET_THUMBNAIL" },
617 { PTP_OC_MTP_GetObjectPropsSupported
, "MTP_GetObjectPropsSupported" },
618 { PTP_OC_MTP_GetObjectPropDesc
, "MTP_GetObjectPropDesc" },
619 { PTP_OC_MTP_GetObjectPropValue
, "MTP_GetObjectPropValue" },
620 { PTP_OC_MTP_SetObjectPropValue
, "MTP_SetObjectPropValue" },
621 { PTP_OC_MTP_GetObjPropList
, "MTP_GetObjPropList" },
622 { PTP_OC_MTP_SetObjPropList
, "MTP_SetObjPropList" },
623 { PTP_OC_MTP_GetInterdependendPropdesc
, "MTP_GetInterdependendPropdesc" },
624 { PTP_OC_MTP_SendObjectPropList
, "MTP_SendObjectPropList" },
625 { PTP_OC_MTP_GetObjectReferences
, "MTP_GetObjectReferences" },
626 { PTP_OC_MTP_SetObjectReferences
, "MTP_SetObjectReferences" },
627 { PTP_OC_MTP_UpdateDeviceFirmware
, "MTP_UpdateDeviceFirmware" },
628 { PTP_OC_MTP_Skip
, "MTP_Skip" },
629 { PTP_OC_MTP_WMDRMPD_GetSecureTimeChallenge
, "MTP_WMDRMPD_GetSecureTimeChallenge" },
630 { PTP_OC_MTP_WMDRMPD_GetSecureTimeResponse
, "MTP_WMDRMPD_GetSecureTimeResponse" },
631 { PTP_OC_MTP_WMDRMPD_SetLicenseResponse
, "MTP_WMDRMPD_SetLicenseResponse" },
632 { PTP_OC_MTP_WMDRMPD_GetSyncList
, "MTP_WMDRMPD_GetSyncList" },
633 { PTP_OC_MTP_WMDRMPD_SendMeterChallengeQuery
, "MTP_WMDRMPD_SendMeterChallengeQuery" },
634 { PTP_OC_MTP_WMDRMPD_GetMeterChallenge
, "MTP_WMDRMPD_GetMeterChallenge" },
635 { PTP_OC_MTP_WMDRMPD_SetMeterResponse
, "MTP_WMDRMPD_SetMeterResponse" },
636 { PTP_OC_MTP_WMDRMPD_CleanDataStore
, "MTP_WMDRMPD_CleanDataStore" },
637 { PTP_OC_MTP_WMDRMPD_GetLicenseState
, "MTP_WMDRMPD_GetLicenseState" },
638 { PTP_OC_MTP_WMDRMPD_SendWMDRMPDCommand
, "MTP_WMDRMPD_SendWMDRMPDCommand" },
639 { PTP_OC_MTP_WMDRMPD_SendWMDRMPDRequest
, "MTP_WMDRMPD_SendWMDRMPDRequest" },
640 { PTP_OC_MTP_WMDRMPD_SendWMDRMPDAppRequest
, "MTP_WMDRMPD_SendWMDRMPDAppRequest" },
641 { PTP_OC_MTP_WMDRMPD_GetWMDRMPDAppResponse
, "MTP_WMDRMPD_GetWMDRMPDAppResponse" },
642 { PTP_OC_MTP_WMDRMPD_EnableTrustedFilesOperations
, "MTP_WMDRMPD_EnableTrustedFilesOperations" },
643 { PTP_OC_MTP_WMDRMPD_DisableTrustedFilesOperations
, "MTP_WMDRMPD_DisableTrustedFilesOperations" },
644 { PTP_OC_MTP_WMDRMPD_EndTrustedAppSession
, "MTP_WMDRMPD_EndTrustedAppSession" },
645 { PTP_OC_MTP_AAVT_OpenMediaSession
, "MTP_AAVT_OpenMediaSession" },
646 { PTP_OC_MTP_AAVT_CloseMediaSession
, "MTP_AAVT_CloseMediaSession" },
647 { PTP_OC_MTP_AAVT_GetNextDataBlock
, "MTP_AAVT_GetNextDataBlock" },
648 { PTP_OC_MTP_AAVT_SetCurrentTimePosition
, "MTP_AAVT_SetCurrentTimePosition" },
649 { PTP_OC_MTP_WMDRMND_SendRegistrationRequest
, "MTP_WMDRMND_SendRegistrationRequest" },
650 { PTP_OC_MTP_WMDRMND_GetRegistrationResponse
, "MTP_WMDRMND_GetRegistrationResponse" },
651 { PTP_OC_MTP_WMDRMND_GetProximityChallenge
, "MTP_WMDRMND_GetProximityChallenge" },
652 { PTP_OC_MTP_WMDRMND_SendProximityResponse
, "MTP_WMDRMND_SendProximityResponse" },
653 { PTP_OC_MTP_WMDRMND_SendWMDRMNDLicenseRequest
, "MTP_WMDRMND_SendWMDRMNDLicenseRequest" },
654 { PTP_OC_MTP_WMDRMND_GetWMDRMNDLicenseResponse
, "MTP_WMDRMND_GetWMDRMNDLicenseResponse" },
655 { PTP_OC_MTP_WMPPD_ReportAddedDeletedItems
, "MTP_WMPPD_ReportAddedDeletedItems" },
656 { PTP_OC_MTP_WMPPD_ReportAcquiredItems
, "MTP_WMPPD_ReportAcquiredItems" },
657 { PTP_OC_MTP_WMPPD_PlaylistObjectPref
, "MTP_WMPPD_PlaylistObjectPref" },
658 { PTP_OC_MTP_ZUNE_GETUNDEFINED001
, "MTP_ZUNE_GETUNDEFINED001" },
659 { PTP_OC_MTP_WPDWCN_ProcessWFCObject
, "MTP_WPDWCN_ProcessWFCObject" },
660 { PTP_OC_OLYMPUS_Capture
, "OLYMPUS_Capture" },
661 { PTP_OC_OLYMPUS_SelfCleaning
, "OLYMPUS_SelfCleaning" },
662 { PTP_OC_OLYMPUS_SetRGBGain
, "OLYMPUS_SetRGBGain" },
663 { PTP_OC_OLYMPUS_SetPresetMode
, "OLYMPUS_SetPresetMode" },
664 { PTP_OC_OLYMPUS_SetWBBiasAll
, "OLYMPUS_SetWBBiasAll" },
665 { PTP_OC_OLYMPUS_GetCameraControlMode
, "OLYMPUS_GetCameraControlMode" },
666 { PTP_OC_OLYMPUS_SetCameraControlMode
, "OLYMPUS_SetCameraControlMode" },
667 { PTP_OC_OLYMPUS_SetWBRGBGain
, "OLYMPUS_SetWBRGBGain" },
668 { PTP_OC_OLYMPUS_GetDeviceInfo
, "OLYMPUS_GetDeviceInfo" },
669 { PTP_OC_OLYMPUS_Init1
, "OLYMPUS_Init1" },
670 { PTP_OC_OLYMPUS_SetDateTime
, "OLYMPUS_SetDateTime" },
671 { PTP_OC_OLYMPUS_GetDateTime
, "OLYMPUS_GetDateTim" },
672 { PTP_OC_OLYMPUS_SetCameraID
, "OLYMPUS_SetCameraID" },
673 { PTP_OC_OLYMPUS_GetCameraID
, "OLYMPUS_GetCameraID" },
674 { PTP_OC_EXTENSION_MASK
, "EXTENSION_MASK" },
675 { PTP_OC_EXTENSION
, "EXTENSION" },
676 { PTP_OC_Undefined
, "Undefined" },
683 * String Names of packet types [3] & [4]
684 * Response codes 0x2000 - 0x2023 defined in Table 27 of [2]
685 * Remainder of Response codes from [4]. Enums reformatted from [4] ptp.h*/
688 /* PTP v1.0 response codes */
689 PTP_RC_Undefined
= 0x2000,
691 PTP_RC_GeneralError
= 0x2002,
692 PTP_RC_SessionNotOpen
= 0x2003,
693 PTP_RC_InvalidTransactionID
= 0x2004,
694 PTP_RC_OperationNotSupported
= 0x2005,
695 PTP_RC_ParameterNotSupported
= 0x2006,
696 PTP_RC_IncompleteTransfer
= 0x2007,
697 PTP_RC_InvalidStorageId
= 0x2008,
698 PTP_RC_InvalidObjectHandle
= 0x2009,
699 PTP_RC_DevicePropNotSupported
= 0x200A,
700 PTP_RC_InvalidObjectFormatCode
= 0x200B,
701 PTP_RC_StoreFull
= 0x200C,
702 PTP_RC_ObjectWriteProtected
= 0x200D,
703 PTP_RC_StoreReadOnly
= 0x200E,
704 PTP_RC_AccessDenied
= 0x200F,
705 PTP_RC_NoThumbnailPresent
= 0x2010,
706 PTP_RC_SelfTestFailed
= 0x2011,
707 PTP_RC_PartialDeletion
= 0x2012,
708 PTP_RC_StoreNotAvailable
= 0x2013,
709 PTP_RC_SpecificationByFormatUnsupported
= 0x2014,
710 PTP_RC_NoValidObjectInfo
= 0x2015,
711 PTP_RC_InvalidCodeFormat
= 0x2016,
712 PTP_RC_UnknownVendorCode
= 0x2017,
713 PTP_RC_CaptureAlreadyTerminated
= 0x2018,
714 PTP_RC_DeviceBusy
= 0x2019,
715 PTP_RC_InvalidParentObject
= 0x201A,
716 PTP_RC_InvalidDevicePropFormat
= 0x201B,
717 PTP_RC_InvalidDevicePropValue
= 0x201C,
718 PTP_RC_InvalidParameter
= 0x201D,
719 PTP_RC_SessionAlreadyOpened
= 0x201E,
720 PTP_RC_TransactionCanceled
= 0x201F,
721 PTP_RC_SpecificationOfDestinationUnsupported
= 0x2020,
722 /* PTP v1.1 response codes */
723 PTP_RC_InvalidEnumHandle
= 0x2021,
724 PTP_RC_NoStreamEnabled
= 0x2022,
725 PTP_RC_InvalidDataSet
= 0x2023,
727 /* Eastman Kodak extension Response Codes */
728 PTP_RC_EK_FilenameRequired
= 0xA001,
729 PTP_RC_EK_FilenameConflicts
= 0xA002,
730 PTP_RC_EK_FilenameInvalid
= 0xA003,
732 /* Nikon specific response codes */
733 PTP_RC_NIKON_HardwareError
= 0xA001,
734 PTP_RC_NIKON_OutOfFocus
= 0xA002,
735 PTP_RC_NIKON_ChangeCameraModeFailed
= 0xA003,
736 PTP_RC_NIKON_InvalidStatus
= 0xA004,
737 PTP_RC_NIKON_SetPropertyNotSupported
= 0xA005,
738 PTP_RC_NIKON_WbResetError
= 0xA006,
739 PTP_RC_NIKON_DustReferenceError
= 0xA007,
740 PTP_RC_NIKON_ShutterSpeedBulb
= 0xA008,
741 PTP_RC_NIKON_MirrorUpSequence
= 0xA009,
742 PTP_RC_NIKON_CameraModeNotAdjustFNumber
=0xA00A,
743 PTP_RC_NIKON_NotLiveView
= 0xA00B,
744 PTP_RC_NIKON_MfDriveStepEnd
= 0xA00C,
745 PTP_RC_NIKON_MfDriveStepInsufficiency
= 0xA00E,
746 PTP_RC_NIKON_AdvancedTransferCancel
= 0xA022,
748 /* Canon specific response codes */
749 PTP_RC_CANON_UNKNOWN_COMMAND
= 0xA001,
750 PTP_RC_CANON_OPERATION_REFUSED
= 0xA005,
751 PTP_RC_CANON_LENS_COVER
= 0xA006,
752 PTP_RC_CANON_BATTERY_LOW
= 0xA101,
753 PTP_RC_CANON_NOT_READY
= 0xA102,
754 PTP_RC_CANON_A009
= 0xA009,
755 /* Microsoft/MTP specific codes */
756 PTP_RC_MTP_Undefined
= 0xA800,
757 PTP_RC_MTP_Invalid_ObjectPropCode
= 0xA801,
758 PTP_RC_MTP_Invalid_ObjectProp_Format
= 0xA802,
759 PTP_RC_MTP_Invalid_ObjectProp_Value
= 0xA803,
760 PTP_RC_MTP_Invalid_ObjectReference
= 0xA804,
761 PTP_RC_MTP_Invalid_Dataset
= 0xA806,
762 PTP_RC_MTP_Specification_By_Group_Unsupported
= 0xA807,
763 PTP_RC_MTP_Specification_By_Depth_Unsupported
= 0xA808,
764 PTP_RC_MTP_Object_Too_Large
= 0xA809,
765 PTP_RC_MTP_ObjectProp_Not_Supported
= 0xA80A,
767 /* Microsoft Advanced Audio/Video Transfer response codes
768 (microsoft.com/AAVT 1.0) */
769 PTP_RC_MTP_Invalid_Media_Session_ID
= 0xA170,
770 PTP_RC_MTP_Media_Session_Limit_Reached
= 0xA171,
771 PTP_RC_MTP_No_More_Data
= 0xA172,
773 /* WiFi Provisioning MTP Extension Error Codes (microsoft.com/WPDWCN: 1.0) */
774 PTP_RC_MTP_Invalid_WFC_Syntax
= 0xA121,
775 PTP_RC_MTP_WFC_Version_Not_Supported
= 0xA122
779 static const value_string ptp_respcode_names
[] = {
781 { PTP_RC_GeneralError
, "GeneralError" },
782 { PTP_RC_SessionNotOpen
, "SessionNotOpen" },
783 { PTP_RC_InvalidTransactionID
, "InvalidTransactionID" },
784 { PTP_RC_OperationNotSupported
, "OperationNotSupported" },
785 { PTP_RC_ParameterNotSupported
, "ParameterNotSupported" },
786 { PTP_RC_IncompleteTransfer
, "IncompleteTransfer" },
787 { PTP_RC_InvalidStorageId
, "InvalidStorageId" },
788 { PTP_RC_InvalidObjectHandle
, "InvalidObjectHandle" },
789 { PTP_RC_DevicePropNotSupported
, "DevicePropNotSupported" },
790 { PTP_RC_InvalidObjectFormatCode
, "InvalidObjectFormatCode" },
791 { PTP_RC_StoreFull
, "StoreFull" },
792 { PTP_RC_StoreReadOnly
, "StoreReadOnly" },
793 { PTP_RC_AccessDenied
, "AccessDenied" },
794 { PTP_RC_NoThumbnailPresent
, "NoThumbnailPresent" },
795 { PTP_RC_SelfTestFailed
, "SelfTestFailed" },
796 { PTP_RC_PartialDeletion
, "PartialDeletion" },
797 { PTP_RC_StoreNotAvailable
, "StoreNotAvailable" },
798 { PTP_RC_SpecificationByFormatUnsupported
, "SpecificationByFormatUnsupported" },
799 { PTP_RC_NoValidObjectInfo
, "NoValidObjectInfo" },
800 { PTP_RC_InvalidCodeFormat
, "InvalidCodeFormat" },
801 { PTP_RC_UnknownVendorCode
, "UnknownVendorCode" },
802 { PTP_RC_CaptureAlreadyTerminated
, "CaptureAlreadyTerminated" },
803 { PTP_RC_DeviceBusy
, "DeviceBusy" },
804 { PTP_RC_InvalidParentObject
, "InvalidParentObject" },
805 { PTP_RC_InvalidDevicePropFormat
, "InvalidDevicePropFormat" },
806 { PTP_RC_InvalidDevicePropValue
, "InvalidDevicePropValue" },
807 { PTP_RC_InvalidParameter
, "InvalidParameter" },
808 { PTP_RC_SessionAlreadyOpened
, "SessionAlreadyOpened" },
809 { PTP_RC_TransactionCanceled
, "TransactionCanceled" },
810 { PTP_RC_SpecificationOfDestinationUnsupported
, "SpecificationOfDestinationUnsupported" },
811 { PTP_RC_InvalidEnumHandle
, "InvalidEnumHandle" },
812 { PTP_RC_NoStreamEnabled
, "NoStreamEnabled" },
813 { PTP_RC_InvalidDataSet
, "InvalidDataSet" },
814 { PTP_RC_EK_FilenameRequired
, "EK_FilenameRequired" },
815 { PTP_RC_EK_FilenameConflicts
, "EK_FilenameConflicts" },
816 { PTP_RC_EK_FilenameInvalid
, "EK_FilenameInvalid" },
817 { PTP_RC_NIKON_HardwareError
, "NIKON_HardwareError" },
818 { PTP_RC_NIKON_OutOfFocus
, "NIKON_OutOfFocus" },
819 { PTP_RC_NIKON_ChangeCameraModeFailed
, "NIKON_ChangeCameraModeFailed" },
820 { PTP_RC_NIKON_InvalidStatus
, "NIKON_InvalidStatus" },
821 { PTP_RC_NIKON_SetPropertyNotSupported
, "NIKON_SetPropertyNotSupported" },
822 { PTP_RC_NIKON_WbResetError
, "NIKON_WbResetError" },
823 { PTP_RC_NIKON_DustReferenceError
, "NIKON_DustReferenceError" },
824 { PTP_RC_NIKON_ShutterSpeedBulb
, "NIKON_ShutterSpeedBulb" },
825 { PTP_RC_NIKON_MirrorUpSequence
, "NIKON_MirrorUpSequence" },
826 { PTP_RC_NIKON_CameraModeNotAdjustFNumber
, "NIKON_CameraModeNotAdjustFNumber" },
827 { PTP_RC_NIKON_NotLiveView
, "NIKON_NotLiveView" },
828 { PTP_RC_NIKON_MfDriveStepEnd
, "NIKON_MfDriveStepEnd" },
829 { PTP_RC_NIKON_MfDriveStepInsufficiency
, "NIKON_MfDriveStepInsufficiency" },
830 { PTP_RC_NIKON_AdvancedTransferCancel
, "NIKON_AdvancedTransferCancel" },
831 { PTP_RC_CANON_UNKNOWN_COMMAND
, "CANON_UNKNOWN_COMMAND" },
832 { PTP_RC_CANON_OPERATION_REFUSED
, "CANON_OPERATION_REFUSED" },
833 { PTP_RC_CANON_LENS_COVER
, "CANON_LENS_COVER" },
834 { PTP_RC_CANON_BATTERY_LOW
, "CANON_BATTERY_LOW" },
835 { PTP_RC_CANON_NOT_READY
, "CANON_NOT_READY" },
836 { PTP_RC_CANON_A009
, "CANON_A009" },
837 { PTP_RC_MTP_Undefined
, "MTP_Undefined" },
838 { PTP_RC_MTP_Invalid_ObjectPropCode
, "MTP_Invalid_ObjectPropCode" },
839 { PTP_RC_MTP_Invalid_ObjectProp_Format
, "MTP_Invalid_ObjectProp_Format" },
840 { PTP_RC_MTP_Invalid_ObjectProp_Value
, "MTP_Invalid_ObjectProp_Value" },
841 { PTP_RC_MTP_Invalid_ObjectReference
, "MTP_Invalid_ObjectReference" },
842 { PTP_RC_MTP_Invalid_Dataset
, "MTP_Invalid_Dataset" },
843 { PTP_RC_MTP_Specification_By_Group_Unsupported
, "MTP_Specification_By_Group_Unsupported" },
844 { PTP_RC_MTP_Specification_By_Depth_Unsupported
, "MTP_Specification_By_Depth_Unsupported" },
845 { PTP_RC_MTP_Object_Too_Large
, "MTP_Object_Too_Large" },
846 { PTP_RC_MTP_ObjectProp_Not_Supported
, "MTP_ObjectProp_Not_Supported" },
847 { PTP_RC_MTP_Invalid_Media_Session_ID
, "MTP_Invalid_Media_Session_ID" },
848 { PTP_RC_MTP_Media_Session_Limit_Reached
, "MTP_Media_Session_Limit_Reached" },
849 { PTP_RC_MTP_No_More_Data
, "MTP_No_More_Data" },
850 { PTP_RC_MTP_Invalid_WFC_Syntax
, "MTP_Invalid_WFC_Syntax" },
851 { PTP_RC_MTP_WFC_Version_Not_Supported
, "MTP_WFC_Version_Not_Supported" },
852 { PTP_RC_Undefined
, "Undefined" },
858 /* function prototypes */
859 void dissect_ptp_opCode_openSession(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, guint16
*offset
);
860 void dissect_ptp_transactionID(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, guint16
*offset
);