mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-05-31 09:43:47 +02:00
NetBios: NodeStatistics: Added read constructor
This commit is contained in:
parent
53706a840a
commit
96120008c5
1 changed files with 25 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
/* Copyright (C) 2014-2020 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
||||||
*
|
*
|
||||||
* You can redistribute this program and/or modify it under the terms of
|
* You can redistribute this program and/or modify it under the terms of
|
||||||
* the GNU Lesser Public License as published by the Free Software Foundation,
|
* the GNU Lesser Public License as published by the Free Software Foundation,
|
||||||
|
@ -41,6 +41,30 @@ namespace SMBLibrary.NetBios
|
||||||
UnitID = new byte[6];
|
UnitID = new byte[6];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NodeStatistics(byte[] buffer, ref int offset)
|
||||||
|
{
|
||||||
|
UnitID = ByteReader.ReadBytes(buffer, ref offset, 6);
|
||||||
|
Jumpers = ByteReader.ReadByte(buffer, ref offset);
|
||||||
|
TestResult = ByteReader.ReadByte(buffer, ref offset);
|
||||||
|
VersionNumber = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
PeriodOfStatistics = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
NumberOfCRCs = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
NumberOfAlignmentErrors = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
NumberOfCollisions = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
NumberOfSendAborts = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
NumberOfGoodSends = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
NumberOfGoodReceives = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
NumberOfRetransmits = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
NumberOfNoResourceConditions = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
NumberOfFreeCommandBlocks = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
TotalNumberOfCommandBlocks = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
MaxTotalNumberOfCommandBlocks = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
NumberOfPendingSessions = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
MaxNumberOfPendingSessions = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
MaxTotalsSessionsPossible = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
SessionDataPacketSize = BigEndianReader.ReadUInt16(buffer, ref offset);
|
||||||
|
}
|
||||||
|
|
||||||
public void WriteBytes(byte[] buffer, int offset)
|
public void WriteBytes(byte[] buffer, int offset)
|
||||||
{
|
{
|
||||||
ByteWriter.WriteBytes(buffer, ref offset, UnitID, 6);
|
ByteWriter.WriteBytes(buffer, ref offset, UnitID, 6);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue