1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 09:49:05 +00:00

const all the things!

This commit is contained in:
dmiller
2021-04-23 20:37:41 +00:00
parent 1717b4a9a9
commit 1fd272f8dd
19 changed files with 215 additions and 219 deletions

View File

@@ -108,7 +108,7 @@ struct TracerouteHop {
int ttl;
float rtt; /* In milliseconds. */
int display_name(char *buf, size_t len) {
int display_name(char *buf, size_t len) const {
if (name.empty())
return Snprintf(buf, len, "%s", inet_ntop_ez(&addr, sizeof(addr)));
else
@@ -192,21 +192,21 @@ class Target {
/* If the host is NOT directly connected, you can set the next hop
value here. It is OK to pass in a sockaddr_in or sockaddr_in6
casted to sockaddr_storage*/
void setNextHop(struct sockaddr_storage *next_hop, size_t next_hop_len);
void setNextHop(const struct sockaddr_storage *next_hop, size_t next_hop_len);
/* Returns the next hop for sending packets to this host. Returns true if
next_hop was filled in. It might be false, for example, if
next_hop has never been set */
bool nextHop(struct sockaddr_storage *next_hop, size_t *next_hop_len);
bool nextHop(struct sockaddr_storage *next_hop, size_t *next_hop_len) const;
void setMTU(int devmtu);
int MTU(void);
int MTU(void) const;
/* Sets the interface type to one of:
devt_ethernet, devt_loopback, devt_p2p, devt_other
*/
void setIfType(devtype iftype) { interface_type = iftype; }
/* Returns -1 if it has not yet been set with setIfType() */
devtype ifType() { return interface_type; }
devtype ifType() const { return interface_type; }
/* Starts the timeout clock for the host running (e.g. you are
beginning a scan). If you do not have the current time handy,
you can pass in NULL. When done, call stopTimeOutClock (it will
@@ -215,15 +215,15 @@ class Target {
/* The complement to startTimeOutClock. */
void stopTimeOutClock(const struct timeval *now);
/* Is the timeout clock currently running? */
bool timeOutClockRunning() { return htn.toclock_running; }
bool timeOutClockRunning() const { return htn.toclock_running; }
/* Returns whether the host is timedout. If the timeoutclock is
running, counts elapsed time for that. Pass NULL if you don't have the
current time handy. You might as well also pass NULL if the
clock is not running, as the func won't need the time. */
bool timedOut(const struct timeval *now);
bool timedOut(const struct timeval *now) const;
/* Return time_t for the start and end time of this host */
time_t StartTime() { return htn.host_start; }
time_t EndTime() { return htn.host_end; }
time_t StartTime() const { return htn.host_start; }
time_t EndTime() const { return htn.host_end; }
/* Takes a 6-byte MAC address */
int setMACAddress(const u8 *addy);
@@ -243,7 +243,7 @@ class Target {
const char *deviceName() const;
const char *deviceFullName() const;
int osscanPerformed(void);
int osscanPerformed(void) const;
void osscanSetFlag(int flag);
struct seq_info seq;