Adding the Kaitai library to parse PCAP files.
[pingpong.git] / Code / Projects / SmartPlugDetector / src / main / java / edu / uci / iotproject / PacketPpi.java
1 // This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
2 package edu.uci.iotproject;
3
4 import io.kaitai.struct.ByteBufferKaitaiStream;
5 import io.kaitai.struct.KaitaiStruct;
6 import io.kaitai.struct.KaitaiStream;
7 import java.io.IOException;
8 import java.util.Map;
9 import java.util.HashMap;
10 import java.util.ArrayList;
11
12
13 /**
14  * PPI is a standard for link layer packet encapsulation, proposed as
15  * generic extensible container to store both captured in-band data and
16  * out-of-band data. Originally it was developed to provide 802.11n
17  * radio information, but can be used for other purposes as well.
18  * 
19  * Sample capture: https://wiki.wireshark.org/SampleCaptures?action=AttachFile&do=get&target=Http.cap  
20  * @see <a href="https://www.cacetech.com/documents/PPI_Header_format_1.0.1.pdf">PPI header format spec, section 3</a>
21  */
22 public class PacketPpi extends KaitaiStruct {
23     public static PacketPpi fromFile(String fileName) throws IOException {
24         return new PacketPpi(new ByteBufferKaitaiStream(fileName));
25     }
26
27     public enum PfhType {
28         RADIO_802_11_COMMON(2),
29         RADIO_802_11N_MAC_EXT(3),
30         RADIO_802_11N_MAC_PHY_EXT(4),
31         SPECTRUM_MAP(5),
32         PROCESS_INFO(6),
33         CAPTURE_INFO(7);
34
35         private final long id;
36         PfhType(long id) { this.id = id; }
37         public long id() { return id; }
38         private static final Map<Long, PfhType> byId = new HashMap<Long, PfhType>(6);
39         static {
40             for (PfhType e : PfhType.values())
41                 byId.put(e.id(), e);
42         }
43         public static PfhType byId(long id) { return byId.get(id); }
44     }
45
46     public enum Linktype {
47         NULL_LINKTYPE(0),
48         ETHERNET(1),
49         AX25(3),
50         IEEE802_5(6),
51         ARCNET_BSD(7),
52         SLIP(8),
53         PPP(9),
54         FDDI(10),
55         PPP_HDLC(50),
56         PPP_ETHER(51),
57         ATM_RFC1483(100),
58         RAW(101),
59         C_HDLC(104),
60         IEEE802_11(105),
61         FRELAY(107),
62         LOOP(108),
63         LINUX_SLL(113),
64         LTALK(114),
65         PFLOG(117),
66         IEEE802_11_PRISM(119),
67         IP_OVER_FC(122),
68         SUNATM(123),
69         IEEE802_11_RADIOTAP(127),
70         ARCNET_LINUX(129),
71         APPLE_IP_OVER_IEEE1394(138),
72         MTP2_WITH_PHDR(139),
73         MTP2(140),
74         MTP3(141),
75         SCCP(142),
76         DOCSIS(143),
77         LINUX_IRDA(144),
78         USER0(147),
79         USER1(148),
80         USER2(149),
81         USER3(150),
82         USER4(151),
83         USER5(152),
84         USER6(153),
85         USER7(154),
86         USER8(155),
87         USER9(156),
88         USER10(157),
89         USER11(158),
90         USER12(159),
91         USER13(160),
92         USER14(161),
93         USER15(162),
94         IEEE802_11_AVS(163),
95         BACNET_MS_TP(165),
96         PPP_PPPD(166),
97         GPRS_LLC(169),
98         GPF_T(170),
99         GPF_F(171),
100         LINUX_LAPD(177),
101         BLUETOOTH_HCI_H4(187),
102         USB_LINUX(189),
103         PPI(192),
104         IEEE802_15_4(195),
105         SITA(196),
106         ERF(197),
107         BLUETOOTH_HCI_H4_WITH_PHDR(201),
108         AX25_KISS(202),
109         LAPD(203),
110         PPP_WITH_DIR(204),
111         C_HDLC_WITH_DIR(205),
112         FRELAY_WITH_DIR(206),
113         IPMB_LINUX(209),
114         IEEE802_15_4_NONASK_PHY(215),
115         USB_LINUX_MMAPPED(220),
116         FC_2(224),
117         FC_2_WITH_FRAME_DELIMS(225),
118         IPNET(226),
119         CAN_SOCKETCAN(227),
120         IPV4(228),
121         IPV6(229),
122         IEEE802_15_4_NOFCS(230),
123         DBUS(231),
124         DVB_CI(235),
125         MUX27010(236),
126         STANAG_5066_D_PDU(237),
127         NFLOG(239),
128         NETANALYZER(240),
129         NETANALYZER_TRANSPARENT(241),
130         IPOIB(242),
131         MPEG_2_TS(243),
132         NG40(244),
133         NFC_LLCP(245),
134         INFINIBAND(247),
135         SCTP(248),
136         USBPCAP(249),
137         RTAC_SERIAL(250),
138         BLUETOOTH_LE_LL(251),
139         NETLINK(253),
140         BLUETOOTH_LINUX_MONITOR(254),
141         BLUETOOTH_BREDR_BB(255),
142         BLUETOOTH_LE_LL_WITH_PHDR(256),
143         PROFIBUS_DL(257),
144         PKTAP(258),
145         EPON(259),
146         IPMI_HPM_2(260),
147         ZWAVE_R1_R2(261),
148         ZWAVE_R3(262),
149         WATTSTOPPER_DLM(263),
150         ISO_14443(264);
151
152         private final long id;
153         Linktype(long id) { this.id = id; }
154         public long id() { return id; }
155         private static final Map<Long, Linktype> byId = new HashMap<Long, Linktype>(104);
156         static {
157             for (Linktype e : Linktype.values())
158                 byId.put(e.id(), e);
159         }
160         public static Linktype byId(long id) { return byId.get(id); }
161     }
162
163     public PacketPpi(KaitaiStream _io) {
164         this(_io, null, null);
165     }
166
167     public PacketPpi(KaitaiStream _io, KaitaiStruct _parent) {
168         this(_io, _parent, null);
169     }
170
171     public PacketPpi(KaitaiStream _io, KaitaiStruct _parent, PacketPpi _root) {
172         super(_io);
173         this._parent = _parent;
174         this._root = _root == null ? this : _root;
175         _read();
176     }
177     private void _read() {
178         this.header = new PacketPpiHeader(this._io, this, _root);
179         this._raw_fields = this._io.readBytes((header().pphLen() - 8));
180         KaitaiStream _io__raw_fields = new ByteBufferKaitaiStream(_raw_fields);
181         this.fields = new PacketPpiFields(_io__raw_fields, this, _root);
182         switch (header().pphDlt()) {
183         case PPI: {
184             this._raw_body = this._io.readBytesFull();
185             KaitaiStream _io__raw_body = new ByteBufferKaitaiStream(_raw_body);
186             this.body = new PacketPpi(_io__raw_body);
187             break;
188         }
189         case ETHERNET: {
190             this._raw_body = this._io.readBytesFull();
191             KaitaiStream _io__raw_body = new ByteBufferKaitaiStream(_raw_body);
192             this.body = new EthernetFrame(_io__raw_body);
193             break;
194         }
195         default: {
196             this.body = this._io.readBytesFull();
197             break;
198         }
199         }
200     }
201     public static class PacketPpiFields extends KaitaiStruct {
202         public static PacketPpiFields fromFile(String fileName) throws IOException {
203             return new PacketPpiFields(new ByteBufferKaitaiStream(fileName));
204         }
205
206         public PacketPpiFields(KaitaiStream _io) {
207             this(_io, null, null);
208         }
209
210         public PacketPpiFields(KaitaiStream _io, PacketPpi _parent) {
211             this(_io, _parent, null);
212         }
213
214         public PacketPpiFields(KaitaiStream _io, PacketPpi _parent, PacketPpi _root) {
215             super(_io);
216             this._parent = _parent;
217             this._root = _root;
218             _read();
219         }
220         private void _read() {
221             this.entries = new ArrayList<PacketPpiField>();
222             {
223                 int i = 0;
224                 while (!this._io.isEof()) {
225                     this.entries.add(new PacketPpiField(this._io, this, _root));
226                     i++;
227                 }
228             }
229         }
230         private ArrayList<PacketPpiField> entries;
231         private PacketPpi _root;
232         private PacketPpi _parent;
233         public ArrayList<PacketPpiField> entries() { return entries; }
234         public PacketPpi _root() { return _root; }
235         public PacketPpi _parent() { return _parent; }
236     }
237
238     /**
239      * @see <a href="https://www.cacetech.com/documents/PPI_Header_format_1.0.1.pdf">PPI header format spec, section 4.1.3</a>
240      */
241     public static class Radio80211nMacExtBody extends KaitaiStruct {
242         public static Radio80211nMacExtBody fromFile(String fileName) throws IOException {
243             return new Radio80211nMacExtBody(new ByteBufferKaitaiStream(fileName));
244         }
245
246         public Radio80211nMacExtBody(KaitaiStream _io) {
247             this(_io, null, null);
248         }
249
250         public Radio80211nMacExtBody(KaitaiStream _io, PacketPpi.PacketPpiField _parent) {
251             this(_io, _parent, null);
252         }
253
254         public Radio80211nMacExtBody(KaitaiStream _io, PacketPpi.PacketPpiField _parent, PacketPpi _root) {
255             super(_io);
256             this._parent = _parent;
257             this._root = _root;
258             _read();
259         }
260         private void _read() {
261             this.flags = new MacFlags(this._io, this, _root);
262             this.aMpduId = this._io.readU4le();
263             this.numDelimiters = this._io.readU1();
264             this.reserved = this._io.readBytes(3);
265         }
266         private MacFlags flags;
267         private long aMpduId;
268         private int numDelimiters;
269         private byte[] reserved;
270         private PacketPpi _root;
271         private PacketPpi.PacketPpiField _parent;
272         public MacFlags flags() { return flags; }
273         public long aMpduId() { return aMpduId; }
274         public int numDelimiters() { return numDelimiters; }
275         public byte[] reserved() { return reserved; }
276         public PacketPpi _root() { return _root; }
277         public PacketPpi.PacketPpiField _parent() { return _parent; }
278     }
279     public static class MacFlags extends KaitaiStruct {
280         public static MacFlags fromFile(String fileName) throws IOException {
281             return new MacFlags(new ByteBufferKaitaiStream(fileName));
282         }
283
284         public MacFlags(KaitaiStream _io) {
285             this(_io, null, null);
286         }
287
288         public MacFlags(KaitaiStream _io, KaitaiStruct _parent) {
289             this(_io, _parent, null);
290         }
291
292         public MacFlags(KaitaiStream _io, KaitaiStruct _parent, PacketPpi _root) {
293             super(_io);
294             this._parent = _parent;
295             this._root = _root;
296             _read();
297         }
298         private void _read() {
299             this.unused1 = this._io.readBitsInt(1) != 0;
300             this.aggregateDelimiter = this._io.readBitsInt(1) != 0;
301             this.moreAggregates = this._io.readBitsInt(1) != 0;
302             this.aggregate = this._io.readBitsInt(1) != 0;
303             this.dupRx = this._io.readBitsInt(1) != 0;
304             this.rxShortGuard = this._io.readBitsInt(1) != 0;
305             this.isHt40 = this._io.readBitsInt(1) != 0;
306             this.greenfield = this._io.readBitsInt(1) != 0;
307             this._io.alignToByte();
308             this.unused2 = this._io.readBytes(3);
309         }
310         private boolean unused1;
311         private boolean aggregateDelimiter;
312         private boolean moreAggregates;
313         private boolean aggregate;
314         private boolean dupRx;
315         private boolean rxShortGuard;
316         private boolean isHt40;
317         private boolean greenfield;
318         private byte[] unused2;
319         private PacketPpi _root;
320         private KaitaiStruct _parent;
321         public boolean unused1() { return unused1; }
322
323         /**
324          * Aggregate delimiter CRC error after this frame
325          */
326         public boolean aggregateDelimiter() { return aggregateDelimiter; }
327
328         /**
329          * More aggregates
330          */
331         public boolean moreAggregates() { return moreAggregates; }
332
333         /**
334          * Aggregate
335          */
336         public boolean aggregate() { return aggregate; }
337
338         /**
339          * Duplicate RX
340          */
341         public boolean dupRx() { return dupRx; }
342
343         /**
344          * RX short guard interval (SGI)
345          */
346         public boolean rxShortGuard() { return rxShortGuard; }
347
348         /**
349          * true = HT40, false = HT20
350          */
351         public boolean isHt40() { return isHt40; }
352
353         /**
354          * Greenfield
355          */
356         public boolean greenfield() { return greenfield; }
357         public byte[] unused2() { return unused2; }
358         public PacketPpi _root() { return _root; }
359         public KaitaiStruct _parent() { return _parent; }
360     }
361
362     /**
363      * @see <a href="https://www.cacetech.com/documents/PPI_Header_format_1.0.1.pdf">PPI header format spec, section 3.1</a>
364      */
365     public static class PacketPpiHeader extends KaitaiStruct {
366         public static PacketPpiHeader fromFile(String fileName) throws IOException {
367             return new PacketPpiHeader(new ByteBufferKaitaiStream(fileName));
368         }
369
370         public PacketPpiHeader(KaitaiStream _io) {
371             this(_io, null, null);
372         }
373
374         public PacketPpiHeader(KaitaiStream _io, PacketPpi _parent) {
375             this(_io, _parent, null);
376         }
377
378         public PacketPpiHeader(KaitaiStream _io, PacketPpi _parent, PacketPpi _root) {
379             super(_io);
380             this._parent = _parent;
381             this._root = _root;
382             _read();
383         }
384         private void _read() {
385             this.pphVersion = this._io.readU1();
386             this.pphFlags = this._io.readU1();
387             this.pphLen = this._io.readU2le();
388             this.pphDlt = PacketPpi.Linktype.byId(this._io.readU4le());
389         }
390         private int pphVersion;
391         private int pphFlags;
392         private int pphLen;
393         private Linktype pphDlt;
394         private PacketPpi _root;
395         private PacketPpi _parent;
396         public int pphVersion() { return pphVersion; }
397         public int pphFlags() { return pphFlags; }
398         public int pphLen() { return pphLen; }
399         public Linktype pphDlt() { return pphDlt; }
400         public PacketPpi _root() { return _root; }
401         public PacketPpi _parent() { return _parent; }
402     }
403
404     /**
405      * @see <a href="https://www.cacetech.com/documents/PPI_Header_format_1.0.1.pdf">PPI header format spec, section 4.1.2</a>
406      */
407     public static class Radio80211CommonBody extends KaitaiStruct {
408         public static Radio80211CommonBody fromFile(String fileName) throws IOException {
409             return new Radio80211CommonBody(new ByteBufferKaitaiStream(fileName));
410         }
411
412         public Radio80211CommonBody(KaitaiStream _io) {
413             this(_io, null, null);
414         }
415
416         public Radio80211CommonBody(KaitaiStream _io, PacketPpi.PacketPpiField _parent) {
417             this(_io, _parent, null);
418         }
419
420         public Radio80211CommonBody(KaitaiStream _io, PacketPpi.PacketPpiField _parent, PacketPpi _root) {
421             super(_io);
422             this._parent = _parent;
423             this._root = _root;
424             _read();
425         }
426         private void _read() {
427             this.tsfTimer = this._io.readU8le();
428             this.flags = this._io.readU2le();
429             this.rate = this._io.readU2le();
430             this.channelFreq = this._io.readU2le();
431             this.channelFlags = this._io.readU2le();
432             this.fhssHopset = this._io.readU1();
433             this.fhssPattern = this._io.readU1();
434             this.dbmAntsignal = this._io.readS1();
435             this.dbmAntnoise = this._io.readS1();
436         }
437         private long tsfTimer;
438         private int flags;
439         private int rate;
440         private int channelFreq;
441         private int channelFlags;
442         private int fhssHopset;
443         private int fhssPattern;
444         private byte dbmAntsignal;
445         private byte dbmAntnoise;
446         private PacketPpi _root;
447         private PacketPpi.PacketPpiField _parent;
448         public long tsfTimer() { return tsfTimer; }
449         public int flags() { return flags; }
450         public int rate() { return rate; }
451         public int channelFreq() { return channelFreq; }
452         public int channelFlags() { return channelFlags; }
453         public int fhssHopset() { return fhssHopset; }
454         public int fhssPattern() { return fhssPattern; }
455         public byte dbmAntsignal() { return dbmAntsignal; }
456         public byte dbmAntnoise() { return dbmAntnoise; }
457         public PacketPpi _root() { return _root; }
458         public PacketPpi.PacketPpiField _parent() { return _parent; }
459     }
460
461     /**
462      * @see <a href="https://www.cacetech.com/documents/PPI_Header_format_1.0.1.pdf">PPI header format spec, section 3.1</a>
463      */
464     public static class PacketPpiField extends KaitaiStruct {
465         public static PacketPpiField fromFile(String fileName) throws IOException {
466             return new PacketPpiField(new ByteBufferKaitaiStream(fileName));
467         }
468
469         public PacketPpiField(KaitaiStream _io) {
470             this(_io, null, null);
471         }
472
473         public PacketPpiField(KaitaiStream _io, PacketPpi.PacketPpiFields _parent) {
474             this(_io, _parent, null);
475         }
476
477         public PacketPpiField(KaitaiStream _io, PacketPpi.PacketPpiFields _parent, PacketPpi _root) {
478             super(_io);
479             this._parent = _parent;
480             this._root = _root;
481             _read();
482         }
483         private void _read() {
484             this.pfhType = PacketPpi.PfhType.byId(this._io.readU2le());
485             this.pfhDatalen = this._io.readU2le();
486             switch (pfhType()) {
487             case RADIO_802_11_COMMON: {
488                 this._raw_body = this._io.readBytes(pfhDatalen());
489                 KaitaiStream _io__raw_body = new ByteBufferKaitaiStream(_raw_body);
490                 this.body = new Radio80211CommonBody(_io__raw_body, this, _root);
491                 break;
492             }
493             case RADIO_802_11N_MAC_EXT: {
494                 this._raw_body = this._io.readBytes(pfhDatalen());
495                 KaitaiStream _io__raw_body = new ByteBufferKaitaiStream(_raw_body);
496                 this.body = new Radio80211nMacExtBody(_io__raw_body, this, _root);
497                 break;
498             }
499             case RADIO_802_11N_MAC_PHY_EXT: {
500                 this._raw_body = this._io.readBytes(pfhDatalen());
501                 KaitaiStream _io__raw_body = new ByteBufferKaitaiStream(_raw_body);
502                 this.body = new Radio80211nMacPhyExtBody(_io__raw_body, this, _root);
503                 break;
504             }
505             default: {
506                 this.body = this._io.readBytes(pfhDatalen());
507                 break;
508             }
509             }
510         }
511         private PfhType pfhType;
512         private int pfhDatalen;
513         private Object body;
514         private PacketPpi _root;
515         private PacketPpi.PacketPpiFields _parent;
516         private byte[] _raw_body;
517         public PfhType pfhType() { return pfhType; }
518         public int pfhDatalen() { return pfhDatalen; }
519         public Object body() { return body; }
520         public PacketPpi _root() { return _root; }
521         public PacketPpi.PacketPpiFields _parent() { return _parent; }
522         public byte[] _raw_body() { return _raw_body; }
523     }
524
525     /**
526      * @see <a href="https://www.cacetech.com/documents/PPI_Header_format_1.0.1.pdf">PPI header format spec, section 4.1.4</a>
527      */
528     public static class Radio80211nMacPhyExtBody extends KaitaiStruct {
529         public static Radio80211nMacPhyExtBody fromFile(String fileName) throws IOException {
530             return new Radio80211nMacPhyExtBody(new ByteBufferKaitaiStream(fileName));
531         }
532
533         public Radio80211nMacPhyExtBody(KaitaiStream _io) {
534             this(_io, null, null);
535         }
536
537         public Radio80211nMacPhyExtBody(KaitaiStream _io, PacketPpi.PacketPpiField _parent) {
538             this(_io, _parent, null);
539         }
540
541         public Radio80211nMacPhyExtBody(KaitaiStream _io, PacketPpi.PacketPpiField _parent, PacketPpi _root) {
542             super(_io);
543             this._parent = _parent;
544             this._root = _root;
545             _read();
546         }
547         private void _read() {
548             this.flags = new MacFlags(this._io, this, _root);
549             this.aMpduId = this._io.readU4le();
550             this.numDelimiters = this._io.readU1();
551             this.mcs = this._io.readU1();
552             this.numStreams = this._io.readU1();
553             this.rssiCombined = this._io.readU1();
554             rssiAntCtl = new ArrayList<Integer>((int) (4));
555             for (int i = 0; i < 4; i++) {
556                 this.rssiAntCtl.add(this._io.readU1());
557             }
558             rssiAntExt = new ArrayList<Integer>((int) (4));
559             for (int i = 0; i < 4; i++) {
560                 this.rssiAntExt.add(this._io.readU1());
561             }
562             this.extChannelFreq = this._io.readU2le();
563             this.extChannelFlags = new ChannelFlags(this._io, this, _root);
564             rfSignalNoise = new ArrayList<SignalNoise>((int) (4));
565             for (int i = 0; i < 4; i++) {
566                 this.rfSignalNoise.add(new SignalNoise(this._io, this, _root));
567             }
568             evm = new ArrayList<Long>((int) (4));
569             for (int i = 0; i < 4; i++) {
570                 this.evm.add(this._io.readU4le());
571             }
572         }
573         public static class ChannelFlags extends KaitaiStruct {
574             public static ChannelFlags fromFile(String fileName) throws IOException {
575                 return new ChannelFlags(new ByteBufferKaitaiStream(fileName));
576             }
577
578             public ChannelFlags(KaitaiStream _io) {
579                 this(_io, null, null);
580             }
581
582             public ChannelFlags(KaitaiStream _io, PacketPpi.Radio80211nMacPhyExtBody _parent) {
583                 this(_io, _parent, null);
584             }
585
586             public ChannelFlags(KaitaiStream _io, PacketPpi.Radio80211nMacPhyExtBody _parent, PacketPpi _root) {
587                 super(_io);
588                 this._parent = _parent;
589                 this._root = _root;
590                 _read();
591             }
592             private void _read() {
593                 this.spectrum2ghz = this._io.readBitsInt(1) != 0;
594                 this.ofdm = this._io.readBitsInt(1) != 0;
595                 this.cck = this._io.readBitsInt(1) != 0;
596                 this.turbo = this._io.readBitsInt(1) != 0;
597                 this.unused = this._io.readBitsInt(8);
598                 this.gfsk = this._io.readBitsInt(1) != 0;
599                 this.dynCckOfdm = this._io.readBitsInt(1) != 0;
600                 this.onlyPassiveScan = this._io.readBitsInt(1) != 0;
601                 this.spectrum5ghz = this._io.readBitsInt(1) != 0;
602             }
603             private boolean spectrum2ghz;
604             private boolean ofdm;
605             private boolean cck;
606             private boolean turbo;
607             private long unused;
608             private boolean gfsk;
609             private boolean dynCckOfdm;
610             private boolean onlyPassiveScan;
611             private boolean spectrum5ghz;
612             private PacketPpi _root;
613             private PacketPpi.Radio80211nMacPhyExtBody _parent;
614
615             /**
616              * 2 GHz spectrum
617              */
618             public boolean spectrum2ghz() { return spectrum2ghz; }
619
620             /**
621              * OFDM (Orthogonal Frequency-Division Multiplexing)
622              */
623             public boolean ofdm() { return ofdm; }
624
625             /**
626              * CCK (Complementary Code Keying)
627              */
628             public boolean cck() { return cck; }
629             public boolean turbo() { return turbo; }
630             public long unused() { return unused; }
631
632             /**
633              * Gaussian Frequency Shift Keying
634              */
635             public boolean gfsk() { return gfsk; }
636
637             /**
638              * Dynamic CCK-OFDM
639              */
640             public boolean dynCckOfdm() { return dynCckOfdm; }
641
642             /**
643              * Only passive scan allowed
644              */
645             public boolean onlyPassiveScan() { return onlyPassiveScan; }
646
647             /**
648              * 5 GHz spectrum
649              */
650             public boolean spectrum5ghz() { return spectrum5ghz; }
651             public PacketPpi _root() { return _root; }
652             public PacketPpi.Radio80211nMacPhyExtBody _parent() { return _parent; }
653         }
654
655         /**
656          * RF signal + noise pair at a single antenna
657          */
658         public static class SignalNoise extends KaitaiStruct {
659             public static SignalNoise fromFile(String fileName) throws IOException {
660                 return new SignalNoise(new ByteBufferKaitaiStream(fileName));
661             }
662
663             public SignalNoise(KaitaiStream _io) {
664                 this(_io, null, null);
665             }
666
667             public SignalNoise(KaitaiStream _io, PacketPpi.Radio80211nMacPhyExtBody _parent) {
668                 this(_io, _parent, null);
669             }
670
671             public SignalNoise(KaitaiStream _io, PacketPpi.Radio80211nMacPhyExtBody _parent, PacketPpi _root) {
672                 super(_io);
673                 this._parent = _parent;
674                 this._root = _root;
675                 _read();
676             }
677             private void _read() {
678                 this.signal = this._io.readS1();
679                 this.noise = this._io.readS1();
680             }
681             private byte signal;
682             private byte noise;
683             private PacketPpi _root;
684             private PacketPpi.Radio80211nMacPhyExtBody _parent;
685
686             /**
687              * RF signal, dBm
688              */
689             public byte signal() { return signal; }
690
691             /**
692              * RF noise, dBm
693              */
694             public byte noise() { return noise; }
695             public PacketPpi _root() { return _root; }
696             public PacketPpi.Radio80211nMacPhyExtBody _parent() { return _parent; }
697         }
698         private MacFlags flags;
699         private long aMpduId;
700         private int numDelimiters;
701         private int mcs;
702         private int numStreams;
703         private int rssiCombined;
704         private ArrayList<Integer> rssiAntCtl;
705         private ArrayList<Integer> rssiAntExt;
706         private int extChannelFreq;
707         private ChannelFlags extChannelFlags;
708         private ArrayList<SignalNoise> rfSignalNoise;
709         private ArrayList<Long> evm;
710         private PacketPpi _root;
711         private PacketPpi.PacketPpiField _parent;
712         public MacFlags flags() { return flags; }
713         public long aMpduId() { return aMpduId; }
714         public int numDelimiters() { return numDelimiters; }
715
716         /**
717          * Modulation Coding Scheme (MCS)
718          */
719         public int mcs() { return mcs; }
720
721         /**
722          * Number of spatial streams (0 = unknown)
723          */
724         public int numStreams() { return numStreams; }
725
726         /**
727          * RSSI (Received Signal Strength Indication), combined from all active antennas / channels
728          */
729         public int rssiCombined() { return rssiCombined; }
730
731         /**
732          * RSSI (Received Signal Strength Indication) for antennas 0-3, control channel
733          */
734         public ArrayList<Integer> rssiAntCtl() { return rssiAntCtl; }
735
736         /**
737          * RSSI (Received Signal Strength Indication) for antennas 0-3, extension channel
738          */
739         public ArrayList<Integer> rssiAntExt() { return rssiAntExt; }
740
741         /**
742          * Extension channel frequency (MHz)
743          */
744         public int extChannelFreq() { return extChannelFreq; }
745
746         /**
747          * Extension channel flags
748          */
749         public ChannelFlags extChannelFlags() { return extChannelFlags; }
750
751         /**
752          * Signal + noise values for antennas 0-3
753          */
754         public ArrayList<SignalNoise> rfSignalNoise() { return rfSignalNoise; }
755
756         /**
757          * EVM (Error Vector Magnitude) for chains 0-3
758          */
759         public ArrayList<Long> evm() { return evm; }
760         public PacketPpi _root() { return _root; }
761         public PacketPpi.PacketPpiField _parent() { return _parent; }
762     }
763     private PacketPpiHeader header;
764     private PacketPpiFields fields;
765     private Object body;
766     private PacketPpi _root;
767     private KaitaiStruct _parent;
768     private byte[] _raw_fields;
769     private byte[] _raw_body;
770     public PacketPpiHeader header() { return header; }
771     public PacketPpiFields fields() { return fields; }
772     public Object body() { return body; }
773     public PacketPpi _root() { return _root; }
774     public KaitaiStruct _parent() { return _parent; }
775     public byte[] _raw_fields() { return _raw_fields; }
776     public byte[] _raw_body() { return _raw_body; }
777 }