public Response(IPEndPoint iPEndPoint, byte[] data) { Error = ""; Server = iPEndPoint; TimeStamp = DateTime.Now; MessageSize = data.Length; RecordReader rr = new RecordReader(data); Questions = new List<Question>(); Answers = new List<AnswerRR>(); Authorities = new List<AuthorityRR>(); Additionals = new List<AdditionalRR>(); header = new Header(rr); for (int intI = 0; intI < header.QDCOUNT; intI++) { Questions.Add(new Question(rr)); } for (int intI = 0; intI < header.ANCOUNT; intI++) { Answers.Add(new AnswerRR(rr)); } for (int intI = 0; intI < header.NSCOUNT; intI++) { Authorities.Add(new AuthorityRR(rr)); } for (int intI = 0; intI < header.ARCOUNT; intI++) { Additionals.Add(new AdditionalRR(rr)); } }
public Request() { header = new Header(); header.OPCODE = OPCode.Query; header.QDCOUNT = 0; questions = new List<Question>(); }
public DNSRequest() { header = new Header(); header.OPCODE = OPCode.QUERY; header.QDCOUNT = 0; Questions = new List<Question>(); }
public DNSResponse() { Questions = new List<Question>(); Answers = new List<AnswerRR>(); Authorities = new List<AuthorityRR>(); Additionals = new List<AdditionalRR>(); Server = new IPEndPoint(0,0); MessageSize = 0; TimeStamp = DateTime.Now; header = new Header(); }