1 /* 2 * Copyright 2015 The Netty Project 3 * 4 * The Netty Project licenses this file to you under the Apache License, 5 * version 2.0 (the "License"); you may not use this file except in compliance 6 * with the License. You may obtain a copy of the License at: 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 * License for the specific language governing permissions and limitations 14 * under the License. 15 */ 16 package io.netty.handler.codec.dns; 17 18 /** 19 * A DNS resource record. 20 */ 21 public interface DnsRecord { 22 23 /** 24 * DNS resource record class: {@code IN} 25 */ 26 int CLASS_IN = 0x0001; 27 28 /** 29 * DNS resource record class: {@code CSNET} 30 */ 31 int CLASS_CSNET = 0x0002; 32 33 /** 34 * DNS resource record class: {@code CHAOS} 35 */ 36 int CLASS_CHAOS = 0x0003; 37 38 /** 39 * DNS resource record class: {@code HESIOD} 40 */ 41 int CLASS_HESIOD = 0x0004; 42 43 /** 44 * DNS resource record class: {@code NONE} 45 */ 46 int CLASS_NONE = 0x00fe; 47 48 /** 49 * DNS resource record class: {@code ANY} 50 */ 51 int CLASS_ANY = 0x00ff; 52 53 /** 54 * Returns the name of this resource record. 55 */ 56 String name(); 57 58 /** 59 * Returns the type of this resource record. 60 */ 61 DnsRecordType type(); 62 63 /** 64 * Returns the class of this resource record. 65 * 66 * @return the class value, usually one of the following: 67 * <ul> 68 * <li>{@link #CLASS_IN}</li> 69 * <li>{@link #CLASS_CSNET}</li> 70 * <li>{@link #CLASS_CHAOS}</li> 71 * <li>{@link #CLASS_HESIOD}</li> 72 * <li>{@link #CLASS_NONE}</li> 73 * <li>{@link #CLASS_ANY}</li> 74 * </ul> 75 */ 76 int dnsClass(); 77 78 /** 79 * Returns the time to live after reading for this resource record. 80 */ 81 long timeToLive(); 82 }