/// <summary> /// Construit un éléments de requête/réponse DNS avec la définition de tous les éléments /// </summary> /// <param name="name">Nom de la requête</param> /// <param name="dnsType">Type de requête/réponse</param> /// <param name="dnsClass">Classe de requête/réponse</param> public DNSQuestion(string name, string dnsType, DNSClass dnsClass) { Name = name; switch (dnsType) { case "ALL": Type = 0xFF; break; case "AXFR": Type = 0xFC; break; case "MAILB": Type = 0xFD; break; case "MAILA": Type = 0xFE; break; default: Type = (ushort)ResourceDetailsLoader.Invoke(DNSServiceName[dnsType], "Service"); break; } Class = dnsClass; }
public override string ToString() { StringBuilder ret = new StringBuilder(); switch (Type) { case 0xFF: ret.Append("ALL"); break; case 0xFC: ret.Append("AXFR"); break; case 0xFD: ret.Append("MAILB"); break; case 0xFE: ret.Append("MAILA"); break; default: ret.Append((string)ResourceDetailsLoader.Invoke(DNSServiceNumber[dnsType], "Name")); break; } ret.Append(","); ret.Append(Class.ToString()); ret.Append("\t"); ret.Append(Name); return(ret.ToString()); }