diff options
| author | Sam Leffler <sam@FreeBSD.org> | 2006-07-17 02:38:17 +0000 |
|---|---|---|
| committer | Sam Leffler <sam@FreeBSD.org> | 2006-07-17 02:38:17 +0000 |
| commit | d3fb7a30d3d11070ecf6edc35739256d75d4d8f0 (patch) | |
| tree | 4ff4cc9a47bced0a8023240314f8a216c104d49a /tools | |
| parent | f14ec548440a4aee3b50373fc81701f3fec63b94 (diff) | |
Notes
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/tools/net80211/wlanwatch/wlanwatch.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/tools/tools/net80211/wlanwatch/wlanwatch.c b/tools/tools/net80211/wlanwatch/wlanwatch.c index c169f996c6e4..1501d211df4b 100644 --- a/tools/tools/net80211/wlanwatch/wlanwatch.c +++ b/tools/tools/net80211/wlanwatch/wlanwatch.c @@ -53,7 +53,13 @@ #include <netinet/in.h> #include <netinet/if_ether.h> #include <netatalk/at.h> +#ifdef __NetBSD__ +#include <net80211/ieee80211_netbsd.h> +#elif __FreeBSD__ #include <net80211/ieee80211_freebsd.h> +#else +#error "No support for your operating system!" +#endif #include <arpa/inet.h> #include <netdb.h> @@ -235,6 +241,19 @@ routename(sa) return (line); } +#ifndef SA_SIZE +/* + * This macro returns the size of a struct sockaddr when passed + * through a routing socket. Basically we round up sa_len to + * a multiple of sizeof(long), with a minimum of sizeof(long). + * The check for a NULL pointer is just a convenience, probably never used. + * The case sa_len == 0 should only apply to empty structures. + */ +#define SA_SIZE(sa) \ + ( (!(sa) || ((struct sockaddr *)(sa))->sa_len == 0) ? \ + sizeof(long) : \ + 1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) ) +#endif static void pmsg_addrs(char *cp, int addrs) @@ -339,8 +358,9 @@ print_rtmsg(struct rt_msghdr *rtm, int msglen) case RTM_IEEE80211_JOIN: case RTM_IEEE80211_REJOIN: printf("%s station %sjoin", - ifan->ifan_what == RTM_IEEE80211_REJOIN ? "re" : "", - ether_sprintf(V(ieee80211_join_event)->iev_addr)); + ether_sprintf(V(ieee80211_join_event)->iev_addr), + ifan->ifan_what == RTM_IEEE80211_REJOIN ? "re" : "" + ); break; case RTM_IEEE80211_LEAVE: printf("%s station leave", |
