FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node_pcap/examples/multiple_interfaces at master · unbug/node_pcap · GitHub
unbug
/
node_pcap
Public
forked from
node-pcap/node_pcap
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
node_pcap
/
examples
/
multiple_interfaces
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
19 lines (16 loc) · 531 Bytes
Breadcrumbs
node_pcap
/
examples
/
multiple_interfaces
Copy path
File metadata and controls
executable file
·
19 lines (16 loc) · 531 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env node
var
util
=
require
(
'util'
)
;
var
pcap
=
require
(
"pcap"
)
;
if
(
process
.
argv
.
length
<
3
)
{
util
.
error
(
"usage: multiple_interfaces <interface 1> [interface 2] ..."
)
;
util
.
error
(
"Example: "
)
;
util
.
error
(
' multiple_interfaces eth0 wlan0'
)
;
process
.
exit
(
1
)
;
}
process
.
argv
.
slice
(
2
)
.
forEach
(
function
(
dev
)
{
var
session
=
pcap
.
createSession
(
dev
)
;
session
.
on
(
'packet'
,
function
(
raw_packet
)
{
var
packet
=
pcap
.
decode
.
packet
(
raw_packet
)
;
util
.
puts
(
dev
+
": "
+
pcap
.
print
.
packet
(
packet
)
)
;
}
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL