org.xbill.DNS.DHCIDRecord Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ddns-dnsjava Show documentation
Show all versions of ddns-dnsjava Show documentation
DiscoveryDNS fork of DNSJava project
// Copyright (c) 2008 Brian Wellington ([email protected])
package org.xbill.DNS;
import java.io.*;
import org.xbill.DNS.utils.base64;
/**
* DHCID - Dynamic Host Configuration Protocol (DHCP) ID (RFC 4701)
*
* @author Brian Wellington
*/
public class DHCIDRecord extends Record {
private static final long serialVersionUID = -8214820200808997707L;
private byte [] data;
DHCIDRecord() {}
Record
getObject() {
return new DHCIDRecord();
}
/**
* Creates an DHCID Record from the given data
* @param name the name
* @param dclass the class
* @param ttl the ttl
* @param data The binary data, which is opaque to DNS.
*/
public
DHCIDRecord(Name name, int dclass, long ttl, byte [] data) {
super(name, Type.DHCID, dclass, ttl);
this.data = data;
}
void
rrFromWire(DNSInput in) throws IOException {
data = in.readByteArray();
}
void
rdataFromString(Tokenizer st, Name origin) throws IOException {
data = st.getBase64();
}
void
rrToWire(DNSOutput out, Compression c, boolean canonical) {
out.writeByteArray(data);
}
String
rrToString() {
return base64.toString(data);
}
/**
* @return the binary data.
*/
public byte []
getData() {
return data;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy