示例#1
0
HostClass* get_hostclass(const string& ip, int firstnode) 
{
    if(HostClass* hc = find_host(hostlist, ip)) 
	return hc;

    HostClass hc(ip, firstnode);
    hostlist.push_back(hc);

    return find_host(hostlist, ip);
}
示例#2
0
string create_unknown_node(const string& prev_node) 
{
    static HostClass* prev_res = 0;

    if(prev_res && prev_res->ip == prev_node) {
	
	prev_res->unknown_hosts++;
	return prev_node;
    }
    
    HostClass hu;
    hostlist.push_back(hu);

    prev_res = find_host(hostlist, hu.ip);
    if(!prev_res)
	cout << "BIGMISTAKE" << endl;

    return hu.name();
}