void conn_status (void) { arla_log(ADEBVLOG, "%u(%u) connections", nactive_connections, nconnections); hashtabforeach (connhtab, print_conn, NULL); }
int checksymbols(void) { int f = 0; hashtabforeach(htab, checkfunc, &f); return f; }
static int test_hash(void) { Hashtab *h; starttesting("hashtab"); h = hashtabnew(100, hash_cmp, hash_hash); if (!h) return endtesting(1); if (!hashtabadd(h, "one")|| !hashtabadd(h, "two")|| !hashtabadd(h, "three")|| !hashtabadd(h, "four")) return endtesting(1); printf("foreach ----\n"); hashtabforeach(h, hash_print, NULL); printf("search ----\none == %s\ntwo == %s\nthree == %s\nfour == %s\n", (char *)hashtabsearch(h, "one"), (char *)hashtabsearch(h, "two"), (char *)hashtabsearch(h, "three"), (char *)hashtabsearch(h, "four")); hashtabrelease(h); return endtesting(0); }
int checkundefined(void) { int f = 0; hashtabforeach(htab, checkfunc, &f); return f; }
static void debug_print_callbacks (void) { if (debuglevel & MDEBROPA) { mlog_log (MDEBROPA, "---callbacks left are---"); hashtabforeach (ht_callbacks, print_callback_sub, NULL); } }
void conn_clearcred(clear_state_mask mask, int32_t cell, nnpfs_pag_t cred, int securityindex) { struct clear_state s; s.mask = mask; s.cell = cell; s.cred = cred; s.securityindex = securityindex; hashtabforeach (connhtab, clear_cred, (void *)&s); }
void conn_downhosts(int32_t cell, uint32_t *hosts, int *num, int flags) { struct down_state s; if (*num == 0) return; s.cell = cell; s.hosts = hosts; s.len = *num; s.i = 0; s.flags = flags; hashtabforeach (connhtab, host_down, (void *)&s); *num = s.i; }
static ConnCacheEntry * get_free_connection (void) { ConnCacheEntry *e; e = (ConnCacheEntry *)listdelhead (connfreelist); if (e != NULL) return e; hashtabforeach (connhtab, clear_conn, NULL); e = (ConnCacheEntry *)listdelhead (connfreelist); if (e != NULL) return e; create_new_connections (CONNFREELISTINC); e = (ConnCacheEntry *)listdelhead (connfreelist); if (e != NULL) return e; arla_errx (1, ADEBERROR, "conncache: there was no way of getting a connection"); }