1 // This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
2 package edu.uci.iotproject;
4 import io.kaitai.struct.ByteBufferKaitaiStream;
5 import io.kaitai.struct.KaitaiStruct;
6 import io.kaitai.struct.KaitaiStream;
7 import java.io.IOException;
9 public class TcpSegment extends KaitaiStruct {
10 public static TcpSegment fromFile(String fileName) throws IOException {
11 return new TcpSegment(new ByteBufferKaitaiStream(fileName));
14 public TcpSegment(KaitaiStream _io) {
15 this(_io, null, null);
18 public TcpSegment(KaitaiStream _io, KaitaiStruct _parent) {
19 this(_io, _parent, null);
22 public TcpSegment(KaitaiStream _io, KaitaiStruct _parent, TcpSegment _root) {
24 this._parent = _parent;
25 this._root = _root == null ? this : _root;
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();
46 private int windowSize;
48 private int urgentPointer;
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; }