Inheritance: ResponseData
Exemplo n.º 1
0
        internal static Srv Get(BinaryReader reader)
        {
            Srv srv = new Srv();

            //Useless Datalength
            reader.ReadBytes(2);
            srv.Priority = BinaryHelper.ReadUInt16(reader);
            srv.Weight   = BinaryHelper.ReadUInt16(reader);
            srv.Port     = BinaryHelper.ReadUInt16(reader);
            srv.Target   = DomainName.Get(reader);
            return(srv);
        }
Exemplo n.º 2
0
 internal static Srv Get(BinaryReader reader)
 {
     Srv srv = new Srv();
     ushort s;
     //Useless Datalength
     reader.ReadBytes(2);
     Message.FromBytes(reader.ReadBytes(2), out s);
     srv.Priority = s;
     Message.FromBytes(reader.ReadBytes(2), out s);
     srv.Weight = s;
     Message.FromBytes(reader.ReadBytes(2), out s);
     srv.Port = s;
     srv.Target = DomainName.Get(reader);
     return srv;
 }
Exemplo n.º 3
0
        internal static ResponseData Get(Type type, System.IO.BinaryReader reader)
        {
            switch (type)
            {
            case Type.A:
            case Type.AAAA:
                return(HostAddress.Get(reader));

            case Type.NS:
                break;

            case Type.MD:
                break;

            case Type.MF:
                break;

            case Type.CNAME:
                return(CName.Get(reader));

            case Type.SOA:
                break;

            case Type.MB:
                break;

            case Type.MG:
                break;

            case Type.MR:
                break;

            case Type.NULL:
                break;

            case Type.WKS:
                break;

            case Type.PTR:
                return(Ptr.Get(reader));

            case Type.HINFO:
                break;

            case Type.MINFO:
                break;

            case Type.MX:
                break;

            case Type.TXT:
                return(Txt.Get(reader));

            case Type.SRV:
                return(Srv.Get(reader));

            default:
                break;
            }
            //throw new NotImplementedException(string.Format("Cannot read {0} response", type));
            return(UnknownResponseData.Get(reader));
        }