Beispiel #1
0
        private void WriteDNSString(byte[] buffer, ref int offset, string value)
        {
            //if (buffer[offset] == 11)
            //{
            //    value = "PtrNamesNotImplemented";
            //}
            string[] spl = value.Split('.');

            foreach (string s in spl)
            {
                if (s.Length == 0)
                {
                    continue;
                }
                NetLib.WriteByte08(buffer, ref offset, (byte)s.Length);
                NetLib.WriteCString(buffer, ref offset, s);
                offset -= 1;
            }
            offset += 1;
        }