1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-03 05:09:14 +00:00

Make const these methods of Target:

deviceName
deviceFullName
directlyConnected
directlyConnectedOrUnset
This commit is contained in:
david
2010-06-07 22:09:37 +00:00
parent 138745fda6
commit 3a0b829ea1
2 changed files with 8 additions and 8 deletions

View File

@@ -141,11 +141,11 @@ void Target::Initialize() {
}
const char * Target::deviceName() {
const char * Target::deviceName() const {
return (devname[0] != '\0')? devname : NULL;
}
const char * Target::deviceFullName() {
const char * Target::deviceFullName() const {
return (devfullname[0] != '\0')? devfullname : NULL;
}
@@ -361,11 +361,11 @@ void Target::setDirectlyConnected(bool connected) {
directly_connected = connected? 1 : 0;
}
int Target::directlyConnectedOrUnset(){
int Target::directlyConnectedOrUnset() const {
return directly_connected;
}
bool Target::directlyConnected() {
bool Target::directlyConnected() const {
assert(directly_connected == 0 || directly_connected == 1);
return directly_connected;
}

View File

@@ -212,8 +212,8 @@ class Target {
that information here. directlyConnected() will abort if it hasn't
been set yet. */
void setDirectlyConnected(bool connected);
bool directlyConnected();
int directlyConnectedOrUnset(); /* 1-directly connected, 0-no, -1-we don't know*/
bool directlyConnected() const;
int directlyConnectedOrUnset() const; /* 1-directly connected, 0-no, -1-we don't know*/
/* 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
@@ -263,8 +263,8 @@ class Target {
qualifier, while the full name may include it (e.g. "eth1:1"). If
these are non-null, they will overwrite the stored version */
void setDeviceNames(const char *name, const char *fullname);
const char *deviceName();
const char *deviceFullName();
const char *deviceName() const;
const char *deviceFullName() const;
int osscanPerformed(void);
void osscanSetFlag(int flag);