All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xbill.DNS.DHCIDRecord Maven / Gradle / Ivy

There is a newer version: 1.1.8-r1685
Show newest version
// 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