1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-25 17:09:02 +00:00

Initialize NetBlock members.

This commit is contained in:
david
2013-01-26 05:31:30 +00:00
parent fd2130bae1
commit b8e4f8832c
2 changed files with 11 additions and 0 deletions

View File

@@ -269,6 +269,15 @@ bool NetBlock::is_resolved_address(const struct sockaddr_storage *ss) const {
return sockaddr_storage_equal(&*this->resolvedaddrs.begin(), ss);
}
NetBlockIPv4Ranges::NetBlockIPv4Ranges() {
unsigned int i;
for (i = 0; i < 4; i++) {
memset(this->octets, 0, sizeof(this->octets));
this->counter[i] = 0;
}
}
bool NetBlockIPv4Ranges::next(struct sockaddr_storage *ss) {
struct sockaddr_in *sin;
unsigned int i;

View File

@@ -135,6 +135,8 @@ class NetBlockIPv4Ranges : public NetBlock {
public:
octet_bitvector octets[4];
NetBlockIPv4Ranges();
bool next(struct sockaddr_storage *ss);
void apply_netmask(int bits);
std::string str() const;