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] [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] [source:mcast]
load = libf2b_source_mcast.so load = f2b/sources/mcast.so
; group = 239.255.186.1 ; group = 239.255.186.1
; port = 3370 ; port = 3370
; bind = 0.0.0.0 ; bind = 0.0.0.0

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

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

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

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

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

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

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

@ -1,5 +1,5 @@
[backend:exec-ipset] [backend:exec-ipset]
load = libf2b_backend_exec.so load = f2b/backends/exec.so
start = /sbin/ipset -! create <ID> hash:ip start = /sbin/ipset -! create <ID> hash:ip
start = /sbin/iptables -I INPUT -m set --match-set <ID> src -j DROP 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 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] [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] [backend:mcast]
load = libf2b_backend_mcast.so load = f2b/backends/mcast.so
; group = 239.255.186.1 ; group = 239.255.186.1
; port = 3370 ; port = 3370

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

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

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

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

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

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

30
src/backends/CMakeLists.txt

@ -1,30 +1,34 @@
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
unset(CMAKE_SHARED_MODULE_PREFIX)
set(BACKENDS "") set(BACKENDS "")
add_library("f2b_backend_exec" MODULE "exec.c" "../strlcpy.c") add_library("b_exec" MODULE "exec.c" "../strlcpy.c")
list(APPEND BACKENDS "f2b_backend_exec") list(APPEND BACKENDS "exec")
if (WITH_MCAST) 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") "../commands.c" "../cmsg.c" "../csocket.c")
list(APPEND BACKENDS "f2b_backend_mcast") list(APPEND BACKENDS "mcast")
endif () endif ()
find_library(REDIS_FOUND "hiredis") find_library(REDIS_FOUND "hiredis")
if (WITH_REDIS AND REDIS_FOUND) if (WITH_REDIS AND REDIS_FOUND)
add_library("f2b_backend_redis" MODULE "redis.c" "../strlcpy.c") add_library("b_redis" MODULE "redis.c" "../strlcpy.c")
target_link_libraries("f2b_backend_redis" "hiredis") target_link_libraries("b_redis" "hiredis")
list(APPEND BACKENDS "f2b_backend_redis") list(APPEND BACKENDS "redis")
endif () endif ()
find_library(IPSET_FOUND "ipset") find_library(IPSET_FOUND "ipset")
if (WITH_IPSET AND IPSET_FOUND) if (WITH_IPSET AND IPSET_FOUND)
add_library("f2b_backend_ipset" MODULE "ipset.c" "../strlcpy.c") add_library("b_ipset" MODULE "ipset.c" "../strlcpy.c")
target_link_libraries("f2b_backend_ipset" "ipset") target_link_libraries("b_ipset" "ipset")
list(APPEND BACKENDS "f2b_backend_ipset") list(APPEND BACKENDS "ipset")
endif () 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} message(STATUS "- Backends : ${BACKENDS}")
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

20
src/filters/CMakeLists.txt

@ -1,17 +1,21 @@
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
unset(CMAKE_SHARED_MODULE_PREFIX)
set(FILTERS "") set(FILTERS "")
add_library("f2b_filter_preg" MODULE "preg.c" "../strlcpy.c") add_library("f_preg" MODULE "preg.c" "../strlcpy.c")
list(APPEND FILTERS "f2b_filter_preg") list(APPEND FILTERS "preg")
find_library(PCRE_FOUND "pcre") find_library(PCRE_FOUND "pcre")
if (WITH_PCRE AND PCRE_FOUND) if (WITH_PCRE AND PCRE_FOUND)
add_library("f2b_filter_pcre" MODULE "pcre.c" "../strlcpy.c") add_library("f_pcre" MODULE "pcre.c" "../strlcpy.c")
target_link_libraries("f2b_filter_pcre" "pcre") target_link_libraries("f_pcre" "pcre")
list(APPEND FILTERS "f2b_filter_pcre") list(APPEND FILTERS "pcre")
endif () 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} message(STATUS "- Filters : ${FILTERS}")
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

28
src/sources/CMakeLists.txt

@ -1,26 +1,30 @@
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
unset(CMAKE_SHARED_MODULE_PREFIX)
set(SOURCES "") set(SOURCES "")
add_library("f2b_source_files" MODULE "files.c" "../strlcpy.c") add_library("s_files" MODULE "files.c" "../strlcpy.c")
list(APPEND SOURCES "f2b_source_files") list(APPEND SOURCES "files")
add_library("f2b_source_portknock" MODULE "portknock.c" "../strlcpy.c") add_library("s_portknock" MODULE "portknock.c" "../strlcpy.c")
list(APPEND SOURCES "f2b_source_portknock") list(APPEND SOURCES "portknock")
if (WITH_MCAST) 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") "../commands.c" "../cmsg.c" "../csocket.c")
list(APPEND SOURCES "f2b_source_mcast") list(APPEND SOURCES "mcast")
endif () endif ()
find_library(REDIS_FOUND "hiredis") find_library(REDIS_FOUND "hiredis")
if (WITH_REDIS AND REDIS_FOUND) if (WITH_REDIS AND REDIS_FOUND)
add_library("f2b_source_redis" MODULE "redis.c" "../strlcpy.c") add_library("s_redis" MODULE "redis.c" "../strlcpy.c")
target_link_libraries("f2b_source_redis" "hiredis") target_link_libraries("s_redis" "hiredis")
list(APPEND SOURCES "f2b_source_redis") list(APPEND SOURCES "redis")
endif () 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} message(STATUS "- Sources : ${SOURCES}")
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

Loading…
Cancel
Save