Browse Source

* change modules naming & location

master
Alex 'AdUser' Z 8 years ago
parent
commit
f7551113d8
  1. 2
      configs/conf-available/05-source-files.conf
  2. 2
      configs/conf-available/05-source-mcast.conf
  3. 2
      configs/conf-available/05-source-portknock.conf
  4. 2
      configs/conf-available/05-source-redis.conf
  5. 2
      configs/conf-available/10-backend-exec-ipfw.conf
  6. 2
      configs/conf-available/10-backend-exec-ipset.conf
  7. 2
      configs/conf-available/10-backend-ipset.conf
  8. 2
      configs/conf-available/10-backend-mcast.conf
  9. 2
      configs/conf-available/10-backend-redis.conf
  10. 2
      configs/conf-available/15-filter-pcre.conf
  11. 2
      configs/conf-available/15-filter-preg.conf
  12. 30
      src/backends/CMakeLists.txt
  13. 20
      src/filters/CMakeLists.txt
  14. 28
      src/sources/CMakeLists.txt

2
configs/conf-available/05-source-files.conf

@ -1,2 +1,2 @@
[source:files]
load = libf2b_source_files.so
load = f2b/sources/files.so

2
configs/conf-available/05-source-mcast.conf

@ -1,5 +1,5 @@
[source:mcast]
load = libf2b_source_mcast.so
load = f2b/sources/mcast.so
; group = 239.255.186.1
; port = 3370
; bind = 0.0.0.0

2
configs/conf-available/05-source-portknock.conf

@ -1,5 +1,5 @@
[source:portknock]
load = libf2b_source_portknock.so
load = f2b/sources/portknock.so
; listen = 0.0.0.0:23 # telnet
; listen = 0.0.0.0:5060 # sip
; listen = 0.0.0.0:6667 # irc

2
configs/conf-available/05-source-redis.conf

@ -1,5 +1,5 @@
[source:redis]
load = libf2b_source_redis.so
load = f2b/sources/redis.so
timeout = 2
host = 127.0.0.1
port = 6379

2
configs/conf-available/10-backend-exec-ipfw.conf

@ -1,5 +1,5 @@
[backend:exec-ipfw]
load = libf2b_backend_exec.so
load = f2b/backends/exec.so
ban = /sbin/ipfw table <ID> add <IP>
unban = /sbin/ipfw table <ID> delete <IP>
timeout = 2

2
configs/conf-available/10-backend-exec-ipset.conf

@ -1,5 +1,5 @@
[backend:exec-ipset]
load = libf2b_backend_exec.so
load = f2b/backends/exec.so
start = /sbin/ipset -! create <ID> hash:ip
start = /sbin/iptables -I INPUT -m set --match-set <ID> src -j DROP
stop = /sbin/iptables -D INPUT -m set --match-set <ID> src -j DROP

2
configs/conf-available/10-backend-ipset.conf

@ -1,2 +1,2 @@
[backend:ipset]
load = libf2b_backend_ipset.so
load = f2b/backends/ipset.so

2
configs/conf-available/10-backend-mcast.conf

@ -1,4 +1,4 @@
[backend:mcast]
load = libf2b_backend_mcast.so
load = f2b/backends/mcast.so
; group = 239.255.186.1
; port = 3370

2
configs/conf-available/10-backend-redis.conf

@ -1,5 +1,5 @@
[backend:redis]
load = libf2b_backend_redis.so
load = f2b/backends/redis.so
shared = yes
timeout = 2
ping = 5

2
configs/conf-available/15-filter-pcre.conf

@ -1,5 +1,5 @@
[filter:pcre]
load = libf2b_filter_pcre.so
load = f2b/filters/pcre.so
icase = yes
study = yes
usejit = no

2
configs/conf-available/15-filter-preg.conf

@ -1,3 +1,3 @@
[filter:preg]
load = libf2b_filter_preg.so
load = f2b/filters/preg.so
icase = yes

30
src/backends/CMakeLists.txt

@ -1,30 +1,34 @@
set(CMAKE_INCLUDE_CURRENT_DIR ON)
unset(CMAKE_SHARED_MODULE_PREFIX)
set(BACKENDS "")
add_library("f2b_backend_exec" MODULE "exec.c" "../strlcpy.c")
list(APPEND BACKENDS "f2b_backend_exec")
add_library("b_exec" MODULE "exec.c" "../strlcpy.c")
list(APPEND BACKENDS "exec")
if (WITH_MCAST)
add_library("f2b_backend_mcast" MODULE "mcast.c" "../strlcpy.c"
add_library("b_mcast" MODULE "mcast.c" "../strlcpy.c"
"../commands.c" "../cmsg.c" "../csocket.c")
list(APPEND BACKENDS "f2b_backend_mcast")
list(APPEND BACKENDS "mcast")
endif ()
find_library(REDIS_FOUND "hiredis")
if (WITH_REDIS AND REDIS_FOUND)
add_library("f2b_backend_redis" MODULE "redis.c" "../strlcpy.c")
target_link_libraries("f2b_backend_redis" "hiredis")
list(APPEND BACKENDS "f2b_backend_redis")
add_library("b_redis" MODULE "redis.c" "../strlcpy.c")
target_link_libraries("b_redis" "hiredis")
list(APPEND BACKENDS "redis")
endif ()
find_library(IPSET_FOUND "ipset")
if (WITH_IPSET AND IPSET_FOUND)
add_library("f2b_backend_ipset" MODULE "ipset.c" "../strlcpy.c")
target_link_libraries("f2b_backend_ipset" "ipset")
list(APPEND BACKENDS "f2b_backend_ipset")
add_library("b_ipset" MODULE "ipset.c" "../strlcpy.c")
target_link_libraries("b_ipset" "ipset")
list(APPEND BACKENDS "ipset")
endif ()
message(STATUS "- Backends : ${BACKENDS}")
set(LIB_PATH "${CMAKE_INSTALL_LIBDIR}/f2b/backends")
foreach (BACKEND IN LISTS BACKENDS)
set_target_properties("b_${BACKEND}" PROPERTIES OUTPUT_NAME ${BACKEND})
install(TARGETS "b_${BACKEND}" LIBRARY DESTINATION ${LIB_PATH})
endforeach ()
install(TARGETS ${BACKENDS}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
message(STATUS "- Backends : ${BACKENDS}")

20
src/filters/CMakeLists.txt

@ -1,17 +1,21 @@
set(CMAKE_INCLUDE_CURRENT_DIR ON)
unset(CMAKE_SHARED_MODULE_PREFIX)
set(FILTERS "")
add_library("f2b_filter_preg" MODULE "preg.c" "../strlcpy.c")
list(APPEND FILTERS "f2b_filter_preg")
add_library("f_preg" MODULE "preg.c" "../strlcpy.c")
list(APPEND FILTERS "preg")
find_library(PCRE_FOUND "pcre")
if (WITH_PCRE AND PCRE_FOUND)
add_library("f2b_filter_pcre" MODULE "pcre.c" "../strlcpy.c")
target_link_libraries("f2b_filter_pcre" "pcre")
list(APPEND FILTERS "f2b_filter_pcre")
add_library("f_pcre" MODULE "pcre.c" "../strlcpy.c")
target_link_libraries("f_pcre" "pcre")
list(APPEND FILTERS "pcre")
endif ()
message(STATUS "- Filters : ${FILTERS}")
set(LIB_PATH "${CMAKE_INSTALL_LIBDIR}/f2b/filters")
foreach (FILTER IN LISTS FILTERS)
set_target_properties("f_${FILTER}" PROPERTIES OUTPUT_NAME ${FILTER})
install(TARGETS "f_${FILTER}" LIBRARY DESTINATION ${LIB_PATH})
endforeach ()
install(TARGETS ${FILTERS}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
message(STATUS "- Filters : ${FILTERS}")

28
src/sources/CMakeLists.txt

@ -1,26 +1,30 @@
set(CMAKE_INCLUDE_CURRENT_DIR ON)
unset(CMAKE_SHARED_MODULE_PREFIX)
set(SOURCES "")
add_library("f2b_source_files" MODULE "files.c" "../strlcpy.c")
list(APPEND SOURCES "f2b_source_files")
add_library("s_files" MODULE "files.c" "../strlcpy.c")
list(APPEND SOURCES "files")
add_library("f2b_source_portknock" MODULE "portknock.c" "../strlcpy.c")
list(APPEND SOURCES "f2b_source_portknock")
add_library("s_portknock" MODULE "portknock.c" "../strlcpy.c")
list(APPEND SOURCES "portknock")
if (WITH_MCAST)
add_library("f2b_source_mcast" MODULE "mcast.c" "../strlcpy.c"
add_library("s_mcast" MODULE "mcast.c" "../strlcpy.c"
"../commands.c" "../cmsg.c" "../csocket.c")
list(APPEND SOURCES "f2b_source_mcast")
list(APPEND SOURCES "mcast")
endif ()
find_library(REDIS_FOUND "hiredis")
if (WITH_REDIS AND REDIS_FOUND)
add_library("f2b_source_redis" MODULE "redis.c" "../strlcpy.c")
target_link_libraries("f2b_source_redis" "hiredis")
list(APPEND SOURCES "f2b_source_redis")
add_library("s_redis" MODULE "redis.c" "../strlcpy.c")
target_link_libraries("s_redis" "hiredis")
list(APPEND SOURCES "redis")
endif ()
message(STATUS "- Sources : ${SOURCES}")
set(LIB_PATH "${CMAKE_INSTALL_LIBDIR}/f2b/sources")
foreach (SOURCE IN LISTS SOURCES)
set_target_properties("s_${SOURCE}" PROPERTIES OUTPUT_NAME ${SOURCE})
install(TARGETS "s_${SOURCE}" LIBRARY DESTINATION ${LIB_PATH})
endforeach ()
install(TARGETS ${SOURCES}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
message(STATUS "- Sources : ${SOURCES}")

Loading…
Cancel
Save