diff options
author | mike <mike@FreeBSD.org> | 2002-10-02 07:44:50 +0000 |
---|---|---|
committer | mike <mike@FreeBSD.org> | 2002-10-02 07:44:50 +0000 |
commit | 7849239d924261f9d43a6afd7a1a628b20a9fbe6 (patch) | |
tree | 7d933d49ee359cd2975211fa1898b18c509a3901 | |
parent | 3a150bca9cc1b9ca767ca73d95fd54081237210b (diff) | |
download | FreeBSD-src-7849239d924261f9d43a6afd7a1a628b20a9fbe6.zip FreeBSD-src-7849239d924261f9d43a6afd7a1a628b20a9fbe6.tar.gz |
Use standards visibility conditionals to conditionalize most of this
header (details on how the visibility conditionals work are available
in <sys/cdefs.h>). Use standard types instead of BSD specific ones,
so that this header compiles in the standards case (specifically this
means changing `u_int' to `unsigned int').
-rw-r--r-- | sys/net/if.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sys/net/if.h b/sys/net/if.h index a87dd47..f13648d 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -37,10 +37,13 @@ #ifndef _NET_IF_H_ #define _NET_IF_H_ +#include <sys/cdefs.h> + #ifdef _KERNEL #include <sys/queue.h> #endif +#if __BSD_VISIBLE /* * <net/if.h> does not depend on <sys/time.h> on most other systems. This * helps userland compatibility. (struct timeval ifi_lastchange) @@ -50,14 +53,17 @@ #endif struct ifnet; +#endif /* * 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 +#define IF_NAMESIZE 16 +#if __BSD_VISIBLE +#define IFNAMSIZ IF_NAMESIZE #define IF_MAXUNIT 0x7fff /* ifp->if_unit is only 15 bits */ +#endif #ifdef _KERNEL /* @@ -80,6 +86,8 @@ struct if_clone { { { 0 }, name, sizeof(name) - 1, minifs, maxunit, NULL, 0, create, destroy } #endif +#if __BSD_VISIBLE + /* * Structure used to query names of interface cloners. */ @@ -315,6 +323,8 @@ struct if_laddrreq { struct sockaddr_storage dstaddr; /* out */ }; +#endif /* __BSD_VISIBLE */ + #ifdef _KERNEL #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_IFADDR); @@ -324,13 +334,13 @@ MALLOC_DECLARE(M_IFMADDR); #ifndef _KERNEL struct if_nameindex { - u_int if_index; /* 1, 2, ... */ + unsigned int if_index; /* 1, 2, ... */ char *if_name; /* null terminated name: "le0", ... */ }; __BEGIN_DECLS -u_int if_nametoindex(const char *); -char *if_indextoname(u_int, char *); +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 |