Package org.cipango.dns

Examples of org.cipango.dns.Name


  public void decode(Buffer buffer) throws IOException
  {
    int nbRecord = getMessage().getHeaderSection().getQuestionRecords();
    for (int i = 0; i < nbRecord; i++)
    {
      Name name = getMessage().getCompression().decodeName(buffer);
      Type type = Type.getType(BufferUtil.get16(buffer));
      DnsClass clazz = DnsClass.getClass(BufferUtil.get16(buffer));
     
      Record record = type.newRecord();
      record.setDnsClass(clazz);
View Full Code Here


  public void decode(Buffer buffer, int nbRecords) throws IOException
  {
    for (int i = 0; i < nbRecords; i++)
    {
      Name name = getMessage().getCompression().decodeName(buffer);
      Type type = Type.getType(BufferUtil.get16(buffer));
      DnsClass clazz = DnsClass.getClass(BufferUtil.get16(buffer));
     
      Record record = type.newRecord();
      record.setName(name);
View Full Code Here

  {
  }
 
  public AaaaRecord(String name)
  {
    setName(new Name(name));
  }
View Full Code Here

  {
  }
 
  public ARecord(String name)
  {
    setName(new Name(name));
  }
View Full Code Here

    setName(name);
  }

  public SrvRecord(String service, String protocol, String host)
  {
    setName(new Name("_" + service + "._" + protocol + "." + host));
  }
View Full Code Here

  {
  }
 
  public NaptrRecord(String name)
  {
    setName(new Name(name));
  }
View Full Code Here

 
  }
   
  public PtrRecord(InetAddress address)
  {
    Name name;
    byte[] addr = address.getAddress();
    if (address instanceof Inet4Address)
    {
      name = new Name("in-addr.arpa");
      for (int i = 0; i < addr.length; i++)
      {
        Name tmp = name;
        name = new Name(Integer.toString(addr[i] & 0xFF));
        name.setChild(tmp);
      }
    }
    else
    {
      name = new Name("ip6.arpa");
      for (int i = 0; i < addr.length; i++)
      {
        Name tmp = name;
        name = new Name(Integer.toHexString((addr[i] >> 4) & 0xF));
        name.setChild(tmp);
        tmp = name;
       
        name = new Name(Integer.toHexString(addr[i] & 0xF));
        name.setChild(tmp);
      }
    }
    setName(name);
  }
View Full Code Here

TOP

Related Classes of org.cipango.dns.Name

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.