From 05bcbe71d9da0b82141b940dbaac4c77a04595b5 Mon Sep 17 00:00:00 2001 From: weilin Date: Thu, 4 Aug 2011 02:37:05 +0000 Subject: [PATCH] Remove unused TargetGroup::rewind method. It was used for --exclude groups before that code was rewritten to use addrset. --- TargetGroup.cc | 38 -------------------------------------- TargetGroup.h | 2 -- 2 files changed, 40 deletions(-) diff --git a/TargetGroup.cc b/TargetGroup.cc index 95205858f..c4f84ec3c 100644 --- a/TargetGroup.cc +++ b/TargetGroup.cc @@ -115,44 +115,6 @@ void TargetGroup::Initialize() { ipsleft = 0; } -/* take the object back to the beginning without (mdmcl) - * reinitalizing the data structures */ -int TargetGroup::rewind() { - - /* For netmasks we must set the current address to the - * starting address and calculate the ips by distance */ - if (targets_type == IPV4_NETMASK) { - currentaddr = startaddr; - if (startaddr.s_addr <= endaddr.s_addr) { - ipsleft = ((unsigned long long) (endaddr.s_addr - startaddr.s_addr)) + 1; - return 0; - } - else - assert(0); - } - /* For ranges, we easily set current to zero and calculate - * the ips by the number of values in the columns */ - else if (targets_type == IPV4_RANGES) { - memset((char *)current, 0, sizeof(current)); - ipsleft = (unsigned long long) (last[0] + 1) * - (unsigned long long) (last[1] + 1) * - (unsigned long long) (last[2] + 1) * - (unsigned long long) (last[3] + 1); - return 0; - } -#if HAVE_IPV6 - /* For IPV6 there is only one address, this function doesn't - * make much sence for IPv6 does it? */ - else if (targets_type == IPV6_ADDRESS) { - ipsleft = 1; - return 0; - } -#endif - - /* If we got this far there must be an error, wrong type */ - return -1; -} - /* Initializes (or reinitializes) the object with a new expression, such as 192.168.0.0/16 , 10.1.0-5.1-254 , or fe80::202:e3ff:fe14:1102 . Returns 0 for success */ diff --git a/TargetGroup.h b/TargetGroup.h index 26e1f04cf..b8e8a3710 100644 --- a/TargetGroup.h +++ b/TargetGroup.h @@ -115,8 +115,6 @@ class TargetGroup { fe80::202:e3ff:fe14:1102 . The af parameter is AF_INET or AF_INET6 Returns 0 for success */ int parse_expr(const char * const target_expr, int af); - /* Reset the object without reinitializing it */ - int rewind(); /* Grab the next host from this expression (if any). Returns 0 and fills in ss if successful. ss must point to a pre-allocated sockaddr_storage structure */