-/* $OpenBSD: if.c,v 1.710 2023/11/10 15:51:24 bluhm Exp $ */
+/* $OpenBSD: if.c,v 1.711 2023/11/11 14:24:03 bluhm Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
* Locate an interface based on a complete address.
*/
struct ifaddr *
-ifa_ifwithaddr(struct sockaddr *addr, u_int rtableid)
+ifa_ifwithaddr(const struct sockaddr *addr, u_int rtableid)
{
struct ifnet *ifp;
struct ifaddr *ifa;
* Locate the point to point interface with a given destination address.
*/
struct ifaddr *
-ifa_ifwithdstaddr(struct sockaddr *addr, u_int rdomain)
+ifa_ifwithdstaddr(const struct sockaddr *addr, u_int rdomain)
{
struct ifnet *ifp;
struct ifaddr *ifa;
* a given address.
*/
struct ifaddr *
-ifaof_ifpforaddr(struct sockaddr *addr, struct ifnet *ifp)
+ifaof_ifpforaddr(const struct sockaddr *addr, struct ifnet *ifp)
{
struct ifaddr *ifa;
- char *cp, *cp2, *cp3;
+ const char *cp, *cp2, *cp3;
char *cplim;
struct ifaddr *ifa_maybe = NULL;
u_int af = addr->sa_family;
}
void
-if_group_routechange(struct sockaddr *dst, struct sockaddr *mask)
+if_group_routechange(const struct sockaddr *dst, const struct sockaddr *mask)
{
switch (dst->sa_family) {
case AF_INET:
- if (satosin(dst)->sin_addr.s_addr == INADDR_ANY &&
+ if (satosin_const(dst)->sin_addr.s_addr == INADDR_ANY &&
mask && (mask->sa_len == 0 ||
- satosin(mask)->sin_addr.s_addr == INADDR_ANY))
+ satosin_const(mask)->sin_addr.s_addr == INADDR_ANY))
if_group_egress_build();
break;
#ifdef INET6
case AF_INET6:
- if (IN6_ARE_ADDR_EQUAL(&(satosin6(dst))->sin6_addr,
+ if (IN6_ARE_ADDR_EQUAL(&(satosin6_const(dst))->sin6_addr,
&in6addr_any) && mask && (mask->sa_len == 0 ||
- IN6_ARE_ADDR_EQUAL(&(satosin6(mask))->sin6_addr,
+ IN6_ARE_ADDR_EQUAL(&(satosin6_const(mask))->sin6_addr,
&in6addr_any)))
if_group_egress_build();
break;
-/* $OpenBSD: if.h,v 1.214 2023/05/30 23:55:42 dlg Exp $ */
+/* $OpenBSD: if.h,v 1.215 2023/11/11 14:24:03 bluhm Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
struct ifg_group *if_creategroup(const char *);
int if_addgroup(struct ifnet *, const char *);
int if_delgroup(struct ifnet *, const char *);
-void if_group_routechange(struct sockaddr *, struct sockaddr *);
+void if_group_routechange(const struct sockaddr *, const struct sockaddr *);
struct ifnet *if_unit(const char *);
struct ifnet *if_get(unsigned int);
void if_put(struct ifnet *);
-/* $OpenBSD: if_var.h,v 1.129 2023/07/07 08:05:02 bluhm Exp $ */
+/* $OpenBSD: if_var.h,v 1.130 2023/11/11 14:24:03 bluhm Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
void p2p_input(struct ifnet *, struct mbuf *);
int p2p_bpf_mtap(caddr_t, const struct mbuf *, u_int);
-struct ifaddr *ifa_ifwithaddr(struct sockaddr *, u_int);
-struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *, u_int);
-struct ifaddr *ifaof_ifpforaddr(struct sockaddr *, struct ifnet *);
+struct ifaddr *ifa_ifwithaddr(const struct sockaddr *, u_int);
+struct ifaddr *ifa_ifwithdstaddr(const struct sockaddr *, u_int);
+struct ifaddr *ifaof_ifpforaddr(const struct sockaddr *, struct ifnet *);
struct ifaddr *ifaref(struct ifaddr *);
void ifafree(struct ifaddr *);