Esempio n. 1
0
        /// <inheritdoc />
        public override void Write(NatWriter writer)
        {
            base.Write(writer);

            writer.WriteByte(0); // reserved
            writer.WriteByte(ResultCode);
            writer.WriteTimeSpan(Lifetime);
            writer.WriteTimeSpan(EpochTime);
            writer.WriteBytes(reserved2);
        }
Esempio n. 2
0
        /// <inheritdoc />
        public override void Write(NatWriter writer)
        {
            writer.WriteByte(Version);
            byte opcode = (byte)Opcode;

            if (IsResponse)
            {
                opcode |= 0x80;
            }
            writer.WriteByte(opcode);
        }
Esempio n. 3
0
        /// <inheritdoc />
        public override void Write(NatWriter writer)
        {
            base.Write(writer);

            writer.WriteBytes(Nonce);
            writer.WriteByte((byte)Protocol);
            writer.WriteByte(0); // reserved 24 bits (3 bytes)
            writer.WriteByte(0);
            writer.WriteByte(0);
            writer.WriteUInt16(InternalPort);
            writer.WriteUInt16(AssignedExternalPort);
            writer.WriteIPv6Address(AssignedExternalAdddress);
        }