Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ITS - Intelligent Transport Systems
ITS
Commits
f46b81d6
Commit
f46b81d6
authored
Aug 03, 2016
by
garciay
Browse files
Validate RSUsimulator against AtsDenm in secured mode
parent
7ea95047
Changes
1
Hide whitespace changes
Inline
Side-by-side
javasrc/adapter/org/etsi/its/adapter/PcapMultiplexer.java
View file @
f46b81d6
...
...
@@ -49,7 +49,7 @@ public class PcapMultiplexer implements Runnable {
int
r
=
Pcap
.
findAllDevs
(
alldevs
,
errbuf
);
if
(
r
==
Pcap
.
NOT_OK
||
alldevs
.
isEmpty
())
{
TERFactory
.
getInstance
().
logError
(
"Can't read list of devices, error is %s"
+
errbuf
.
toString
());
//
TERFactory.getInstance().logError("Can't read list of devices, error is %s" + errbuf.toString());
return
;
}
...
...
@@ -72,7 +72,7 @@ public class PcapMultiplexer implements Runnable {
}
device
=
alldevs
.
get
(
ifaceIndex
);
//
TERFactory.getInstance().logDebug("Listening: " + device.getName());
//
TERFactory.getInstance().logDebug("Listening: " + device.getName());
}
/**
...
...
@@ -84,7 +84,7 @@ public class PcapMultiplexer implements Runnable {
}
public
synchronized
void
register
(
Layer
client
,
byte
[]
macAddress
,
short
frameType
)
{
//
TERFactory.getInstance().logDebug(">>>PcapMultiplexer.registering: " + frameType);
//
TERFactory.getInstance().logDebug(">>>PcapMultiplexer.registering: " + frameType);
if
(
clientsToMacs
.
isEmpty
())
{
// Open interface
...
...
@@ -94,8 +94,7 @@ public class PcapMultiplexer implements Runnable {
pcap
=
Pcap
.
openLive
(
device
.
getName
(),
snaplen
,
flags
,
timeout
,
errbuf
);
if
(
pcap
==
null
)
{
TERFactory
.
getInstance
().
logError
(
"Error while opening device for capture: "
+
errbuf
.
toString
());
//TERFactory.getInstance().logError("Error while opening device for capture: " + errbuf.toString());
return
;
}
captureThread
=
new
Thread
(
this
);
...
...
@@ -103,7 +102,7 @@ public class PcapMultiplexer implements Runnable {
filter
=
""
;
}
else
{
//
TERFactory.getInstance().logDebug("Another Client !");
//
TERFactory.getInstance().logDebug("Another Client !");
filter
=
filter
+
" and "
;
}
...
...
@@ -114,7 +113,7 @@ public class PcapMultiplexer implements Runnable {
}
filter
=
filter
+
"not ether src "
+
strMacAddress
;
//
TERFactory.getInstance().logDebug("New filter: " + filter);
//
TERFactory.getInstance().logDebug("New filter: " + filter);
// Apply filter
PcapBpfProgram
bpfFilter
=
new
PcapBpfProgram
();
...
...
@@ -122,7 +121,7 @@ public class PcapMultiplexer implements Runnable {
int
netmask
=
0
;
int
r
=
pcap
.
compile
(
bpfFilter
,
filter
,
optimize
,
netmask
);
if
(
r
!=
Pcap
.
OK
)
{
//
TERFactory.getInstance().logDebug("Filter error: " + pcap.getErr());
//
TERFactory.getInstance().logDebug("Filter error: " + pcap.getErr());
}
pcap
.
setFilter
(
bpfFilter
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment