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

Class Code

src/main/java/core/org/xbill/DNS/EDNSOption.java:16–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14public abstract class EDNSOption {
15
16public static class Code {
17 private Code() {}
18
19 /** Name Server Identifier, RFC 5001 */
20 public final static int NSID = 3;
21
22 /** Client Subnet, defined in draft-vandergaast-edns-client-subnet-02 */
23 public final static int CLIENT_SUBNET = 8;
24
25 private static Mnemonic codes = new Mnemonic("EDNS Option Codes",
26 Mnemonic.CASE_UPPER);
27
28 static {
29 codes.setMaximum(0xFFFF);
30 codes.setPrefix("CODE");
31 codes.setNumericAllowed(true);
32
33 codes.add(NSID, "NSID");
34 codes.add(CLIENT_SUBNET, "CLIENT_SUBNET");
35 }
36
37 /**
38 * Converts an EDNS Option Code into its textual representation
39 */
40 public static String
41 string(int code) {
42 return codes.getText(code);
43 }
44
45 /**
46 * Converts a textual representation of an EDNS Option Code into its
47 * numeric value.
48 * @param s The textual representation of the option code
49 * @return The option code, or -1 on error.
50 */
51 public static int
52 value(String s) {
53 return codes.getValue(s);
54 }
55}
56
57private final int code;
58

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