Ejemplo n.º 1
0
        public override string ToString()
        {
            switch (QR)
            {
            case DNS.QR.Q:
                return(string.Format("Request: {0}",
                                     OPCODE.ToString()
                                     ));

            case DNS.QR.R:
                return(string.Format("{0}: {1} RD={2} RA={3} {4} {5}",
                                     (AA ? "Authoritative Response" : "Non-Authoritative Response"),
                                     OPCODE.ToString(),
                                     (RD ? "1" : "0"),
                                     (RA ? "1" : "0"),
                                     RCODE.ToString(),
                                     (TC ? "TRUNCATED " : "")
                                     ));
            }
            // throw new InvalidOperationException("Unexpected QR value.");
            // CA1065	Do not raise exceptions in unexpected locations
            return(null);
        }