Exemplo n.º 1
0
        public void ReadFromBuffer(STUNAttr attr)
        {
            var buffer = attr.data;

            buffer.GetByte();
            family = (AddressFamily)buffer.GetByte();

            // XOR
            port = buffer.GetUShort();
            if (AddressFamily.IPv4 == family)
            {
                ipv4.Read(ref buffer);
            }
            else
            {
                ipv6.Read(ref buffer);
            }

            port ^= attr.stunMessage.GetUShort(4);
            if (AddressFamily.IPv4 == family)
            {
                ipv4.bits ^= attr.stunMessage.GetUInt(4);
            }
            else
            {
                ipv6.msb ^= attr.stunMessage.GetULong(4);
                ipv6.lsb ^= attr.stunMessage.GetULong(12);
            }
        }
Exemplo n.º 2
0
        public void ReadFromBuffer(STUNAttr attr)
        {
            var buffer = attr.data;

            crc = buffer.GetUInt() ^ FINGERPRINT_XOR;

            copiedBuffer         = attr.stunMessage;
            copiedBuffer.Length -= 8;
        }
Exemplo n.º 3
0
        public void ReadFromBuffer(STUNAttr attr)
        {
            var buffer = attr.data;

            buffer.GetByte();
            family = (AddressFamily)buffer.GetByte();
            port   = buffer.GetUShort();

            ip.Read(ref buffer, family == AddressFamily.IPv4);
        }
Exemplo n.º 4
0
        public void ReadFromBuffer(STUNAttr attr)
        {
            var buffer = attr.data;

            buffer.GetUShort();
            byte errorClass  = buffer.GetByte();
            byte errorNumber = buffer.GetByte();

            code   = (ushort)(errorClass * 100 + errorNumber % 100);
            reason = Encoding.UTF8.GetString(buffer.data, buffer.absPosition, buffer.Length - 4);
        }
Exemplo n.º 5
0
        public void ReadFromBuffer(STUNAttr attr)
        {
            var buffer = attr.data;

            buffer.GetByte();
            family = (AddressFamily)buffer.GetByte();
            port   = buffer.GetUShort();

            if (AddressFamily.IPv4 == family)
            {
                ipv4.Read(ref buffer);
            }
            else
            {
                ipv6.Read(ref buffer);
            }
        }
Exemplo n.º 6
0
        public void ReadFromBuffer(STUNAttr attr)
        {
            var buffer = attr.data;

            priority = buffer.GetUInt();
        }
Exemplo n.º 7
0
 public STUNAttr_Priority(STUNAttr attr) : this()
 {
     ReadFromBuffer(attr);
 }
Exemplo n.º 8
0
 public STUNAttr_Username(STUNAttr attr) : this()
 {
     ReadFromBuffer(attr);
 }
Exemplo n.º 9
0
 public STUNAttr_Fingerprint(STUNAttr attr) : this()
 {
     ReadFromBuffer(attr);
 }
Exemplo n.º 10
0
 public void ReadFromBuffer(STUNAttr attr)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 11
0
 public void ReadFromBuffer(STUNAttr attr)
 {
     // Not intended to be used this way
     this = attr;
 }
Exemplo n.º 12
0
 public STUNAttr_Software(STUNAttr attr) : this()
 {
     ReadFromBuffer(attr);
 }
Exemplo n.º 13
0
 public void ReadFromBuffer(STUNAttr attr)
 {
     // TO DO
     Logger.Warn("ReadFromBuffer is not implemented in STUNAttr_MessageIntegrity");
 }
Exemplo n.º 14
0
 public STUNAttr_ErrorCode(STUNAttr attr) : this()
 {
     ReadFromBuffer(attr);
 }
Exemplo n.º 15
0
 public STUNAttr_UseCandidate(STUNAttr attr) : this()
 {
     ReadFromBuffer(attr);
 }
Exemplo n.º 16
0
 public void ReadFromBuffer(STUNAttr attr)
 {
     software = Encoding.UTF8.GetString(attr.data.data, attr.data.absPosition, Math.Min(128, attr.data.Length));
 }
Exemplo n.º 17
0
        public void ReadFromBuffer(STUNAttr attr)
        {
            var buffer = attr.data;

            crc = buffer.GetUInt() ^ FINGERPRINT_XOR;
        }
Exemplo n.º 18
0
 public void ReadFromBuffer(STUNAttr attr)
 {
     tieBreaker = attr.data.GetULong();
 }
Exemplo n.º 19
0
 public STUNAttr_IceControlled(STUNAttr attr) : this()
 {
     ReadFromBuffer(attr);
 }
Exemplo n.º 20
0
 public STUNAttr_MappedAddress(STUNAttr attr) : this()
 {
     ReadFromBuffer(attr);
 }
Exemplo n.º 21
0
 public void ReadFromBuffer(STUNAttr attr)
 {
 }
Exemplo n.º 22
0
 public void ReadFromBuffer(STUNAttr attr)
 {
     usernameInString = Encoding.UTF8.GetString(attr.data.data, attr.data.absPosition, Math.Min(512, attr.data.Length));
 }
Exemplo n.º 23
0
 public void ReadFromBuffer(STUNAttr attr)
 {
     // Not intended to be used this way
     throw new System.NotImplementedException();
 }
Exemplo n.º 24
0
 public STUNAttr_MessageIntegrity(STUNAttr attr) : this()
 {
     ReadFromBuffer(attr);
 }