Class Message

java.lang.Object
net.handle.dnslib.Message
All Implemented Interfaces:
Cloneable

public class Message extends Object implements Cloneable
  • Field Details

  • Constructor Details

    • Message

      public Message()
    • Message

      public Message(Question q, boolean recursionDesired, boolean useEDNS)
  • Method Details

    • copy

      public static Message copy(Message message)
    • getOpcode

      public byte getOpcode()
    • getQuestion

      public Question getQuestion()
    • getQuestionNameAsString

      public String getQuestionNameAsString()
    • getQuestionAfterCNAME

      public Question getQuestionAfterCNAME()
    • getRecursionDesired

      public boolean getRecursionDesired()
    • getTTL

      public int getTTL()
      Returns the minimum ttl of all records in the Message. The Message must be frozen once this is called, except that the id and recursionDesired fields can be changed to facilitate caching.
    • parseWire

      public int parseWire(byte[] wire) throws ParseException
      Throws:
      ParseException
    • getUDPPayloadSize

      public int getUDPPayloadSize()
    • getEDNSVersion

      public int getEDNSVersion()
    • getExtendedResponseCode

      public int getExtendedResponseCode()
    • setResponseCode

      public void setResponseCode(byte responseCode)
      can only set unextended code
    • initialResponse

      public static Message initialResponse(Message query, boolean recursionAvailable, boolean largeEDNS)
      Initial filter for both resolvers and nameservers. If this returns null, it means to ignore the query. If it returns a message with an rcode other than OK, it means return that message. Otherwise the returned message can be modified in its AA bit, its RCODE, and have resource records added.
    • appendToWire

      public int appendToWire(OutputStream wire) throws IOException
      Throws:
      IOException
    • getDatagram

      public byte[] getDatagram(int udpPayloadSize) throws IOException
      Returns a byte array representing the on-wire message. The Message must be frozen once this is called, except that the id and recursionDesired fields can be changed to facilitate caching.
      Throws:
      IOException
    • debugPrint

      public static void debugPrint(byte b)
    • debugPrint

      public static void debugPrint(byte[] bytes)
    • debugPrint

      public void debugPrint()