mirror of
https://github.com/nmap/nmap.git
synced 2025-12-22 15:39:03 +00:00
Avoid hidden overloaded virtual functions
Since the functions were hidden for the comiler, I specified every function that was being hidden in the IPv*Header.h header files. This allows us to use both overloaded functions and the original one instead of having one being hidden by the others. Here is the compiler warning output before the fix: warning: 'file::function' hides overloaded virtual function note: hidden overloaded virtual function 'file2::function' declared here: different qualifiers
This commit is contained in:
@@ -249,6 +249,7 @@ class IPv4Header : public NetworkLayerElement {
|
||||
u8 getNextProto() const;
|
||||
int setNextHeader(u8 val);
|
||||
u8 getNextHeader() const;
|
||||
virtual u8 getNextHeader(){return 0;}
|
||||
|
||||
/* Checksum */
|
||||
int setSum();
|
||||
@@ -261,16 +262,18 @@ class IPv4Header : public NetworkLayerElement {
|
||||
int setDestinationAddress(struct in_addr d);
|
||||
const u8 *getDestinationAddress() const;
|
||||
struct in_addr getDestinationAddress(struct in_addr *result) const;
|
||||
|
||||
virtual u8 *getDestinationAddress(){return NULL;}
|
||||
|
||||
/* Source IP */
|
||||
int setSourceAddress(u32 d);
|
||||
int setSourceAddress(struct in_addr d);
|
||||
const u8 *getSourceAddress() const;
|
||||
struct in_addr getSourceAddress(struct in_addr *result) const;
|
||||
virtual u8 *getSourceAddress(){return NULL;}
|
||||
|
||||
u16 getAddressLength() const;
|
||||
|
||||
virtual u16 getAddressLength(){return 0;}
|
||||
|
||||
/* IP Options */
|
||||
int setOpts(const char *txt);
|
||||
int setOpts(u8 *opts_buff, u32 opts_len);
|
||||
|
||||
@@ -213,7 +213,8 @@ class IPv6Header : public NetworkLayerElement {
|
||||
int setNextHeader(u8 val);
|
||||
int setNextHeader(const char *p);
|
||||
u8 getNextHeader() const;
|
||||
|
||||
virtual u8 getNextHeader(){return 0;}
|
||||
|
||||
/* Hop Limit */
|
||||
int setHopLimit(u8 val);
|
||||
u8 getHopLimit() const;
|
||||
@@ -223,14 +224,17 @@ class IPv6Header : public NetworkLayerElement {
|
||||
int setSourceAddress(struct in6_addr val);
|
||||
const u8 *getSourceAddress() const;
|
||||
struct in6_addr getSourceAddress(struct in6_addr *result) const;
|
||||
|
||||
virtual u8 *getSourceAddress(){return NULL;}
|
||||
|
||||
/* Destination Address*/
|
||||
int setDestinationAddress(u8 *val);
|
||||
int setDestinationAddress(struct in6_addr val);
|
||||
const u8 *getDestinationAddress() const;
|
||||
struct in6_addr getDestinationAddress(struct in6_addr *result) const;
|
||||
virtual u8 *getDestinationAddress(){return NULL;}
|
||||
|
||||
u16 getAddressLength() const;
|
||||
virtual u16 getAddressLength(){return 0;}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user