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)
|
2019-01-03 10:02:12 -05:00
|
|
|
add_compile_options(-Wall -pedantic -Wextra)
|
2018-04-07 07:03:14 -04:00
|
|
|
|
|
|
|
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 08:26:27 -05:00
|
|
|
src/ncurses/manager.c
|
2018-11-19 11:51:01 -05:00
|
|
|
src/ncurses/windows/call_flow_win.c
|
|
|
|
src/ncurses/windows/call_list_win.c
|
|
|
|
src/ncurses/windows/call_raw_win.c
|
|
|
|
src/ncurses/windows/column_select_win.c
|
|
|
|
src/ncurses/windows/filter_win.c
|
|
|
|
src/ncurses/windows/msg_diff_win.c
|
|
|
|
src/ncurses/windows/save_win.c
|
|
|
|
src/ncurses/windows/settings_win.c
|
|
|
|
src/ncurses/windows/stats_win.c
|
2018-11-26 06:18:52 -05:00
|
|
|
src/ncurses/windows/auth_validate_win.c
|
2018-11-18 08:26:27 -05:00
|
|
|
src/ncurses/window.c
|
2018-12-16 04:20:08 -05:00
|
|
|
src/ncurses/dialog.c
|
2018-11-18 05:21:23 -05:00
|
|
|
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
|
2018-04-20 17:45:14 -04:00
|
|
|
src/stream.c
|
2018-04-15 13:51:35 -04:00
|
|
|
src/setting.c
|
2018-11-18 08:09:57 -05:00
|
|
|
src/attribute.c
|
2018-04-20 14:28:45 -04:00
|
|
|
src/storage.c
|
2018-11-18 08:13:57 -05:00
|
|
|
src/call.c
|
|
|
|
src/message.c
|
2018-04-21 19:28:45 -04:00
|
|
|
src/timeval.c
|
2018-12-06 08:19:09 -05:00
|
|
|
src/glib-extra.c
|
2018-04-07 07:03:14 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# HEP Support
|
2018-11-23 06:00:12 -05:00
|
|
|
option (USE_HEP "Enable HEP Support" ON)
|
2018-04-13 16:12:52 -04:00
|
|
|
if (USE_HEP)
|
|
|
|
set(SOURCES ${SOURCES} src/capture/capture_hep.c)
|
2018-11-22 13:51:29 -05:00
|
|
|
set(SOURCES ${SOURCES} src/packet/dissectors/packet_hep.c)
|
2018-04-13 16:12:52 -04:00
|
|
|
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)
|
2019-01-03 10:02:12 -05:00
|
|
|
include_directories(${CURSES_INCLUDE_DIRS})
|
|
|
|
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-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
|
|
|
|
2018-12-09 08:11:37 -05:00
|
|
|
configure_file(
|
|
|
|
${PROJECT_SOURCE_DIR}/src/config.h.cmake
|
|
|
|
${PROJECT_SOURCE_DIR}/src/config.h
|
|
|
|
)
|
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-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(" ")
|