A
Andrea
This is the code:
class Ipktgen {
public native int Pktgen(int ttl, long d_ip, byte[] payload);
int ttl = this.ttl;
long d_ip = this.d_ip;
byte[] payload = this.payload;
static {System.loadLibrary("Lpktgen");}
public static void main(String[] args) {
Ipktgen pkt = new Ipktgen();
int result = pkt.Pktgen(ttl, d_ip, payload);
}
}
Theese are compiler's errors:
Ipktgen.java:13: non-static variable ttl cannot be referenced from a static
context
int result = pkt.Pktgen(ttl, d_ip, payload);
^
Ipktgen.java:13: non-static variable d_ip cannot be referenced from a static
context
int result = pkt.Pktgen(ttl, d_ip, payload);
^
Ipktgen.java:13: non-static variable payload cannot be referenced from a
static context
int result = pkt.Pktgen(ttl, d_ip, payload);
class Ipktgen {
public native int Pktgen(int ttl, long d_ip, byte[] payload);
int ttl = this.ttl;
long d_ip = this.d_ip;
byte[] payload = this.payload;
static {System.loadLibrary("Lpktgen");}
public static void main(String[] args) {
Ipktgen pkt = new Ipktgen();
int result = pkt.Pktgen(ttl, d_ip, payload);
}
}
Theese are compiler's errors:
Ipktgen.java:13: non-static variable ttl cannot be referenced from a static
context
int result = pkt.Pktgen(ttl, d_ip, payload);
^
Ipktgen.java:13: non-static variable d_ip cannot be referenced from a static
context
int result = pkt.Pktgen(ttl, d_ip, payload);
^
Ipktgen.java:13: non-static variable payload cannot be referenced from a
static context
int result = pkt.Pktgen(ttl, d_ip, payload);