#ifndef __CAPWAP_HEADER__ #define __CAPWAP_HEADER__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Endian */ #if __BYTE_ORDER == __BIG_ENDIAN #define CAPWAP_BIG_ENDIAN #else #define CAPWAP_LITTLE_ENDIAN #endif /* Min & Max */ #ifndef max #define max(a,b) ((a) >= (b) ? (a) : (b)) #endif #ifndef min #define min(a,b) ((a) <= (b) ? (a) : (b)) #endif /* Opaque type */ #define DECLARE_OPAQUE_TYPE(name) struct name##__opaque__ { int unused; }; typedef struct name##__opaque__* name /* UDPLite */ #ifdef HAVE_NETINET_UDPLITE_H #include #else #ifndef IPPROTO_UDPLITE #define IPPROTO_UDPLITE 136 #endif #ifndef SOL_UDPLITE #define SOL_UDPLITE 136 #endif #ifndef UDPLITE_SEND_CSCOV #define UDPLITE_SEND_CSCOV 10 #endif #endif /* standard include */ #include "rfc.h" #include "logging.h" #include "debug.h" #include "error.h" /* Helper exit */ void capwap_exit(int errorcode); /* Random generator */ void capwap_init_rand(void); int capwap_get_rand(int max); /* */ void capwap_daemon(void); /* */ #define capwap_outofmemory() do { \ log_printf(LOG_EMERG, "Out of memory %s(%d)", __FILE__, __LINE__); \ capwap_exit(CAPWAP_OUT_OF_MEMORY); \ } while(0) /* Helper buffer copy */ char* capwap_duplicate_string(const char* source); void* capwap_clone(const void* buffer, int buffersize); /* */ char* capwap_itoa(int input, char* output); char* capwap_ltoa(long input, char* output); #endif /* __CAPWAP_HEADER__ */