MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rn_newpair

Function rn_newpair

freebsd/net/radix.c:392–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390 */
391
392static struct radix_node *
393rn_newpair(void *v, int b, struct radix_node nodes[2])
394{
395 struct radix_node *tt = nodes, *t = tt + 1;
396 t->rn_bit = b;
397 t->rn_bmask = 0x80 >> (b & 7);
398 t->rn_left = tt;
399 t->rn_offset = b >> 3;
400
401#if 0 /* XXX perhaps we should fill these fields as well. */
402 t->rn_parent = t->rn_right = NULL;
403
404 tt->rn_mask = NULL;
405 tt->rn_dupedkey = NULL;
406 tt->rn_bmask = 0;
407#endif
408 tt->rn_bit = -1;
409 tt->rn_key = (caddr_t)v;
410 tt->rn_parent = t;
411 tt->rn_flags = t->rn_flags = RNF_ACTIVE;
412 tt->rn_mklist = t->rn_mklist = 0;
413#ifdef RN_DEBUG
414 tt->rn_info = rn_nodenum++; t->rn_info = rn_nodenum++;
415 tt->rn_twin = t;
416 tt->rn_ybro = rn_clist;
417 rn_clist = tt;
418#endif
419 return (t);
420}
421
422static struct radix_node *
423rn_insert(void *v_arg, struct radix_head *head, int *dupentry,

Callers 2

rn_insertFunction · 0.85
rn_inithead_internalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected