use MACSTR and MAC2STR where appropriate

Replace capwap_printf_macaddress with MACSTR and MAC2STR
macro for all EUI48 MAC addresses. Save a text buffer in
the station structure and some buffers in functions.
This commit is contained in:
Andreas Schultz
2016-04-06 12:50:39 +02:00
parent f3fb11ac81
commit c132036914
9 changed files with 100 additions and 82 deletions

View File

@ -1,9 +1,6 @@
#ifndef __CAPWAP_DEBUG_HEADER__
#define __CAPWAP_DEBUG_HEADER__
#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
#ifdef DEBUG
#define ASSERT(expr) if (!(expr)) { log_printf(LOG_EMERG, "Assertion failed \'%s\': %s(%d)", #expr, __FILE__, __LINE__); capwap_exit(CAPWAP_ASSERT_CONDITION); }

View File

@ -1,6 +1,9 @@
#ifndef __CAPWAP_LOGGING_HEADER__
#define __CAPWAP_LOGGING_HEADER__
#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
#include <syslog.h>
#define LOG_TO_SYSLOG