|
@@ -53,25 +53,33 @@ static void traverse_subtree( struct ip_node *node, int depth, int options )
|
|
|
|
|
|
if ( node->flags & NODE_IPLEAF_FLAG ) {
|
|
|
int ns = node_status(node);
|
|
|
- DBG("pike:traverse_subtree: options: 0x%02x, node status: 0x%02x", options, ns);
|
|
|
+ DBG("pike:traverse_subtree: options: 0x%02x, node status: 0x%02x",
|
|
|
+ options, ns);
|
|
|
/* add to the result list if it has requested status */
|
|
|
switch (options) {
|
|
|
case NODE_STATUS_HOT:
|
|
|
if ( ns & NODE_STATUS_HOT )
|
|
|
- pike_top_add_entry(ip_addr, depth+1, node->leaf_hits, node->hits, node->expires - get_ticks(), ns);
|
|
|
+ pike_top_add_entry(ip_addr, depth+1,
|
|
|
+ node->leaf_hits, node->hits,
|
|
|
+ node->expires - get_ticks(), ns);
|
|
|
break;
|
|
|
case NODE_STATUS_ALL:
|
|
|
- pike_top_add_entry(ip_addr, depth+1, node->leaf_hits, node->hits, node->expires - get_ticks(), ns);
|
|
|
+ pike_top_add_entry(ip_addr, depth+1, node->leaf_hits,
|
|
|
+ node->hits, node->expires - get_ticks(), ns);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- else if (! node->kids) { /* TODO non IP leaf of ip_tree - it is possible to report WARM nodes here */
|
|
|
+ else if (! node->kids) {
|
|
|
+ /* TODO non IP leaf of ip_tree - it is possible to report WARM nodes here */
|
|
|
/* if ( options == ns )
|
|
|
- pike_top_add_entry(ip_addr, depth+1, node->leaf_hits, node->hits, node->expires - get_ticks(), ns);
|
|
|
+ pike_top_add_entry(ip_addr, depth+1, node->leaf_hits, node->hits,
|
|
|
+ node->expires - get_ticks(), ns);
|
|
|
*/ }
|
|
|
else { /* not a any kind of leaf - inner node */
|
|
|
- DBG("pike:rpc traverse_subtree, not IP leaf, depth: %d, ip: %d.%d.%d.%d hits[%d,%d], expires: %d",
|
|
|
- depth, ip_addr[0], ip_addr[1], ip_addr[2], ip_addr[3], node->hits[0], node->hits[1], node->expires - get_ticks());
|
|
|
+ DBG("pike:rpc traverse_subtree, not IP leaf, depth: %d, ip: %d.%d.%d.%d"
|
|
|
+ " hits[%d,%d], expires: %d",
|
|
|
+ depth, ip_addr[0], ip_addr[1], ip_addr[2], ip_addr[3],
|
|
|
+ node->hits[0], node->hits[1], node->expires - get_ticks());
|
|
|
}
|
|
|
|
|
|
foo = node->kids;
|
|
@@ -150,8 +158,10 @@ static void pike_top(rpc_t *rpc, void *c)
|
|
|
}
|
|
|
else {
|
|
|
for( ti = top_list_root, i = 0; ti != 0; ti = ti->next, ++i ) {
|
|
|
- pike_top_print_addr(ti->ip_addr, ti->addr_len, addr_buff, sizeof(addr_buff));
|
|
|
- DBG("pike:top: result[%d]: %s leaf_hits[%d,%d] hits[%d,%d] expires: %d status: 0x%02x",
|
|
|
+ pike_top_print_addr(ti->ip_addr, ti->addr_len, addr_buff,
|
|
|
+ sizeof(addr_buff));
|
|
|
+ DBG("pike:top: result[%d]: %s leaf_hits[%d,%d] hits[%d,%d]"
|
|
|
+ " expires: %d status: 0x%02x",
|
|
|
i, addr_buff, ti->leaf_hits[0], ti->leaf_hits[1],
|
|
|
ti->hits[0], ti->hits[1], ti->expires, ti->status);
|
|
|
rpc->array_add(list, "{", &item);
|