is no point in keeping an unused level of abstraction.
ok mikeb@, claudio@
-/* $OpenBSD: vfs_subr.c,v 1.234 2015/10/07 11:57:44 mpi Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.235 2015/10/08 08:41:58 mpi Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
error = EINVAL;
goto out;
}
- rn = (*rnh->rnh_addaddr)((caddr_t)saddr, (caddr_t)smask, rnh,
- np->netc_rnodes, 0);
+ rn = rn_addroute(saddr, smask, rnh, np->netc_rnodes, 0);
if (rn == 0 || np != (struct netcred *)rn) { /* already exists */
error = EPERM;
goto out;
{
struct radix_node_head *rnh = (struct radix_node_head *)w;
- (*rnh->rnh_deladdr)(rn->rn_key, rn->rn_mask, rnh, NULL);
+ rn_delete(rn->rn_key, rn->rn_mask, rnh, NULL);
free(rn, M_NETADDR, 0);
return (0);
}
struct radix_node_head *rnh;
if ((rnh = nep->ne_rtable_inet) != NULL) {
- (*rnh->rnh_walktree)(rnh, vfs_free_netcred, rnh);
+ rn_walktree(rnh, vfs_free_netcred, rnh);
free(rnh, M_RTABLE, 0);
nep->ne_rtable_inet = NULL;
}
rnh = NULL;
break;
}
- if (rnh != NULL) {
- np = (struct netcred *)
- (*rnh->rnh_matchaddr)((caddr_t)saddr,
- rnh);
- }
+ if (rnh != NULL)
+ np = (struct netcred *)rn_match(saddr, rnh);
}
/*
* If no address match, use the default if it exists.
-/* $OpenBSD: radix.c,v 1.49 2015/10/07 10:50:35 mpi Exp $ */
+/* $OpenBSD: radix.c,v 1.50 2015/10/08 08:41:58 mpi Exp $ */
/* $NetBSD: radix.c,v 1.20 2003/08/07 16:32:56 agc Exp $ */
/*
tt->rn_b = -1 - off;
*ttt = *tt;
ttt->rn_key = rn_ones;
- rnh->rnh_addaddr = rn_addroute;
- rnh->rnh_deladdr = rn_delete;
- rnh->rnh_matchaddr = rn_match;
- rnh->rnh_lookup = rn_lookup;
- rnh->rnh_walktree = rn_walktree;
rnh->rnh_treetop = t;
return (1);
}
-/* $OpenBSD: radix.h,v 1.26 2015/09/04 08:43:39 mpi Exp $ */
+/* $OpenBSD: radix.h,v 1.27 2015/10/08 08:41:58 mpi Exp $ */
/* $NetBSD: radix.h,v 1.8 1996/02/13 22:00:37 christos Exp $ */
/*
struct radix_node *rnh_treetop;
int rnh_addrsize; /* permit, but not require fixed keys */
int rnh_pktsize; /* permit, but not require fixed keys */
- /* add based on sockaddr */
- struct radix_node *(*rnh_addaddr)(void *v, void *mask,
- struct radix_node_head *head, struct radix_node nodes[],
- u_int8_t prio);
- /* remove based on sockaddr */
- struct radix_node *(*rnh_deladdr)(void *v, void *mask,
- struct radix_node_head *head, struct radix_node *rn);
- /* locate based on sockaddr */
- struct radix_node *(*rnh_matchaddr)(void *v,
- struct radix_node_head *head);
- /* locate based on sockaddr */
- struct radix_node *(*rnh_lookup)(void *v, void *mask,
- struct radix_node_head *head);
- /* traverse tree */
- int (*rnh_walktree)(struct radix_node_head *,
- int (*)(struct radix_node *, void *, u_int), void *);
struct radix_node rnh_nodes[3];/* empty tree for common case */
int rnh_multipath; /* multipath? */
u_int rnh_rtableid;
-/* $OpenBSD: radix_mpath.c,v 1.33 2015/09/28 08:36:24 mpi Exp $ */
+/* $OpenBSD: radix_mpath.c,v 1.34 2015/10/08 08:41:58 mpi Exp $ */
/* $KAME: radix_mpath.c,v 1.13 2002/10/28 21:05:59 itojun Exp $ */
/*
char *p, *q, *eq;
int same, l, skip;
- rn1 = rnh->rnh_lookup(dst, netmask, rnh);
+ rn1 = rn_lookup(dst, netmask, rnh);
if (!rn1)
return 0;
/*
* unlike other functions we have in this file, we have to check
- * all key/mask/gateway as rnh_lookup can match less specific entry.
+ * all key/mask/gateway as rn_lookup can match less specific entry.
*/
rt1 = (struct rtentry *)rn1;