@ -50,7 +50,7 @@ if(N2N_OPTION_USE_PTHREAD)
if ( NOT PTHREAD_LIB )
if ( NOT PTHREAD_LIB )
MESSAGE ( FATAL_ERROR "libpthread not found." )
MESSAGE ( FATAL_ERROR "libpthread not found." )
endif ( NOT PTHREAD_LIB )
endif ( NOT PTHREAD_LIB )
MESSAGE ( INFO "Using libpthread." )
MESSAGE ( STATUS "Using libpthread." )
ADD_DEFINITIONS ( "-DHAVE_PTHREAD" )
ADD_DEFINITIONS ( "-DHAVE_PTHREAD" )
endif ( N2N_OPTION_USE_PTHREAD )
endif ( N2N_OPTION_USE_PTHREAD )
@ -69,54 +69,49 @@ if(N2N_OPTION_USE_OPENSSL)
endif ( N2N_OPTION_USE_OPENSSL )
endif ( N2N_OPTION_USE_OPENSSL )
if ( N2N_OPTION_USE_ZSTD )
if ( N2N_OPTION_USE_ZSTD )
# T O D O : t h e find_library ( ) c a l l w o r k s f o r s o m e o f t h e c o n f i g , b u t n o t o t h e r s
find_library ( LIBZSTD zstd )
# find_library ( LIBZSTD libzstd )
if ( NOT LIBZSTD )
# if ( NOT LIBZSTD )
MESSAGE ( FATAL_ERROR "libzstd not found." )
# MESSAGE ( FATAL_ERROR "libzstd not found." )
endif ( NOT LIBZSTD )
# endif ( NOT LIBZSTD )
MESSAGE ( STATUS "Using libztd." )
MESSAGE ( INFO "Using libztd." )
add_definitions ( -DN2N_HAVE_ZSTD )
add_definitions ( -DN2N_HAVE_ZSTD )
endif ( N2N_OPTION_USE_ZSTD )
endif ( N2N_OPTION_USE_ZSTD )
if ( N2N_OPTION_USE_PCAPLIB )
if ( N2N_OPTION_USE_PCAPLIB )
# T O D O : t h e find_library ( ) c a l l w o r k s f o r s o m e o f t h e c o n f i g , b u t n o t o t h e r s
find_library ( PCAP_LIB pcap )
# find_library ( PCAP_LIB pcap )
if ( NOT PCAP_LIB )
# if ( NOT PCAP_LIB )
MESSAGE ( FATAL_ERROR "libpcap not found." )
# MESSAGE ( FATAL_ERROR "libpcap not found." )
endif ( NOT PCAP_LIB )
# endif ( NOT PCAP_LIB )
# S e t v a r n e e d e d f o r check_function_exists ( )
set ( CMAKE_REQUIRED_LIBRARIES ${ PCAP_LIB } )
# T O D O
# T O D O
# - t h i s i s d i f f e r e n t t o t h e c o n f i g u r e . a c l o g i c
# - p c a p _ s e t _ i m m e d i a t e _ m o d e h a s b e e n a v a i l a b l e s i n c e l i b p c a p 1 . 5 i n 2 0 1 3
# p r o b a b l y s h o u l d r e m o v e t h i s c h e c k
check_function_exists ( pcap_set_immediate_mode HAVE_PCAP_IMMEDIATE_MODE )
check_function_exists ( pcap_set_immediate_mode HAVE_PCAP_IMMEDIATE_MODE )
IF ( NOT HAVE_PCAP_IMMEDIATE_MODE )
IF ( NOT HAVE_PCAP_IMMEDIATE_MODE )
MESSAGE ( FATAL_ERROR "libpcap not support pcap_set_immediate_mode()" )
MESSAGE ( FATAL_ERROR "libpcap not support pcap_set_immediate_mode()" )
ENDIF ( NOT HAVE_PCAP_IMMEDIATE_MODE )
ENDIF ( NOT HAVE_PCAP_IMMEDIATE_MODE )
MESSAGE ( INFO "Using libpcap." )
MESSAGE ( STATUS "Using libpcap." )
ADD_DEFINITIONS ( "-DHAVE_PCAP_IMMEDIATE_MODE" )
ADD_DEFINITIONS ( "-DHAVE_PCAP_IMMEDIATE_MODE" )
add_executable ( n2n-decode tools/n2n-decode.c )
add_executable ( n2n-decode tools/n2n-decode.c )
target_link_libraries ( n2n-decode n2n pcap )
target_link_libraries ( n2n-decode n2n pcap )
install ( TARGETS n2n-decode RUNTIME DESTINATION bin )
install ( TARGETS n2n-decode RUNTIME DESTINATION bin )
# T O D O :
# - T h i s v a r i a b l e i s a l s o s e t e l s e w h e r e , I d o n t t h i n k i t w o r k s t h i s w a y
set ( CMAKE_REQUIRED_LIBRARIES ${ PCAP_LIB } )
endif ( N2N_OPTION_USE_PCAPLIB )
endif ( N2N_OPTION_USE_PCAPLIB )
if ( N2N_OPTION_USE_CAPLIB )
if ( N2N_OPTION_USE_CAPLIB )
# L i n u x C a p a b i l i t i e s
# L i n u x C a p a b i l i t i e s
# T O D O : t h e find_library ( ) c a l l w o r k s f o r s o m e o f t h e c o n f i g , b u t n o t o t h e r s
find_library ( CAP_LIB cap )
# find_library ( CAP_LIB cap )
if ( NOT CAP_LIB )
# if ( NOT CAP_LIB )
MESSAGE ( FATAL_ERROR "libcap not found." )
# MESSAGE ( FATAL_ERROR "libcap not found." )
endif ( NOT CAP_LIB )
# endif ( NOT CAP_LIB )
MESSAGE ( STATUS "Using libcap." )
MESSAGE ( INFO "Using libpcap." )
ADD_DEFINITIONS ( "-DHAVE_LIBCAP" )
ADD_DEFINITIONS ( "-DHAVE_LIBCAP" )
# T O D O :
# - T h i s v a r i a b l e i s a l s o s e t e l s e w h e r e , I d o n t t h i n k i t w o r k s t h i s w a y
set ( CMAKE_REQUIRED_LIBRARIES ${ CAP_LIB } )
endif ( N2N_OPTION_USE_CAPLIB )
endif ( N2N_OPTION_USE_CAPLIB )
if ( N2N_OPTION_USE_PORTMAPPING )
if ( N2N_OPTION_USE_PORTMAPPING )