@@ -47,13 +47,18 @@ local securityProtocolStrings = {
47
47
[7 ] = " WPA2_MIXED_PSK"
48
48
}
49
49
50
+ local serviceStrings = {
51
+ [1 ] = " UDP" ,
52
+ [2 ] = " TCP"
53
+ }
54
+
50
55
packetNames = {
51
- [0x0002 ] = " Get PAN Gateway " ,
52
- [0x0003 ] = " Device state response " ,
56
+ [0x0002 ] = " Get PAN gateway " ,
57
+ [0x0003 ] = " PAN gateway state " ,
53
58
[0x0004 ] = " Get time" ,
54
59
[0x0005 ] = " Set time" ,
55
60
[0x0006 ] = " Time state" ,
56
- [0x0007 ] = " Get reset switch" ,
61
+ [0x0007 ] = " Get reset switch state " ,
57
62
[0x0008 ] = " Reset switch state" ,
58
63
[0x0009 ] = " Get dummy load" ,
59
64
[0x000a ] = " Set dummy load" ,
@@ -73,15 +78,20 @@ packetNames = {
73
78
[0x0018 ] = " Set bulb label" ,
74
79
[0x0019 ] = " Bulb label" ,
75
80
[0x001a ] = " Get tags" ,
81
+ [0x001b ] = " Set tags" ,
76
82
[0x001c ] = " Tags" ,
77
83
[0x001d ] = " Get tag labels" ,
84
+ [0x001e ] = " Set tag labels" ,
78
85
[0x001f ] = " Tag labels" ,
79
86
[0x0020 ] = " Get version" ,
87
+ [0x0021 ] = " Version state" ,
80
88
[0x0022 ] = " Get info" ,
81
- [0x0023 ] = " Info" ,
89
+ [0x0023 ] = " Info state " ,
82
90
[0x0024 ] = " Get MCU rail voltage" ,
83
91
[0x0025 ] = " MCU rail voltage" ,
84
92
[0x0026 ] = " Reboot" ,
93
+ [0x0027 ] = " Set factory test mode" ,
94
+ [0x0028 ] = " Disable factory test mode" ,
85
95
[0x0065 ] = " Get light state" ,
86
96
[0x0066 ] = " Set light colour" ,
87
97
[0x0067 ] = " Set waveform" ,
@@ -96,31 +106,77 @@ packetNames = {
96
106
[0x0132 ] = " Access point"
97
107
}
98
108
99
- function deviceStateResponse (buffer , pinfo , tree )
100
- tree :add (F .unknown , buffer (0 , 1 ))
101
- tree :add (F .unknown , buffer (1 , 2 ))
109
+ function panGatewayState (buffer , pinfo , tree )
110
+ tree :add (F .service , buffer (0 , 1 ))
111
+ tree :add_le (F .port , buffer (1 , 4 ))
102
112
end
103
113
104
114
function setTime (buffer , pinfo , tree )
105
115
tree :add (F .time , buffer (0 , 8 ))
106
116
end
107
117
108
- function getTime (buffer , pinfo , tree )
118
+ function timeState (buffer , pinfo , tree )
109
119
tree :add (F .time , buffer (0 , 8 ))
110
120
end
111
121
112
122
function resetSwitchState (buffer , pinfo , tree )
113
- tree :add (F .time , buffer (0 , 8 ))
123
+ tree :add (F .resetSwitch , buffer (0 , 1 ))
124
+ end
125
+
126
+ function meshInfo (buffer , pinfo , tree )
127
+ tree :add (F .signal , buffer (0 , 4 ))
128
+ tree :add (F .tx , buffer (4 , 4 ))
129
+ tree :add (F .rx , buffer (8 , 4 ))
130
+ tree :add (F .mcuTemperature , buffer (12 , 2 ))
131
+ end
132
+
133
+ function meshFirmwareState (buffer , pinfo , tree )
134
+ local build = tree :add (buffer (0 , 8 ), " Build" )
135
+ local install = tree :add (buffer (8 , 8 ), " Install" )
136
+
137
+ build :add (F .second , buffer (0 , 1 ))
138
+ build :add (F .minute , buffer (1 , 1 ))
139
+ build :add (F .hour , buffer (2 , 1 ))
140
+ build :add (F .day , buffer (3 , 1 ))
141
+ build :add (F .month , buffer (4 , 3 ))
142
+ build :add (F .year , buffer (7 , 1 ))
143
+
144
+ install :add (F .second , buffer (8 , 1 ))
145
+ install :add (F .minute , buffer (9 , 1 ))
146
+ install :add (F .hour , buffer (10 , 1 ))
147
+ install :add (F .day , buffer (11 , 1 ))
148
+ install :add (F .month , buffer (14 , 3 ))
149
+ install :add (F .year , buffer (17 , 1 ))
150
+
151
+ tree :add (F .version , buffer (18 , 4 ))
114
152
end
115
153
116
154
function wifiInfo (buffer , pinfo , tree )
117
- tree :add (F .unknown , buffer (0 , 14 ))
155
+ tree :add (F .signal , buffer (0 , 4 ))
156
+ tree :add (F .tx , buffer (4 , 4 ))
157
+ tree :add (F .rx , buffer (8 , 4 ))
158
+ tree :add (F .mcuTemperature , buffer (12 , 2 ))
118
159
end
119
160
120
161
function wifiFirmwareState (buffer , pinfo , tree )
121
- tree :add (F .unknown , buffer (0 , 16 ))
122
- tree :add (F .unknown , buffer (0 , 2 ))
123
- tree :add (F .unknown , buffer (0 , 2 ))
162
+ local build = tree :add (buffer (0 , 8 ), " Build" )
163
+ local install = tree :add (buffer (8 , 8 ), " Install" )
164
+
165
+ build :add (F .second , buffer (0 , 1 ))
166
+ build :add (F .minute , buffer (1 , 1 ))
167
+ build :add (F .hour , buffer (2 , 1 ))
168
+ build :add (F .day , buffer (3 , 1 ))
169
+ build :add (F .month , buffer (4 , 3 ))
170
+ build :add (F .year , buffer (7 , 1 ))
171
+
172
+ install :add (F .second , buffer (8 , 1 ))
173
+ install :add (F .minute , buffer (9 , 1 ))
174
+ install :add (F .hour , buffer (10 , 1 ))
175
+ install :add (F .day , buffer (11 , 1 ))
176
+ install :add (F .month , buffer (14 , 3 ))
177
+ install :add (F .year , buffer (17 , 1 ))
178
+
179
+ tree :add (F .version , buffer (18 , 4 ))
124
180
end
125
181
126
182
function setPowerState (buffer , pinfo , tree )
@@ -139,14 +195,48 @@ function setBulbLabel(buffer, pinfo, tree)
139
195
tree :add (F .bulbName , buffer (0 , 32 ))
140
196
end
141
197
198
+ function setTags (buffer , pinfo , tree )
199
+ tree :add (F .tags , buffer (0 , 8 ))
200
+ end
201
+
142
202
function tags (buffer , pinfo , tree )
143
203
tree :add (F .tags , buffer (0 , 8 ))
144
204
end
145
205
206
+ function getTagLabels (buffer , pinfo , tree )
207
+ tree :add (F .tags , buffer (0 , 8 ))
208
+ end
209
+
210
+ function setTagLabels (buffer , pinfo , tree )
211
+ tree :add (F .tags , buffer (0 , 8 ))
212
+ tree :add (F .label , buffer (8 , 40 ))
213
+ end
214
+
215
+ function tagLabels (buffer , pinfo , tree )
216
+ tree :add (F .tags , buffer (0 , 8 ))
217
+ tree :add (F .label , buffer (8 , 40 ))
218
+ end
219
+
220
+ function versionState (buffer , pinfo , tree )
221
+ tree :add (F .vendor , buffer (0 , 4 ))
222
+ tree :add (F .product , buffer (4 , 4 ))
223
+ tree :add (F .vendor , buffer (8 , 4 ))
224
+ end
225
+
226
+ function infoState (buffer , pinfo , tree )
227
+ tree :add (F .time , buffer (0 , 8 ))
228
+ tree :add (F .uptime , buffer (8 , 8 ))
229
+ tree :add (F .downtime , buffer (16 , 8 ))
230
+ end
231
+
146
232
function mcuRailVoltage (buffer , pinfo , tree )
147
233
tree :add (F .voltage , buffer (0 , 4 ))
148
234
end
149
235
236
+ function setFactoryTestMode (buffer , pinfo , tree )
237
+ tree :add (F .on , buffer (0 , 1 ))
238
+ end
239
+
150
240
function setLightColour (buffer , pinfo , tree )
151
241
tree :add (F .stream , buffer (0 , 1 ))
152
242
tree :add_le (F .hue , buffer (1 , 2 ))
@@ -165,7 +255,8 @@ function setWaveform(buffer, pinfo, tree)
165
255
tree :add_le (F .kelvin , buffer (8 , 2 ))
166
256
tree :add_le (F .period , buffer (10 , 4 ))
167
257
tree :add (F .cycles , buffer (14 , 4 ))
168
- tree :add (F .waveform , buffer (18 , 1 ))
258
+ tree :add (F .dutyCycles , buffer (18 , 2 ))
259
+ tree :add (F .waveform , buffer (20 , 1 ))
169
260
end
170
261
171
262
function setDimAbsolute (buffer , pinfo , tree )
@@ -193,6 +284,13 @@ function getWifiState(buffer, pinfo, tree)
193
284
tree :add (F .interface , buffer (0 , 1 ))
194
285
end
195
286
287
+ function setWifiState (buffer , pinfo , tree )
288
+ tree :add (F .interface , buffer (0 , 1 ))
289
+ tree :add (F .wifiStatus , buffer (1 , 1 ))
290
+ tree :add (F .ip4Address , buffer (2 , 4 ))
291
+ tree :add (F .ip6Address , buffer (6 , 16 ))
292
+ end
293
+
196
294
function wifiState (buffer , pinfo , tree )
197
295
tree :add (F .interface , buffer (0 , 1 ))
198
296
tree :add (F .wifiStatus , buffer (1 , 1 ))
@@ -207,13 +305,21 @@ function setAccessPoint(buffer, pinfo, tree)
207
305
tree :add (F .securityProtocol , buffer (97 , 1 ))
208
306
end
209
307
308
+ function accessPoint (buffer , pinfo , tree )
309
+ tree :add (F .interface , buffer (0 , 1 ))
310
+ tree :add (F .ssid , buffer (1 , 32 ))
311
+ tree :add (F .securityProtocol , buffer (33 , 1 ))
312
+ tree :add (F .strength , buffer (34 , 2 ))
313
+ tree :add (F .channel , buffer (36 , 2 ))
314
+ end
315
+
210
316
packetTable = switch {
211
317
[0x0002 ] = getPanGateway ,
212
- [0x0003 ] = deviceStateResponse ,
318
+ [0x0003 ] = panGatewayState ,
213
319
[0x0004 ] = getTime ,
214
320
[0x0005 ] = setTime ,
215
321
[0x0006 ] = timeState ,
216
- [0x0007 ] = getResetSwitch ,
322
+ [0x0007 ] = getResetSwitchState ,
217
323
[0x0008 ] = resetSwitchState ,
218
324
[0x0009 ] = getDummyLoad ,
219
325
[0x000a ] = setDummyLoad ,
@@ -233,15 +339,20 @@ packetTable = switch {
233
339
[0x0018 ] = setBulbLabel ,
234
340
[0x0019 ] = bulbLabel ,
235
341
[0x001a ] = getTags ,
342
+ [0x001b ] = setTags ,
236
343
[0x001c ] = tags ,
237
344
[0x001d ] = getTagLabels ,
345
+ [0x001e ] = setTagLabels ,
238
346
[0x001f ] = tagLabels ,
239
347
[0x0020 ] = getVersion ,
348
+ [0x0021 ] = versionState ,
240
349
[0x0022 ] = getInfo ,
241
- [0x0023 ] = info ,
350
+ [0x0023 ] = infoState ,
242
351
[0x0024 ] = getMcuRailVoltage ,
243
352
[0x0025 ] = mcuRailVoltage ,
244
353
[0x0026 ] = reboot ,
354
+ [0x0027 ] = setFactoryTestMode ,
355
+ [0x0028 ] = disableFactoryTestMode ,
245
356
[0x0065 ] = getLightState ,
246
357
[0x0066 ] = setLightColour ,
247
358
[0x0067 ] = setWaveform ,
@@ -256,41 +367,61 @@ packetTable = switch {
256
367
[0x0132 ] = accessPoint
257
368
}
258
369
259
- F .size = ProtoField .uint16 (" lifx.size" , " Packet size" , base .HEX )
370
+ F .size = ProtoField .uint16 (" lifx.size" , " Packet size" , base .DEC )
260
371
F .protocol = ProtoField .uint16 (" lifx.protocol" , " LIFX protocol" , base .HEX )
261
372
F .reserved = ProtoField .bytes (" lifx.reserved" , " Reserved" , base .HEX )
262
373
F .targetAddr = ProtoField .ether (" lifx.targetAddr" , " Target address" , base .HEX )
263
374
F .site = ProtoField .ether (" lifx.site" , " Site address" , base .HEX )
264
375
F .timestamp = ProtoField .uint64 (" lifx.timestamp" , " Timestamp" , base .HEX )
265
376
F .packetType = ProtoField .uint16 (" lifx.packetType" , " Packet type" , base .HEX , packetNames )
266
-
267
377
F .unknown = ProtoField .bytes (" lifx.unknown" , " Unknown" , base .HEX )
268
378
F .onoffReq = ProtoField .uint8 (" lifx.onoff" , " On/off setting" , base .HEX , onOffStrings )
269
379
F .bulbName = ProtoField .string (" lifx.bulbName" , " Bulb name" , base .HEX )
270
- F .hue = ProtoField .uint16 (" lifx.hue" , " Hue" , base .HEX )
271
- F .saturation = ProtoField .uint16 (" lifx.saturation" , " Saturation" , base .HEX )
272
- F .brightness = ProtoField .uint16 (" lifx.brightness" , " Brightness" , base .HEX )
273
- F .kelvin = ProtoField .uint16 (" lifx.kelvin" , " Colour temperature" , base .HEX )
274
- F .fadeTime = ProtoField .uint16 (" lifx.fadeTime" , " Fade time" , base .HEX )
380
+ F .hue = ProtoField .uint16 (" lifx.hue" , " Hue" , base .DEC )
381
+ F .saturation = ProtoField .uint16 (" lifx.saturation" , " Saturation" , base .DEC )
382
+ F .brightness = ProtoField .uint16 (" lifx.brightness" , " Brightness" , base .DEC )
383
+ F .kelvin = ProtoField .uint16 (" lifx.kelvin" , " Colour temperature" , base .DEC )
384
+ F .fadeTime = ProtoField .uint16 (" lifx.fadeTime" , " Fade time" , base .DEC )
275
385
F .onoffRes = ProtoField .uint16 (" lifx.onoffResponse" , " On/off" , base .HEX , onOffStrings )
276
386
F .time = ProtoField .uint64 (" lifx.time" , " Time (us since epoch)" , base .HEX )
387
+ F .uptime = ProtoField .uint64 (" lifx.uptime" , " Uptime" , base .DEC )
277
388
F .resetSwitch = ProtoField .uint8 (" lifx.resetSwitch" , " Reset switch" , base .HEX , resetSwitchStrings )
278
389
F .tags = ProtoField .uint64 (" lifx.tags" , " Tags" , base .HEX )
279
- F .voltage = ProtoField .uint64 (" lifx.voltage" , " Voltage" , base .HEX )
390
+ F .voltage = ProtoField .uint64 (" lifx.voltage" , " Voltage" , base .DEC )
280
391
F .stream = ProtoField .uint8 (" lifx.stream" , " Stream" , base .HEX )
281
392
F .transient = ProtoField .uint8 (" lifx.transient" , " Transient" , base .HEX )
282
393
F .period = ProtoField .uint32 (" lifx.period" , " Period" , base .HEX )
283
394
F .cycles = ProtoField .float (" lifx.cycles" , " Cycles" , base .HEX )
395
+ F .dutyCycles = ProtoField .uint16 (" lifx.dutyCycles" , " Duty cycles" , base .HEX )
284
396
F .waveform = ProtoField .uint8 (" lifx.waveform" , " Waveform" , base .HEX )
285
- F .dim = ProtoField .uint16 (" lifx.dim" , " Dim" , base .HEX )
286
- F .power = ProtoField .uint16 (" lifx.power" , " Power" , base .HEX )
287
- F .interface = ProtoField .uint8 (" lifx.interface" , " Interface" , base .HEX , interfaceStrings )
397
+ F .dim = ProtoField .uint16 (" lifx.dim" , " Dim" , base .DEC )
398
+ F .power = ProtoField .uint16 (" lifx.power" , " Power" , base .HEX , onOffStrings )
399
+ F .interface = ProtoField .uint8 (" lifx.interface" , " Interface" , base .DEC , interfaceStrings )
288
400
F .wifiStatus = ProtoField .uint8 (" lifx.wifiStatus" , " Wifi status" , base .HEX , wifiStatusStrings )
289
401
F .ip4Address = ProtoField .bytes (" lifx.ip4Address" , " IP4 address" , base .HEX )
290
402
F .ip6Address = ProtoField .bytes (" lifx.ip6Address" , " IP6 address" , base .HEX )
291
403
F .ssid = ProtoField .bytes (" lifx.ssid" , " SSID (UTF8)" , base .HEX )
292
404
F .password = ProtoField .bytes (" lifx.password" , " Password (UTF8)" , base .HEX )
293
405
F .securityProtocol = ProtoField .bytes (" lifx.securityProtocol" , " Security protocol" , base .HEX , securityProtocolStrings )
406
+ F .signal = ProtoField .float (" lifx.signal" , " Signal" , base .DEC )
407
+ F .tx = ProtoField .uint32 (" lifx.tx" , " Tx" , base .DEC )
408
+ F .rx = ProtoField .uint32 (" lifx.rx" , " Rx" , base .DEC )
409
+ F .mcuTemperature = ProtoField .uint16 (" lifx.mcuTemperature" , " MCU temperature" , base .DEC )
410
+ F .second = ProtoField .uint8 (" lifx.second" , " Second" , base .DEC )
411
+ F .minute = ProtoField .uint8 (" lifx.minute" , " Minute" , base .DEC )
412
+ F .hour = ProtoField .uint8 (" lifx.hour" , " Hour" , base .DEC )
413
+ F .day = ProtoField .uint8 (" lifx.day" , " Day" , base .DEC )
414
+ F .month = ProtoField .bytes (" lifx.month" , " Month" , base .HEX )
415
+ F .year = ProtoField .uint8 (" lifx.year" , " Year" , base .DEC )
416
+ F .label = ProtoField .bytes (" lifx.label" , " Label" , base .HEX )
417
+ F .version = ProtoField .uint32 (" lifx.version" , " Version" , base .HEX )
418
+ F .product = ProtoField .uint32 (" lifx.product" , " Product" , base .HEX )
419
+ F .vendor = ProtoField .uint32 (" lifx.vendor" , " Vendor" , base .HEX )
420
+ F .on = ProtoField .uint8 (" lifx.on" , " On" , base .HEX )
421
+ F .strength = ProtoField .uint8 (" lifx.strength" , " Strength" , base .DEC )
422
+ F .channel = ProtoField .uint8 (" lifx.channel" , " Channel" , base .DEC )
423
+ F .service = ProtoField .uint8 (" lifx.service" , " Service" , base .HEX , serviceStrings )
424
+ F .port = ProtoField .uint32 (" lifx.port" , " Port" , base .DEC )
294
425
295
426
function lifx .dissector (buffer , pinfo , tree )
296
427
analyse (buffer , pinfo , tree )
0 commit comments