예제 #1
0
void connect_closeopen(void *pri_work) {

	rbwalk(state_tbl, kill_connection, 1, pri_work);

	if (a_conns) {
		VRB(1, "%u connections left hanging", a_conns);
	}

	VRB(2, "TCP STATS:\n"
		"\tConnect related TCP Segments sent: %d\n"
		"\tStream Reassembly aborted due to damaged tcp segment: %d\n"
		"\tStream death due to remote reset: %d\n"
		"\tTCP Segments to a Closed socket: %d\n"
		"\tTCP Segments out of window: %d\n"
		"\tTCP Segments with data truncated that went past window: %d\n"
		"\tTCP Seqments recieved out of order: %d\n"
		"\tConnections Established: %d\n"
		"\tTCP Triggers sent: %d\n"
		"\tTCP Dynamic Triggers sent: %d\n"
		"\tTCP segments to non-existant sockets: %d",
		s->stats.stream_segments_sent,
		s->stats.stream_reassembly_abort_badpkt,
		s->stats.stream_remote_abort,
		s->stats.stream_closed_alien_pkt,
		s->stats.stream_out_of_window_pkt,
		s->stats.stream_trunc_past_window,
		s->stats.stream_out_of_order_segment,
		s->stats.stream_connections_est,
		s->stats.stream_triggers_sent,
		s->stats.stream_dynamic_triggers_sent,
		s->stats.stream_completely_alien_packet
	);

	return;
}
예제 #2
0
void c_hash_walk(lv_t *hash, void(*callback)(lv_t *, lv_t *)) {
    assert(hash && hash->type == l_hash);
    assert(callback);

    void hash_walker(const void *np, const VISIT w, const int d, void *msg) {
        if(w == leaf || w == postorder) {
            // inorder, strangely
            callback(((hash_node_t *)np)->key_item,
                     ((hash_node_t *)np)->value);
        }
    }

    rbwalk(L_HASH(hash), hash_walker, NULL);
}
예제 #3
0
파일: intdict.c 프로젝트: brettmeyers/silk
void
int_dict_destroy(
    int_dict_t         *dict)
{
    assert(dict);
    assert(dict->tree);

    WRITE_LOCK(&dict->mutex);
    rbwalk(dict->tree, destroy_node, NULL);
    rbdestroy(dict->tree);
    if (dict->tnode != NULL) {
        free(dict->tnode);
    }
    RW_MUTEX_UNLOCK(&dict->mutex);
    RW_MUTEX_DESTROY(&dict->mutex);
    free(dict);
}