gpt4 book ai didi

org.xbill.DNS.ZoneTransferIn.newAXFR()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 01:10:49 27 4
gpt4 key购买 nike

本文整理了Java中org.xbill.DNS.ZoneTransferIn.newAXFR()方法的一些代码示例,展示了ZoneTransferIn.newAXFR()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneTransferIn.newAXFR()方法的具体详情如下:
包路径:org.xbill.DNS.ZoneTransferIn
类名称:ZoneTransferIn
方法名:newAXFR

ZoneTransferIn.newAXFR介绍

暂无

代码示例

代码示例来源:origin: dnsjava/dnsjava

/**
 * Instantiates a ZoneTransferIn object to do an AXFR (full zone transfer).
 * @param zone The zone to transfer.
 * @param host The host from which to transfer the zone.
 * @param key The TSIG key used to authenticate the transfer, or null.
 * @return The ZoneTransferIn object.
 * @throws UnknownHostException The host does not exist.
 */
public static ZoneTransferIn
newAXFR(Name zone, String host, TSIG key)
throws UnknownHostException
{
  return newAXFR(zone, host, 0, key);
}

代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi

/**
 * Instantiates a ZoneTransferIn object to do an AXFR (full zone transfer).
 * @param zone The zone to transfer.
 * @param host The host from which to transfer the zone.
 * @param key The TSIG key used to authenticate the transfer, or null.
 * @return The ZoneTransferIn object.
 * @throws UnknownHostException The host does not exist.
 */
public static ZoneTransferIn
newAXFR(Name zone, String host, TSIG key)
throws UnknownHostException
{
  return newAXFR(zone, host, 0, key);
}

代码示例来源:origin: org.littleshoot/dnsjava

/**
 * Instantiates a ZoneTransferIn object to do an AXFR (full zone transfer).
 * @param zone The zone to transfer.
 * @param host The host from which to transfer the zone.
 * @param key The TSIG key used to authenticate the transfer, or null.
 * @return The ZoneTransferIn object.
 * @throws UnknownHostException The host does not exist.
 */
public static ZoneTransferIn
newAXFR(Name zone, String host, TSIG key)
throws UnknownHostException
{
  return newAXFR(zone, host, 0, key);
}

代码示例来源:origin: tiandawu/IotXmpp

/**
 * Instantiates a ZoneTransferIn object to do an AXFR (full zone transfer).
 * @param zone The zone to transfer.
 * @param host The host from which to transfer the zone.
 * @param key The TSIG key used to authenticate the transfer, or null.
 * @return The ZoneTransferIn object.
 * @throws UnknownHostException The host does not exist.
 */
public static ZoneTransferIn
newAXFR(Name zone, String host, TSIG key)
throws UnknownHostException
{
  return newAXFR(zone, host, 0, key);
}

代码示例来源:origin: dnsjava/dnsjava

/**
 * Instantiates a ZoneTransferIn object to do an AXFR (full zone transfer).
 * @param zone The zone to transfer.
 * @param host The host from which to transfer the zone.
 * @param port The port to connect to on the server, or 0 for the default.
 * @param key The TSIG key used to authenticate the transfer, or null.
 * @return The ZoneTransferIn object.
 * @throws UnknownHostException The host does not exist.
 */
public static ZoneTransferIn
newAXFR(Name zone, String host, int port, TSIG key)
throws UnknownHostException
{
  if (port == 0)
    port = SimpleResolver.DEFAULT_PORT;
  return newAXFR(zone, new InetSocketAddress(host, port), key);
}

代码示例来源:origin: tiandawu/IotXmpp

/**
 * Instantiates a ZoneTransferIn object to do an AXFR (full zone transfer).
 * @param zone The zone to transfer.
 * @param host The host from which to transfer the zone.
 * @param port The port to connect to on the server, or 0 for the default.
 * @param key The TSIG key used to authenticate the transfer, or null.
 * @return The ZoneTransferIn object.
 * @throws UnknownHostException The host does not exist.
 */
public static ZoneTransferIn
newAXFR(Name zone, String host, int port, TSIG key)
throws UnknownHostException
{
  if (port == 0)
    port = SimpleResolver.DEFAULT_PORT;
  return newAXFR(zone, new InetSocketAddress(host, port), key);
}

代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi

/**
 * Instantiates a ZoneTransferIn object to do an AXFR (full zone transfer).
 * @param zone The zone to transfer.
 * @param host The host from which to transfer the zone.
 * @param port The port to connect to on the server, or 0 for the default.
 * @param key The TSIG key used to authenticate the transfer, or null.
 * @return The ZoneTransferIn object.
 * @throws UnknownHostException The host does not exist.
 */
public static ZoneTransferIn
newAXFR(Name zone, String host, int port, TSIG key)
throws UnknownHostException
{
  if (port == 0)
    port = SimpleResolver.DEFAULT_PORT;
  return newAXFR(zone, new InetSocketAddress(host, port), key);
}

代码示例来源:origin: org.littleshoot/dnsjava

/**
 * Instantiates a ZoneTransferIn object to do an AXFR (full zone transfer).
 * @param zone The zone to transfer.
 * @param host The host from which to transfer the zone.
 * @param port The port to connect to on the server, or 0 for the default.
 * @param key The TSIG key used to authenticate the transfer, or null.
 * @return The ZoneTransferIn object.
 * @throws UnknownHostException The host does not exist.
 */
public static ZoneTransferIn
newAXFR(Name zone, String host, int port, TSIG key)
throws UnknownHostException
{
  if (port == 0)
    port = SimpleResolver.DEFAULT_PORT;
  return newAXFR(zone, new InetSocketAddress(host, port), key);
}

代码示例来源:origin: LendingClub/mercator

public Optional<List> getRecordsbyZone(String zone) {
  
  Preconditions.checkArgument(!Strings.isNullOrEmpty(zone), "Zone name can not be empty");
  ZoneTransferIn xfrin;
  try {
    xfrin = ZoneTransferIn.newAXFR(new Name(zone), dnsServer, getTSIGKey());
  
    logger.info("Trying a zone transfer from {}  for {} zone with {} key", dnsServer, zone, keyName);
    return Optional.of(xfrin.run());
  } catch (IOException | ZoneTransferException e) {
    logger.error("Failed to extract the records for {} zone", zone);
  }
  
  return Optional.empty();
}

代码示例来源:origin: dnsjava/dnsjava

/**
 * Creates a Zone by performing a zone transfer to the specified host.
 * @see ZoneTransferIn
 */
public
Zone(Name zone, int dclass, String remote)
throws IOException, ZoneTransferException
{
  ZoneTransferIn xfrin = ZoneTransferIn.newAXFR(zone, remote, null);
  xfrin.setDClass(dclass);
  fromXFR(xfrin);
}

代码示例来源:origin: org.littleshoot/dnsjava

/**
 * Creates a Zone by performing a zone transfer to the specified host.
 * @see ZoneTransferIn
 */
public
Zone(Name zone, int dclass, String remote)
throws IOException, ZoneTransferException
{
  ZoneTransferIn xfrin = ZoneTransferIn.newAXFR(zone, remote, null);
  xfrin.setDClass(dclass);
  fromXFR(xfrin);
}

代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi

/**
 * Creates a Zone by performing a zone transfer to the specified host.
 * @see ZoneTransferIn
 */
public
Zone(Name zone, int dclass, String remote)
throws IOException, ZoneTransferException
{
  ZoneTransferIn xfrin = ZoneTransferIn.newAXFR(zone, remote, null);
  xfrin.setDClass(dclass);
  fromXFR(xfrin);
}

代码示例来源:origin: tiandawu/IotXmpp

/**
 * Creates a Zone by performing a zone transfer to the specified host.
 * @see ZoneTransferIn
 */
public
Zone(Name zone, int dclass, String remote)
throws IOException, ZoneTransferException
{
  ZoneTransferIn xfrin = ZoneTransferIn.newAXFR(zone, remote, null);
  xfrin.setDClass(dclass);
  fromXFR(xfrin);
}

代码示例来源:origin: sensepost/yeti

public static List<ForwardLookupResult> attemptZoneTransfer(String domain, List<ForwardLookupResult> nameServers) throws TextParseException {
  List<ForwardLookupResult> result = new ArrayList<>();
  ZoneTransferIn xfr;
  Iterator i = nameServers.iterator();
  for (ForwardLookupResult nameServer : nameServers) {
    try {
      xfr = ZoneTransferIn.newAXFR(new Name(domain), nameServer.getIpAddress(), null);
      List records = xfr.run();
      for (Iterator it = records.iterator(); it.hasNext();) {
        Record r = (Record) it.next();
        if (r.getType() == 1) {
          ForwardLookupResult rec = new ForwardLookupResult(domain);
          String hostName = ((ARecord) r).getName().toString().toLowerCase();
          if (hostName.endsWith(".")) {
            hostName = hostName.substring(0, hostName.length() - 1);
          }
          rec.setHostName(hostName);
          rec.setIpAddress(((ARecord) r).getAddress().getHostAddress());
          rec.setLookupType("A");
          result.add(rec);
        }
      }
    } catch (IOException ioex) {
      Logger.getLogger("ForwardLookupHelper.attemptZoneTransfer").log(Level.WARNING, null, ioex);
    } catch (ZoneTransferException zex) {
      Log.debug("ForwardLookupHelper.attemptZoneTransfer: Failed zonetransfer");
    }
  }
  return result;
}

代码示例来源:origin: OpenNMS/opennms

xfer = ZoneTransferIn.newAXFR(new Name(request.getZone()), request.getHost(), null);
records = getRecords(xfer);

代码示例来源:origin: org.jboss.resteasy/resteasy-eagledns-fork

ZoneTransferIn xfrin = ZoneTransferIn.newAXFR(this.secondaryZone.getZoneName(), this.secondaryZone.getRemoteServerAddress(), null);
xfrin.setDClass(DClass.value(this.secondaryZone.getDclass()));
xfrin.setTimeout(axfrTimeout);

代码示例来源:origin: dnsjava/dnsjava

private Message
sendAXFR(Message query) throws IOException {
  Name qname = query.getQuestion().getName();
  ZoneTransferIn xfrin = ZoneTransferIn.newAXFR(qname, address, tsig);
  xfrin.setTimeout((int)(getTimeout() / 1000));
  xfrin.setLocalAddress(localAddress);
  try {
    xfrin.run();
  }
  catch (ZoneTransferException e) {
    throw new WireParseException(e.getMessage());
  }
  List records = xfrin.getAXFR();
  Message response = new Message(query.getHeader().getID());
  response.getHeader().setFlag(Flags.AA);
  response.getHeader().setFlag(Flags.QR);
  response.addRecord(query.getQuestion(), Section.QUESTION);
  Iterator it = records.iterator();
  while (it.hasNext())
    response.addRecord((Record)it.next(), Section.ANSWER);
  return response;
}

代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi

private Message
sendAXFR(Message query) throws IOException {
  Name qname = query.getQuestion().getName();
  ZoneTransferIn xfrin = ZoneTransferIn.newAXFR(qname, address, tsig);
  xfrin.setTimeout((int)(getTimeout() / 1000));
  xfrin.setLocalAddress(localAddress);
  try {
    xfrin.run();
  }
  catch (ZoneTransferException e) {
    throw new WireParseException(e.getMessage());
  }
  List records = xfrin.getAXFR();
  Message response = new Message(query.getHeader().getID());
  response.getHeader().setFlag(Flags.AA);
  response.getHeader().setFlag(Flags.QR);
  response.addRecord(query.getQuestion(), Section.QUESTION);
  Iterator it = records.iterator();
  while (it.hasNext())
    response.addRecord((Record)it.next(), Section.ANSWER);
  return response;
}

代码示例来源:origin: tiandawu/IotXmpp

private Message
sendAXFR(Message query) throws IOException {
  Name qname = query.getQuestion().getName();
  ZoneTransferIn xfrin = ZoneTransferIn.newAXFR(qname, address, tsig);
  xfrin.setTimeout((int)(getTimeout() / 1000));
  xfrin.setLocalAddress(localAddress);
  try {
    xfrin.run();
  }
  catch (ZoneTransferException e) {
    throw new WireParseException(e.getMessage());
  }
  List records = xfrin.getAXFR();
  Message response = new Message(query.getHeader().getID());
  response.getHeader().setFlag(Flags.AA);
  response.getHeader().setFlag(Flags.QR);
  response.addRecord(query.getQuestion(), Section.QUESTION);
  Iterator it = records.iterator();
  while (it.hasNext())
    response.addRecord((Record)it.next(), Section.ANSWER);
  return response;
}

代码示例来源:origin: org.littleshoot/dnsjava

private Message
sendAXFR(Message query) throws IOException {
  Name qname = query.getQuestion().getName();
  ZoneTransferIn xfrin = ZoneTransferIn.newAXFR(qname, address, tsig);
  xfrin.setTimeout((int)(getTimeout() / 1000));
  xfrin.setLocalAddress(localAddress);
  try {
    xfrin.run();
  }
  catch (ZoneTransferException e) {
    throw new WireParseException(e.getMessage());
  }
  List records = xfrin.getAXFR();
  Message response = new Message(query.getHeader().getID());
  response.getHeader().setFlag(Flags.AA);
  response.getHeader().setFlag(Flags.QR);
  response.addRecord(query.getQuestion(), Section.QUESTION);
  Iterator it = records.iterator();
  while (it.hasNext())
    response.addRecord((Record)it.next(), Section.ANSWER);
  return response;
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com