sniffing function added
This commit is contained in:
parent
3716f9267c
commit
699ff4221d
7 changed files with 57 additions and 24 deletions
|
|
@ -64,7 +64,7 @@ void Packet::parse(bytes data) {
|
|||
pull(head, i, tokenId);
|
||||
pull(head, i, checkSum);
|
||||
if (this->getLength() != checkLen) {
|
||||
printf("Packet Length doesn't match: %hd != %hd\n", this->getLength(),
|
||||
printf("Packet Length doesn't match: %hd != %hd\n", data.size(),
|
||||
checkLen);
|
||||
}
|
||||
i = 0;
|
||||
|
|
@ -76,7 +76,14 @@ void Packet::parse(bytes data) {
|
|||
pull(body, i, d.value, d.len);
|
||||
payload[d.type] = d;
|
||||
}
|
||||
}
|
||||
|
||||
const bytes& Packet::getBody() const {
|
||||
return body;
|
||||
}
|
||||
|
||||
const bytes& Packet::getHead() const {
|
||||
return head;
|
||||
}
|
||||
|
||||
void Packet::setBody(bytes data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue