diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2015-09-14 10:47:02 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2015-09-14 10:47:02 +0000 |
commit | 46a8ca4a2f81cb1e49fc202de9ca1a5b96470758 (patch) | |
tree | 29584ec67826e87b36fd0631b6443954684a2dad /lib/libc | |
parent | 0487b68f110fa292916e43ca578eef61c7c89fdf (diff) |
Wrap <net/if.h> and <net/if_dl.h> so internal calls go direct and all the
symbols are weak
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/hidden/net/if.h | 28 | ||||
-rw-r--r-- | lib/libc/hidden/net/if_dl.h | 25 | ||||
-rw-r--r-- | lib/libc/net/if_indextoname.c | 3 | ||||
-rw-r--r-- | lib/libc/net/if_nametoindex.c | 3 |
4 files changed, 57 insertions, 2 deletions
diff --git a/lib/libc/hidden/net/if.h b/lib/libc/hidden/net/if.h new file mode 100644 index 00000000000..0c183004b8a --- /dev/null +++ b/lib/libc/hidden/net/if.h @@ -0,0 +1,28 @@ +/* $OpenBSD: if.h,v 1.1 2015/09/14 10:47:01 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_NET_IF_H_ +#define _LIBC_NET_IF_H_ + +#include_next <net/if.h> + +PROTO_NORMAL(if_indextoname); +PROTO_DEPRECATED(if_freenameindex); +PROTO_DEPRECATED(if_nameindex); +PROTO_NORMAL(if_nametoindex); + +#endif /* _LIBC_NET_IF_H_ */ diff --git a/lib/libc/hidden/net/if_dl.h b/lib/libc/hidden/net/if_dl.h new file mode 100644 index 00000000000..bbf99f73e01 --- /dev/null +++ b/lib/libc/hidden/net/if_dl.h @@ -0,0 +1,25 @@ +/* $OpenBSD: if_dl.h,v 1.1 2015/09/14 10:47:01 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_NET_IF_DL_H_ +#define _LIBC_NET_IF_DL_H_ + +#include_next <net/if_dl.h> + +PROTO_DEPRECATED(link_ntoa); + +#endif /* _LIBC_NET_IF_DL_H_ */ diff --git a/lib/libc/net/if_indextoname.c b/lib/libc/net/if_indextoname.c index f99e52e387e..f1c65966dfd 100644 --- a/lib/libc/net/if_indextoname.c +++ b/lib/libc/net/if_indextoname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_indextoname.c,v 1.9 2002/03/07 22:40:23 millert Exp $ */ +/* $OpenBSD: if_indextoname.c,v 1.10 2015/09/14 10:47:01 guenther Exp $ */ /* $KAME: if_indextoname.c,v 1.6 2000/11/07 22:33:25 jinmei Exp $ */ /*- @@ -84,3 +84,4 @@ if_indextoname(unsigned int ifindex, char *ifname) errno = error; return(ifname); } +DEF_WEAK(if_indextoname); diff --git a/lib/libc/net/if_nametoindex.c b/lib/libc/net/if_nametoindex.c index 8bd792b949c..8b2cbf743f5 100644 --- a/lib/libc/net/if_nametoindex.c +++ b/lib/libc/net/if_nametoindex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nametoindex.c,v 1.8 2002/03/07 22:40:23 millert Exp $ */ +/* $OpenBSD: if_nametoindex.c,v 1.9 2015/09/14 10:47:01 guenther Exp $ */ /* $KAME: if_nametoindex.c,v 1.5 2000/11/24 08:04:40 itojun Exp $ */ /*- @@ -79,3 +79,4 @@ if_nametoindex(const char *ifname) errno = ENXIO; return(ni); } +DEF_WEAK(if_nametoindex); |