// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static final int OK = 0;
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native int PcapCanSetRfMon(Pcap pcap) throws PcapCloseException, NativeException;
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native void PcapClose(Pcap pcap) throws PcapCloseException;
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native int PcapDataLink(Pcap pcap) throws PcapCloseException;
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native String PcapGetErr(Pcap pcap) throws PcapCloseException;
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native Pcap PcapOpenDead(int linktype, int snaplen);
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native int PcapSetDirection(Pcap pcap, PcapDirection direction) throws PcapCloseException, PlatformNotSupportedException;
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native int PcapSetRfMon(Pcap pcap, int rfmon) throws PcapCloseException;
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native int PcapSnapshot(Pcap pcap) throws PcapCloseException;
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native String PcapStrError(int error);
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/exception/NativeException.java
// public class NativeException extends RuntimeException {
// 
// 	private static final long serialVersionUID = -3993889826336916332L;
// 
// 	public NativeException() {
// 		this("");
// 	}
// 
// 	public NativeException(final String message) {
// 		this(message, new RuntimeException(message));
// 	}
// 
// 	public NativeException(final Throwable cause) {
// 		this(cause.getMessage(), cause);
// 	}
// 
// 	public NativeException(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 static com.ardikars.jxnet.Jxnet.OK;
import static com.ardikars.jxnet.Jxnet.PcapCanSetRfMon;
import static com.ardikars.jxnet.Jxnet.PcapClose;
import static com.ardikars.jxnet.Jxnet.PcapDataLink;
import static com.ardikars.jxnet.Jxnet.PcapGetErr;
import static com.ardikars.jxnet.Jxnet.PcapOpenDead;
import static com.ardikars.jxnet.Jxnet.PcapSetDirection;
import static com.ardikars.jxnet.Jxnet.PcapSetRfMon;
import static com.ardikars.jxnet.Jxnet.PcapSnapshot;
import static com.ardikars.jxnet.Jxnet.PcapStrError;
import com.ardikars.common.net.Inet4Address;
import com.ardikars.jxnet.exception.NativeException;
import com.ardikars.jxnet.exception.PlatformNotSupportedException;
import java.util.HashMap;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/**
 * 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;





@RunWith(JUnit4.class)
public class FreakTest {

    private Logger logger = Logger.getLogger(FreakTest.class.getName());

    private Pcap pcap;
    private int snaplen = 65535;
    private DataLinkType linkType = DataLinkType.LINUX_SLL;

    private int resultCode;

    /**
     * Initialize
     */
    @Before
    public void create() {
        pcap = PcapOpenDead(linkType.getValue(), snaplen);
        if (pcap == null) {
            logger.warning("create:PcapOpenDead(): ");
            return;
        }
    }

    @Test
    public void Test01_PcapGetErr() {
        System.out.println("Pcap Error: " + PcapGetErr(pcap));
    }

    @Test
    public void Test02_PcapDatalink() {
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static final int OK = 0;
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native int PcapCanSetRfMon(Pcap pcap) throws PcapCloseException, NativeException;
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native void PcapClose(Pcap pcap) throws PcapCloseException;
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native int PcapDataLink(Pcap pcap) throws PcapCloseException;
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native String PcapGetErr(Pcap pcap) throws PcapCloseException;
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native Pcap PcapOpenDead(int linktype, int snaplen);
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native int PcapSetDirection(Pcap pcap, PcapDirection direction) throws PcapCloseException, PlatformNotSupportedException;
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native int PcapSetRfMon(Pcap pcap, int rfmon) throws PcapCloseException;
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native int PcapSnapshot(Pcap pcap) throws PcapCloseException;
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/Jxnet.java
// public static native String PcapStrError(int error);
// 
// Path: jxnet-core/src/main/java/com/ardikars/jxnet/exception/NativeException.java
// public class NativeException extends RuntimeException {
// 
// 	private static final long serialVersionUID = -3993889826336916332L;
// 
// 	public NativeException() {
// 		this("");
// 	}
// 
// 	public NativeException(final String message) {
// 		this(message, new RuntimeException(message));
// 	}
// 
// 	public NativeException(final Throwable cause) {
// 		this(cause.getMessage(), cause);
// 	}
// 
// 	public NativeException(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-core/src/test/java/com/ardikars/jxnet/FreakTest.java
import static com.ardikars.jxnet.Jxnet.OK;
import static com.ardikars.jxnet.Jxnet.PcapCanSetRfMon;
import static com.ardikars.jxnet.Jxnet.PcapClose;
import static com.ardikars.jxnet.Jxnet.PcapDataLink;
import static com.ardikars.jxnet.Jxnet.PcapGetErr;
import static com.ardikars.jxnet.Jxnet.PcapOpenDead;
import static com.ardikars.jxnet.Jxnet.PcapSetDirection;
import static com.ardikars.jxnet.Jxnet.PcapSetRfMon;
import static com.ardikars.jxnet.Jxnet.PcapSnapshot;
import static com.ardikars.jxnet.Jxnet.PcapStrError;
import com.ardikars.common.net.Inet4Address;
import com.ardikars.jxnet.exception.NativeException;
import com.ardikars.jxnet.exception.PlatformNotSupportedException;
import java.util.HashMap;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/**
 * 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;





@RunWith(JUnit4.class)
public class FreakTest {

    private Logger logger = Logger.getLogger(FreakTest.class.getName());

    private Pcap pcap;
    private int snaplen = 65535;
    private DataLinkType linkType = DataLinkType.LINUX_SLL;

    private int resultCode;

    /**
     * Initialize
     */
    @Before
    public void create() {
        pcap = PcapOpenDead(linkType.getValue(), snaplen);
        if (pcap == null) {
            logger.warning("create:PcapOpenDead(): ");
            return;
        }
    }

    @Test
    public void Test01_PcapGetErr() {
        System.out.println("Pcap Error: " + PcapGetErr(pcap));
    }

    @Test
    public void Test02_PcapDatalink() {
        System.out.println("Data Link Type: " + PcapDataLink(pcap));