本文整理汇总了C#中Microsoft.Protocols.TestTools.StackSdk.PduMarshaler.WriteUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# PduMarshaler.WriteUInt32方法的具体用法?C# PduMarshaler.WriteUInt32怎么用?C# PduMarshaler.WriteUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Protocols.TestTools.StackSdk.PduMarshaler
的用法示例。
在下文中一共展示了PduMarshaler.WriteUInt32方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Encode
/// <summary>
/// Encode this PDU to the PduMarshaler.
/// </summary>
/// <param name="marshaler">This is used to encode the fields of this PDU.</param>
public override void Encode(PduMarshaler marshaler)
{
base.Encode(marshaler);
marshaler.WriteUInt32(FunctionId);
}
示例2: Encode
/// <summary>
/// Encode this PDU to the PduMarshaler.
/// </summary>
/// <param name="marshaler">This is used to encode the fields of this PDU.</param>
public override void Encode(PduMarshaler marshaler)
{
marshaler.WriteUInt32(this.Header.cbSize);
marshaler.WriteUInt32((uint)this.Header.PacketType);
marshaler.WriteByte(this.PresentatioinId);
marshaler.WriteByte((byte)this.NotificationType);
marshaler.WriteUInt16(this.Reserved);
marshaler.WriteUInt32(this.cbData);
marshaler.WriteBytes(this.pData);
}
示例3: Encode
/// <summary>
/// Encode this PDU to the PduMarshaler.
/// </summary>
/// <param name="marshaler">This is used to encode the fields of this PDU.</param>
public override void Encode(PduMarshaler marshaler)
{
base.Encode(marshaler);
marshaler.WriteUInt32(configurationHandle);
marshaler.WriteUInt32(numInterfaces);
if (null != Interface)
{
for (int i = 0; i < Interface.Length; i++)
{
interfaces[i].Encode(marshaler);
}
}
}
示例4: Encode
public override void Encode(PduMarshaler marshaler)
{
marshaler.WriteUInt32(fecHeader.snSourceAck);
marshaler.WriteUInt16(fecHeader.uReceiveWindowSize);
marshaler.WriteUInt16((ushort)fecHeader.uFlags);
if (SynData.HasValue)
{
marshaler.WriteUInt32(SynData.Value.snInitialSequenceNumber);
marshaler.WriteUInt16(SynData.Value.uUpStreamMtu);
marshaler.WriteUInt16(SynData.Value.uDownStreamMtu);
// This datagram MUST be zero-padded to increase the size of this datagram to 1232 bytes.
int length = 16;
if (CorrelationId.HasValue)
{
marshaler.WriteBytes(CorrelationId.Value.uCorrelationId);
length += 16;
marshaler.WriteBytes(CorrelationId.Value.uReserved);
length += 16;
}
byte[] padBytes = new byte[1232 - length];
marshaler.WriteBytes(padBytes);
return;
}
if (ackVectorHeader.HasValue)
{
// ACK
marshaler.WriteUInt16(ackVectorHeader.Value.uAckVectorSize);
if (ackVectorHeader.Value.AckVectorElement != null)
{
List<byte> ackVecElementList = new List<byte>();
foreach (AckVector vec in ackVectorHeader.Value.AckVectorElement)
{
byte vecByte = 0;
vecByte |= vec.Length;
byte state = (byte)vec.State;
vecByte |= (byte)(state << 6);
ackVecElementList.Add(vecByte);
}
ackVecElementList.Reverse();
marshaler.WriteBytes(ackVecElementList.ToArray());
}
// Padding (variable): A variable-sized array, of length zero or more,
// such that this structure ends on a DWORD ([MS-DTYP] section 2.2.9) boundary.
int padLen = 4 - (2 + ackVectorHeader.Value.uAckVectorSize) % 4;
if (padLen > 0 && padLen != 4)
{
byte[] padding = new byte[padLen];
marshaler.WriteBytes(padding);
}
// Ack of Acks.
if (ackOfAckVector.HasValue)
{
marshaler.WriteUInt32(ackOfAckVector.Value.snAckOfAcksSeqNum);
}
}
if (sourceHeader.HasValue || fecPayloadHeader.HasValue)
{
if (sourceHeader.HasValue)
{
// Source Data.
marshaler.WriteUInt32(sourceHeader.Value.snCoded);
marshaler.WriteUInt32(sourceHeader.Value.snSourceStart);
}
else
{
// FEC Data.
marshaler.WriteUInt32(fecPayloadHeader.Value.snCoded);
marshaler.WriteUInt32(fecPayloadHeader.Value.snSourceStart);
marshaler.WriteByte(fecPayloadHeader.Value.uRange);
marshaler.WriteByte(fecPayloadHeader.Value.uFecIndex);
marshaler.WriteUInt16(fecPayloadHeader.Value.uPadding);
}
if (payload != null)
{
marshaler.WriteBytes(payload);
}
}
}
示例5: Encode
/// <summary>
/// Encode this PDU to the PduMarshaler.
/// </summary>
/// <param name="marshaler">This is used to encode the fields of this PDU.</param>
public override void Encode(PduMarshaler marshaler)
{
marshaler.WriteUInt16((ushort)blockType);
marshaler.WriteUInt32(blockLen);
}