Add PTR record parsing

This commit is contained in:
Rene Treffer 2014-07-22 23:22:35 +02:00
parent bc621bfcfb
commit 6eda21b416
3 changed files with 24 additions and 1 deletions

View file

@ -9,6 +9,7 @@ import de.measite.minidns.record.AAAA;
import de.measite.minidns.record.CNAME; import de.measite.minidns.record.CNAME;
import de.measite.minidns.record.Data; import de.measite.minidns.record.Data;
import de.measite.minidns.record.NS; import de.measite.minidns.record.NS;
import de.measite.minidns.record.PTR;
import de.measite.minidns.record.SRV; import de.measite.minidns.record.SRV;
import de.measite.minidns.util.NameUtil; import de.measite.minidns.util.NameUtil;
@ -250,6 +251,9 @@ public class Record {
case CNAME: case CNAME:
this.payloadData = new CNAME(); this.payloadData = new CNAME();
break; break;
case PTR:
this.payloadData = new PTR();
break;
default: default:
System.out.println("Unparsed type " + type); System.out.println("Unparsed type " + type);
this.payloadData = null; this.payloadData = null;

View file

@ -0,0 +1,19 @@
package de.measite.minidns.record;
import java.io.DataInputStream;
import java.io.IOException;
import de.measite.minidns.Record.TYPE;
import de.measite.minidns.util.NameUtil;
/**
* A PTR record is handled like a CNAME
*/
public class PTR extends CNAME {
@Override
public TYPE getType() {
return TYPE.PTR;
}
}