diff options
| author | Joel Klinghed <the_jk@yahoo.com> | 2017-08-10 21:55:29 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@yahoo.com> | 2017-08-10 21:55:29 +0200 |
| commit | cc61af1e2c933f2178a5dc3e5a5599e74d380eb3 (patch) | |
| tree | 80e034aeb4f4511f7ddb3cc990fb6eb942a657ab /src/monitor.cc | |
| parent | e3f7ecc6bdf7bbd1ae7ec10c387e15743842db90 (diff) | |
Add duration to packages and tpp format
Diffstat (limited to 'src/monitor.cc')
| -rw-r--r-- | src/monitor.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/monitor.cc b/src/monitor.cc index e07b036..cffe3d5 100644 --- a/src/monitor.cc +++ b/src/monitor.cc @@ -179,18 +179,23 @@ private: delegate_->package_data( this, pkg.id, reinterpret_cast<char*>(package_) + offset + o, size - o, - last); + last, pkg.timestamp); } } - } else if (size >= 10 && memcmp(package_ + offset, "DAT", 3) == 0) { + } else if (size >= 22 && memcmp(package_ + offset, "DAT", 3) == 0) { uint32_t id = read_u32(package_ + offset + o); o += 4; uint8_t flags = package_[offset + o]; ++o; + struct timespec ts; + ts.tv_sec = read_u64(package_ + offset + o); + o += 8; + ts.tv_nsec = read_u32(package_ + offset + o); + o += 4; delegate_->package_data( this, id, reinterpret_cast<char*>(package_) + offset + o, size - o, - !(flags & 0x01)); + !(flags & 0x01), ts); } offset += size; } |
