// Path: jxnet-core/src/main/java/com/ardikars/jxnet/exception/BpfProgramCloseException.java
// public class BpfProgramCloseException extends RuntimeException {
// 
// 	private static final long serialVersionUID = 981862853161292421L;
// 
// 	public BpfProgramCloseException() {
// 		this("");
// 	}
// 	
// 	public BpfProgramCloseException(final String message) {
// 		this(message, new RuntimeException(message));
// 	}
// 
// 	public BpfProgramCloseException(final Throwable cause) {
// 		this(cause.getMessage(), cause);
// 	}
// 	
// 	public BpfProgramCloseException(final String message, final Throwable cause) {
// 		super(message, cause);
// 	}
// 	
// }
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/exception/PcapCloseException.java
// public class PcapCloseException extends RuntimeException {
// 
// 	private static final long serialVersionUID = 8393262940022738877L;
// 
// 	public PcapCloseException() {
// 		this("");
// 	}
// 	
// 	public PcapCloseException(final String message) {
// 		this(message, new RuntimeException(message));
// 	}
// 
// 	public PcapCloseException(final Throwable cause) {
// 		this(cause.getMessage(), cause);
// 	}
// 
// 	public PcapCloseException(final String message, final Throwable cause) {
// 		super(message, cause);
// 	}
// 
// }
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/exception/PcapDumperCloseException.java
// public class PcapDumperCloseException extends RuntimeException {
// 
// 	private static final long serialVersionUID = -3728289207910510051L;
// 
// 	public PcapDumperCloseException() {
// 		this("");
// 	}
// 	
// 	public PcapDumperCloseException(final String message) {
// 		this(message, new RuntimeException(message));
// 	}
// 
// 	public PcapDumperCloseException(final Throwable cause) {
// 		this(cause.getMessage(), cause);
// 	}
// 
// 	public PcapDumperCloseException(final String message, final Throwable cause) {
// 		super(message, cause);
// 	}
// 
// }
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/exception/PlatformNotSupportedException.java
// public class PlatformNotSupportedException extends RuntimeException {
// 
//     private static final long serialVersionUID = -5714154798477963289L;
// 
//     public PlatformNotSupportedException() {
//         this("");
//     }
// 
//     public PlatformNotSupportedException(final String message) {
//         this(message, new RuntimeException(message));
//     }
// 
//     public PlatformNotSupportedException(final Throwable cause) {
//         this(cause.getMessage(), cause);
//     }
// 
//     public PlatformNotSupportedException(final String message, final Throwable cause) {
//         super(message, cause);
//     }
// 
// }


import com.ardikars.common.net.Inet4Address;
import com.ardikars.common.util.Builder;
import com.ardikars.common.util.Factory;
import com.ardikars.jxnet.exception.BpfProgramCloseException;
import com.ardikars.jxnet.exception.PcapCloseException;
import com.ardikars.jxnet.exception.PcapDumperCloseException;
import com.ardikars.jxnet.exception.PlatformNotSupportedException;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
/**
 * Copyright (C) 2015-2018 Jxnet
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.ardikars.jxnet;



/**
 * Application context for wrap a pcap handle.
 *
 * @author <a href="mailto:contact@ardikars.com">Ardika Rommy Sanjaya</a>
 * @since 1.1.5
 * @deprecated please use {@link com.ardikars.jxnet.context.Context}.
 */
@Deprecated
public interface Context extends Factory<Context, Builder<Pcap, Void>> {

    String getApplicationName();

    String getApplicationDisplayName();

	String getApplicationVersion();

    /**
     * Native function mapping
     */

