2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 13:37:55 +00:00

[#3730] Added generate messages

This commit is contained in:
Francis Dupont
2025-02-19 22:51:36 +01:00
committed by Andrei Pavel
parent 411249c0fd
commit 60b424b8d1
30 changed files with 383 additions and 5 deletions

View File

@@ -669,6 +669,7 @@ config_report = custom_target(
#### Build Starts Here
LIBS_BUILT_SO_FAR = []
TARGETS_GEN_MESSAGES = []
subdir('tools')
subdir('src')
subdir('fuzz')
@@ -677,4 +678,17 @@ if have_premium
subdir('premium')
endif
alias_target('all-targets-gen-messages', TARGETS_GEN_MESSAGES)
top_docs = [
'AUTHORS',
'COPYING',
'ChangeLog',
'README',
'CONTRIBUTING.md',
'SECURITY.md',
'platforms.rst',
'code_of_conduct.md',
]
install_data(top_docs, install_dir: 'share/doc/kea')
install_emptydir('var/run/kea')

View File

@@ -24,3 +24,12 @@ executable(
link_with: [agent_lib] + LIBS_BUILT_SO_FAR,
)
subdir('tests')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-bin-agent-ca_messages',
command: [kea_msg_compiler, f'@current_source_dir@/ca_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -23,3 +23,12 @@ executable(
link_with: [dhcp4_lib] + LIBS_BUILT_SO_FAR,
)
subdir('tests')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-bin-dhcp4-dhcp4_messages',
command: [kea_msg_compiler, f'@current_source_dir@/dhcp4_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -24,3 +24,12 @@ executable(
link_with: [dhcp6_lib] + LIBS_BUILT_SO_FAR,
)
subdir('tests')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-bin-dhcp6-dhcp6_messages',
command: [kea_msg_compiler, f'@current_source_dir@/dhcp6_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -14,3 +14,12 @@ executable(
link_with: [lfc_lib] + LIBS_BUILT_SO_FAR,
)
subdir('tests')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-bin-lfc-lfc_messages',
command: [kea_msg_compiler, f'@current_source_dir@/lfc_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -37,3 +37,15 @@ executable(
)
subdir('tests')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-bin-netconf-netconf_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/netconf_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -16,3 +16,12 @@ dhcp_bootp_archive = static_library(
)
subdir('libloadtests')
subdir('tests')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-hooks-dhcp-bootp-bootp_messages',
command: [kea_msg_compiler, f'@current_source_dir@/bootp_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -18,3 +18,15 @@ dhcp_flex_option_archive = static_library(
)
subdir('libloadtests')
subdir('tests')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-hooks-dhcp-flex_option-flex_option_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/flex_option_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -27,3 +27,12 @@ dhcp_ha_archive = static_library(
)
subdir('libloadtests')
subdir('tests')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-hooks-dhcp-high_availability-ha_messages',
command: [kea_msg_compiler, f'@current_source_dir@/ha_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -20,3 +20,15 @@ dhcp_lease_cmds_archive = static_library(
)
subdir('libloadtests')
subdir('tests')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-hooks-dhcp-lease_cmds-lease_cmds_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/lease_cmds_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -30,3 +30,31 @@ dhcp_mysql_archive = static_library(
)
subdir('libloadtests')
subdir('tests')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-hooks-dhcp-mysql-mysql_cb_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/mysql_cb_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
target_gen_messages = run_target(
'src-hooks-dhcp-mysql-mysql_hb_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/mysql_hb_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
target_gen_messages = run_target(
'src-hooks-dhcp-mysql-mysql_lb_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/mysql_lb_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -23,3 +23,15 @@ dhcp_perfmon_archive = static_library(
)
subdir('libloadtests')
subdir('tests')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-hooks-dhcp-perfmon-perfmon_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/perfmon_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -30,3 +30,31 @@ dhcp_pgsql_archive = static_library(
)
subdir('libloadtests')
subdir('tests')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-hooks-dhcp-pgsql-pgsql_cb_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/pgsql_cb_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
target_gen_messages = run_target(
'src-hooks-dhcp-pgsql-pgsql_hb_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/pgsql_hb_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
target_gen_messages = run_target(
'src-hooks-dhcp-pgsql-pgsql_lb_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/pgsql_lb_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -19,3 +19,15 @@ dhcp_run_script_archive = static_library(
# Do tests first
subdir('tests')
subdir('libloadtests')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-hooks-dhcp-run_script-run_script_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/run_script_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -18,3 +18,14 @@ dhcp_stat_cmds_archive = static_library(
)
subdir('libloadtests')
subdir('tests')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-hooks-dhcp-stat_cmds-stat_cmds_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/stat_cmds_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -22,3 +22,15 @@ dhcp_user_chk_archive = static_library(
objects: dhcp_user_chk_lib.extract_all_objects(recursive: false),
)
subdir('tests')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-hooks-dhcp-user_chk-user_chk_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/user_chk_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -12,3 +12,15 @@ LIBS_BUILT_SO_FAR = [kea_asiodns_lib] + LIBS_BUILT_SO_FAR
subdir('tests')
kea_asiodns_headers = ['asiodns_messages.h', 'io_fetch.h', 'logger.h']
install_headers(kea_asiodns_headers, preserve_path: true, subdir: 'kea/asiodns')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-lib-asiodns-asiodns_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/asiodns_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -41,3 +41,12 @@ kea_config_headers = [
'unix_command_mgr.h',
]
install_headers(kea_config_headers, preserve_path: true, subdir: 'kea/config')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-lib-config-config_messages',
command: [kea_msg_compiler, f'@current_source_dir@/config_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -34,3 +34,12 @@ kea_d2srv_headers = [
'nc_trans.h',
]
install_headers(kea_d2srv_headers, preserve_path: true, subdir: 'kea/d2srv')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-lib-d2srv-d2_messages',
command: [kea_msg_compiler, f'@current_source_dir@/d2_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -34,3 +34,12 @@ install_headers(
preserve_path: true,
subdir: 'kea/database',
)
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-lib-database-db_messages',
command: [kea_msg_compiler, f'@current_source_dir@/db_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -24,3 +24,15 @@ install_headers(
preserve_path: true,
subdir: 'kea/dhcp_ddns',
)
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-lib-dhcp_ddns-dhcp_ddns_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/dhcp_ddns_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -205,3 +205,33 @@ kea_dhcpsrv_headers = [
'writable_host_data_source.h',
]
install_headers(kea_dhcpsrv_headers, preserve_path: true, subdir: 'kea/dhcpsrv')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-lib-dhcpsrv-alloc_engine_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/alloc_engine_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
target_gen_messages = run_target(
'src-lib-dhcpsrv-dhcpsrv_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/dhcpsrv_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
target_gen_messages = run_target(
'src-lib-dhcpsrv-hosts_messages',
command: [kea_msg_compiler, f'@current_source_dir@/hosts_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
target_gen_messages = run_target(
'src-lib-dhcpsrv-fuzz_messages',
command: [kea_msg_compiler, f'@current_source_dir@/fuzz_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -26,3 +26,12 @@ kea_eval_headers = [
'token.h',
]
install_headers(kea_eval_headers, preserve_path: true, subdir: 'kea/eval')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-lib-eval-eval_messages',
command: [kea_msg_compiler, f'@current_source_dir@/eval_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -40,3 +40,12 @@ kea_hooks_headers = [
'server_hooks.h',
]
install_headers(kea_hooks_headers, preserve_path: true, subdir: 'kea/hooks')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-lib-hooks-hooks_messages',
command: [kea_msg_compiler, f'@current_source_dir@/hooks_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -68,3 +68,17 @@ kea_http_headers = [
'url.h',
]
install_headers(kea_http_headers, preserve_path: true, subdir: 'kea/http')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-lib-http-auth_messages',
command: [kea_msg_compiler, f'@current_source_dir@/auth_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
target_gen_messages = run_target(
'src-lib-http-http_messages',
command: [kea_msg_compiler, f'@current_source_dir@/http_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -1,6 +1,13 @@
executable('kea-msg-compiler',
'message.cc',
include_directories: [include_directories('.')] + INCLUDES,
link_with : LIBS_BUILT_SO_FAR,
install : true,
if meson.is_cross_build()
HAS_KEA_MSG_COMPILER = false
subdir_done()
endif
kea_msg_compiler = executable(
'kea-msg-compiler',
'message.cc',
include_directories: INCLUDES,
install_dir: 'bin',
link_with: LIBS_BUILT_SO_FAR,
)
HAS_KEA_MSG_COMPILER = true

View File

@@ -27,6 +27,7 @@ kea_log_lib = library(
link_with: LIBS_BUILT_SO_FAR,
)
LIBS_BUILT_SO_FAR = [kea_log_lib] + LIBS_BUILT_SO_FAR
subdir('compiler')
subdir('tests')
kea_log_headers = [
'buffer_appender_impl.h',
@@ -53,3 +54,20 @@ kea_log_headers = [
'output_option.h',
]
install_headers(kea_log_headers, preserve_path: true, subdir: 'kea/log')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-lib-log-log_messages',
command: [kea_msg_compiler, f'@current_source_dir@/log_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
target_gen_messages = run_target(
'src-lib-log-logimpl_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/logimpl_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -89,3 +89,15 @@ foreach shtest : shtests
priority: -1,
)
endforeach
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-lib-log-tests-log_test_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/log_test_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -38,3 +38,15 @@ kea_process_headers = [
'redact_config.h',
]
install_headers(kea_process_headers, preserve_path: true, subdir: 'kea/process')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-lib-process-process_messages',
command: [
kea_msg_compiler,
f'@current_source_dir@/process_messages.mes',
],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif

View File

@@ -26,3 +26,12 @@ kea_tcp_headers = [
'tcp_stream_msg.h',
]
install_headers(kea_tcp_headers, preserve_path: true, subdir: 'kea/tcp')
if HAS_KEA_MSG_COMPILER
current_source_dir = meson.current_source_dir()
target_gen_messages = run_target(
'src-lib-tcp-tcp_messages',
command: [kea_msg_compiler, f'@current_source_dir@/tcp_messages.mes'],
)
TARGETS_GEN_MESSAGES += [target_gen_messages]
endif