/usr/include/dublintraceroute/hop.h is in libdublintraceroute-dev 0.3-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | /**
* \file hop.h
* \Author Andrea Barberio <insomniac@slackware.it>
* \date October 2015
* \brief Definition of the Hop class
*
* This file contains the definition of the Hop class, which represent every
* single hop in a traceroute. A Hop includes the sent packet, the matching
* received packet (if any), NAT information and last-hop information.
*
* This module currently offers the set-up of the logging facilities.
*
* \sa hop.cc
*/
#ifndef _HOP_H
#define _HOP_H
#include <future>
#include <memory>
#include <tins/tins.h>
#include <json/json.h>
using namespace Tins;
class Hop {
private:
std::shared_ptr<IP> sent_;
std::shared_ptr<IP> received_;
std::shared_ptr<Timestamp> sent_timestamp_;
std::shared_ptr<Timestamp> received_timestamp_;
std::shared_ptr<std::string> name_;
bool last_hop_;
public:
Hop(): last_hop_(false) { }
std::shared_ptr<IP> sent() { return sent_; }
std::shared_ptr<IP> received() { return received_; }
std::shared_ptr<std::string> name() { if (!name_) name_ = std::make_shared<std::string>(resolve()); return name_; }
std::shared_ptr<Tins::Timestamp> received_timestamp() { return received_timestamp_; }
std::shared_ptr<Tins::Timestamp> sent_timestamp() { return sent_timestamp_; }
std::string resolve();
uint16_t nat_id();
void sent(IP &packet);
void received(IP &packet, const Tins::Timestamp ×tamp);
void name(std::string &name);
void sent_timestamp(const Tins::Timestamp ×tamp);
const bool is_last_hop() const { return last_hop_; }
void is_last_hop(bool is_last) { last_hop_ = is_last; }
unsigned int rtt();
operator bool() const { return (bool)received_; }
Json::Value to_json();
};
#endif /* _HOP_H */
|