2018-04-07 07:03:14 -04:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
|
|
|
project(sngrep
|
|
|
|
VERSION 2.0.0
|
|
|
|
LANGUAGES C)
|
|
|
|
|
|
|
|
set(PROJECT_NAME sngrep)
|
2018-07-29 12:47:09 -04:00
|
|
|
set(CMAKE_C_STANDARD 11)
|
2018-07-29 12:08:55 -04:00
|
|
|
#add_compile_options(-Werror -g)
|
|
|
|
add_compile_options(-Werror -g -Wall -pedantic -Wextra)
|
2018-04-07 07:03:14 -04:00
|
|
|
|
|
|
|
configure_file(
|
2018-04-12 06:51:25 -04:00
|
|
|
${PROJECT_SOURCE_DIR}/src/config.h.cmake.in
|
2018-04-07 07:03:14 -04:00
|
|
|
${PROJECT_SOURCE_DIR}/src/config.h
|
|
|
|
)
|
|
|
|
|
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/src)
|
2018-07-29 04:57:34 -04:00
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/src/curses)
|
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/src/curses/widgets)
|
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/src/curses/screens)
|
2018-04-07 07:03:14 -04:00
|
|
|
|
|
|
|
set(SOURCES
|
2018-04-15 13:51:35 -04:00
|
|
|
src/packet/address.c
|
|
|
|
src/packet/packet.c
|
|
|
|
src/packet/parser.c
|
|
|
|
src/packet/dissectors/packet_link.c
|
|
|
|
src/packet/dissectors/packet_ip.c
|
|
|
|
src/packet/dissectors/packet_tcp.c
|
|
|
|
src/packet/dissectors/packet_udp.c
|
|
|
|
src/packet/dissectors/packet_sip.c
|
2018-04-20 14:16:46 -04:00
|
|
|
src/packet/dissectors/packet_sdp.c
|
2018-04-15 13:51:35 -04:00
|
|
|
src/packet/dissectors/packet_rtp.c
|
|
|
|
src/packet/dissectors/packet_rtcp.c
|
|
|
|
src/capture/capture.c
|
|
|
|
src/capture/capture_pcap.c
|
2018-04-21 06:40:39 -04:00
|
|
|
src/capture/capture_txt.c
|
2018-11-18 05:21:23 -05:00
|
|
|
src/ncurses/ui_manager.c
|
|
|
|
src/ncurses/ui_call_flow.c
|
|
|
|
src/ncurses/ui_call_list.c
|
|
|
|
src/ncurses/ui_call_raw.c
|
|
|
|
src/ncurses/ui_column_select.c
|
|
|
|
src/ncurses/ui_filter.c
|
|
|
|
src/ncurses/ui_msg_diff.c
|
|
|
|
src/ncurses/ui_save.c
|
|
|
|
src/ncurses/ui_settings.c
|
|
|
|
src/ncurses/ui_stats.c
|
|
|
|
src/ncurses/ui_panel.c
|
|
|
|
src/ncurses/keybinding.c
|
|
|
|
src/ncurses/scrollbar.c
|
2018-04-15 13:51:35 -04:00
|
|
|
src/filter.c
|
|
|
|
src/group.c
|
|
|
|
src/main.c
|
|
|
|
src/option.c
|
2018-04-20 17:45:14 -04:00
|
|
|
src/stream.c
|
2018-04-15 13:51:35 -04:00
|
|
|
src/setting.c
|
|
|
|
src/sip_attr.c
|
2018-04-20 14:28:45 -04:00
|
|
|
src/storage.c
|
2018-04-15 13:51:35 -04:00
|
|
|
src/sip_call.c
|
|
|
|
src/sip_msg.c
|
2018-04-21 19:28:45 -04:00
|
|
|
src/timeval.c
|
2018-04-15 13:51:35 -04:00
|
|
|
src/glib-utils.c
|
2018-04-07 07:03:14 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# HEP Support
|
2018-07-29 04:57:34 -04:00
|
|
|
option (USE_HEP "Enable EEP/HEP Support" OFF)
|
2018-04-13 16:12:52 -04:00
|
|
|
if (USE_HEP)
|
|
|
|
set(SOURCES ${SOURCES} src/capture/capture_hep.c)
|
|
|
|
endif (USE_HEP)
|
2018-04-07 07:03:14 -04:00
|
|
|
|
|
|
|
# IPv6 Support
|
|
|
|
option (USE_IPV6 "Enable IPv6 Support" ON)
|
|
|
|
|
|
|
|
# GnuTLS Support
|
2018-07-29 04:57:34 -04:00
|
|
|
option (WITH_SSL "Enable SSL Support (TLS SIP Transport)" OFF)
|
2018-04-16 17:43:33 -04:00
|
|
|
if (WITH_SSL)
|
2018-04-15 13:51:35 -04:00
|
|
|
set(SOURCES ${SOURCES} src/packet/dissectors/packet_tls.c)
|
2018-04-16 17:43:33 -04:00
|
|
|
endif(WITH_SSL)
|
2018-04-07 07:03:14 -04:00
|
|
|
|
|
|
|
######################################################################
|
|
|
|
add_executable(sngrep ${SOURCES})
|
|
|
|
target_link_libraries(sngrep pcap)
|
|
|
|
|
|
|
|
find_package(PkgConfig REQUIRED)
|
2018-07-29 04:57:34 -04:00
|
|
|
pkg_check_modules(CURSES REQUIRED ncursesw menuw panelw formw)
|
2018-04-07 07:03:14 -04:00
|
|
|
include_directories(${CURSES_INCLUDE_DIR})
|
2018-07-29 04:57:34 -04:00
|
|
|
target_link_libraries(sngrep ${CURSES_LIBRARIES} )
|
2018-04-07 07:03:14 -04:00
|
|
|
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(GLIB REQUIRED glib-2.0)
|
|
|
|
include_directories(${GLIB_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(sngrep ${GLIB_LIBRARIES})
|
|
|
|
|
2018-07-29 04:57:34 -04:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(GOBJECT REQUIRED gobject-2.0)
|
|
|
|
include_directories(${GOBJECT_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(sngrep ${GOBJECT_LIBRARIES})
|
|
|
|
|
2018-04-07 07:03:14 -04:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
find_package (Threads)
|
|
|
|
target_link_libraries (sngrep ${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
|
2018-04-16 17:43:33 -04:00
|
|
|
if (WITH_SSL)
|
2018-04-07 07:03:14 -04:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(GNUTLS REQUIRED gnutls)
|
|
|
|
include_directories(${GNUTLS_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(sngrep ${GNUTLS_LIBRARIES} gcrypt)
|
2018-04-16 17:43:33 -04:00
|
|
|
endif(WITH_SSL)
|
2018-04-07 07:03:14 -04:00
|
|
|
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
add_definitions(-D_GNU_SOURCE)
|
2018-07-29 04:57:34 -04:00
|
|
|
add_definitions(-D_XOPEN_SOURCE_EXTENDED)
|
|
|
|
|
|
|
|
######################################################################
|
2018-11-18 05:21:23 -05:00
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT src/ncurses/gnt/gntmarshal.h src/ncurses/gnt/gntmarshal.c
|
|
|
|
WORKING_DIRECTORY src/ncurses/gnt/
|
2018-07-29 04:57:34 -04:00
|
|
|
COMMAND glib-genmarshal --body --prefix=gnt_closure_marshal genmarshal > gntmarshal.c
|
|
|
|
COMMAND glib-genmarshal --header --prefix=gnt_closure_marshal genmarshal > gntmarshal.h
|
2018-11-18 05:21:23 -05:00
|
|
|
DEPENDS "src/ncurses/widgets/genmarshal"
|
2018-07-29 04:57:34 -04:00
|
|
|
VERBATIM
|
|
|
|
COMMENT "Generating GObject Marshal code...")
|
2018-04-07 07:03:14 -04:00
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Print Logo
|
|
|
|
option(DISPLAY_LOGO "Disable Irontec Logo from Summary menu" ON)
|
|
|
|
|
|
|
|
if (DISPLAY_LOGO)
|
|
|
|
message(" ")
|
|
|
|
message(" ██╗██████╗ ██████╗ ███╗ ██╗████████╗███████╗ ██████╗ ")
|
|
|
|
message(" ██║██╔══██╗██╔═══██╗████╗ ██║╚══██╔══╝██╔════╝██╔════╝ ")
|
|
|
|
message(" ██║██████╔╝██║ ██║██╔██╗ ██║ ██║ █████╗ ██║ ")
|
|
|
|
message(" ██║██╔══██╗██║ ██║██║╚██╗██║ ██║ ██╔══╝ ██║ ")
|
|
|
|
message(" ██║██║ ██║╚██████╔╝██║ ╚████║ ██║ ███████╗╚██████╗ ")
|
|
|
|
message(" ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚══════╝ ╚═════╝ ")
|
|
|
|
message(" ")
|
|
|
|
endif (DISPLAY_LOGO)
|
|
|
|
|
|
|
|
message(" ")
|
2018-04-16 17:43:33 -04:00
|
|
|
message(" sngrep configure finished ")
|
|
|
|
message(" ====================================================== ")
|
|
|
|
message(" SSL Support : ${WITH_SSL} ")
|
2018-07-29 04:57:34 -04:00
|
|
|
message(" HEP Support : ${USE_HEP} ")
|
2018-04-07 07:03:14 -04:00
|
|
|
message(" IPv6 Support : ${USE_IPV6} ")
|
2018-04-16 17:43:33 -04:00
|
|
|
message(" ====================================================== ")
|
2018-04-07 07:03:14 -04:00
|
|
|
message(" ")
|