diff options
| author | zhangyang <[email protected]> | 2024-04-29 23:05:41 -0400 |
|---|---|---|
| committer | zhangyang <[email protected]> | 2024-04-29 23:05:41 -0400 |
| commit | 59f2cb894bbf2b5ee8d27f4be7078719d2303267 (patch) | |
| tree | 0e8a533628e09531ed6b554062c63b9b7c0a4711 | |
| parent | 666b2cf45fb6ec080c9f78e89e4d5c702f640037 (diff) | |
30 files changed, 950 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3597114..f66e9c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,4 +12,5 @@ add_subdirectory(demo1) add_subdirectory(demo2) add_subdirectory(demo3) add_subdirectory(demo4) +add_subdirectory(demo5) add_subdirectory(matt)
\ No newline at end of file diff --git a/build/CMakeCache.txt b/build/CMakeCache.txt index 521dd81..cb28a63 100644 --- a/build/CMakeCache.txt +++ b/build/CMakeCache.txt @@ -239,6 +239,15 @@ Demo4_IS_TOP_LEVEL:STATIC=OFF Demo4_SOURCE_DIR:STATIC=/root/Git/demo/demo4 //Value Computed by CMake +Demo5_BINARY_DIR:STATIC=/root/Git/demo/build/demo5 + +//Value Computed by CMake +Demo5_IS_TOP_LEVEL:STATIC=OFF + +//Value Computed by CMake +Demo5_SOURCE_DIR:STATIC=/root/Git/demo/demo5 + +//Value Computed by CMake MyProject_BINARY_DIR:STATIC=/root/Git/demo/build //Value Computed by CMake @@ -370,7 +379,7 @@ CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_NM CMAKE_NM-ADVANCED:INTERNAL=1 //number of local generators -CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=6 +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=7 //ADVANCED property for variable: CMAKE_OBJCOPY CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_OBJDUMP diff --git a/build/CMakeFiles/Makefile.cmake b/build/CMakeFiles/Makefile.cmake index 3db10eb..871e546 100644 --- a/build/CMakeFiles/Makefile.cmake +++ b/build/CMakeFiles/Makefile.cmake @@ -15,6 +15,7 @@ set(CMAKE_MAKEFILE_DEPENDS "/root/Git/demo/demo2/CMakeLists.txt" "/root/Git/demo/demo3/CMakeLists.txt" "/root/Git/demo/demo4/CMakeLists.txt" + "/root/Git/demo/demo5/CMakeLists.txt" "/root/Git/demo/matt/CMakeLists.txt" "/usr/share/cmake/Modules/CMakeCInformation.cmake" "/usr/share/cmake/Modules/CMakeCXXInformation.cmake" @@ -48,6 +49,7 @@ set(CMAKE_MAKEFILE_PRODUCTS "demo2/CMakeFiles/CMakeDirectoryInformation.cmake" "demo3/CMakeFiles/CMakeDirectoryInformation.cmake" "demo4/CMakeFiles/CMakeDirectoryInformation.cmake" + "demo5/CMakeFiles/CMakeDirectoryInformation.cmake" "matt/CMakeFiles/CMakeDirectoryInformation.cmake" ) @@ -57,5 +59,6 @@ set(CMAKE_DEPEND_INFO_FILES "demo2/CMakeFiles/Demo2.dir/DependInfo.cmake" "demo3/CMakeFiles/demo3.dir/DependInfo.cmake" "demo4/CMakeFiles/Demo4.dir/DependInfo.cmake" + "demo5/CMakeFiles/Demo5.dir/DependInfo.cmake" "matt/CMakeFiles/maat.dir/DependInfo.cmake" ) diff --git a/build/CMakeFiles/Makefile2 b/build/CMakeFiles/Makefile2 index 3cdf09e..6f8bf06 100644 --- a/build/CMakeFiles/Makefile2 +++ b/build/CMakeFiles/Makefile2 @@ -67,6 +67,7 @@ all: demo1/all all: demo2/all all: demo3/all all: demo4/all +all: demo5/all all: matt/all .PHONY : all @@ -75,6 +76,7 @@ preinstall: demo1/preinstall preinstall: demo2/preinstall preinstall: demo3/preinstall preinstall: demo4/preinstall +preinstall: demo5/preinstall preinstall: matt/preinstall .PHONY : preinstall @@ -83,6 +85,7 @@ clean: demo1/clean clean: demo2/clean clean: demo3/clean clean: demo4/clean +clean: demo5/clean clean: matt/clean .PHONY : clean @@ -147,6 +150,21 @@ demo4/clean: demo4/CMakeFiles/Demo4.dir/clean .PHONY : demo4/clean #============================================================================= +# Directory level rules for directory demo5 + +# Recursive "all" directory target. +demo5/all: demo5/CMakeFiles/Demo5.dir/all +.PHONY : demo5/all + +# Recursive "preinstall" directory target. +demo5/preinstall: +.PHONY : demo5/preinstall + +# Recursive "clean" directory target. +demo5/clean: demo5/CMakeFiles/Demo5.dir/clean +.PHONY : demo5/clean + +#============================================================================= # Directory level rules for directory matt # Recursive "all" directory target. @@ -220,7 +238,7 @@ demo2/CMakeFiles/Demo2.dir/clean: demo3/CMakeFiles/demo3.dir/all: $(MAKE) $(MAKESILENT) -f demo3/CMakeFiles/demo3.dir/build.make demo3/CMakeFiles/demo3.dir/depend $(MAKE) $(MAKESILENT) -f demo3/CMakeFiles/demo3.dir/build.make demo3/CMakeFiles/demo3.dir/build - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/root/Git/demo/build/CMakeFiles --progress-num=7,8 "Built target demo3" + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/root/Git/demo/build/CMakeFiles --progress-num=9,10 "Built target demo3" .PHONY : demo3/CMakeFiles/demo3.dir/all # Build rule for subdir invocation for target. @@ -266,13 +284,39 @@ demo4/CMakeFiles/Demo4.dir/clean: .PHONY : demo4/CMakeFiles/Demo4.dir/clean #============================================================================= +# Target rules for target demo5/CMakeFiles/Demo5.dir + +# All Build rule for target. +demo5/CMakeFiles/Demo5.dir/all: + $(MAKE) $(MAKESILENT) -f demo5/CMakeFiles/Demo5.dir/build.make demo5/CMakeFiles/Demo5.dir/depend + $(MAKE) $(MAKESILENT) -f demo5/CMakeFiles/Demo5.dir/build.make demo5/CMakeFiles/Demo5.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/root/Git/demo/build/CMakeFiles --progress-num=7,8 "Built target Demo5" +.PHONY : demo5/CMakeFiles/Demo5.dir/all + +# Build rule for subdir invocation for target. +demo5/CMakeFiles/Demo5.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /root/Git/demo/build/CMakeFiles 2 + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 demo5/CMakeFiles/Demo5.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /root/Git/demo/build/CMakeFiles 0 +.PHONY : demo5/CMakeFiles/Demo5.dir/rule + +# Convenience name for target. +Demo5: demo5/CMakeFiles/Demo5.dir/rule +.PHONY : Demo5 + +# clean rule for target. +demo5/CMakeFiles/Demo5.dir/clean: + $(MAKE) $(MAKESILENT) -f demo5/CMakeFiles/Demo5.dir/build.make demo5/CMakeFiles/Demo5.dir/clean +.PHONY : demo5/CMakeFiles/Demo5.dir/clean + +#============================================================================= # Target rules for target matt/CMakeFiles/maat.dir # All Build rule for target. matt/CMakeFiles/maat.dir/all: $(MAKE) $(MAKESILENT) -f matt/CMakeFiles/maat.dir/build.make matt/CMakeFiles/maat.dir/depend $(MAKE) $(MAKESILENT) -f matt/CMakeFiles/maat.dir/build.make matt/CMakeFiles/maat.dir/build - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/root/Git/demo/build/CMakeFiles --progress-num=9,10 "Built target maat" + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/root/Git/demo/build/CMakeFiles --progress-num=11,12 "Built target maat" .PHONY : matt/CMakeFiles/maat.dir/all # Build rule for subdir invocation for target. diff --git a/build/CMakeFiles/TargetDirectories.txt b/build/CMakeFiles/TargetDirectories.txt index 32a6af9..9d5b508 100644 --- a/build/CMakeFiles/TargetDirectories.txt +++ b/build/CMakeFiles/TargetDirectories.txt @@ -12,6 +12,9 @@ /root/Git/demo/build/demo4/CMakeFiles/Demo4.dir /root/Git/demo/build/demo4/CMakeFiles/edit_cache.dir /root/Git/demo/build/demo4/CMakeFiles/rebuild_cache.dir +/root/Git/demo/build/demo5/CMakeFiles/Demo5.dir +/root/Git/demo/build/demo5/CMakeFiles/edit_cache.dir +/root/Git/demo/build/demo5/CMakeFiles/rebuild_cache.dir /root/Git/demo/build/matt/CMakeFiles/maat.dir /root/Git/demo/build/matt/CMakeFiles/edit_cache.dir /root/Git/demo/build/matt/CMakeFiles/rebuild_cache.dir diff --git a/build/CMakeFiles/progress.marks b/build/CMakeFiles/progress.marks index f599e28..48082f7 100644 --- a/build/CMakeFiles/progress.marks +++ b/build/CMakeFiles/progress.marks @@ -1 +1 @@ -10 +12 diff --git a/build/Makefile b/build/Makefile index 71bbee7..45e6502 100644 --- a/build/Makefile +++ b/build/Makefile @@ -169,6 +169,19 @@ Demo4/fast: .PHONY : Demo4/fast #============================================================================= +# Target rules for targets named Demo5 + +# Build rule for target. +Demo5: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 Demo5 +.PHONY : Demo5 + +# fast build rule for target. +Demo5/fast: + $(MAKE) $(MAKESILENT) -f demo5/CMakeFiles/Demo5.dir/build.make demo5/CMakeFiles/Demo5.dir/build +.PHONY : Demo5/fast + +#============================================================================= # Target rules for targets named maat # Build rule for target. @@ -192,6 +205,7 @@ help: @echo "... Demo1" @echo "... Demo2" @echo "... Demo4" + @echo "... Demo5" @echo "... demo3" @echo "... maat" .PHONY : help diff --git a/build/cmake_install.cmake b/build/cmake_install.cmake index e07ccdf..12aa518 100644 --- a/build/cmake_install.cmake +++ b/build/cmake_install.cmake @@ -48,6 +48,7 @@ if(NOT CMAKE_INSTALL_LOCAL_ONLY) include("/root/Git/demo/build/demo2/cmake_install.cmake") include("/root/Git/demo/build/demo3/cmake_install.cmake") include("/root/Git/demo/build/demo4/cmake_install.cmake") + include("/root/Git/demo/build/demo5/cmake_install.cmake") include("/root/Git/demo/build/matt/cmake_install.cmake") endif() diff --git a/build/compile_commands.json b/build/compile_commands.json index 52df143..467f4b0 100644 --- a/build/compile_commands.json +++ b/build/compile_commands.json @@ -24,6 +24,12 @@ "output": "demo4/CMakeFiles/Demo4.dir/main.c.o" }, { + "directory": "/root/Git/demo/build/demo5", + "command": "/usr/bin/gcc -I/opt/MESA/include/MESA -g -o CMakeFiles/Demo5.dir/main.c.o -c /root/Git/demo/demo5/main.c", + "file": "/root/Git/demo/demo5/main.c", + "output": "demo5/CMakeFiles/Demo5.dir/main.c.o" +}, +{ "directory": "/root/Git/demo/build/matt", "command": "/usr/bin/gcc -I/opt/MESA/include/MESA -g -o CMakeFiles/maat.dir/main.c.o -c /root/Git/demo/matt/main.c", "file": "/root/Git/demo/matt/main.c", diff --git a/build/demo3/CMakeFiles/demo3.dir/progress.make b/build/demo3/CMakeFiles/demo3.dir/progress.make index 72bb7dd..b700c2c 100644 --- a/build/demo3/CMakeFiles/demo3.dir/progress.make +++ b/build/demo3/CMakeFiles/demo3.dir/progress.make @@ -1,3 +1,3 @@ -CMAKE_PROGRESS_1 = 7 -CMAKE_PROGRESS_2 = 8 +CMAKE_PROGRESS_1 = 9 +CMAKE_PROGRESS_2 = 10 diff --git a/build/matt/CMakeFiles/maat.dir/compiler_depend.make b/build/matt/CMakeFiles/maat.dir/compiler_depend.make index 4a6b382..c2e8731 100644 --- a/build/matt/CMakeFiles/maat.dir/compiler_depend.make +++ b/build/matt/CMakeFiles/maat.dir/compiler_depend.make @@ -1,2 +1,196 @@ -# Empty compiler generated dependencies file for maat. -# This may be replaced when dependencies are built. +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.26 + +matt/CMakeFiles/maat.dir/main.c.o: /root/Git/demo/matt/main.c \ + /usr/include/stdc-predef.h \ + /opt/MESA/include/MESA/maat.h \ + /usr/lib/gcc/x86_64-redhat-linux/8/include/stdint.h \ + /usr/include/stdint.h \ + /usr/include/bits/libc-header-start.h \ + /usr/include/features.h \ + /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h \ + /usr/include/bits/long-double.h \ + /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h \ + /usr/include/bits/wchar.h \ + /usr/include/bits/stdint-intn.h \ + /usr/include/bits/stdint-uintn.h \ + /usr/include/netinet/in.h \ + /usr/include/sys/socket.h \ + /usr/include/bits/types/struct_iovec.h \ + /usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h \ + /usr/include/bits/socket.h \ + /usr/include/sys/types.h \ + /usr/include/bits/types/clock_t.h \ + /usr/include/bits/types/clockid_t.h \ + /usr/include/bits/types/time_t.h \ + /usr/include/bits/types/timer_t.h \ + /usr/include/endian.h \ + /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h \ + /usr/include/bits/uintn-identity.h \ + /usr/include/sys/select.h \ + /usr/include/bits/select.h \ + /usr/include/bits/types/sigset_t.h \ + /usr/include/bits/types/__sigset_t.h \ + /usr/include/bits/types/struct_timeval.h \ + /usr/include/bits/types/struct_timespec.h \ + /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/thread-shared-types.h \ + /usr/include/bits/pthreadtypes-arch.h \ + /usr/include/bits/socket_type.h \ + /usr/include/bits/sockaddr.h \ + /usr/include/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/asm/sockios.h \ + /usr/include/asm-generic/sockios.h \ + /usr/include/bits/types/struct_osockaddr.h \ + /usr/include/bits/in.h \ + /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h \ + /usr/include/bits/types/__fpos_t.h \ + /usr/include/bits/types/__mbstate_t.h \ + /usr/include/bits/types/__fpos64_t.h \ + /usr/include/bits/types/__FILE.h \ + /usr/include/bits/types/FILE.h \ + /usr/include/bits/types/struct_FILE.h \ + /usr/include/bits/stdio_lim.h \ + /usr/include/bits/sys_errlist.h \ + /usr/include/arpa/inet.h \ + /usr/include/assert.h \ + /usr/include/string.h \ + /usr/include/bits/types/locale_t.h \ + /usr/include/bits/types/__locale_t.h \ + /usr/include/strings.h + + +/usr/include/string.h: + +/usr/include/assert.h: + +/usr/include/arpa/inet.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/types/FILE.h: + +/usr/include/bits/types/__FILE.h: + +/usr/include/bits/types/__mbstate_t.h: + +/usr/include/bits/types/__fpos_t.h: + +/usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h: + +/usr/include/stdio.h: + +/usr/include/bits/in.h: + +/usr/include/bits/types/struct_FILE.h: + +/usr/include/bits/types/struct_osockaddr.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/bits/sockaddr.h: + +/usr/include/bits/pthreadtypes-arch.h: + +/usr/include/bits/types/__fpos64_t.h: + +/usr/include/bits/thread-shared-types.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/bits/types/struct_timespec.h: + +/usr/include/bits/typesizes.h: + +/usr/include/bits/wordsize.h: + +/usr/include/bits/stdint-intn.h: + +/opt/MESA/include/MESA/maat.h: + +/usr/include/bits/socket.h: + +/usr/include/bits/byteswap.h: + +/usr/include/bits/types/__sigset_t.h: + +/usr/lib/gcc/x86_64-redhat-linux/8/include/stdint.h: + +/usr/include/gnu/stubs.h: + +/usr/include/stdc-predef.h: + +/usr/include/bits/wchar.h: + +/usr/include/asm/sockios.h: + +/root/Git/demo/matt/main.c: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/types/sigset_t.h: + +/usr/include/features.h: + +/usr/include/bits/long-double.h: + +/usr/include/stdint.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/select.h: + +/usr/include/bits/types/locale_t.h: + +/usr/include/netinet/in.h: + +/usr/include/sys/socket.h: + +/usr/include/bits/types/timer_t.h: + +/usr/include/bits/types/__locale_t.h: + +/usr/include/bits/socket_type.h: + +/usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h: + +/usr/include/strings.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types/clockid_t.h: + +/usr/include/bits/types/struct_iovec.h: + +/usr/include/bits/stdint-uintn.h: + +/usr/include/bits/types/clock_t.h: + +/usr/include/bits/types.h: + +/usr/include/endian.h: + +/usr/include/bits/types/struct_timeval.h: + +/usr/include/bits/endian.h: + +/usr/include/bits/libc-header-start.h: + +/usr/include/bits/types/time_t.h: + +/usr/include/bits/uintn-identity.h: + +/usr/include/sys/select.h: diff --git a/build/matt/CMakeFiles/maat.dir/progress.make b/build/matt/CMakeFiles/maat.dir/progress.make index b700c2c..596289c 100644 --- a/build/matt/CMakeFiles/maat.dir/progress.make +++ b/build/matt/CMakeFiles/maat.dir/progress.make @@ -1,3 +1,3 @@ -CMAKE_PROGRESS_1 = 9 -CMAKE_PROGRESS_2 = 10 +CMAKE_PROGRESS_1 = 11 +CMAKE_PROGRESS_2 = 12 diff --git a/demo4/maat_json_cb.json b/demo4/maat_json_cb.json index 3ada0cd..8e087b1 100644 --- a/demo4/maat_json_cb.json +++ b/demo4/maat_json_cb.json @@ -29,8 +29,8 @@ { "table_name": "WANNAT_COMPILE", "table_content": [ - "301\t0\t1\t0\t2\t{}\t{\"ip_object_ids\":[203,204], \"translate_type\":\"never\", \"time_interval\":123, \"connection_count\":1243}\t1\t1\t0", - "302\t0\t2\t0\t2\t{}\t{\"ue_object_ids\":[102], \"failover\":\"drop\"}\t2\t1\t0" + "301\t0\t1\t0\t2\t{}\t{\"ip_object_ids\":[203,204],\"translate_type\":\"never\",\"time_interval\":123,\"connection_count\":1243}\t1\t1\t0", + "302\t0\t2\t0\t2\t{}\t{\"ue_object_ids\":[102],\"failover\":\"drop\"}\t2\t1\t0" ] } ] diff --git a/demo4/maat_json_cb.json_iris_tmp/WANNAT_COMPILE.local b/demo4/maat_json_cb.json_iris_tmp/WANNAT_COMPILE.local index 117ea92..724b4b4 100644 --- a/demo4/maat_json_cb.json_iris_tmp/WANNAT_COMPILE.local +++ b/demo4/maat_json_cb.json_iris_tmp/WANNAT_COMPILE.local @@ -1,3 +1,3 @@ 0000000002 -301 0 1 0 2 {} {"ip_object_ids":[203,204], "translate_type":"never", "time_interval":123, "connection_count":1243} 1 1 0 -302 0 2 0 2 {} {"ue_object_ids":[102], "failover":"drop"} 2 1 0 +301 0 1 0 2 {} {"ip_object_ids":[203,204],"translate_type":"never","time_interval":123,"connection_count":1243} 1 1 0 +302 0 2 0 2 {} {"ue_object_ids":[102],"failover":"drop"} 2 1 0 diff --git a/demo4/main.c b/demo4/main.c index 2eb3e51..12d4aaf 100644 --- a/demo4/main.c +++ b/demo4/main.c @@ -53,6 +53,51 @@ void ip_plugin_ex_dup_cb(int table_id, void **to, void **from, long argl, void * *to = ud; } +struct wannat_compile +{ + int compile_id; + int service; + int action; + int do_blacklist; + int do_log; + char user_region[8192]; + int group_num; + int is_valid; +}; + +void wannat_compile_ex_new_cb(const char *table_name, int table_id, const char *key, const char *table_line, void **ad, + long argl, void *argp) +{ + int *counter = (int *)argp; + char effective_range[20] = {0}; + char op_time[20] = {0}; + + struct wannat_compile *ud = ALLOC(struct wannat_compile, 1); + + int ret = sscanf(table_line, "%d\t%d\t%d\t%d\t%d\t%10s\t%8192s\t%d\t%d\t%20s", &(ud->compile_id), &(ud->service), + &(ud->action), &(ud->do_blacklist), &(ud->do_log), effective_range, ud->user_region, + &(ud->group_num), &(ud->is_valid), &op_time); + + *ad = ud; + (*counter)++; +} + +void wannat_compile_ex_free_cb(int table_id, void **ad, long argl, void *argp) +{ + struct wannat_compile *ud = (struct wannat_compile *)(*ad); + + memset(ud, 0, sizeof(struct wannat_compile)); + free(ud); + *ad = NULL; +} + +void wannat_compile_ex_dup_cb(int table_id, void **to, void **from, long argl, void *argp) +{ + struct wannat_compile *ud = (struct wannat_compile *)(*from); + + *to = ud; +} + int main() { /* initialize maat options which will be used by maat_new() */ @@ -87,6 +132,25 @@ int main() assert(ud != NULL); assert(ud->id == 1); + plugin_ex_data_counter = 0; + const char *table_name2 = "WANNAT_COMPILE"; + table_id = maat_get_table_id(maat_instance, table_name2); + assert(table_id == 3); /* defined in table_info.conf */ + + ret = maat_plugin_table_ex_schema_register(maat_instance, table_name2, wannat_compile_ex_new_cb, wannat_compile_ex_free_cb, + wannat_compile_ex_dup_cb, 0, &plugin_ex_data_counter); + assert(ret == 0); + assert(plugin_ex_data_counter == 2); + + struct wannat_compile *ud2 = NULL; + int key = 301; + ud2 = (struct wannat_compile *)maat_plugin_table_get_ex_data(maat_instance, table_id, (char *)&key, sizeof(int)); + + assert(ud2 != NULL); + assert(ud2->compile_id == 301); + assert(ud2->action == 1); + + // struct ip_addr ipv4; // ipv4.ip_type = IPv4; // ret = inet_pton(AF_INET, "192.168.30.100", &ipv4.ipv4); diff --git a/demo4/sample_test.log.2024-04-25 b/demo4/sample_test.log.2024-04-25 index f3eec23..cc8de63 100644 --- a/demo4/sample_test.log.2024-04-25 +++ b/demo4/sample_test.log.2024-04-25 @@ -29,3 +29,115 @@ Thu Apr 25 09:13:31 2024, INFO, maat.rule(7824), table:<WANNAT_COMPILE> rule_cou Thu Apr 25 09:13:31 2024, INFO, maat.rule(7824), Full config version 1 load 10 entries complete Thu Apr 25 09:13:40 2024, INFO, maat.plugin(7824), table[WANNAT_DYN_UE_ID_IP] commit 2 plugin rules, version:0 Thu Apr 25 09:13:40 2024, INFO, maat.rule(7854), rule_monitor_loop thread still alive......... +Thu Apr 25 10:19:58 2024, INFO, maat.table(8974), successfully register physical table[WANNAT_DYN_UE_ID_IP]->table_id:0 +Thu Apr 25 10:19:58 2024, INFO, maat.table(8974), successfully register physical table[WANNAT_OBJ_UE_ID]->table_id:1 +Thu Apr 25 10:19:58 2024, INFO, maat.table(8974), successfully register physical table[WANNAT_OBJ_IP_ADDR]->table_id:2 +Thu Apr 25 10:19:58 2024, INFO, maat.table(8974), successfully register physical table[WANNAT_COMPILE]->table_id:3 +Thu Apr 25 10:19:58 2024, INFO, maat.table(8974), default compile table id: -1 +Thu Apr 25 10:19:58 2024, INFO, maat.table(8974), group2group table id: -1 +Thu Apr 25 10:19:58 2024, INFO, maat.config_monitor(8974), Maat initial with JSON file /root/Git/demo/demo4/maat_json_cb.json, formating... +Thu Apr 25 10:19:58 2024, INFO, maat.config_monitor(8974), JSON file /root/Git/demo/demo4/maat_json_cb.json md5: 99c4c248f18e587bd8de8312bd51826c, generate index file /root/Git/demo/demo4/maat_json_cb.json_iris_tmp/index OK +Thu Apr 25 10:19:58 2024, INFO, maat.config_monitor(8974), load /root/Git/demo/demo4/maat_json_cb.json_iris_tmp/index/full_config_index.0000000001 +Thu Apr 25 10:19:58 2024, INFO, maat.rule(8974), table:<WANNAT_DYN_UE_ID_IP> rule_count:2 +Thu Apr 25 10:19:58 2024, INFO, maat.rule(8974), table:<WANNAT_OBJ_UE_ID> rule_count:2 +Thu Apr 25 10:19:58 2024, INFO, maat.rule(8974), table:<WANNAT_OBJ_IP_ADDR> rule_count:4 +Thu Apr 25 10:19:58 2024, INFO, maat.rule(8974), table:<WANNAT_COMPILE> rule_count:2 +Thu Apr 25 10:19:58 2024, INFO, maat.rule(8974), Full config version 1 load 10 entries complete +Thu Apr 25 10:20:00 2024, INFO, maat.rule(8980), rule_monitor_loop thread still alive......... +Thu Apr 25 10:20:06 2024, INFO, maat.plugin(8974), table[WANNAT_DYN_UE_ID_IP] commit 2 plugin rules, version:0 +Thu Apr 25 10:20:39 2024, INFO, maat.table(9194), successfully register physical table[WANNAT_DYN_UE_ID_IP]->table_id:0 +Thu Apr 25 10:20:39 2024, INFO, maat.table(9194), successfully register physical table[WANNAT_OBJ_UE_ID]->table_id:1 +Thu Apr 25 10:20:39 2024, INFO, maat.table(9194), successfully register physical table[WANNAT_OBJ_IP_ADDR]->table_id:2 +Thu Apr 25 10:20:39 2024, INFO, maat.table(9194), successfully register physical table[WANNAT_COMPILE]->table_id:3 +Thu Apr 25 10:20:39 2024, INFO, maat.table(9194), default compile table id: -1 +Thu Apr 25 10:20:39 2024, INFO, maat.table(9194), group2group table id: -1 +Thu Apr 25 10:20:39 2024, INFO, maat.config_monitor(9194), Maat initial with JSON file /root/Git/demo/demo4/maat_json_cb.json, formating... +Thu Apr 25 10:20:39 2024, INFO, maat.config_monitor(9194), JSON file /root/Git/demo/demo4/maat_json_cb.json md5: 99c4c248f18e587bd8de8312bd51826c, generate index file /root/Git/demo/demo4/maat_json_cb.json_iris_tmp/index OK +Thu Apr 25 10:20:39 2024, INFO, maat.config_monitor(9194), load /root/Git/demo/demo4/maat_json_cb.json_iris_tmp/index/full_config_index.0000000001 +Thu Apr 25 10:20:39 2024, INFO, maat.rule(9194), table:<WANNAT_DYN_UE_ID_IP> rule_count:2 +Thu Apr 25 10:20:39 2024, INFO, maat.rule(9194), table:<WANNAT_OBJ_UE_ID> rule_count:2 +Thu Apr 25 10:20:39 2024, INFO, maat.rule(9194), table:<WANNAT_OBJ_IP_ADDR> rule_count:4 +Thu Apr 25 10:20:39 2024, INFO, maat.rule(9194), table:<WANNAT_COMPILE> rule_count:2 +Thu Apr 25 10:20:39 2024, INFO, maat.rule(9194), Full config version 1 load 10 entries complete +Thu Apr 25 10:20:43 2024, INFO, maat.plugin(9194), table[WANNAT_DYN_UE_ID_IP] commit 2 plugin rules, version:0 +Thu Apr 25 10:20:46 2024, INFO, maat.plugin(9194), table[WANNAT_COMPILE] commit 2 plugin rules, version:0 +Thu Apr 25 10:21:28 2024, INFO, maat.table(9437), successfully register physical table[WANNAT_DYN_UE_ID_IP]->table_id:0 +Thu Apr 25 10:21:28 2024, INFO, maat.table(9437), successfully register physical table[WANNAT_OBJ_UE_ID]->table_id:1 +Thu Apr 25 10:21:28 2024, INFO, maat.table(9437), successfully register physical table[WANNAT_OBJ_IP_ADDR]->table_id:2 +Thu Apr 25 10:21:28 2024, INFO, maat.table(9437), successfully register physical table[WANNAT_COMPILE]->table_id:3 +Thu Apr 25 10:21:28 2024, INFO, maat.table(9437), default compile table id: -1 +Thu Apr 25 10:21:28 2024, INFO, maat.table(9437), group2group table id: -1 +Thu Apr 25 10:21:28 2024, INFO, maat.config_monitor(9437), Maat initial with JSON file /root/Git/demo/demo4/maat_json_cb.json, formating... +Thu Apr 25 10:21:28 2024, INFO, maat.config_monitor(9437), JSON file /root/Git/demo/demo4/maat_json_cb.json md5: 99c4c248f18e587bd8de8312bd51826c, generate index file /root/Git/demo/demo4/maat_json_cb.json_iris_tmp/index OK +Thu Apr 25 10:21:28 2024, INFO, maat.config_monitor(9437), load /root/Git/demo/demo4/maat_json_cb.json_iris_tmp/index/full_config_index.0000000001 +Thu Apr 25 10:21:28 2024, INFO, maat.rule(9437), table:<WANNAT_DYN_UE_ID_IP> rule_count:2 +Thu Apr 25 10:21:28 2024, INFO, maat.rule(9437), table:<WANNAT_OBJ_UE_ID> rule_count:2 +Thu Apr 25 10:21:28 2024, INFO, maat.rule(9437), table:<WANNAT_OBJ_IP_ADDR> rule_count:4 +Thu Apr 25 10:21:28 2024, INFO, maat.rule(9437), table:<WANNAT_COMPILE> rule_count:2 +Thu Apr 25 10:21:28 2024, INFO, maat.rule(9437), Full config version 1 load 10 entries complete +Thu Apr 25 10:21:31 2024, INFO, maat.plugin(9437), table[WANNAT_DYN_UE_ID_IP] commit 2 plugin rules, version:0 +Thu Apr 25 10:21:33 2024, INFO, maat.plugin(9437), table[WANNAT_COMPILE] commit 2 plugin rules, version:0 +Thu Apr 25 11:21:22 2024, INFO, maat.table(10132), successfully register physical table[WANNAT_DYN_UE_ID_IP]->table_id:0 +Thu Apr 25 11:21:22 2024, INFO, maat.table(10132), successfully register physical table[WANNAT_OBJ_UE_ID]->table_id:1 +Thu Apr 25 11:21:22 2024, INFO, maat.table(10132), successfully register physical table[WANNAT_OBJ_IP_ADDR]->table_id:2 +Thu Apr 25 11:21:22 2024, INFO, maat.table(10132), successfully register physical table[WANNAT_COMPILE]->table_id:3 +Thu Apr 25 11:21:22 2024, INFO, maat.table(10132), default compile table id: -1 +Thu Apr 25 11:21:22 2024, INFO, maat.table(10132), group2group table id: -1 +Thu Apr 25 11:21:22 2024, INFO, maat.config_monitor(10132), Maat initial with JSON file /root/Git/demo/demo4/maat_json_cb.json, formating... +Thu Apr 25 11:21:22 2024, INFO, maat.config_monitor(10132), JSON file /root/Git/demo/demo4/maat_json_cb.json md5: 99c4c248f18e587bd8de8312bd51826c, generate index file /root/Git/demo/demo4/maat_json_cb.json_iris_tmp/index OK +Thu Apr 25 11:21:22 2024, INFO, maat.config_monitor(10132), load /root/Git/demo/demo4/maat_json_cb.json_iris_tmp/index/full_config_index.0000000001 +Thu Apr 25 11:21:22 2024, INFO, maat.rule(10132), table:<WANNAT_DYN_UE_ID_IP> rule_count:2 +Thu Apr 25 11:21:22 2024, INFO, maat.rule(10132), table:<WANNAT_OBJ_UE_ID> rule_count:2 +Thu Apr 25 11:21:22 2024, INFO, maat.rule(10132), table:<WANNAT_OBJ_IP_ADDR> rule_count:4 +Thu Apr 25 11:21:22 2024, INFO, maat.rule(10132), table:<WANNAT_COMPILE> rule_count:2 +Thu Apr 25 11:21:22 2024, INFO, maat.rule(10132), Full config version 1 load 10 entries complete +Thu Apr 25 11:21:27 2024, INFO, maat.plugin(10132), table[WANNAT_DYN_UE_ID_IP] commit 2 plugin rules, version:0 +Thu Apr 25 11:21:34 2024, INFO, maat.plugin(10132), table[WANNAT_COMPILE] commit 2 plugin rules, version:0 +Thu Apr 25 11:23:58 2024, INFO, maat.table(10290), successfully register physical table[WANNAT_DYN_UE_ID_IP]->table_id:0 +Thu Apr 25 11:23:58 2024, INFO, maat.table(10290), successfully register physical table[WANNAT_OBJ_UE_ID]->table_id:1 +Thu Apr 25 11:23:58 2024, INFO, maat.table(10290), successfully register physical table[WANNAT_OBJ_IP_ADDR]->table_id:2 +Thu Apr 25 11:23:58 2024, INFO, maat.table(10290), successfully register physical table[WANNAT_COMPILE]->table_id:3 +Thu Apr 25 11:23:58 2024, INFO, maat.table(10290), default compile table id: -1 +Thu Apr 25 11:23:58 2024, INFO, maat.table(10290), group2group table id: -1 +Thu Apr 25 11:23:58 2024, INFO, maat.config_monitor(10290), Maat initial with JSON file /root/Git/demo/demo4/maat_json_cb.json, formating... +Thu Apr 25 11:23:58 2024, INFO, maat.config_monitor(10290), JSON file /root/Git/demo/demo4/maat_json_cb.json md5: 99c4c248f18e587bd8de8312bd51826c, generate index file /root/Git/demo/demo4/maat_json_cb.json_iris_tmp/index OK +Thu Apr 25 11:23:58 2024, INFO, maat.config_monitor(10290), load /root/Git/demo/demo4/maat_json_cb.json_iris_tmp/index/full_config_index.0000000001 +Thu Apr 25 11:23:58 2024, INFO, maat.rule(10290), table:<WANNAT_DYN_UE_ID_IP> rule_count:2 +Thu Apr 25 11:23:58 2024, INFO, maat.rule(10290), table:<WANNAT_OBJ_UE_ID> rule_count:2 +Thu Apr 25 11:23:58 2024, INFO, maat.rule(10290), table:<WANNAT_OBJ_IP_ADDR> rule_count:4 +Thu Apr 25 11:23:58 2024, INFO, maat.rule(10290), table:<WANNAT_COMPILE> rule_count:2 +Thu Apr 25 11:23:58 2024, INFO, maat.rule(10290), Full config version 1 load 10 entries complete +Thu Apr 25 11:24:05 2024, INFO, maat.plugin(10290), table[WANNAT_DYN_UE_ID_IP] commit 2 plugin rules, version:0 +Thu Apr 25 11:28:37 2024, INFO, maat.table(11407), successfully register physical table[WANNAT_DYN_UE_ID_IP]->table_id:0 +Thu Apr 25 11:28:37 2024, INFO, maat.table(11407), successfully register physical table[WANNAT_OBJ_UE_ID]->table_id:1 +Thu Apr 25 11:28:37 2024, INFO, maat.table(11407), successfully register physical table[WANNAT_OBJ_IP_ADDR]->table_id:2 +Thu Apr 25 11:28:37 2024, INFO, maat.table(11407), successfully register physical table[WANNAT_COMPILE]->table_id:3 +Thu Apr 25 11:28:37 2024, INFO, maat.table(11407), default compile table id: -1 +Thu Apr 25 11:28:37 2024, INFO, maat.table(11407), group2group table id: -1 +Thu Apr 25 11:28:37 2024, INFO, maat.config_monitor(11407), Maat initial with JSON file /root/Git/demo/demo4/maat_json_cb.json, formating... +Thu Apr 25 11:28:37 2024, INFO, maat.config_monitor(11407), JSON file /root/Git/demo/demo4/maat_json_cb.json md5: 58dbe07962c97a9617a4e4b4246f68b3, generate index file /root/Git/demo/demo4/maat_json_cb.json_iris_tmp/index OK +Thu Apr 25 11:28:37 2024, INFO, maat.config_monitor(11407), load /root/Git/demo/demo4/maat_json_cb.json_iris_tmp/index/full_config_index.0000000001 +Thu Apr 25 11:28:37 2024, INFO, maat.rule(11407), table:<WANNAT_DYN_UE_ID_IP> rule_count:2 +Thu Apr 25 11:28:37 2024, INFO, maat.rule(11407), table:<WANNAT_OBJ_UE_ID> rule_count:2 +Thu Apr 25 11:28:37 2024, INFO, maat.rule(11407), table:<WANNAT_OBJ_IP_ADDR> rule_count:4 +Thu Apr 25 11:28:37 2024, INFO, maat.rule(11407), table:<WANNAT_COMPILE> rule_count:2 +Thu Apr 25 11:28:37 2024, INFO, maat.rule(11407), Full config version 1 load 10 entries complete +Thu Apr 25 11:28:40 2024, INFO, maat.plugin(11407), table[WANNAT_DYN_UE_ID_IP] commit 2 plugin rules, version:0 +Thu Apr 25 11:28:40 2024, INFO, maat.rule(11413), rule_monitor_loop thread still alive......... +Thu Apr 25 11:29:15 2024, INFO, maat.plugin(11407), table[WANNAT_COMPILE] commit 2 plugin rules, version:0 +Thu Apr 25 11:49:40 2024, INFO, maat.table(11745), successfully register physical table[WANNAT_DYN_UE_ID_IP]->table_id:0 +Thu Apr 25 11:49:40 2024, INFO, maat.table(11745), successfully register physical table[WANNAT_OBJ_UE_ID]->table_id:1 +Thu Apr 25 11:49:40 2024, INFO, maat.table(11745), successfully register physical table[WANNAT_OBJ_IP_ADDR]->table_id:2 +Thu Apr 25 11:49:40 2024, INFO, maat.table(11745), successfully register physical table[WANNAT_COMPILE]->table_id:3 +Thu Apr 25 11:49:40 2024, INFO, maat.table(11745), default compile table id: -1 +Thu Apr 25 11:49:40 2024, INFO, maat.table(11745), group2group table id: -1 +Thu Apr 25 11:49:40 2024, INFO, maat.config_monitor(11745), Maat initial with JSON file /root/Git/demo/demo4/maat_json_cb.json, formating... +Thu Apr 25 11:49:40 2024, INFO, maat.config_monitor(11745), JSON file /root/Git/demo/demo4/maat_json_cb.json md5: 79515826b6e691f52394f32c90bd2690, generate index file /root/Git/demo/demo4/maat_json_cb.json_iris_tmp/index OK +Thu Apr 25 11:49:40 2024, INFO, maat.config_monitor(11745), load /root/Git/demo/demo4/maat_json_cb.json_iris_tmp/index/full_config_index.0000000001 +Thu Apr 25 11:49:40 2024, INFO, maat.rule(11745), table:<WANNAT_DYN_UE_ID_IP> rule_count:2 +Thu Apr 25 11:49:40 2024, INFO, maat.rule(11745), table:<WANNAT_OBJ_UE_ID> rule_count:2 +Thu Apr 25 11:49:40 2024, INFO, maat.rule(11745), table:<WANNAT_OBJ_IP_ADDR> rule_count:4 +Thu Apr 25 11:49:40 2024, INFO, maat.rule(11745), table:<WANNAT_COMPILE> rule_count:2 +Thu Apr 25 11:49:40 2024, INFO, maat.rule(11745), Full config version 1 load 10 entries complete +Thu Apr 25 11:49:42 2024, INFO, maat.plugin(11745), table[WANNAT_DYN_UE_ID_IP] commit 2 plugin rules, version:0 +Thu Apr 25 11:49:42 2024, INFO, maat.plugin(11745), table[WANNAT_COMPILE] commit 2 plugin rules, version:0 diff --git a/demo5/CMakeLists.txt b/demo5/CMakeLists.txt new file mode 100644 index 0000000..7da1e49 --- /dev/null +++ b/demo5/CMakeLists.txt @@ -0,0 +1,8 @@ +# Set the minimum version of CMake that can be used +cmake_minimum_required(VERSION 3.10) + +# Define a new project +project(Demo5) + +# Add an executable +add_executable(Demo5 main.c)
\ No newline at end of file diff --git a/demo5/main.c b/demo5/main.c new file mode 100644 index 0000000..64aac7b --- /dev/null +++ b/demo5/main.c @@ -0,0 +1,137 @@ +#include "maat.h" +#include "stdio.h" +#include <arpa/inet.h> +#include <assert.h> +#include <stddef.h> +#include <string.h> +#include <stdlib.h> // Include the header file for 'calloc' + +#define ARRAY_SIZE 16 +#define ALLOC(type, number) ((type *)calloc(sizeof(type), number)) + +const char *json_filename = "/root/Git/demo/demo5/wgw_scan.json"; +const char *table_info_path = "/root/Git/demo/demo5/table_info_wgw_scan.conf"; + +struct dyn_ue_id_ip +{ + int id; + int addr_type; + char ip[40]; + char ue_id[11]; + int is_valid; +}; + +void ip_plugin_ex_new_cb(const char *table_name, int table_id, const char *key, const char *table_line, void **ad, + long argl, void *argp) +{ + int *counter = (int *)argp; + + char op_time[20] = {0}; + + struct dyn_ue_id_ip *ud = ALLOC(struct dyn_ue_id_ip, 1); + + int ret = sscanf(table_line, "%d\t%d\t%10s\t%39s\t%d\t%20s", &(ud->id), &(ud->addr_type), ud->ip, ud->ue_id, + &(ud->is_valid), &op_time); + + *ad = ud; + (*counter)++; +} + +void ip_plugin_ex_free_cb(int table_id, void **ad, long argl, void *argp) +{ + struct dyn_ue_id_ip *ud = (struct dyn_ue_id_ip *)(*ad); + + memset(ud, 0, sizeof(struct dyn_ue_id_ip)); + free(ud); + *ad = NULL; +} + +void ip_plugin_ex_dup_cb(int table_id, void **to, void **from, long argl, void *argp) +{ + struct dyn_ue_id_ip *ud = (struct dyn_ue_id_ip *)(*from); + + *to = ud; +} + +int main() +{ + /* initialize maat options which will be used by maat_new() */ + struct maat_options *opts = maat_options_new(); + maat_options_set_json_file(opts, json_filename); + maat_options_set_logger(opts, "/root/Git/demo/demo5/sample_test.log", LOG_LEVEL_TRACE); + + /* create maat instance, rules in table_info.conf will be loaded. */ + struct maat *maat_instance = maat_new(opts, table_info_path); + assert(maat_instance != NULL); + maat_options_free(opts); + + const char *table_name = "UE_ID"; // ่ๆ่กจ 5 + int table_id = maat_get_table_id(maat_instance, table_name); + assert(table_id == 5); /* defined in table_info.conf */ + + int thread_id = 0; + long long results[ARRAY_SIZE] = {0}; + size_t n_hit_result = 0; + int ret = 0; + + /* store scanning intermediate state */ + struct maat_state *state = maat_state_new(maat_instance, thread_id); + assert(state != NULL); + + const char *ue_id = "abcdefghij"; + + ret = maat_scan_string(maat_instance, table_id, ue_id, strlen(ue_id), results, ARRAY_SIZE, &n_hit_result, state); + assert(ret == MAAT_SCAN_HIT); + assert(n_hit_result == 1); + assert(results[0] == 301); + + maat_state_free(state); + + struct ip_addr ipv4_src; + ipv4_src.ip_type = 4; + ret = inet_pton(AF_INET, "20.20.20.20", &ipv4_src.ipv4); + + struct maat_state *state2 = maat_state_new(maat_instance, thread_id); + assert(state2 != NULL); + + uint32_t a = ipv4_src.ipv4; + ret = maat_scan_ipv4_port(maat_instance, 6, a, 443, results, ARRAY_SIZE, &n_hit_result, state2); + assert(ret == MAAT_SCAN_HALF_HIT); + assert(n_hit_result == 0); + + struct ip_addr ipv4_dst; + ipv4_dst.ip_type = 4; + ret = inet_pton(AF_INET, "8.8.8.8", &ipv4_dst.ipv4); + + uint32_t b = ipv4_dst.ipv4; + ret = maat_scan_ipv4_port(maat_instance, 7, b, 443, results, ARRAY_SIZE, &n_hit_result, state2); + assert(ret == MAAT_SCAN_HIT); + assert(n_hit_result == 1); + assert(results[0] == 302); + + maat_state_free(state2); + + const char *table_name_ueidip = "WANNAT_DYN_UE_ID_IP"; /* maat_json.json has TEST_IP_PLUGIN_WITH_EXDATA rule */ + int table_id_ueidip = maat_get_table_id(maat_instance, table_name_ueidip); + assert(table_id_ueidip == 8); /* defined in table_info.conf */ + + int plugin_ex_data_counter = 0; + ret = maat_plugin_table_ex_schema_register(maat_instance, table_name_ueidip, ip_plugin_ex_new_cb, ip_plugin_ex_free_cb, + ip_plugin_ex_dup_cb, 0, &plugin_ex_data_counter); + + assert(ret == 0); + assert(plugin_ex_data_counter == 2); + + uint32_t ipv4_addr1; + ret = inet_pton(AF_INET, "10.0.0.1", &ipv4_addr1); + assert(ret == 1); + + struct dyn_ue_id_ip *ud = NULL; + ud = (struct dyn_ue_id_ip *)maat_plugin_table_get_ex_data(maat_instance, table_id_ueidip, (char *)&ipv4_addr1, + sizeof(ipv4_addr1)); + + assert(ud != NULL); + assert(ud->id == 1); + + return 0; +} diff --git a/demo5/sample_test.log b/demo5/sample_test.log new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/demo5/sample_test.log diff --git a/demo5/sample_test.log.2024-04-29 b/demo5/sample_test.log.2024-04-29 new file mode 100644 index 0000000..265ad3e --- /dev/null +++ b/demo5/sample_test.log.2024-04-29 @@ -0,0 +1,88 @@ +Mon Apr 29 23:01:30 2024, INFO, maat.table(111869), successfully register physical table[WANNAT_COMPILE]->table_id:0 +Mon Apr 29 23:01:30 2024, INFO, maat.table(111869), successfully register physical table[WANNAT_GROUP_COMPILE_RELATION]->table_id:1 +Mon Apr 29 23:01:30 2024, INFO, maat.table(111869), successfully register physical table[GROUP2GROUP]->table_id:2 +Mon Apr 29 23:01:30 2024, INFO, maat.table(111869), successfully register physical table[WANNAT_OBJ_UE_ID]->table_id:3 +Mon Apr 29 23:01:30 2024, INFO, maat.table(111869), successfully register physical table[WANNAT_OBJ_IP_ADDR]->table_id:4 +Mon Apr 29 23:01:30 2024, INFO, maat.table(111869), successfully register virtual table[UE_ID]->vtable_id:5, physical_table_id:3 +Mon Apr 29 23:01:30 2024, INFO, maat.table(111869), successfully register virtual table[SOURCE_IP]->vtable_id:6, physical_table_id:4 +Mon Apr 29 23:01:30 2024, INFO, maat.table(111869), successfully register virtual table[DESTINATION_IP]->vtable_id:7, physical_table_id:4 +Mon Apr 29 23:01:30 2024, INFO, maat.table(111869), successfully register physical table[WANNAT_DYN_UE_ID_IP]->table_id:8 +Mon Apr 29 23:01:30 2024, INFO, maat.table(111869), default compile table id: 0 +Mon Apr 29 23:01:30 2024, INFO, maat.table(111869), group2group table id: 2 +Mon Apr 29 23:01:30 2024, INFO, maat.config_monitor(111869), Maat initial with JSON file /root/Git/demo/demo5/wgw_scan.json, formating... +Mon Apr 29 23:01:30 2024, INFO, maat.config_monitor(111869), JSON file /root/Git/demo/demo5/wgw_scan.json md5: 366c62cc81ffbc832120d84efacbd202, generate index file /root/Git/demo/demo5/wgw_scan.json_iris_tmp/index OK +Mon Apr 29 23:01:30 2024, INFO, maat.config_monitor(111869), load /root/Git/demo/demo5/wgw_scan.json_iris_tmp/index/full_config_index.0000000001 +Mon Apr 29 23:01:30 2024, DEBUG, maat.plugin(111869), plugin table:<WANNAT_DYN_UE_ID_IP> update one line, key:10.0.0.1, key_len:8, is_valid:1 +Mon Apr 29 23:01:30 2024, DEBUG, maat.plugin(111869), plugin table:<WANNAT_DYN_UE_ID_IP> update one line, key:10.0.0.2, key_len:8, is_valid:1 +Mon Apr 29 23:01:30 2024, INFO, maat.compile(111869), Build bool matcher of 2 expressions with 16777436 bytes memory. +Mon Apr 29 23:01:30 2024, INFO, maat.compile(111869), table[WANNAT_COMPILE] commit 2 compile rules and rebuild compile bool_matcher completed, version:1, consume:2ms +Mon Apr 29 23:01:30 2024, INFO, maat.expr_matcher(111869), expr_matcher module: build bool matcher of 1 expressions with 16777356 bytes memory +Mon Apr 29 23:01:30 2024, INFO, maat.expr(111869), table[WANNAT_OBJ_UE_ID] has 1 rules, commit 1 expr rules(literal_rules:1 regex_rules:0) and rebuild expr_matcher(hyperscan) completed, version:1, consume:3ms +Mon Apr 29 23:01:30 2024, INFO, maat.ip(111869), table[WANNAT_OBJ_IP_ADDR] commit 2 ip rules and rebuild ip_matcher completed, version:1, consume:0ms +Mon Apr 29 23:01:30 2024, INFO, maat.rule(111869), table:<WANNAT_COMPILE> rule_count:2 +Mon Apr 29 23:01:30 2024, INFO, maat.rule(111869), table:<WANNAT_GROUP_COMPILE_RELATION> rule_count:3 +Mon Apr 29 23:01:30 2024, INFO, maat.rule(111869), table:<WANNAT_OBJ_UE_ID> rule_count:1 +Mon Apr 29 23:01:30 2024, INFO, maat.rule(111869), table:<WANNAT_OBJ_IP_ADDR> rule_count:2 +Mon Apr 29 23:01:30 2024, INFO, maat.rule(111869), table:<WANNAT_DYN_UE_ID_IP> rule_count:2 +Mon Apr 29 23:01:30 2024, INFO, maat.rule(111869), Full config version 1 load 10 entries complete +Mon Apr 29 23:01:30 2024, INFO, maat.rule(111895), rule_monitor_loop thread still alive......... +Mon Apr 29 23:01:59 2024, DEBUG, maat.plugin(111869), plugin table:<WANNAT_DYN_UE_ID_IP> update one line, key:10.0.0.1, key_len:8, is_valid:1 +Mon Apr 29 23:02:05 2024, DEBUG, maat.plugin(111869), plugin table:<WANNAT_DYN_UE_ID_IP> update one line, key:10.0.0.2, key_len:8, is_valid:1 +Mon Apr 29 23:02:05 2024, INFO, maat.plugin(111869), table[WANNAT_DYN_UE_ID_IP] commit 2 plugin rules, version:0 +Mon Apr 29 23:04:37 2024, INFO, maat.table(112022), successfully register physical table[WANNAT_COMPILE]->table_id:0 +Mon Apr 29 23:04:37 2024, INFO, maat.table(112022), successfully register physical table[WANNAT_GROUP_COMPILE_RELATION]->table_id:1 +Mon Apr 29 23:04:37 2024, INFO, maat.table(112022), successfully register physical table[GROUP2GROUP]->table_id:2 +Mon Apr 29 23:04:37 2024, INFO, maat.table(112022), successfully register physical table[WANNAT_OBJ_UE_ID]->table_id:3 +Mon Apr 29 23:04:37 2024, INFO, maat.table(112022), successfully register physical table[WANNAT_OBJ_IP_ADDR]->table_id:4 +Mon Apr 29 23:04:37 2024, INFO, maat.table(112022), successfully register virtual table[UE_ID]->vtable_id:5, physical_table_id:3 +Mon Apr 29 23:04:37 2024, INFO, maat.table(112022), successfully register virtual table[SOURCE_IP]->vtable_id:6, physical_table_id:4 +Mon Apr 29 23:04:37 2024, INFO, maat.table(112022), successfully register virtual table[DESTINATION_IP]->vtable_id:7, physical_table_id:4 +Mon Apr 29 23:04:37 2024, INFO, maat.table(112022), successfully register physical table[WANNAT_DYN_UE_ID_IP]->table_id:8 +Mon Apr 29 23:04:37 2024, INFO, maat.table(112022), default compile table id: 0 +Mon Apr 29 23:04:37 2024, INFO, maat.table(112022), group2group table id: 2 +Mon Apr 29 23:04:37 2024, INFO, maat.config_monitor(112022), Maat initial with JSON file /root/Git/demo/demo5/wgw_scan.json, formating... +Mon Apr 29 23:04:37 2024, INFO, maat.config_monitor(112022), JSON file /root/Git/demo/demo5/wgw_scan.json md5: 366c62cc81ffbc832120d84efacbd202, generate index file /root/Git/demo/demo5/wgw_scan.json_iris_tmp/index OK +Mon Apr 29 23:04:37 2024, INFO, maat.config_monitor(112022), load /root/Git/demo/demo5/wgw_scan.json_iris_tmp/index/full_config_index.0000000001 +Mon Apr 29 23:04:37 2024, DEBUG, maat.plugin(112022), plugin table:<WANNAT_DYN_UE_ID_IP> update one line, key:10.0.0.1, key_len:8, is_valid:1 +Mon Apr 29 23:04:37 2024, DEBUG, maat.plugin(112022), plugin table:<WANNAT_DYN_UE_ID_IP> update one line, key:10.0.0.2, key_len:8, is_valid:1 +Mon Apr 29 23:04:37 2024, INFO, maat.compile(112022), Build bool matcher of 2 expressions with 16777436 bytes memory. +Mon Apr 29 23:04:37 2024, INFO, maat.compile(112022), table[WANNAT_COMPILE] commit 2 compile rules and rebuild compile bool_matcher completed, version:1, consume:2ms +Mon Apr 29 23:04:37 2024, INFO, maat.expr_matcher(112022), expr_matcher module: build bool matcher of 1 expressions with 16777356 bytes memory +Mon Apr 29 23:04:37 2024, INFO, maat.expr(112022), table[WANNAT_OBJ_UE_ID] has 1 rules, commit 1 expr rules(literal_rules:1 regex_rules:0) and rebuild expr_matcher(hyperscan) completed, version:1, consume:5ms +Mon Apr 29 23:04:37 2024, INFO, maat.ip(112022), table[WANNAT_OBJ_IP_ADDR] commit 2 ip rules and rebuild ip_matcher completed, version:1, consume:0ms +Mon Apr 29 23:04:37 2024, INFO, maat.rule(112022), table:<WANNAT_COMPILE> rule_count:2 +Mon Apr 29 23:04:37 2024, INFO, maat.rule(112022), table:<WANNAT_GROUP_COMPILE_RELATION> rule_count:3 +Mon Apr 29 23:04:37 2024, INFO, maat.rule(112022), table:<WANNAT_OBJ_UE_ID> rule_count:1 +Mon Apr 29 23:04:37 2024, INFO, maat.rule(112022), table:<WANNAT_OBJ_IP_ADDR> rule_count:2 +Mon Apr 29 23:04:37 2024, INFO, maat.rule(112022), table:<WANNAT_DYN_UE_ID_IP> rule_count:2 +Mon Apr 29 23:04:37 2024, INFO, maat.rule(112022), Full config version 1 load 10 entries complete +Mon Apr 29 23:05:07 2024, INFO, maat.table(112249), successfully register physical table[WANNAT_COMPILE]->table_id:0 +Mon Apr 29 23:05:07 2024, INFO, maat.table(112249), successfully register physical table[WANNAT_GROUP_COMPILE_RELATION]->table_id:1 +Mon Apr 29 23:05:07 2024, INFO, maat.table(112249), successfully register physical table[GROUP2GROUP]->table_id:2 +Mon Apr 29 23:05:07 2024, INFO, maat.table(112249), successfully register physical table[WANNAT_OBJ_UE_ID]->table_id:3 +Mon Apr 29 23:05:07 2024, INFO, maat.table(112249), successfully register physical table[WANNAT_OBJ_IP_ADDR]->table_id:4 +Mon Apr 29 23:05:07 2024, INFO, maat.table(112249), successfully register virtual table[UE_ID]->vtable_id:5, physical_table_id:3 +Mon Apr 29 23:05:07 2024, INFO, maat.table(112249), successfully register virtual table[SOURCE_IP]->vtable_id:6, physical_table_id:4 +Mon Apr 29 23:05:07 2024, INFO, maat.table(112249), successfully register virtual table[DESTINATION_IP]->vtable_id:7, physical_table_id:4 +Mon Apr 29 23:05:07 2024, INFO, maat.table(112249), successfully register physical table[WANNAT_DYN_UE_ID_IP]->table_id:8 +Mon Apr 29 23:05:07 2024, INFO, maat.table(112249), default compile table id: 0 +Mon Apr 29 23:05:07 2024, INFO, maat.table(112249), group2group table id: 2 +Mon Apr 29 23:05:07 2024, INFO, maat.config_monitor(112249), Maat initial with JSON file /root/Git/demo/demo5/wgw_scan.json, formating... +Mon Apr 29 23:05:07 2024, INFO, maat.config_monitor(112249), JSON file /root/Git/demo/demo5/wgw_scan.json md5: 366c62cc81ffbc832120d84efacbd202, generate index file /root/Git/demo/demo5/wgw_scan.json_iris_tmp/index OK +Mon Apr 29 23:05:07 2024, INFO, maat.config_monitor(112249), load /root/Git/demo/demo5/wgw_scan.json_iris_tmp/index/full_config_index.0000000001 +Mon Apr 29 23:05:07 2024, DEBUG, maat.plugin(112249), plugin table:<WANNAT_DYN_UE_ID_IP> update one line, key:10.0.0.1, key_len:8, is_valid:1 +Mon Apr 29 23:05:07 2024, DEBUG, maat.plugin(112249), plugin table:<WANNAT_DYN_UE_ID_IP> update one line, key:10.0.0.2, key_len:8, is_valid:1 +Mon Apr 29 23:05:07 2024, INFO, maat.compile(112249), Build bool matcher of 2 expressions with 16777436 bytes memory. +Mon Apr 29 23:05:07 2024, INFO, maat.compile(112249), table[WANNAT_COMPILE] commit 2 compile rules and rebuild compile bool_matcher completed, version:1, consume:2ms +Mon Apr 29 23:05:07 2024, INFO, maat.expr_matcher(112249), expr_matcher module: build bool matcher of 1 expressions with 16777356 bytes memory +Mon Apr 29 23:05:07 2024, INFO, maat.expr(112249), table[WANNAT_OBJ_UE_ID] has 1 rules, commit 1 expr rules(literal_rules:1 regex_rules:0) and rebuild expr_matcher(hyperscan) completed, version:1, consume:6ms +Mon Apr 29 23:05:07 2024, INFO, maat.ip(112249), table[WANNAT_OBJ_IP_ADDR] commit 2 ip rules and rebuild ip_matcher completed, version:1, consume:0ms +Mon Apr 29 23:05:07 2024, INFO, maat.rule(112249), table:<WANNAT_COMPILE> rule_count:2 +Mon Apr 29 23:05:07 2024, INFO, maat.rule(112249), table:<WANNAT_GROUP_COMPILE_RELATION> rule_count:3 +Mon Apr 29 23:05:07 2024, INFO, maat.rule(112249), table:<WANNAT_OBJ_UE_ID> rule_count:1 +Mon Apr 29 23:05:07 2024, INFO, maat.rule(112249), table:<WANNAT_OBJ_IP_ADDR> rule_count:2 +Mon Apr 29 23:05:07 2024, INFO, maat.rule(112249), table:<WANNAT_DYN_UE_ID_IP> rule_count:2 +Mon Apr 29 23:05:07 2024, INFO, maat.rule(112249), Full config version 1 load 10 entries complete +Mon Apr 29 23:05:07 2024, DEBUG, maat.plugin(112249), plugin table:<WANNAT_DYN_UE_ID_IP> update one line, key:10.0.0.1, key_len:8, is_valid:1 +Mon Apr 29 23:05:07 2024, DEBUG, maat.plugin(112249), plugin table:<WANNAT_DYN_UE_ID_IP> update one line, key:10.0.0.2, key_len:8, is_valid:1 +Mon Apr 29 23:05:07 2024, INFO, maat.plugin(112249), table[WANNAT_DYN_UE_ID_IP] commit 2 plugin rules, version:0 diff --git a/demo5/table_info_wgw_scan.conf b/demo5/table_info_wgw_scan.conf new file mode 100644 index 0000000..1314b3d --- /dev/null +++ b/demo5/table_info_wgw_scan.conf @@ -0,0 +1,103 @@ +[ + { + "table_id":0, + "table_name":"WANNAT_COMPILE", + "table_type":"compile", + "default_compile_table":0, + "user_region_encoded":"escape", + "valid_column":9, + "custom": { + "compile_id":1, + "service":2, + "action":3, + "do_blacklist":4, + "do_log":5, + "tags":6, + "user_region":7, + "clause_num":8 + } + }, + { + "table_id":1, + "table_name":"WANNAT_GROUP_COMPILE_RELATION", + "table_type":"group2compile", + "associated_compile_table_id":0, + "valid_column":6, + "custom": { + "group_id":1, + "compile_id":2, + "not_flag":3, + "virtual_table_name":4, + "clause_index":5 + } + }, + { + "table_id":2, + "table_name":"GROUP2GROUP", + "table_type":"group2group", + "valid_column":4, + "custom": { + "group_id":1, + "included_sub_group_ids":2, + "excluded_sub_group_ids":3 + } + }, + { + "table_id":3, + "table_name":"WANNAT_OBJ_UE_ID", + "table_type":"expr", + "valid_column":7, + "custom": { + "item_id":1, + "group_id":2, + "keywords":3, + "expr_type":4, + "match_method":5, + "is_hexbin":6 + } + }, + { + "table_id":4, + "table_name":"WANNAT_OBJ_IP_ADDR", + "table_type":"ip", + "valid_column":8, + "custom": { + "item_id":1, + "group_id":2, + "addr_type":3, + "addr_format":4, + "ip1":5, + "ip2":6, + "port":7 + } + }, + { + "table_id":5, + "table_name": "UE_ID", + "table_type": "virtual", + "physical_table": "WANNAT_OBJ_UE_ID" + }, + { + "table_id":6, + "table_name": "SOURCE_IP", + "table_type": "virtual", + "physical_table": "WANNAT_OBJ_IP_ADDR" + }, + { + "table_id":7, + "table_name": "DESTINATION_IP", + "table_type": "virtual", + "physical_table": "WANNAT_OBJ_IP_ADDR" + }, + { + "table_id":8, + "table_name":"WANNAT_DYN_UE_ID_IP", + "table_type":"plugin", + "valid_column":5, + "custom": { + "key_type":"ip_addr", + "addr_type":2, + "key":3 + } + } +]
\ No newline at end of file diff --git a/demo5/wgw_scan.json b/demo5/wgw_scan.json new file mode 100644 index 0000000..976bd82 --- /dev/null +++ b/demo5/wgw_scan.json @@ -0,0 +1,106 @@ +{ + "compile_table": "WANNAT_COMPILE", + "group2compile_table": "WANNAT_GROUP_COMPILE_RELATION", + "group2group_table": "GROUP2GROUP", + "rules": [ + { + "compile_id": 301, + "service": 0, + "action": 1, + "do_blacklist": 0, + "do_log": 2, + "effective_range": "{}", + "user_region": "{\"ip_object_ids\":[203,204], \"translate_type\":\"never\", \"time_interval\":123, \"connection_count\":1243}", + "group_num": 8, + "is_valid": "yes", + "modified_time": "100", + "groups": [ + { + "virtual_table": "UE_ID", + "group_name": "SNAT", + "group_id": 1, + "not_flag": 0, + "nth_clause": 1, + "regions": [ + { + "table_name": "WANNAT_OBJ_UE_ID", + "table_type": "expr", + "table_content": { + "region_id": 101, + "keywords": "abcdefghij", + "expr_type": "none", + "match_method": "exact", + "is_hexbin": "no", + "format": "uncase plain" + } + } + ] + } + ] + }, + { + "compile_id": 302, + "service": 0, + "action": 2, + "do_blacklist": 0, + "do_log": 2, + "effect_range": "{}", + "user_region": "{\"ue_object_ids\":[102], \"failover\":\"drop\"}", + "is_valid": "yes", + "modified_time": "200", + "groups": [ + { + "group_name": "DNAT_SRC", + "group_id": 2, + "not_flag": 0, + "virtual_table": "SOURCE_IP", + "nth_clause": 1, + "regions": [ + { + "table_name": "WANNAT_OBJ_IP_ADDR", + "table_type": "ip", + "table_content": { + "region_id": 201, + "addr_type": "ipv4", + "addr_format": "CIDR", + "ip1": "20.20.20.20", + "ip2": "32", + "port": "0-65535" + } + } + ] + }, + { + "group_name": "DNAT_DST", + "group_id": 3, + "not_flag": 0, + "virtual_table": "DESTINATION_IP", + "nth_clause": 1, + "regions": [ + { + "table_name": "WANNAT_OBJ_IP_ADDR", + "table_type": "ip", + "table_content": { + "region_id": 202, + "addr_type": "ipv4", + "addr_format": "CIDR", + "ip1": "8.8.8.8", + "ip2": "32", + "port": "0-65535" + } + } + ] + } + ] + } + ], + "plugin_table": [ + { + "table_name": "WANNAT_DYN_UE_ID_IP", + "table_content": [ + "1\t4\t10.0.0.1\tabcdefghij\t1\t0", + "2\t4\t10.0.0.2\tbbcdefghij\t1\t0" + ] + } + ] +}
\ No newline at end of file diff --git a/demo5/wgw_scan.json_iris_tmp/GROUP2GROUP.local b/demo5/wgw_scan.json_iris_tmp/GROUP2GROUP.local new file mode 100644 index 0000000..62580c9 --- /dev/null +++ b/demo5/wgw_scan.json_iris_tmp/GROUP2GROUP.local @@ -0,0 +1 @@ +0000000000 diff --git a/demo5/wgw_scan.json_iris_tmp/WANNAT_COMPILE.local b/demo5/wgw_scan.json_iris_tmp/WANNAT_COMPILE.local new file mode 100644 index 0000000..9e4cb50 --- /dev/null +++ b/demo5/wgw_scan.json_iris_tmp/WANNAT_COMPILE.local @@ -0,0 +1,3 @@ +0000000002 +301 0 1 0 2 {} {"ip_object_ids":[203,204], "translate_type":"never", "time_interval":123, "connection_count":1243} 1 1 +302 0 2 0 2 {} {"ue_object_ids":[102], "failover":"drop"} 2 1 diff --git a/demo5/wgw_scan.json_iris_tmp/WANNAT_DYN_UE_ID_IP.local b/demo5/wgw_scan.json_iris_tmp/WANNAT_DYN_UE_ID_IP.local new file mode 100644 index 0000000..50a21a1 --- /dev/null +++ b/demo5/wgw_scan.json_iris_tmp/WANNAT_DYN_UE_ID_IP.local @@ -0,0 +1,3 @@ +0000000002 +1 4 10.0.0.1 abcdefghij 1 0 +2 4 10.0.0.2 bbcdefghij 1 0 diff --git a/demo5/wgw_scan.json_iris_tmp/WANNAT_GROUP_COMPILE_RELATION.local b/demo5/wgw_scan.json_iris_tmp/WANNAT_GROUP_COMPILE_RELATION.local new file mode 100644 index 0000000..8ec983d --- /dev/null +++ b/demo5/wgw_scan.json_iris_tmp/WANNAT_GROUP_COMPILE_RELATION.local @@ -0,0 +1,4 @@ +0000000003 +1 301 0 UE_ID 0 1 +2 302 0 SOURCE_IP 0 1 +3 302 0 DESTINATION_IP 1 1 diff --git a/demo5/wgw_scan.json_iris_tmp/WANNAT_OBJ_IP_ADDR.local b/demo5/wgw_scan.json_iris_tmp/WANNAT_OBJ_IP_ADDR.local new file mode 100644 index 0000000..f8e0618 --- /dev/null +++ b/demo5/wgw_scan.json_iris_tmp/WANNAT_OBJ_IP_ADDR.local @@ -0,0 +1,3 @@ +0000000002 +201 2 4 CIDR 20.20.20.20 32 0-65535 1 +202 3 4 CIDR 8.8.8.8 32 0-65535 1 diff --git a/demo5/wgw_scan.json_iris_tmp/WANNAT_OBJ_UE_ID.local b/demo5/wgw_scan.json_iris_tmp/WANNAT_OBJ_UE_ID.local new file mode 100644 index 0000000..6d0104a --- /dev/null +++ b/demo5/wgw_scan.json_iris_tmp/WANNAT_OBJ_UE_ID.local @@ -0,0 +1,2 @@ +0000000001 +101 1 abcdefghij 0 3 0 1 diff --git a/demo5/wgw_scan.json_iris_tmp/index/full_config_index.0000000001 b/demo5/wgw_scan.json_iris_tmp/index/full_config_index.0000000001 new file mode 100644 index 0000000..67c734a --- /dev/null +++ b/demo5/wgw_scan.json_iris_tmp/index/full_config_index.0000000001 @@ -0,0 +1,6 @@ +WANNAT_COMPILE 2 /root/Git/demo/demo5/wgw_scan.json_iris_tmp/WANNAT_COMPILE.local +WANNAT_GROUP_COMPILE_RELATION 3 /root/Git/demo/demo5/wgw_scan.json_iris_tmp/WANNAT_GROUP_COMPILE_RELATION.local +GROUP2GROUP 0 /root/Git/demo/demo5/wgw_scan.json_iris_tmp/GROUP2GROUP.local +WANNAT_DYN_UE_ID_IP 2 /root/Git/demo/demo5/wgw_scan.json_iris_tmp/WANNAT_DYN_UE_ID_IP.local +WANNAT_OBJ_UE_ID 1 /root/Git/demo/demo5/wgw_scan.json_iris_tmp/WANNAT_OBJ_UE_ID.local +WANNAT_OBJ_IP_ADDR 2 /root/Git/demo/demo5/wgw_scan.json_iris_tmp/WANNAT_OBJ_IP_ADDR.local diff --git a/matt/sample_test.log.2024-04-29 b/matt/sample_test.log.2024-04-29 new file mode 100644 index 0000000..7e06870 --- /dev/null +++ b/matt/sample_test.log.2024-04-29 @@ -0,0 +1,21 @@ +Mon Apr 29 22:58:44 2024, INFO, maat.table(111260), successfully register physical table[WANNAT_COMPILE]->table_id:0 +Mon Apr 29 22:58:44 2024, INFO, maat.table(111260), successfully register physical table[WANNAT_GROUP_COMPILE_RELATION]->table_id:1 +Mon Apr 29 22:58:44 2024, INFO, maat.table(111260), successfully register physical table[GROUP2GROUP]->table_id:2 +Mon Apr 29 22:58:44 2024, INFO, maat.table(111260), successfully register physical table[WANNAT_OBJ_UE_ID]->table_id:3 +Mon Apr 29 22:58:44 2024, INFO, maat.table(111260), successfully register physical table[WANNAT_OBJ_IP_ADDR]->table_id:4 +Mon Apr 29 22:58:44 2024, INFO, maat.table(111260), successfully register virtual table[UE_ID]->vtable_id:5, physical_table_id:3 +Mon Apr 29 22:58:44 2024, INFO, maat.table(111260), successfully register virtual table[SOURCE_IP]->vtable_id:6, physical_table_id:4 +Mon Apr 29 22:58:44 2024, INFO, maat.table(111260), successfully register virtual table[DESTINATION_IP]->vtable_id:7, physical_table_id:4 +Mon Apr 29 22:58:44 2024, INFO, maat.table(111260), default compile table id: -1 +Mon Apr 29 22:58:44 2024, INFO, maat.table(111260), group2group table id: 2 +Mon Apr 29 22:58:44 2024, INFO, maat.config_monitor(111260), Maat initial with JSON file /root/Git/demo/matt/maat_json.json, formating... +Mon Apr 29 22:58:44 2024, INFO, maat.config_monitor(111260), JSON file /root/Git/demo/matt/maat_json.json md5: 4da09adb368132edc5ffdf2414ee9e8c, generate index file /root/Git/demo/matt/maat_json.json_iris_tmp/index OK +Mon Apr 29 22:58:44 2024, INFO, maat.config_monitor(111260), load /root/Git/demo/matt/maat_json.json_iris_tmp/index/full_config_index.0000000001 +Mon Apr 29 22:58:44 2024, INFO, maat.compile(111260), Build bool matcher of 2 expressions with 16777436 bytes memory. +Mon Apr 29 22:58:44 2024, INFO, maat.compile(111260), table[WANNAT_COMPILE] commit 2 compile rules and rebuild compile bool_matcher completed, version:1, consume:2ms +Mon Apr 29 22:58:44 2024, INFO, maat.expr_matcher(111260), expr_matcher module: build bool matcher of 1 expressions with 16777356 bytes memory +Mon Apr 29 22:58:44 2024, INFO, maat.expr(111260), table[WANNAT_OBJ_UE_ID] has 1 rules, commit 1 expr rules(literal_rules:1 regex_rules:0) and rebuild expr_matcher(hyperscan) completed, version:1, consume:3ms +Mon Apr 29 22:58:44 2024, INFO, maat.rule(111260), table:<WANNAT_COMPILE> rule_count:2 +Mon Apr 29 22:58:44 2024, INFO, maat.rule(111260), table:<WANNAT_GROUP_COMPILE_RELATION> rule_count:3 +Mon Apr 29 22:58:44 2024, INFO, maat.rule(111260), table:<WANNAT_OBJ_UE_ID> rule_count:1 +Mon Apr 29 22:58:44 2024, INFO, maat.rule(111260), Full config version 1 load 6 entries complete |
