Examples of toWire()


Examples of org.xbill.DNS.Message.toWire()

    }
    if (rcode == Rcode.SERVFAIL) {
      response.addRecord(question, Section.QUESTION);
    }
    header.setRcode(rcode);
    return response.toWire();
  }

  byte[] formerrMessage(byte[] in) {
    Header header;
    try {
View Full Code Here

Examples of org.xbill.DNS.Message.toWire()

                if (tsig != null) {
                    tsig.applyStream(response, qtsig, first);
                    qtsig = response.getTSIG();
                }
                first = false;
                byte[] out = response.toWire();
                dataOut.writeShort(out.length);
                dataOut.write(out);
            }
        } catch (IOException ex) {
            System.out.println("AXFR failed");
View Full Code Here

Examples of org.xbill.DNS.Message.toWire()

                    optflags);
            response.addRecord(opt, Section.ADDITIONAL);
        }

        response.setTSIG(tsig, Rcode.NOERROR, queryTSIG);
        return response.toWire(maxLength);
    }

    byte[] buildErrorMessage(Header header, int rcode, Record question) {
        Message response = new Message();
        response.setHeader(header);
View Full Code Here

Examples of org.xbill.DNS.Message.toWire()

        for (int i = 0; i < 4; i++)
            response.removeAllRecords(i);
        if (rcode == Rcode.SERVFAIL)
            response.addRecord(question, Section.QUESTION);
        header.setRcode(rcode);
        return response.toWire();
    }

    public byte[] formerrMessage(byte[] in) {
        Header header;
        try {
View Full Code Here

Examples of org.xbill.DNS.Message.toWire()

            OPTRecord opt = new OPTRecord((short) 4096, rcode, (byte) 0,
                    optflags);
            response.addRecord(opt, Section.ADDITIONAL);
        }

        return response.toWire(maxLength);
    }

    byte[] buildErrorMessage(Header header, int rcode, Record question) {
        Message response = new Message();
        response.setHeader(header);
View Full Code Here

Examples of org.xbill.DNS.Message.toWire()

        for (int i = 0; i < 4; i++)
            response.removeAllRecords(i);
        if (rcode == Rcode.SERVFAIL)
            response.addRecord(question, Section.QUESTION);
        header.setRcode(rcode);
        return response.toWire();
    }

    public byte[] formerrMessage(byte[] in) {
        Header header;
        try {
View Full Code Here

Examples of org.xbill.DNS.Name.toWire()

    {
  public void test_rel() throws TextParseException
  {
      Name n = new Name("A.Relative.Name");
      try {
    n.toWire(new DNSOutput(), null);
    fail("IllegalArgumentException not thrown");
      }
      catch(IllegalArgumentException e){}
  }
View Full Code Here

Examples of org.xbill.DNS.Name.toWire()

  {
      byte[] raw = new byte[] { 1, 'A', 5, 'B', 'a', 's', 'i', 'c', 4, 'N', 'a', 'm', 'e', 0 };
      Name n = new Name("A.Basic.Name.");
     
      DNSOutput o = new DNSOutput();
      n.toWire(o, null);

      assertTrue(Arrays.equals(raw, o.toByteArray()));
  }

  public void test_empty_Compression() throws TextParseException
View Full Code Here

Examples of org.xbill.DNS.Name.toWire()

      byte[] raw = new byte[] { 1, 'A', 5, 'B', 'a', 's', 'i', 'c', 4, 'N', 'a', 'm', 'e', 0 };
      Name n = new Name("A.Basic.Name.");
     
      Compression c = new Compression();
      DNSOutput o = new DNSOutput();
      n.toWire(o, c);

      assertTrue(Arrays.equals(raw, o.toByteArray()));
      assertEquals(0, c.get(n));
  }
View Full Code Here

Examples of org.xbill.DNS.Name.toWire()

      Compression c = new Compression();
      c.add(256, n);
      byte[] exp = new byte[] { (byte)0xC1, 0x0 };

      DNSOutput o = new DNSOutput();
      n.toWire(o, c);
      assertTrue(Arrays.equals(exp, o.toByteArray()));
      assertEquals(256, c.get(n));
  }

  public void test_with_partial_Compression() throws TextParseException
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.