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 import io.netty.util.internal.UnstableApi; 19 20 /** 21 * A DNS resource record. 22 */ 23 @UnstableApi 24 public interface DnsRecord { 25 26 /** 27 * DNS resource record class: {@code IN} 28 */ 29 int CLASS_IN = 0x0001; 30 31 /** 32 * DNS resource record class: {@code CSNET} 33 */ 34 int CLASS_CSNET = 0x0002; 35 36 /** 37 * DNS resource record class: {@code CHAOS} 38 */ 39 int CLASS_CHAOS = 0x0003; 40 41 /** 42 * DNS resource record class: {@code HESIOD} 43 */ 44 int CLASS_HESIOD = 0x0004; 45 46 /** 47 * DNS resource record class: {@code NONE} 48 */ 49 int CLASS_NONE = 0x00fe; 50 51 /** 52 * DNS resource record class: {@code ANY} 53 */ 54 int CLASS_ANY = 0x00ff; 55 56 /** 57 * Returns the name of this resource record. 58 */ 59 String name(); 60 61 /** 62 * Returns the type of this resource record. 63 */ 64 DnsRecordType type(); 65 66 /** 67 * Returns the class of this resource record. 68 * 69 * @return the class value, usually one of the following: 70 * <ul> 71 * <li>{@link #CLASS_IN}</li> 72 * <li>{@link #CLASS_CSNET}</li> 73 * <li>{@link #CLASS_CHAOS}</li> 74 * <li>{@link #CLASS_HESIOD}</li> 75 * <li>{@link #CLASS_NONE}</li> 76 * <li>{@link #CLASS_ANY}</li> 77 * </ul> 78 */ 79 int dnsClass(); 80 81 /** 82 * Returns the time to live after reading for this resource record. 83 */ 84 long timeToLive(); 85 }