Skip to content

Commit

Permalink
ssid tag
Browse files Browse the repository at this point in the history
  • Loading branch information
arselzer committed Mar 17, 2015
1 parent c9c0219 commit d0f54f3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 80211_tags.js
Expand Up @@ -2,7 +2,8 @@ function parse_tag(tag, type) {
// SSID
if (type === 0) {
return {
type: "ssid"
type: "ssid",
ssid: new String(tag.slice(0, tag.length))
}
}
// rates
Expand Down Expand Up @@ -72,7 +73,6 @@ function parse_tag(tag, type) {
}

function parse_tags(buffer) {
console.log(buffer.length, buffer.toString())
var tags = []
var pos = 0

Expand All @@ -81,7 +81,7 @@ function parse_tags(buffer) {
var tagType = buffer.readUInt8(pos)
var tagLen = buffer.readUInt8(pos + 1)

var content = buffer.slice(pos + 1, pos + tagLen + 1)
var content = buffer.slice(pos + 2, pos + tagLen + 2)
var tag = parse_tag(content, tagType)
tag.type_number = tagType
tag.content = content
Expand Down
18 changes: 18 additions & 0 deletions test/probe.js
@@ -0,0 +1,18 @@
var pcap = require("pcap")
var radioparse = require("../index")

var session = pcap.createSession("mon0")

session.on("packet", function(raw) {
var packet = radioparse.parse(radioparse.slice_packet(raw))

if (packet.frame) {
if (packet.frame.type === 0 && packet.frame.subtype === 8) {
packet.frame.tags.forEach(function(tag) {
if (tag.type === "ssid") {
console.log(tag)
}
})
}
}
})

0 comments on commit d0f54f3

Please sign in to comment.