@@ -8,7 +8,7 @@ Jxnet wraps a native packet capture library (libpcap/npcap) via JNI (Java Native
8
8
[ ![ Codacy Badge] ( https://api.codacy.com/project/badge/Grade/4d6ca7f3d9214098b1436990ac76a6cd )] ( https://www.codacy.com/project/jxnet/Jxnet/dashboard?utm_source=github.com& ; utm_medium=referral& ; utm_content=jxnet/Jxnet& ; utm_campaign=Badge_Grade_Dashboard )
9
9
[ ![ Build status] ( https://ci.appveyor.com/api/projects/status/ev4t6t1ssacwj18j?svg=true )] ( https://ci.appveyor.com/project/jxnet/jxnet )
10
10
11
- [ ![ Download] ( https://api.bintray.com/packages/ardikars/maven/com.ardikars.jxnet/images/download.svg?version=1.4.9.Final ) ] ( https://bintray.com/ardikars/maven/com.ardikars.jxnet/1.4.9.Final /link )
11
+ [ ![ Download] ( https://api.bintray.com/packages/ardikars/maven/com.ardikars.jxnet/images/download.svg?version=1.5.3.RELEASE ) ] ( https://bintray.com/ardikars/maven/com.ardikars.jxnet/1.5.3.RELEASE /link )
12
12
13
13
14
14
Features
@@ -63,7 +63,7 @@ List of supported protocol available at [Jxpacket](https://github.com/jxnet/Jxpa
63
63
>>> <dependency>
64
64
>>> <groupId>com.ardikars.jxnet</groupId>
65
65
>>> <artifactId>jxnet</artifactId>
66
- >>> <version>1.4.9.Final </version>
66
+ >>> <version>1.5.3.RELEASE </version>
67
67
>>> <type>pom</type>
68
68
>>> <scope>import</scope>
69
69
>>> </dependency>
@@ -82,45 +82,23 @@ List of supported protocol available at [Jxpacket](https://github.com/jxnet/Jxpa
82
82
>>> }
83
83
>>>
84
84
>>> dependencyManagement {
85
- >>> imports { mavenBom("com.ardikars.jxnet:jxnet:1.4.9.Final ") }
85
+ >>> imports { mavenBom("com.ardikars.jxnet:jxnet:1.5.3.RELEASE ") }
86
86
>>> }
87
87
>>> ```
88
88
89
89
- ##### Example Application
90
90
91
91
```java
92
92
@SpringBootApplication
93
- public class Applicationimplements CommandLineRunner {
94
-
93
+ public class Applicationextends AbstractJxnetApplicationRunner<String> {
94
+
95
95
public static final int MAX_PACKET = -1; // infinite loop
96
-
97
- private static final Logger LOGGER = LoggerFactory.getLogger(Application.class.getName());
98
-
99
- private Context context;
100
- private PcapIf pcapIf;
101
- private MacAddress macAddress;
102
-
103
- @Autowired
104
- private PcapHandler<String> pcapHandler;
105
-
106
- public Application(Context context, PcapIf pcapIf, MacAddress macAddress) {
107
- this.context = context;
108
- this.pcapIf = pcapIf;
109
- this.macAddress = macAddress;
110
- }
111
-
96
+
112
97
@Override
113
98
public void run(String... args) throws Exception {
114
- LOGGER.info("Network Interface : {}", pcapIf.getName());
115
- LOGGER.info("MAC Address : {}", macAddress);
116
- LOGGER.info("Addresses : ");
117
- for (PcapAddr addr : pcapIf.getAddresses()) {
118
- if (addr.getAddr().getSaFamily() == SockAddr.Family.AF_INET) {
119
- LOGGER.info("\tAddress : {}", Inet4Address.valueOf(addr.getAddr().getData()));
120
- LOGGER.info("\tNetwork : {}", Inet4Address.valueOf(addr.getNetmask().getData()));
121
- }
122
- }
123
- context.pcapLoop(MAX_PACKET, pcapHandler, "Jxnet!");
99
+ showSystemInfo();
100
+ showNetworkInfo();
101
+ loop(MAX_PACKET, "Jxnet!");
124
102
}
125
103
126
104
public static void main(String[] args) {