Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Commit

Permalink
24-02-2017 01:03:06 UTC
Browse files Browse the repository at this point in the history
  • Loading branch information
ardikars committed Feb 24, 2017
1 parent a1a1f31 commit e1425e5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions jxnet-core/java/src/com/ardikars/jxnet/Inet4Address.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ public byte[] toBytes() {
return Arrays.copyOf(this.address, this.address.length);
}

public void update(Inet4Address inet4address) {
this.address = inet4address.toBytes();
}

@Override
public boolean equals(Object obj) {
if (obj == this)
Expand Down
4 changes: 4 additions & 0 deletions jxnet-core/java/src/com/ardikars/jxnet/Inet6Address.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ private static short parseHextet(String ipPart) {
return (short) hextet;
}

public void update(Inet6Address inet6address) {
this.address = inet6address.toBytes();
}

@Override
public boolean equals(Object obj) {
if (obj == this)
Expand Down
2 changes: 1 addition & 1 deletion jxnet-core/java/src/com/ardikars/jxnet/Jxnet.java
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ private Jxnet() {
* @return -1 on error, 0 otherwise.
*/
@Deprecated
public static native int PcapLookupNet(String device, InetAddress netp, InetAddress maskp, StringBuilder errbuf);
public static native int PcapLookupNet(String device, Inet4Address netp, Inet4Address maskp, StringBuilder errbuf);

/**
* Compile a packet filter without the need of opening an adapter.
Expand Down
2 changes: 1 addition & 1 deletion jxnet-test/src/test/java/com/ardikars/test/AllTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
PcapOpenOffline.class })
public class AllTests
{
public static final String deviceName = "wlan0";
public static final String deviceName = "eth0";
public static final int snaplen = 1500;
public static final int promisc = 1;
public static final int to_ms = 2000;
Expand Down
4 changes: 2 additions & 2 deletions jxnet-test/src/test/java/com/ardikars/test/PcapLookupNet.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public class PcapLookupNet {
public void run() {
StringBuilder errbuf = new StringBuilder();
String source = AllTests.deviceName;
InetAddress netp = Inet4Address.valueOf(0);
InetAddress nmask = Inet4Address.valueOf(0);
Inet4Address netp = Inet4Address.valueOf(0);
Inet4Address nmask = Inet4Address.valueOf(0);
int res = PcapLookupNet(source, netp, nmask, errbuf);
if (res != OK) {
System.err.println(errbuf.toString());
Expand Down

0 comments on commit e1425e5

Please sign in to comment.