| 1 |
/* |
| 2 |
* Copyright 2015-2020 the original author or authors |
| 3 |
* |
| 4 |
* This software is licensed under the Apache License, Version 2.0, |
| 5 |
* the GNU Lesser General Public License version 2 or later ("LGPL") |
| 6 |
* and the WTFPL. |
| 7 |
* You may choose either license to govern your use of this software only |
| 8 |
* upon the condition that you accept all of the terms of either |
| 9 |
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL. |
| 10 |
*/ |
| 11 |
package org.minidns.edns; |
| 12 |
|
| 13 |
import org.minidns.edns.Edns.OptionCode; |
| 14 |
import org.minidns.util.Hex; |
| 15 |
|
| 16 |
public class UnknownEdnsOption extends EdnsOption { |
| 17 |
|
| 18 |
protected UnknownEdnsOption(int optionCode, byte[] optionData) { |
| 19 |
super(optionCode, optionData); |
| 20 |
} |
| 21 |
|
| 22 |
@Override |
| 23 |
public OptionCode getOptionCode() { |
| 24 |
return OptionCode.UNKNOWN; |
| 25 |
} |
| 26 |
|
| 27 |
@Override |
| 28 |
protected CharSequence asTerminalOutputInternal() { |
| 29 |
return Hex.from(optionData); |
| 30 |
} |
| 31 |
|
| 32 |
@Override |
| 33 |
protected CharSequence toStringInternal() { |
| 34 |
return asTerminalOutputInternal(); |
| 35 |
} |
| 36 |
|
| 37 |
} |