43 static void HostBitFreeAll(
void *store)
52 if (host_bit_id.
id == -1) {
53 FatalError(
"Can't initiate host storage for bits");
70 for ( ; gv != NULL; gv = gv->
next) {
81 static XBit *HostBitGet(
Host *h, uint32_t idx)
84 for ( ; gv != NULL; gv = gv->
next) {
94 static void HostBitAdd(
Host *h, uint32_t idx, uint32_t expire)
96 XBit *fb = HostBitGet(h, idx);
117 static void HostBitRemove(
Host *h, uint32_t idx)
119 XBit *fb = HostBitGet(h, idx);
133 XBit *fb = HostBitGet(h, idx);
135 HostBitAdd(h, idx, expire);
141 XBit *fb = HostBitGet(h, idx);
143 HostBitRemove(h, idx);
149 XBit *fb = HostBitGet(h, idx);
151 HostBitRemove(h, idx);
153 HostBitAdd(h, idx, expire);
159 XBit *fb = HostBitGet(h, idx);
162 HostBitRemove(h,idx);
172 XBit *fb = HostBitGet(h, idx);
178 HostBitRemove(h,idx);
193 for ( ; gv != NULL; gv = gv->
next) {
205 static int HostBitTest01 (
void)
216 XBit *fb = HostBitGet(h,0);
226 static int HostBitTest02 (
void)
235 XBit *fb = HostBitGet(h,0);
245 static int HostBitTest03 (
void)
254 HostBitAdd(h, 0, 30);
256 XBit *fb = HostBitGet(h,0);
258 printf(
"fb == NULL although it was just added: ");
264 fb = HostBitGet(h,0);
266 printf(
"fb != NULL although it was just removed: ");
278 static int HostBitTest04 (
void)
287 HostBitAdd(h, 0, 30);
288 HostBitAdd(h, 1, 30);
289 HostBitAdd(h, 2, 30);
290 HostBitAdd(h, 3, 30);
292 XBit *fb = HostBitGet(h,0);
302 static int HostBitTest05 (
void)
311 HostBitAdd(h, 0, 30);
312 HostBitAdd(h, 1, 30);
313 HostBitAdd(h, 2, 30);
314 HostBitAdd(h, 3, 30);
316 XBit *fb = HostBitGet(h,1);
326 static int HostBitTest06 (
void)
335 HostBitAdd(h, 0, 90);
336 HostBitAdd(h, 1, 90);
337 HostBitAdd(h, 2, 90);
338 HostBitAdd(h, 3, 90);
340 XBit *fb = HostBitGet(h,2);
350 static int HostBitTest07 (
void)
359 HostBitAdd(h, 0, 90);
360 HostBitAdd(h, 1, 90);
361 HostBitAdd(h, 2, 90);
362 HostBitAdd(h, 3, 90);
364 XBit *fb = HostBitGet(h,3);
374 static int HostBitTest08 (
void)
383 HostBitAdd(h, 0, 90);
384 HostBitAdd(h, 1, 90);
385 HostBitAdd(h, 2, 90);
386 HostBitAdd(h, 3, 90);
388 XBit *fb = HostBitGet(h,0);
394 fb = HostBitGet(h,0);
396 printf(
"fb != NULL even though it was removed: ");
407 static int HostBitTest09 (
void)
416 HostBitAdd(h, 0, 90);
417 HostBitAdd(h, 1, 90);
418 HostBitAdd(h, 2, 90);
419 HostBitAdd(h, 3, 90);
421 XBit *fb = HostBitGet(h,1);
427 fb = HostBitGet(h,1);
429 printf(
"fb != NULL even though it was removed: ");
440 static int HostBitTest10 (
void)
449 HostBitAdd(h, 0, 90);
450 HostBitAdd(h, 1, 90);
451 HostBitAdd(h, 2, 90);
452 HostBitAdd(h, 3, 90);
454 XBit *fb = HostBitGet(h,2);
460 fb = HostBitGet(h,2);
462 printf(
"fb != NULL even though it was removed: ");
473 static int HostBitTest11 (
void)
482 HostBitAdd(h, 0, 90);
483 HostBitAdd(h, 1, 90);
484 HostBitAdd(h, 2, 90);
485 HostBitAdd(h, 3, 90);
487 XBit *fb = HostBitGet(h,3);
493 fb = HostBitGet(h,3);
495 printf(
"fb != NULL even though it was removed: ");