@Override public TransStruct parse(Buffer b, SmbSession session) { creationTime = ByteOrderConverter.swap(b.getLong()); lastAccessTime = ByteOrderConverter.swap(b.getLong()); lastWriteTime = ByteOrderConverter.swap(b.getLong()); lastChangeTime = ByteOrderConverter.swap(b.getLong()); extFileAttributes = ExtFileAttributes.parse(ByteOrderConverter.swap(b.getInt())); reserved = ByteOrderConverter.swap(b.getInt()); return this; }
private static TcpPacket parse( IpPacket p, InetAddress source, InetAddress destination, int tcpLength, Buffer data) throws BufferUnderflowException { TcpPacket s = new TcpPacket(); s.ipPacket = p; s.tcpLength = tcpLength; s.sourceAddr = source; s.destinationAddr = destination; s.srcPort = data.getUnsignedShort(); s.dstPort = data.getUnsignedShort(); s.sessionKey = new TcpSessionKeyImpl(s.sourceAddr, s.destinationAddr, s.srcPort, s.dstPort); s.seq = data.getInt(); s.ack = data.getInt(); s.parseDataOffsetAndFlags(data); s.window = data.getUnsignedShort(); s.checksum = data.getUnsignedShort(); s.urgentPointer = data.getUnsignedShort(); s.parseOptions(data); s.parseData(data); return s; }