summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2012-09-10 02:24:25 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2012-09-10 02:24:25 +0000
commit1ab9d2999a133cfa6c16eefcc185b8184c6776fa (patch)
tree7c758b4f96b7017303edf792e80c65469392fc2c /sys
parentb3248fcfb31227732a5e27eae91578ee1e6bb495 (diff)
Bring into compliance with POSIX, exposing just the specified bits.
Requested by jasper@, ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if.h51
1 files changed, 30 insertions, 21 deletions
diff --git a/sys/net/if.h b/sys/net/if.h
index 3f0bd6b7341..95e2d94dcd0 100644
--- a/sys/net/if.h
+++ b/sys/net/if.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.h,v 1.132 2012/08/21 19:50:39 bluhm Exp $ */
+/* $OpenBSD: if.h,v 1.133 2012/09/10 02:24:24 guenther Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
@@ -35,6 +35,30 @@
#ifndef _NET_IF_H_
#define _NET_IF_H_
+#include <sys/cdefs.h>
+
+/*
+ * Length of interface external name, including terminating '\0'.
+ * Note: this is the same size as a generic device's external name.
+ */
+#define IF_NAMESIZE 16
+
+struct if_nameindex {
+ unsigned int if_index;
+ char *if_name;
+};
+
+#ifndef _KERNEL
+__BEGIN_DECLS
+unsigned int if_nametoindex(const char *);
+char *if_indextoname(unsigned int, char *);
+struct if_nameindex *if_nameindex(void);
+void if_freenameindex(struct if_nameindex *);
+__END_DECLS
+#endif
+
+#if __BSD_VISIBLE
+
#include <sys/queue.h>
#include <sys/tree.h>
@@ -226,12 +250,8 @@ struct if_status_description {
*/
TAILQ_HEAD(ifnet_head, ifnet); /* the actual queue head */
-/*
- * Length of interface external name, including terminating '\0'.
- * Note: this is the same size as a generic device's external name.
- */
-#define IFNAMSIZ 16
-#define IF_NAMESIZE IFNAMSIZ
+/* Traditional BSD name for length of interface external name. */
+#define IFNAMSIZ IF_NAMESIZE
/*
* Length of interface description, including terminating '\0'.
@@ -674,20 +694,6 @@ struct if_laddrreq {
struct sockaddr_storage dstaddr; /* out */
};
-struct if_nameindex {
- unsigned int if_index;
- char *if_name;
-};
-
-#ifndef _KERNEL
-__BEGIN_DECLS
-unsigned int if_nametoindex(const char *);
-char *if_indextoname(unsigned int, char *);
-struct if_nameindex *if_nameindex(void);
-void if_freenameindex(struct if_nameindex *);
-__END_DECLS
-#endif
-
#include <net/if_arp.h>
#ifdef _KERNEL
@@ -858,4 +864,7 @@ void ifa_del(struct ifnet *, struct ifaddr *);
void ifa_update_broadaddr(struct ifnet *, struct ifaddr *,
struct sockaddr *);
#endif /* _KERNEL */
+
+#endif /* __BSD_VISIBLE */
+
#endif /* _NET_IF_H_ */