-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathResponseRecord.java
46 lines (36 loc) · 1018 Bytes
/
ResponseRecord.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
public class ResponseRecord {
private String name; //name is two byte. if first 2 bits are 11, then rest is a pointer to the actual name, offset from request id.
private String type;
private int ttl;
private int dataLength;
private String data;
public Boolean isAnswer = false;
public ResponseRecord(String name, String type, int ttl, int dataLength, String data) {
this.name = name;
this.type = type;
this.ttl = ttl;
this.dataLength = dataLength;
this.data = data;
}
public String getName() {
return this.name;
}
public String getType() {
return this.type;
}
public int getTtl() {
return this.ttl;
}
public int getDataLength() {
return this.dataLength;
}
public String getData() {
return this.data;
}
public int getRecordLength() {
return this.dataLength + 12;
}
public boolean isAnswer() {
return this.isAnswer;
}
}