MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / Opcode

Class Opcode

src/main/java/core/org/xbill/DNS/Opcode.java:11–60  ·  view source on GitHub ↗

Constants and functions relating to DNS opcodes @author Brian Wellington

Source from the content-addressed store, hash-verified

9 */
10
11public final class Opcode {
12
13/** A standard query */
14public static final int QUERY = 0;
15
16/** An inverse query (deprecated) */
17public static final int IQUERY = 1;
18
19/** A server status request (not used) */
20public static final int STATUS = 2;
21
22/**
23 * A message from a primary to a secondary server to initiate a zone transfer
24 */
25public static final int NOTIFY = 4;
26
27/** A dynamic update message */
28public static final int UPDATE = 5;
29
30private static Mnemonic opcodes = new Mnemonic("DNS Opcode",
31 Mnemonic.CASE_UPPER);
32
33static {
34 opcodes.setMaximum(0xF);
35 opcodes.setPrefix("RESERVED");
36 opcodes.setNumericAllowed(true);
37
38 opcodes.add(QUERY, "QUERY");
39 opcodes.add(IQUERY, "IQUERY");
40 opcodes.add(STATUS, "STATUS");
41 opcodes.add(NOTIFY, "NOTIFY");
42 opcodes.add(UPDATE, "UPDATE");
43}
44
45private
46Opcode() {}
47
48/** Converts a numeric Opcode into a String */
49public static String
50string(int i) {
51 return opcodes.getText(i);
52}
53
54/** Converts a String representation of an Opcode into its numeric value */
55public static int
56value(String s) {
57 return opcodes.getValue(s);
58}
59
60}

Callers

nothing calls this directly

Calls 4

setMaximumMethod · 0.80
setPrefixMethod · 0.80
setNumericAllowedMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected