From: mpi Date: Wed, 7 Oct 2015 11:39:49 +0000 (+0000) Subject: Make rtable_get() private to ensure it won't be used outside of X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=56588de8f0271a1ffec8783923fae0353840ee99;p=openbsd Make rtable_get() private to ensure it won't be used outside of net/rtable.c. This will ease the introduction of rtable_put(). Routing tables are mapped to a tuple (idx, af) so the public API should as much as possible require these two keys. ok dlg@ --- diff --git a/sys/net/rtable.c b/sys/net/rtable.c index 80e7b9edca3..7aee943965d 100644 --- a/sys/net/rtable.c +++ b/sys/net/rtable.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtable.c,v 1.10 2015/10/07 10:50:35 mpi Exp $ */ +/* $OpenBSD: rtable.c,v 1.11 2015/10/07 11:39:49 mpi Exp $ */ /* * Copyright (c) 2014-2015 Martin Pieuchot @@ -36,6 +36,7 @@ unsigned int *rtables2dom; /* rtable to domain lookup table */ void rtable_init_backend(unsigned int); int rtable_attach(unsigned int, sa_family_t, int); +void *rtable_get(unsigned int, sa_family_t); void rtable_set(unsigned int, sa_family_t, void *); void diff --git a/sys/net/rtable.h b/sys/net/rtable.h index 802ff820890..66c62000957 100644 --- a/sys/net/rtable.h +++ b/sys/net/rtable.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rtable.h,v 1.5 2015/10/07 10:50:35 mpi Exp $ */ +/* $OpenBSD: rtable.h,v 1.6 2015/10/07 11:39:49 mpi Exp $ */ /* * Copyright (c) 2014-2015 Martin Pieuchot @@ -50,6 +50,11 @@ #endif /* ART */ void rtable_init(void); +int rtable_exists(unsigned int); +int rtable_add(unsigned int); +unsigned int rtable_l2(unsigned int); +void rtable_l2set(unsigned int, unsigned int); + struct rtentry *rtable_lookup(unsigned int, struct sockaddr *, struct sockaddr *); struct rtentry *rtable_match(unsigned int, struct sockaddr *); @@ -57,12 +62,6 @@ int rtable_insert(unsigned int, struct sockaddr *, struct sockaddr *, uint8_t, struct rtentry *); int rtable_delete(unsigned int, struct sockaddr *, struct sockaddr *, uint8_t, struct rtentry *); - -int rtable_exists(unsigned int); -int rtable_add(unsigned int); -void *rtable_get(unsigned int, sa_family_t); -unsigned int rtable_l2(unsigned int); -void rtable_l2set(unsigned int, unsigned int); int rtable_walk(unsigned int, sa_family_t, int (*)(struct rtentry *, void *, unsigned int), void *);