    /**
     * Collect a group of packets.
     * Callback argument already asyncronous.
     * @param cnt maximum iteration, -1 is infinite iteration.
     * @param callback callback funtion.
     * @param user args
     * @param <T> args type.
     * @return PcapLoop() returns 0 if cnt is exhausted or if, when reading from a
     * savefile, no more packets are available. It returns -1 if an error
     * occurs or -2 if the loop terminated due to a call to PcapBreakLoop()
     * before any packets were processed.  It does not return when live packet
     * buffer timeouts occur; instead, it attempts to read more packets.
     * @throws PcapCloseException pcap close exception.
     * @since 1.1.4
     */
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/exception/BpfProgramCloseException.java
// public class BpfProgramCloseException extends RuntimeException {
// 
// 	private static final long serialVersionUID = 981862853161292421L;
// 
// 	public BpfProgramCloseException() {
// 		this("");
// 	}
// 	
// 	public BpfProgramCloseException(final String message) {
// 		this(message, new RuntimeException(message));
// 	}
// 
// 	public BpfProgramCloseException(final Throwable cause) {
// 		this(cause.getMessage(), cause);
// 	}
// 	
// 	public BpfProgramCloseException(final String message, final Throwable cause) {
// 		super(message, cause);
// 	}
// 	
// }
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/exception/PcapCloseException.java
// public class PcapCloseException extends RuntimeException {
// 
// 	private static final long serialVersionUID = 8393262940022738877L;
// 
// 	public PcapCloseException() {
// 		this("");
// 	}
// 	
// 	public PcapCloseException(final String message) {
// 		this(message, new RuntimeException(message));
// 	}
// 
// 	public PcapCloseException(final Throwable cause) {
// 		this(cause.getMessage(), cause);
// 	}
// 
// 	public PcapCloseException(final String message, final Throwable cause) {
// 		super(message, cause);
// 	}
// 
// }
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/exception/PcapDumperCloseException.java
// public class PcapDumperCloseException extends RuntimeException {
// 
// 	private static final long serialVersionUID = -3728289207910510051L;
// 
// 	public PcapDumperCloseException() {
// 		this("");
// 	}
// 	
// 	public PcapDumperCloseException(final String message) {
// 		this(message, new RuntimeException(message));
// 	}
// 
// 	public PcapDumperCloseException(final Throwable cause) {
// 		this(cause.getMessage(), cause);
// 	}
// 
// 	public PcapDumperCloseException(final String message, final Throwable cause) {
// 		super(message, cause);
// 	}
// 
// }
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/exception/PlatformNotSupportedException.java
// public class PlatformNotSupportedException extends RuntimeException {
// 
//     private static final long serialVersionUID = -5714154798477963289L;
// 
//     public PlatformNotSupportedException() {
//         this("");
//     }
// 
//     public PlatformNotSupportedException(final String message) {
//         this(message, new RuntimeException(message));
//     }
// 
//     public PlatformNotSupportedException(final Throwable cause) {
//         this(cause.getMessage(), cause);
//     }
// 
//     public PlatformNotSupportedException(final String message, final Throwable cause) {
//         super(message, cause);
//     }
// 
// }


// Path: jxnet-context/src/main/java/com/ardikars/jxnet/Context.java
import com.ardikars.common.net.Inet4Address;
import com.ardikars.common.util.Builder;
import com.ardikars.common.util.Factory;
import com.ardikars.jxnet.exception.BpfProgramCloseException;
import com.ardikars.jxnet.exception.PcapCloseException;
import com.ardikars.jxnet.exception.PcapDumperCloseException;
import com.ardikars.jxnet.exception.PlatformNotSupportedException;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;

/**
 * Copyright (C) 2015-2018 Jxnet
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.ardikars.jxnet;



/**
 * Application context for wrap a pcap handle.
 *
 * @author <a href="mailto:contact@ardikars.com">Ardika Rommy Sanjaya</a>
 * @since 1.1.5
 * @deprecated please use {@link com.ardikars.jxnet.context.Context}.
 */
@Deprecated
public interface Context extends Factory<Context, Builder<Pcap, Void>> {

    String getApplicationName();

    String getApplicationDisplayName();

	String getApplicationVersion();

    /**
     * Native function mapping
     */

    /**
     * Collect a group of packets.
     * Callback argument already asyncronous.
     * @param cnt maximum iteration, -1 is infinite iteration.
     * @param callback callback funtion.
     * @param user args
     * @param <T> args type.
     * @return PcapLoop() returns 0 if cnt is exhausted or if, when reading from a
     * savefile, no more packets are available. It returns -1 if an error
     * occurs or -2 if the loop terminated due to a call to PcapBreakLoop()
     * before any packets were processed.  It does not return when live packet
     * buffer timeouts occur; instead, it attempts to read more packets.
     * @throws PcapCloseException pcap close exception.
     * @since 1.1.4
     */
    <T> PcapCode pcapLoop(int cnt, PcapHandler<T> callback, T user) throws PcapCloseException;