80ec76e9a10e9cadc38addecc0ddcf34dea282a6
[pingpong.git] / Code / Projects / SmartPlugDetector / src / main / java / edu / uci / iotproject / TcpSegment.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
9 public class TcpSegment extends KaitaiStruct {
10     public static TcpSegment fromFile(String fileName) throws IOException {
11         return new TcpSegment(new ByteBufferKaitaiStream(fileName));
12     }
13
14     public TcpSegment(KaitaiStream _io) {
15         this(_io, null, null);
16     }
17
18     public TcpSegment(KaitaiStream _io, KaitaiStruct _parent) {
19         this(_io, _parent, null);
20     }
21
22     public TcpSegment(KaitaiStream _io, KaitaiStruct _parent, TcpSegment _root) {
23         super(_io);
24         this._parent = _parent;
25         this._root = _root == null ? this : _root;
26         _read();
27     }
28     private void _read() {
29         this.srcPort = this._io.readU2be();
30         this.dstPort = this._io.readU2be();
31         this.seqNum = this._io.readU4be();
32         this.ackNum = this._io.readU4be();
33         this.b12 = this._io.readU1();
34         this.b13 = this._io.readU1();
35         this.windowSize = this._io.readU2be();
36         this.checksum = this._io.readU2be();
37         this.urgentPointer = this._io.readU2be();
38         this.body = this._io.readBytesFull();
39     }
40     private int srcPort;
41     private int dstPort;
42     private long seqNum;
43     private long ackNum;
44     private int b12;
45     private int b13;
46     private int windowSize;
47     private int checksum;
48     private int urgentPointer;
49     private byte[] body;
50     private TcpSegment _root;
51     private KaitaiStruct _parent;
52     public int srcPort() { return srcPort; }
53     public int dstPort() { return dstPort; }
54     public long seqNum() { return seqNum; }
55     public long ackNum() { return ackNum; }
56     public int b12() { return b12; }
57     public int b13() { return b13; }
58     public int windowSize() { return windowSize; }
59     public int checksum() { return checksum; }
60     public int urgentPointer() { return urgentPointer; }
61     public byte[] body() { return body; }
62     public TcpSegment _root() { return _root; }
63     public KaitaiStruct _parent() { return _parent; }
64 }