├── .vscode └── tasks.json ├── bin ├── templates │ ├── test2.html │ └── test.html ├── iconv.dll ├── libjwt.dll ├── zlib1.dll ├── libmysql.dll ├── libpcre.dll ├── libxml2.dll ├── libcrypto.dll ├── libjansson.dll ├── libpcre32.dll ├── libserver.dll.a ├── libssl-1_1.dll ├── pthreadVC2.dll ├── libcrypto-1_1.dll ├── mdb │ └── mdbclient.exe ├── static │ ├── Assets │ │ ├── images │ │ │ ├── f1.png │ │ │ ├── f2.png │ │ │ ├── f3.png │ │ │ ├── f4.png │ │ │ ├── f5.png │ │ │ ├── p1.png │ │ │ ├── p2.png │ │ │ ├── p3.png │ │ │ ├── p4.png │ │ │ ├── p5.png │ │ │ ├── p6.png │ │ │ ├── bg_a.png │ │ │ ├── f_1.png │ │ │ ├── f_2.png │ │ │ ├── f_3.png │ │ │ ├── f_4.png │ │ │ ├── f_5.png │ │ │ ├── icon1.png │ │ │ ├── icon2.png │ │ │ ├── icon3.png │ │ │ ├── icon4.png │ │ │ ├── icon5.png │ │ │ ├── icon6.png │ │ │ ├── icon7.png │ │ │ ├── icon8.png │ │ │ ├── icon9.png │ │ │ ├── logo.png │ │ │ ├── movie.ogg │ │ │ ├── next.png │ │ │ ├── prev.png │ │ │ ├── icon10.png │ │ │ ├── icon11.png │ │ │ ├── icon12.png │ │ │ ├── icon13.png │ │ │ └── nav_ico.png │ │ ├── upload │ │ │ ├── pic10.jpg │ │ │ ├── pic2.jpg │ │ │ ├── pic3.jpg │ │ │ ├── pic4.jpg │ │ │ ├── pic5.jpg │ │ │ ├── pic6.jpg │ │ │ ├── pic7.jpg │ │ │ ├── pic8.jpg │ │ │ ├── pic9.jpg │ │ │ ├── banner.jpg │ │ │ └── banner_a.jpg │ │ ├── plugins │ │ │ └── FlexSlider │ │ │ │ ├── images │ │ │ │ ├── banner.jpg │ │ │ │ └── nav_ico.png │ │ │ │ └── index.html │ │ └── css │ │ │ └── reset.css │ └── conf.xml ├── conf.xml └── cert │ ├── localhost.pem │ └── localhost-key.pem ├── winbuild.bat ├── doc ├── test1.png ├── test2.png ├── test3.png ├── hardware.png ├── dmfserver.png ├── test1_result.png ├── test2_result.png ├── test3_result.png ├── 2023-05-12 (1).png ├── 2023-05-12 (2).png └── 2023-05-12 (3).png ├── lib ├── iconv.dll ├── iconv.lib ├── libjwt.dll ├── libssl.lib ├── zdll.lib ├── zlib.lib ├── zlib1.dll ├── libjwt.dll.a ├── libmysql.dll ├── libmysql.lib ├── libpcre.dll ├── libxml2.dll ├── libxml2.lib ├── libcrypto.lib ├── libjansson.dll ├── libpcre32.dll ├── libssl-1_1.dll ├── linux │ ├── libpcre.a │ ├── libjansson.a │ ├── libpcrecpp.a │ ├── libpcreposix.a │ ├── libxml2-2.9.4.so │ └── libcrypto-1.1.1.so ├── pthreadVC2.dll ├── pthreadVC2.lib └── libcrypto-1_1.dll ├── winbuild.sh ├── .VSCodeCounter └── 2023-11-12_19-31-34 │ ├── diff.csv │ ├── diff-details.md │ ├── diff.md │ └── diff.txt ├── get.py ├── .gitignore ├── Src ├── testviews │ ├── ws.c │ ├── other.c │ ├── template.c │ ├── mdb.c │ └── mysql.c ├── model │ └── test.c ├── mdb │ └── CMakeLists.txt ├── conf │ └── test.c ├── elr_mpl │ └── elr_mtx.c ├── utility │ └── dm_hash.c ├── middleware │ ├── jwt_token.c │ └── middleware.c ├── CMakeLists.txt ├── test │ └── pcre_test.c └── main.c ├── include ├── openssl │ ├── ecdh.h │ ├── ecdsa.h │ ├── asn1_mac.h │ ├── pem2.h │ ├── ssl2.h │ ├── __DECC_INCLUDE_EPILOGUE.H │ ├── __DECC_INCLUDE_PROLOGUE.H │ ├── buffererr.h │ ├── rc4.h │ ├── ebcdic.h │ ├── mdc2.h │ ├── cmac.h │ ├── md2.h │ ├── comperr.h │ ├── ripemd.h │ ├── symhacks.h │ ├── conf_api.h │ ├── objectserr.h │ ├── asyncerr.h │ ├── md5.h │ ├── srtp.h │ ├── md4.h │ ├── comp.h │ ├── whrlpool.h │ ├── rc2.h │ ├── hmac.h │ ├── dtls1.h │ ├── buffer.h │ ├── cast.h │ ├── txt_db.h │ ├── blowfish.h │ ├── rc5.h │ ├── kdferr.h │ ├── idea.h │ ├── cryptoerr.h │ ├── rand.h │ └── async.h ├── dmfserver │ └── dmfserver │ │ ├── common.h │ │ ├── utility │ │ ├── base64.h │ │ ├── dm_hash.h │ │ ├── utility.h │ │ ├── dm_list.h │ │ ├── dm_stack.h │ │ ├── dm_timer.h │ │ ├── dm_queue.h │ │ ├── dm_map.h │ │ ├── dm_string.h │ │ └── dm_thread_pool.h │ │ ├── cfg.h │ │ ├── middleware │ │ └── middleware.h │ │ ├── ws.h │ │ ├── mpool.h │ │ ├── model.h │ │ ├── mdb │ │ ├── mdb.h │ │ └── mdb_operate.h │ │ ├── template.h │ │ ├── socket.h │ │ ├── conf │ │ └── conf.h │ │ ├── elr_mpl │ │ └── elr_mtx.h │ │ ├── log.h │ │ ├── cpool.h │ │ ├── connection.h │ │ ├── session.h │ │ └── router.h ├── mysql │ ├── mysql_version.h │ ├── mysql │ │ ├── mysql_lex_string.h │ │ ├── get_password.h │ │ ├── client_authentication.h │ │ ├── thread_type.h │ │ ├── service_thd_engine_lock.h │ │ ├── client_plugin.h.pp │ │ ├── plugin_validate_password.h │ │ ├── psi │ │ │ └── mysql_memory.h │ │ ├── service_my_plugin_log.h │ │ ├── services.h │ │ └── innodb_priv.h │ ├── mysql_embed.h │ ├── mysql_com_server.h │ ├── plugin_validate_password.h │ ├── my_list.h │ ├── my_command.h │ └── sslopt-case.h ├── libxml │ ├── xmlmodule.h │ ├── dict.h │ ├── threads.h │ ├── nanohttp.h │ └── xmlsave.h ├── pcre │ └── config.h ├── elr_mpl │ └── elr_mtx.h └── jansson │ └── jansson_config.h └── CMakeLists.txt /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bin/templates/test2.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /winbuild.bat: -------------------------------------------------------------------------------- 1 | cd build && cmake ../CMakeLists.txt -G "MinGW Makefiles" && make -------------------------------------------------------------------------------- /bin/iconv.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/iconv.dll -------------------------------------------------------------------------------- /bin/libjwt.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/libjwt.dll -------------------------------------------------------------------------------- /bin/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/zlib1.dll -------------------------------------------------------------------------------- /doc/test1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/doc/test1.png -------------------------------------------------------------------------------- /doc/test2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/doc/test2.png -------------------------------------------------------------------------------- /doc/test3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/doc/test3.png -------------------------------------------------------------------------------- /lib/iconv.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/iconv.dll -------------------------------------------------------------------------------- /lib/iconv.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/iconv.lib -------------------------------------------------------------------------------- /lib/libjwt.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/libjwt.dll -------------------------------------------------------------------------------- /lib/libssl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/libssl.lib -------------------------------------------------------------------------------- /lib/zdll.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/zdll.lib -------------------------------------------------------------------------------- /lib/zlib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/zlib.lib -------------------------------------------------------------------------------- /lib/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/zlib1.dll -------------------------------------------------------------------------------- /bin/libmysql.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/libmysql.dll -------------------------------------------------------------------------------- /bin/libpcre.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/libpcre.dll -------------------------------------------------------------------------------- /bin/libxml2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/libxml2.dll -------------------------------------------------------------------------------- /doc/hardware.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/doc/hardware.png -------------------------------------------------------------------------------- /lib/libjwt.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/libjwt.dll.a -------------------------------------------------------------------------------- /lib/libmysql.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/libmysql.dll -------------------------------------------------------------------------------- /lib/libmysql.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/libmysql.lib -------------------------------------------------------------------------------- /lib/libpcre.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/libpcre.dll -------------------------------------------------------------------------------- /lib/libxml2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/libxml2.dll -------------------------------------------------------------------------------- /lib/libxml2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/libxml2.lib -------------------------------------------------------------------------------- /bin/libcrypto.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/libcrypto.dll -------------------------------------------------------------------------------- /bin/libjansson.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/libjansson.dll -------------------------------------------------------------------------------- /bin/libpcre32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/libpcre32.dll -------------------------------------------------------------------------------- /bin/libserver.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/libserver.dll.a -------------------------------------------------------------------------------- /bin/libssl-1_1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/libssl-1_1.dll -------------------------------------------------------------------------------- /bin/pthreadVC2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/pthreadVC2.dll -------------------------------------------------------------------------------- /doc/dmfserver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/doc/dmfserver.png -------------------------------------------------------------------------------- /lib/libcrypto.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/libcrypto.lib -------------------------------------------------------------------------------- /lib/libjansson.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/libjansson.dll -------------------------------------------------------------------------------- /lib/libpcre32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/libpcre32.dll -------------------------------------------------------------------------------- /lib/libssl-1_1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/libssl-1_1.dll -------------------------------------------------------------------------------- /lib/linux/libpcre.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/linux/libpcre.a -------------------------------------------------------------------------------- /lib/pthreadVC2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/pthreadVC2.dll -------------------------------------------------------------------------------- /lib/pthreadVC2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/pthreadVC2.lib -------------------------------------------------------------------------------- /bin/libcrypto-1_1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/libcrypto-1_1.dll -------------------------------------------------------------------------------- /bin/mdb/mdbclient.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/mdb/mdbclient.exe -------------------------------------------------------------------------------- /doc/test1_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/doc/test1_result.png -------------------------------------------------------------------------------- /doc/test2_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/doc/test2_result.png -------------------------------------------------------------------------------- /doc/test3_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/doc/test3_result.png -------------------------------------------------------------------------------- /lib/libcrypto-1_1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/libcrypto-1_1.dll -------------------------------------------------------------------------------- /doc/2023-05-12 (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/doc/2023-05-12 (1).png -------------------------------------------------------------------------------- /doc/2023-05-12 (2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/doc/2023-05-12 (2).png -------------------------------------------------------------------------------- /doc/2023-05-12 (3).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/doc/2023-05-12 (3).png -------------------------------------------------------------------------------- /lib/linux/libjansson.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/linux/libjansson.a -------------------------------------------------------------------------------- /lib/linux/libpcrecpp.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/linux/libpcrecpp.a -------------------------------------------------------------------------------- /lib/linux/libpcreposix.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/linux/libpcreposix.a -------------------------------------------------------------------------------- /winbuild.sh: -------------------------------------------------------------------------------- 1 | rm build -r && mkdir build && cd build && cmake ../CMakeLists.txt -G "MinGW Makefiles" && make -------------------------------------------------------------------------------- /lib/linux/libxml2-2.9.4.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/linux/libxml2-2.9.4.so -------------------------------------------------------------------------------- /lib/linux/libcrypto-1.1.1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/lib/linux/libcrypto-1.1.1.so -------------------------------------------------------------------------------- /bin/static/Assets/images/f1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/f1.png -------------------------------------------------------------------------------- /bin/static/Assets/images/f2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/f2.png -------------------------------------------------------------------------------- /bin/static/Assets/images/f3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/f3.png -------------------------------------------------------------------------------- /bin/static/Assets/images/f4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/f4.png -------------------------------------------------------------------------------- /bin/static/Assets/images/f5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/f5.png -------------------------------------------------------------------------------- /bin/static/Assets/images/p1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/p1.png -------------------------------------------------------------------------------- /bin/static/Assets/images/p2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/p2.png -------------------------------------------------------------------------------- /bin/static/Assets/images/p3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/p3.png -------------------------------------------------------------------------------- /bin/static/Assets/images/p4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/p4.png -------------------------------------------------------------------------------- /bin/static/Assets/images/p5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/p5.png -------------------------------------------------------------------------------- /bin/static/Assets/images/p6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/p6.png -------------------------------------------------------------------------------- /.VSCodeCounter/2023-11-12_19-31-34/diff.csv: -------------------------------------------------------------------------------- 1 | "filename", "language", "", "comment", "blank", "total" 2 | "Total", "-", , 0, 0, 0 -------------------------------------------------------------------------------- /bin/static/Assets/images/bg_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/bg_a.png -------------------------------------------------------------------------------- /bin/static/Assets/images/f_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/f_1.png -------------------------------------------------------------------------------- /bin/static/Assets/images/f_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/f_2.png -------------------------------------------------------------------------------- /bin/static/Assets/images/f_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/f_3.png -------------------------------------------------------------------------------- /bin/static/Assets/images/f_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/f_4.png -------------------------------------------------------------------------------- /bin/static/Assets/images/f_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/f_5.png -------------------------------------------------------------------------------- /bin/static/Assets/images/icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/icon1.png -------------------------------------------------------------------------------- /bin/static/Assets/images/icon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/icon2.png -------------------------------------------------------------------------------- /bin/static/Assets/images/icon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/icon3.png -------------------------------------------------------------------------------- /bin/static/Assets/images/icon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/icon4.png -------------------------------------------------------------------------------- /bin/static/Assets/images/icon5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/icon5.png -------------------------------------------------------------------------------- /bin/static/Assets/images/icon6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/icon6.png -------------------------------------------------------------------------------- /bin/static/Assets/images/icon7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/icon7.png -------------------------------------------------------------------------------- /bin/static/Assets/images/icon8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/icon8.png -------------------------------------------------------------------------------- /bin/static/Assets/images/icon9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/icon9.png -------------------------------------------------------------------------------- /bin/static/Assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/logo.png -------------------------------------------------------------------------------- /bin/static/Assets/images/movie.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/movie.ogg -------------------------------------------------------------------------------- /bin/static/Assets/images/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/next.png -------------------------------------------------------------------------------- /bin/static/Assets/images/prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/prev.png -------------------------------------------------------------------------------- /bin/static/Assets/upload/pic10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/upload/pic10.jpg -------------------------------------------------------------------------------- /bin/static/Assets/upload/pic2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/upload/pic2.jpg -------------------------------------------------------------------------------- /bin/static/Assets/upload/pic3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/upload/pic3.jpg -------------------------------------------------------------------------------- /bin/static/Assets/upload/pic4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/upload/pic4.jpg -------------------------------------------------------------------------------- /bin/static/Assets/upload/pic5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/upload/pic5.jpg -------------------------------------------------------------------------------- /bin/static/Assets/upload/pic6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/upload/pic6.jpg -------------------------------------------------------------------------------- /bin/static/Assets/upload/pic7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/upload/pic7.jpg -------------------------------------------------------------------------------- /bin/static/Assets/upload/pic8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/upload/pic8.jpg -------------------------------------------------------------------------------- /bin/static/Assets/upload/pic9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/upload/pic9.jpg -------------------------------------------------------------------------------- /bin/static/Assets/images/icon10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/icon10.png -------------------------------------------------------------------------------- /bin/static/Assets/images/icon11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/icon11.png -------------------------------------------------------------------------------- /bin/static/Assets/images/icon12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/icon12.png -------------------------------------------------------------------------------- /bin/static/Assets/images/icon13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/icon13.png -------------------------------------------------------------------------------- /bin/static/Assets/images/nav_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/images/nav_ico.png -------------------------------------------------------------------------------- /bin/static/Assets/upload/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/upload/banner.jpg -------------------------------------------------------------------------------- /bin/static/Assets/upload/banner_a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/upload/banner_a.jpg -------------------------------------------------------------------------------- /bin/static/Assets/plugins/FlexSlider/images/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/plugins/FlexSlider/images/banner.jpg -------------------------------------------------------------------------------- /bin/static/Assets/plugins/FlexSlider/images/nav_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengzechen/Dmf-FrameWork/HEAD/bin/static/Assets/plugins/FlexSlider/images/nav_ico.png -------------------------------------------------------------------------------- /get.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | for i in range(1000): 4 | res = requests.post('http://localhost/apptemp/template', 5 | headers={'Cookie': 'dmfsession=RHkGhqy3Sk'}) 6 | print(res.text) 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .vscode/c_cpp_properties.json 3 | .vscode/settings.json 4 | ./VSCodeCounter/* 5 | bin/*.exe 6 | 7 | 8 | build/* 9 | bin/server 10 | bin/server.log 11 | bin/mdb/libmdb_operate.dll 12 | bin/mdb/libmdb_operate.dll.a 13 | bin/mdb/mdbserver.exe 14 | bin/mdb/rw3.exe 15 | -------------------------------------------------------------------------------- /Src/testviews/ws.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | void wsfunc(connection_tp conn, const request_t *req) 4 | { 5 | char key[128] = {0}; 6 | req_get_ws_key(req, key); 7 | 8 | upto_ws_prot(conn, key); 9 | } 10 | 11 | RouterAdd(ws) 12 | { 13 | ContFun cf[] = {&wsfunc, NULL}; 14 | char* keys[] = {"/ws", NULL}; 15 | router_add_app(cf, keys, __func__); 16 | } -------------------------------------------------------------------------------- /include/openssl/ecdh.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #include 11 | -------------------------------------------------------------------------------- /include/openssl/ecdsa.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #include 11 | -------------------------------------------------------------------------------- /bin/templates/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Template 4 | 5 | 6 | 7 |

Name: [#name#]

8 |

Date: [#date#]

9 |
    10 | [@dec1@ 11 |
  • {{item}}
  • 12 | @] 13 |
14 | 15 | [@myfunction@

Myfunction Test

@] 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /include/openssl/asn1_mac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #error "This file is obsolete; please update your software." 11 | -------------------------------------------------------------------------------- /include/openssl/pem2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_PEM2_H 11 | # define HEADER_PEM2_H 12 | # include 13 | #endif 14 | -------------------------------------------------------------------------------- /.VSCodeCounter/2023-11-12_19-31-34/diff-details.md: -------------------------------------------------------------------------------- 1 | # Diff Details 2 | 3 | Date : 2023-11-12 19:31:34 4 | 5 | Directory d:\\TEMP\\C_learn\\Myserver\\Dmfserver\\Dmf-FrameWork 6 | 7 | Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines 8 | 9 | [Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details 10 | 11 | ## Files 12 | | filename | language | code | comment | blank | total | 13 | | :--- | :--- | ---: | ---: | ---: | ---: | 14 | 15 | [Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #CMake最低版本号要求 2 | cmake_minimum_required(VERSION 3.10.0) 3 | 4 | #指定项目名称 5 | project(DmfServer) 6 | 7 | # cmake:reset cmake tools for extension state 8 | 9 | #可以输出中文 10 | if( CMAKE_SYSTEM_NAME STREQUAL "Windows" ) 11 | add_definitions("-fexec-charset=gbk") 12 | endif() 13 | 14 | #指定版本信息 15 | set(CMAKE_SYSTEM_VERSION 1) 16 | 17 | #指定编译目录 18 | set(PROJECT_BINARY_DIR ${PROJECT_SOURCE_DIR}/build) 19 | 20 | #指定二进制文件输出目录 21 | set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) 22 | 23 | set (CMAKE_BUILD_TYPE "Debug") 24 | 25 | #添加子目录 26 | add_subdirectory(${PROJECT_SOURCE_DIR}/Src) 27 | -------------------------------------------------------------------------------- /include/openssl/ssl2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_SSL2_H 11 | # define HEADER_SSL2_H 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | # define SSL2_VERSION 0x0002 18 | 19 | # define SSL2_MT_CLIENT_HELLO 1 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /.VSCodeCounter/2023-11-12_19-31-34/diff.md: -------------------------------------------------------------------------------- 1 | # Diff Summary 2 | 3 | Date : 2023-11-12 19:31:34 4 | 5 | Directory d:\\TEMP\\C_learn\\Myserver\\Dmfserver\\Dmf-FrameWork 6 | 7 | Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines 8 | 9 | [Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md) 10 | 11 | ## Languages 12 | | language | files | code | comment | blank | total | 13 | | :--- | ---: | ---: | ---: | ---: | ---: | 14 | 15 | ## Directories 16 | | path | files | code | comment | blank | total | 17 | | :--- | ---: | ---: | ---: | ---: | ---: | 18 | 19 | [Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md) -------------------------------------------------------------------------------- /bin/conf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 80 6 | localhsot 7 | SSLSimpleServer 8 | 9 | ./cert/localhost-key.pem 10 | ./cert/localhost.pem 11 | 12 | 13 | 14 | 15 | localhost 16 | 3306 17 | pzc 18 | pzc123 19 | pzc 20 | 21 | 22 | 25 | 26 | 27 | 28 | ./static 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /bin/static/conf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 80 6 | localhsot 7 | SSLSimpleServer 8 | 9 | ./cert/localhost-key.pem 10 | ./cert/localhost.pem 11 | 12 | 13 | 14 | 15 | localhost 16 | 3306 17 | pzc 18 | pzc123 19 | pzc 20 | 21 | 22 | 25 | 26 | 27 | 28 | ./static 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Src/model/test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | 20 | -------------------------------------------------------------------------------- /Src/mdb/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 设置 可执行文件的输出路径为此目录 2 | set(EXECUTABLE_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/bin/mdb") 3 | # 设置 dll 的输出路径为此目录 4 | set(LIBRARY_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/bin/mdb") 5 | 6 | 7 | # 添加动态链接库 8 | file( GLOB libmdb_SRC 9 | "mdb_operate.c" 10 | "../utility/dm_hash.c" 11 | ) 12 | add_library(mdb_operate SHARED ${libmdb_SRC} ) 13 | 14 | # 编译 mdbserver 15 | add_executable(mdbserver "mdbserver.c") 16 | 17 | 18 | # 编译 mdbrw 19 | link_directories("${PROJECT_SOURCE_DIR}/bin/mdb/") 20 | 21 | if(CMAKE_SYSTEM_NAME STREQUAL "Linux") 22 | link_libraries("mdb_operate") 23 | else(CMAKE_SYSTEM_NAME STREQUAL "Windows") 24 | link_libraries("libmdb_operate") 25 | endif() 26 | 27 | add_executable(mdbclient "mdbclient.c") 28 | 29 | 30 | -------------------------------------------------------------------------------- /Src/conf/test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | #include 19 | 20 | void test () { 21 | printf("test ok\n"); 22 | } -------------------------------------------------------------------------------- /Src/testviews/other.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | #ifdef __WIN32__ 6 | 7 | void usleep1(unsigned long usec) 8 | { 9 | HANDLE timer; 10 | LARGE_INTEGER interval; 11 | interval.QuadPart = -(10 * usec); 12 | 13 | timer = CreateWaitableTimer(NULL, TRUE, NULL); 14 | SetWaitableTimer(timer, &interval, 0, NULL, NULL, 0); 15 | WaitForSingleObject(timer, INFINITE); 16 | CloseHandle(timer); 17 | } 18 | #endif 19 | 20 | void string(connection_tp conn, const request_t* req) 21 | { 22 | // void *block1 = pool_alloc(); 23 | // usleep1(400); 24 | // pool_free(block1); 25 | //printf("%s\n", req->query[0].key); 26 | res_row(conn, "test ok"); 27 | } 28 | 29 | 30 | RouterAdd(other){ 31 | ContFun cf[] = { &string, NULL}; 32 | char* keys[] = { "/string", NULL}; 33 | router_add_app(cf, keys, __func__); 34 | } -------------------------------------------------------------------------------- /include/openssl/__DECC_INCLUDE_EPILOGUE.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | /* 11 | * This file is only used by HP C/C++ on VMS, and is included automatically 12 | * after each header file from this directory 13 | */ 14 | 15 | /* 16 | * The C++ compiler doesn't understand these pragmas, even though it 17 | * understands the corresponding command line qualifier. 18 | */ 19 | #ifndef __cplusplus 20 | /* restore state. Must correspond to the save in __decc_include_prologue.h */ 21 | # pragma names restore 22 | #endif 23 | -------------------------------------------------------------------------------- /Src/testviews/template.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | void mfunction(char *out, char *in) { 4 | 5 | strcpy(out, in); 6 | } 7 | 8 | void template(connection_tp conn, const request_t *req) { 9 | 10 | struct Kvmap kv0 = {.key = "name", .value = "Dmfserver", .type = 1}; 11 | struct Kvmap kv1 = {.key = "date", .value = "2023/4/14", .type = 1}; 12 | struct Kvmap kv2 = {.key = "myfunction", .Func = &mfunction, .type = 2}; 13 | 14 | struct Kvmap kv[4]; 15 | kv[0] = kv0; 16 | kv[1] = kv1; 17 | kv[2] = kv2; 18 | 19 | kv[3].key = "dec1"; 20 | kv[3].dec[0] = "Apache"; 21 | kv[3].dec[1] = "Nginx"; 22 | kv[3].dec[2] = "Http"; 23 | kv[3].dec[3] = NULL; 24 | kv[3].type = 3; 25 | 26 | res_render(conn, "test.html", kv, 4); 27 | } 28 | 29 | RouterAdd(apptemp) 30 | { 31 | ContFun cf[] = {&template, NULL}; 32 | char* keys[] = {"/template", NULL}; 33 | router_add_app(cf, keys, __func__); 34 | } -------------------------------------------------------------------------------- /Src/elr_mpl/elr_mtx.c: -------------------------------------------------------------------------------- 1 | #include "dmfserver/elr_mpl/elr_mtx.h" 2 | 3 | #ifdef __WIN32__ 4 | 5 | elr_counter_t elr_atomic_inc(elr_atomic_t* v) 6 | { 7 | return InterlockedIncrement(v); 8 | } 9 | 10 | elr_counter_t elr_atomic_dec(elr_atomic_t* v) 11 | { 12 | return InterlockedDecrement(v); 13 | } 14 | 15 | /* 16 | ** 初始化互斥体,返回0表示初始化失败 17 | */ 18 | int elr_mtx_init(elr_mtx *mtx) 19 | { 20 | DWORD err; 21 | InitializeCriticalSection(&mtx->_cs); 22 | err = GetLastError(); 23 | if (STATUS_NO_MEMORY == err) 24 | { 25 | DeleteCriticalSection(&mtx->_cs); 26 | return 0; 27 | } 28 | 29 | return 1; 30 | } 31 | 32 | void elr_mtx_lock (elr_mtx *mtx) 33 | { 34 | EnterCriticalSection(&mtx->_cs); 35 | } 36 | 37 | void elr_mtx_unlock(elr_mtx *mtx) 38 | { 39 | LeaveCriticalSection(&mtx->_cs); 40 | } 41 | 42 | void elr_mtx_finalize(elr_mtx *mtx) 43 | { 44 | DeleteCriticalSection(&mtx->_cs); 45 | } 46 | #endif -------------------------------------------------------------------------------- /Src/testviews/mdb.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | void mdbfind(connection_tp conn, const request_t* req) 6 | { 7 | char* str_from_mdb; 8 | 9 | char data[40] = {0}; 10 | 11 | strcpy(data, hashmap_get( req->query, "name")); 12 | char* pdata = data; 13 | 14 | str_from_mdb = mdb_find(pdata); 15 | res_row(conn, str_from_mdb); 16 | //free(str_from_mdb); 17 | } 18 | 19 | void mdbinsert(connection_tp conn, const request_t* req) 20 | { 21 | char ckey[64] = {0}; 22 | char cdata[512] = {0}; 23 | strcpy(ckey, "name"); 24 | strcpy(cdata, hashmap_get( req->query, "name")); 25 | 26 | char* key = ckey; 27 | char* data = cdata; 28 | mdb_insert(key, data); 29 | res_row(conn, "insert ok!"); 30 | } 31 | 32 | 33 | RouterAdd(mdb){ 34 | ContFun cf[] = {&mdbfind, &mdbinsert, NULL}; 35 | char* keys[] = {"/find", "/insert", NULL}; 36 | router_add_app(cf, keys, __func__); 37 | } 38 | 39 | -------------------------------------------------------------------------------- /include/openssl/__DECC_INCLUDE_PROLOGUE.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | /* 11 | * This file is only used by HP C/C++ on VMS, and is included automatically 12 | * after each header file from this directory 13 | */ 14 | 15 | /* 16 | * The C++ compiler doesn't understand these pragmas, even though it 17 | * understands the corresponding command line qualifier. 18 | */ 19 | #ifndef __cplusplus 20 | /* save state */ 21 | # pragma names save 22 | /* have the compiler shorten symbols larger than 31 chars to 23 chars 23 | * followed by a 8 hex char CRC 24 | */ 25 | # pragma names as_is,shortened 26 | #endif 27 | -------------------------------------------------------------------------------- /include/openssl/buffererr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_BUFERR_H 12 | # define HEADER_BUFERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_BUF_strings(void); 22 | 23 | /* 24 | * BUF function codes. 25 | */ 26 | # define BUF_F_BUF_MEM_GROW 100 27 | # define BUF_F_BUF_MEM_GROW_CLEAN 105 28 | # define BUF_F_BUF_MEM_NEW 101 29 | 30 | /* 31 | * BUF reason codes. 32 | */ 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /include/openssl/rc4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_RC4_H 11 | # define HEADER_RC4_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_RC4 16 | # include 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | typedef struct rc4_key_st { 22 | RC4_INT x, y; 23 | RC4_INT data[256]; 24 | } RC4_KEY; 25 | 26 | const char *RC4_options(void); 27 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 28 | void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, 29 | unsigned char *outdata); 30 | 31 | # ifdef __cplusplus 32 | } 33 | # endif 34 | # endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __COMMON_INCLUDE__ 20 | #define __COMMON_INCLUDE__ 21 | 22 | #include 23 | 24 | typedef struct _server_t { 25 | pool_t pool_io; 26 | pool_t pool_handle; 27 | } server_t; 28 | 29 | 30 | #endif // __COMMON_INCLUDE__ -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/utility/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __DM_BASE64_INCLUDE__ 20 | #define __DM_BASE64_INCLUDE__ 21 | 22 | #include 23 | #include 24 | 25 | unsigned char *base64_encode(unsigned char *str); 26 | 27 | unsigned char *base64_decode(unsigned char *code); 28 | 29 | #endif // __DM_BASE64_INCLUDE__ -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/utility/dm_hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __DM_HASH_INCLUDE__ 20 | #define __DM_HASH_INCLUDE__ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | extern unsigned int BKDRHash(char *str); 27 | 28 | #ifdef __cplusplus 29 | } /* end of the 'extern "C"' block */ 30 | #endif 31 | 32 | 33 | #endif // __DM_HASH_INCLUDE__ -------------------------------------------------------------------------------- /include/openssl/ebcdic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_EBCDIC_H 11 | # define HEADER_EBCDIC_H 12 | 13 | # include 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /* Avoid name clashes with other applications */ 20 | # define os_toascii _openssl_os_toascii 21 | # define os_toebcdic _openssl_os_toebcdic 22 | # define ebcdic2ascii _openssl_ebcdic2ascii 23 | # define ascii2ebcdic _openssl_ascii2ebcdic 24 | 25 | extern const unsigned char os_toascii[256]; 26 | extern const unsigned char os_toebcdic[256]; 27 | void *ebcdic2ascii(void *dest, const void *srce, size_t count); 28 | void *ascii2ebcdic(void *dest, const void *srce, size_t count); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | #endif 34 | -------------------------------------------------------------------------------- /Src/utility/dm_hash.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #include 20 | 21 | 22 | // BKDR Hash Function 23 | extern unsigned int BKDRHash(char *str) 24 | { 25 | unsigned int seed = 131; // 31 131 1313 13131 131313 etc.. 26 | unsigned int hash = 0; 27 | while (*str){ 28 | hash = hash * seed + (*str++); 29 | } 30 | return (hash & 0x7FFFFFFF); 31 | } -------------------------------------------------------------------------------- /Src/testviews/mysql.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | void mysqltest(connection_tp conn, const request_t* req) 5 | { 6 | 7 | mysql_conn* conn1 = get_mysql_connection_block(); 8 | mysql_query(&conn1->conn, "select Count(*) from test;"); 9 | MYSQL_RES* res_ptr = mysql_store_result(&conn1->conn); 10 | // printf(" query result %d\n", mysql_num_rows(res_ptr)); 11 | MYSQL_ROW result_row = mysql_fetch_row(res_ptr); 12 | 13 | char sql[100] = {0}; 14 | sprintf(sql, "insert into test(id, test_string) value " 15 | "(%s, 'test string');", result_row[0] ); 16 | 17 | mysql_query(&conn1->conn, sql); 18 | 19 | 20 | mysql_free_result(res_ptr); 21 | free(res_ptr); 22 | 23 | res_row(conn, "ok"); 24 | release_mysql_connection(conn1); 25 | } 26 | 27 | void mysqltest1(connection_tp conn, const request_t* req) 28 | { 29 | 30 | exe_sql("select id from test where id=3;"); 31 | 32 | res_row(conn, "ok"); 33 | } 34 | 35 | RouterAdd(model) 36 | { 37 | ContFun cf[] = {&mysqltest, &mysqltest1,NULL}; 38 | char* keys[] = {"/mysqltest", "/mysqltest1",NULL}; 39 | router_add_app(cf, keys, __func__); 40 | } -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/cfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __CFG_INCLUDE__ 20 | #define __CFG_INCLUDE__ 21 | 22 | 23 | // #define __SERVER_MPOOL__ // 启用server内存池 24 | 25 | #ifdef __SERVER_MPOOL__ 26 | #define SERVER_MPOOL_NUM 8192 27 | #endif // __SERVER_MPOOL__ 28 | 29 | // #define __SERVER_IOCP_DEBUG__ // 不会启用request router 等模块,接到请求直接返回 hello woorld 字符串 30 | 31 | 32 | 33 | #endif // __CFG_INCLUDE__ -------------------------------------------------------------------------------- /include/mysql/mysql_version.h: -------------------------------------------------------------------------------- 1 | /* Copyright Abandoned 1996,1999 TCX DataKonsult AB & Monty Program KB 2 | & Detron HB, 1996, 1999-2004, 2007 MySQL AB. 3 | This file is public domain and comes with NO WARRANTY of any kind 4 | */ 5 | 6 | /* Version numbers for protocol & mysqld */ 7 | 8 | #ifndef _mysql_version_h 9 | #define _mysql_version_h 10 | 11 | #define PROTOCOL_VERSION 10 12 | #define MYSQL_SERVER_VERSION "5.7.41" 13 | #define MYSQL_BASE_VERSION "mysqld-5.7" 14 | #define MYSQL_SERVER_SUFFIX_DEF "" 15 | #define FRM_VER 6 16 | #define MYSQL_VERSION_ID 50741 17 | #define MYSQL_PORT 3306 18 | #define MYSQL_PORT_DEFAULT 0 19 | #define MYSQL_UNIX_ADDR "/tmp/mysql.sock" 20 | #define MYSQL_CONFIG_NAME "my" 21 | #define MYSQL_COMPILATION_COMMENT "MySQL Community Server (GPL)" 22 | #define LIBMYSQL_VERSION "5.7.41" 23 | #define LIBMYSQL_VERSION_ID 50741 24 | #define SYS_SCHEMA_VERSION "1.5.2" 25 | 26 | #ifndef LICENSE 27 | #define LICENSE GPL 28 | #endif /* LICENSE */ 29 | 30 | #endif /* _mysql_version_h */ 31 | -------------------------------------------------------------------------------- /bin/static/Assets/plugins/FlexSlider/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 无标题文档 6 | 7 | 8 | 9 | 17 | 20 | 21 | 22 | 23 |
24 |
25 |
    26 |
  • 27 | 28 |
  • 29 |
  • 30 | 31 |
  • 32 |
  • 33 | 34 |
  • 35 |
36 |
37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/utility/utility.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __UTILITY_INCLUDE__ 20 | #define __UTILITY_INCLUDE__ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | extern void server_time(char* str); 32 | 33 | extern char * itoa(int value,char *string,int radix); 34 | 35 | #ifdef __cplusplus 36 | } /* end of the 'extern "C"' block */ 37 | #endif 38 | 39 | #endif // __UTILITY_INCLUDE__ -------------------------------------------------------------------------------- /include/openssl/mdc2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_MDC2_H 11 | # define HEADER_MDC2_H 12 | 13 | # include 14 | 15 | #ifndef OPENSSL_NO_MDC2 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | # define MDC2_BLOCK 8 23 | # define MDC2_DIGEST_LENGTH 16 24 | 25 | typedef struct mdc2_ctx_st { 26 | unsigned int num; 27 | unsigned char data[MDC2_BLOCK]; 28 | DES_cblock h, hh; 29 | int pad_type; /* either 1 or 2, default 1 */ 30 | } MDC2_CTX; 31 | 32 | int MDC2_Init(MDC2_CTX *c); 33 | int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len); 34 | int MDC2_Final(unsigned char *md, MDC2_CTX *c); 35 | unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md); 36 | 37 | # ifdef __cplusplus 38 | } 39 | # endif 40 | # endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/openssl/cmac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_CMAC_H 11 | # define HEADER_CMAC_H 12 | 13 | # ifndef OPENSSL_NO_CMAC 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | # include 20 | 21 | /* Opaque */ 22 | typedef struct CMAC_CTX_st CMAC_CTX; 23 | 24 | CMAC_CTX *CMAC_CTX_new(void); 25 | void CMAC_CTX_cleanup(CMAC_CTX *ctx); 26 | void CMAC_CTX_free(CMAC_CTX *ctx); 27 | EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx); 28 | int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); 29 | 30 | int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, 31 | const EVP_CIPHER *cipher, ENGINE *impl); 32 | int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen); 33 | int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen); 34 | int CMAC_resume(CMAC_CTX *ctx); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | # endif 41 | #endif 42 | -------------------------------------------------------------------------------- /include/openssl/md2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_MD2_H 11 | # define HEADER_MD2_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_MD2 16 | # include 17 | # ifdef __cplusplus 18 | extern "C" { 19 | # endif 20 | 21 | typedef unsigned char MD2_INT; 22 | 23 | # define MD2_DIGEST_LENGTH 16 24 | # define MD2_BLOCK 16 25 | 26 | typedef struct MD2state_st { 27 | unsigned int num; 28 | unsigned char data[MD2_BLOCK]; 29 | MD2_INT cksm[MD2_BLOCK]; 30 | MD2_INT state[MD2_BLOCK]; 31 | } MD2_CTX; 32 | 33 | const char *MD2_options(void); 34 | int MD2_Init(MD2_CTX *c); 35 | int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); 36 | int MD2_Final(unsigned char *md, MD2_CTX *c); 37 | unsigned char *MD2(const unsigned char *d, size_t n, unsigned char *md); 38 | 39 | # ifdef __cplusplus 40 | } 41 | # endif 42 | # endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /.VSCodeCounter/2023-11-12_19-31-34/diff.txt: -------------------------------------------------------------------------------- 1 | Date : 2023-11-12 19:31:34 2 | Directory : d:\TEMP\C_learn\Myserver\Dmfserver\Dmf-FrameWork 3 | Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines 4 | 5 | Languages 6 | +----------+------------+------------+------------+------------+------------+ 7 | | language | files | code | comment | blank | total | 8 | +----------+------------+------------+------------+------------+------------+ 9 | +----------+------------+------------+------------+------------+------------+ 10 | 11 | Directories 12 | +------+------------+------------+------------+------------+------------+ 13 | | path | files | code | comment | blank | total | 14 | +------+------------+------------+------------+------------+------------+ 15 | +------+------------+------------+------------+------------+------------+ 16 | 17 | Files 18 | +----------+----------+------------+------------+------------+------------+ 19 | | filename | language | code | comment | blank | total | 20 | +----------+----------+------------+------------+------------+------------+ 21 | | Total | | 0 | 0 | 0 | 0 | 22 | +----------+----------+------------+------------+------------+------------+ -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/middleware/middleware.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | 20 | #ifndef __MIDDLEWARE_INCLUDE__ 21 | #define __MIDDLEWARE_INCLUDE__ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | static int middleware_check_if_too_often(connection_tp conn); 32 | 33 | extern void middleware_init(); 34 | 35 | extern int middleware_handle(connection_tp conn ); 36 | 37 | #ifdef __cplusplus 38 | } /* end of the 'extern "C"' block */ 39 | #endif 40 | 41 | 42 | #endif // __MIDDLEWARE_INCLUDE__ -------------------------------------------------------------------------------- /bin/static/Assets/css/reset.css: -------------------------------------------------------------------------------- 1 | body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, textarea, p, blockquote, th, td { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | a { 6 | text-decoration: none; 7 | } 8 | fieldset, img { 9 | border: 0; 10 | } 11 | address, caption, cite, code, dfn, em, th, var { 12 | font-style: normal; 13 | font-weight: normal; 14 | } 15 | ol, ul { 16 | list-style: none; 17 | } 18 | caption, th { 19 | text-align: left; 20 | } 21 | q:before, q:after { 22 | content: ''; 23 | } 24 | abbr, acronym { 25 | border: 0; 26 | } 27 | /*通用父子盒子嵌套浮动问题解决,开始*/ 28 | .clear { 29 | margin: 0px auto; 30 | width: 100%; 31 | height: 1px; 32 | font-size: 1px; 33 | clear: both; 34 | background: none; 35 | overflow: hidden; 36 | } 37 | .clearfix:after { 38 | content: "."; 39 | display: block; 40 | height: 0; 41 | clear: both; 42 | visibility: hidden; 43 | } 44 | .clearfix { 45 | display: inline-block; 46 | } 47 | * html .clearfix { 48 | height: 1%; 49 | } 50 | .clearfix { 51 | display: block; 52 | } 53 | /*通用父子盒子嵌套浮动问题解决,结束*/ 54 | /*间隙层开始*/ 55 | .space_hx { /*横向间隙*/ 56 | clear: both; 57 | width: 100%; 58 | height: 20px; 59 | font-size: 1px; 60 | overflow: hidden; 61 | } 62 | .space_zx { /*纵向间隙*/ 63 | float: left; 64 | width: 10px; 65 | font-size: 1px; 66 | overflow: hidden; 67 | } 68 | /*间隙层结束*/ 69 | -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/ws.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __WS_INCLUDE__ 20 | #define __WS_INCLUDE__ 21 | 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | 29 | #ifdef __WIN32__ 30 | #include // 为了使用 send 31 | #elif __linux__ 32 | #include 33 | #include 34 | #include 35 | #include // for close 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | extern void upto_ws_prot( connection_tp conn, char key[]) ; 43 | 44 | 45 | #ifdef __cplusplus 46 | } /* end of the 'extern "C"' block */ 47 | #endif 48 | 49 | #endif // __WS_INCLUDE__ -------------------------------------------------------------------------------- /include/openssl/comperr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_COMPERR_H 12 | # define HEADER_COMPERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # include 19 | 20 | # ifndef OPENSSL_NO_COMP 21 | 22 | # ifdef __cplusplus 23 | extern "C" 24 | # endif 25 | int ERR_load_COMP_strings(void); 26 | 27 | /* 28 | * COMP function codes. 29 | */ 30 | # define COMP_F_BIO_ZLIB_FLUSH 99 31 | # define COMP_F_BIO_ZLIB_NEW 100 32 | # define COMP_F_BIO_ZLIB_READ 101 33 | # define COMP_F_BIO_ZLIB_WRITE 102 34 | # define COMP_F_COMP_CTX_NEW 103 35 | 36 | /* 37 | * COMP reason codes. 38 | */ 39 | # define COMP_R_ZLIB_DEFLATE_ERROR 99 40 | # define COMP_R_ZLIB_INFLATE_ERROR 100 41 | # define COMP_R_ZLIB_NOT_SUPPORTED 101 42 | 43 | # endif 44 | #endif 45 | -------------------------------------------------------------------------------- /include/libxml/xmlmodule.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Summary: dynamic module loading 3 | * Description: basic API for dynamic module loading, used by 4 | * libexslt added in 2.6.17 5 | * 6 | * Copy: See Copyright for the status of this software. 7 | * 8 | * Author: Joel W. Reed 9 | */ 10 | 11 | #ifndef __XML_MODULE_H__ 12 | #define __XML_MODULE_H__ 13 | 14 | #include 15 | 16 | #ifdef LIBXML_MODULES_ENABLED 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /** 23 | * xmlModulePtr: 24 | * 25 | * A handle to a dynamically loaded module 26 | */ 27 | typedef struct _xmlModule xmlModule; 28 | typedef xmlModule *xmlModulePtr; 29 | 30 | /** 31 | * xmlModuleOption: 32 | * 33 | * enumeration of options that can be passed down to xmlModuleOpen() 34 | */ 35 | typedef enum { 36 | XML_MODULE_LAZY = 1, /* lazy binding */ 37 | XML_MODULE_LOCAL= 2 /* local binding */ 38 | } xmlModuleOption; 39 | 40 | XMLPUBFUN xmlModulePtr XMLCALL xmlModuleOpen (const char *filename, 41 | int options); 42 | 43 | XMLPUBFUN int XMLCALL xmlModuleSymbol (xmlModulePtr module, 44 | const char* name, 45 | void **result); 46 | 47 | XMLPUBFUN int XMLCALL xmlModuleClose (xmlModulePtr module); 48 | 49 | XMLPUBFUN int XMLCALL xmlModuleFree (xmlModulePtr module); 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif /* LIBXML_MODULES_ENABLED */ 56 | 57 | #endif /*__XML_MODULE_H__ */ 58 | -------------------------------------------------------------------------------- /include/openssl/ripemd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_RIPEMD_H 11 | # define HEADER_RIPEMD_H 12 | 13 | # include 14 | 15 | #ifndef OPENSSL_NO_RMD160 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | # define RIPEMD160_LONG unsigned int 23 | 24 | # define RIPEMD160_CBLOCK 64 25 | # define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) 26 | # define RIPEMD160_DIGEST_LENGTH 20 27 | 28 | typedef struct RIPEMD160state_st { 29 | RIPEMD160_LONG A, B, C, D, E; 30 | RIPEMD160_LONG Nl, Nh; 31 | RIPEMD160_LONG data[RIPEMD160_LBLOCK]; 32 | unsigned int num; 33 | } RIPEMD160_CTX; 34 | 35 | int RIPEMD160_Init(RIPEMD160_CTX *c); 36 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); 37 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); 38 | unsigned char *RIPEMD160(const unsigned char *d, size_t n, unsigned char *md); 39 | void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); 40 | 41 | # ifdef __cplusplus 42 | } 43 | # endif 44 | # endif 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /include/openssl/symhacks.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_SYMHACKS_H 11 | # define HEADER_SYMHACKS_H 12 | 13 | # include 14 | 15 | /* Case insensitive linking causes problems.... */ 16 | # if defined(OPENSSL_SYS_VMS) 17 | # undef ERR_load_CRYPTO_strings 18 | # define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings 19 | # undef OCSP_crlID_new 20 | # define OCSP_crlID_new OCSP_crlID2_new 21 | 22 | # undef d2i_ECPARAMETERS 23 | # define d2i_ECPARAMETERS d2i_UC_ECPARAMETERS 24 | # undef i2d_ECPARAMETERS 25 | # define i2d_ECPARAMETERS i2d_UC_ECPARAMETERS 26 | # undef d2i_ECPKPARAMETERS 27 | # define d2i_ECPKPARAMETERS d2i_UC_ECPKPARAMETERS 28 | # undef i2d_ECPKPARAMETERS 29 | # define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS 30 | 31 | /* This one clashes with CMS_data_create */ 32 | # undef cms_Data_create 33 | # define cms_Data_create priv_cms_Data_create 34 | 35 | # endif 36 | 37 | #endif /* ! defined HEADER_VMS_IDHACKS_H */ 38 | -------------------------------------------------------------------------------- /include/openssl/conf_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_CONF_API_H 11 | # define HEADER_CONF_API_H 12 | 13 | # include 14 | # include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* Up until OpenSSL 0.9.5a, this was new_section */ 21 | CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); 22 | /* Up until OpenSSL 0.9.5a, this was get_section */ 23 | CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); 24 | /* Up until OpenSSL 0.9.5a, this was CONF_get_section */ 25 | STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, 26 | const char *section); 27 | 28 | int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); 29 | char *_CONF_get_string(const CONF *conf, const char *section, 30 | const char *name); 31 | long _CONF_get_number(const CONF *conf, const char *section, 32 | const char *name); 33 | 34 | int _CONF_new_data(CONF *conf); 35 | void _CONF_free_data(CONF *conf); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif 41 | -------------------------------------------------------------------------------- /include/openssl/objectserr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_OBJERR_H 12 | # define HEADER_OBJERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_OBJ_strings(void); 22 | 23 | /* 24 | * OBJ function codes. 25 | */ 26 | # define OBJ_F_OBJ_ADD_OBJECT 105 27 | # define OBJ_F_OBJ_ADD_SIGID 107 28 | # define OBJ_F_OBJ_CREATE 100 29 | # define OBJ_F_OBJ_DUP 101 30 | # define OBJ_F_OBJ_NAME_NEW_INDEX 106 31 | # define OBJ_F_OBJ_NID2LN 102 32 | # define OBJ_F_OBJ_NID2OBJ 103 33 | # define OBJ_F_OBJ_NID2SN 104 34 | # define OBJ_F_OBJ_TXT2OBJ 108 35 | 36 | /* 37 | * OBJ reason codes. 38 | */ 39 | # define OBJ_R_OID_EXISTS 102 40 | # define OBJ_R_UNKNOWN_NID 101 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/openssl/asyncerr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_ASYNCERR_H 12 | # define HEADER_ASYNCERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_ASYNC_strings(void); 22 | 23 | /* 24 | * ASYNC function codes. 25 | */ 26 | # define ASYNC_F_ASYNC_CTX_NEW 100 27 | # define ASYNC_F_ASYNC_INIT_THREAD 101 28 | # define ASYNC_F_ASYNC_JOB_NEW 102 29 | # define ASYNC_F_ASYNC_PAUSE_JOB 103 30 | # define ASYNC_F_ASYNC_START_FUNC 104 31 | # define ASYNC_F_ASYNC_START_JOB 105 32 | # define ASYNC_F_ASYNC_WAIT_CTX_SET_WAIT_FD 106 33 | 34 | /* 35 | * ASYNC reason codes. 36 | */ 37 | # define ASYNC_R_FAILED_TO_SET_POOL 101 38 | # define ASYNC_R_FAILED_TO_SWAP_CONTEXT 102 39 | # define ASYNC_R_INIT_FAILED 105 40 | # define ASYNC_R_INVALID_POOL_SIZE 103 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/openssl/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_MD5_H 11 | # define HEADER_MD5_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_MD5 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | /* 23 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 24 | * ! MD5_LONG has to be at least 32 bits wide. ! 25 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 26 | */ 27 | # define MD5_LONG unsigned int 28 | 29 | # define MD5_CBLOCK 64 30 | # define MD5_LBLOCK (MD5_CBLOCK/4) 31 | # define MD5_DIGEST_LENGTH 16 32 | 33 | typedef struct MD5state_st { 34 | MD5_LONG A, B, C, D; 35 | MD5_LONG Nl, Nh; 36 | MD5_LONG data[MD5_LBLOCK]; 37 | unsigned int num; 38 | } MD5_CTX; 39 | 40 | int MD5_Init(MD5_CTX *c); 41 | int MD5_Update(MD5_CTX *c, const void *data, size_t len); 42 | int MD5_Final(unsigned char *md, MD5_CTX *c); 43 | unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md); 44 | void MD5_Transform(MD5_CTX *c, const unsigned char *b); 45 | # ifdef __cplusplus 46 | } 47 | # endif 48 | # endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /include/openssl/srtp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | /* 11 | * DTLS code by Eric Rescorla 12 | * 13 | * Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc. 14 | */ 15 | 16 | #ifndef HEADER_D1_SRTP_H 17 | # define HEADER_D1_SRTP_H 18 | 19 | # include 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | # define SRTP_AES128_CM_SHA1_80 0x0001 26 | # define SRTP_AES128_CM_SHA1_32 0x0002 27 | # define SRTP_AES128_F8_SHA1_80 0x0003 28 | # define SRTP_AES128_F8_SHA1_32 0x0004 29 | # define SRTP_NULL_SHA1_80 0x0005 30 | # define SRTP_NULL_SHA1_32 0x0006 31 | 32 | /* AEAD SRTP protection profiles from RFC 7714 */ 33 | # define SRTP_AEAD_AES_128_GCM 0x0007 34 | # define SRTP_AEAD_AES_256_GCM 0x0008 35 | 36 | # ifndef OPENSSL_NO_SRTP 37 | 38 | __owur int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles); 39 | __owur int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles); 40 | 41 | __owur STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl); 42 | __owur SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s); 43 | 44 | # endif 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /include/openssl/md4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_MD4_H 11 | # define HEADER_MD4_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_MD4 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | /*- 23 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 24 | * ! MD4_LONG has to be at least 32 bits wide. ! 25 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 26 | */ 27 | # define MD4_LONG unsigned int 28 | 29 | # define MD4_CBLOCK 64 30 | # define MD4_LBLOCK (MD4_CBLOCK/4) 31 | # define MD4_DIGEST_LENGTH 16 32 | 33 | typedef struct MD4state_st { 34 | MD4_LONG A, B, C, D; 35 | MD4_LONG Nl, Nh; 36 | MD4_LONG data[MD4_LBLOCK]; 37 | unsigned int num; 38 | } MD4_CTX; 39 | 40 | int MD4_Init(MD4_CTX *c); 41 | int MD4_Update(MD4_CTX *c, const void *data, size_t len); 42 | int MD4_Final(unsigned char *md, MD4_CTX *c); 43 | unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md); 44 | void MD4_Transform(MD4_CTX *c, const unsigned char *b); 45 | 46 | # ifdef __cplusplus 47 | } 48 | # endif 49 | # endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /include/openssl/comp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_COMP_H 11 | # define HEADER_COMP_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_COMP 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | 23 | 24 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); 25 | const COMP_METHOD *COMP_CTX_get_method(const COMP_CTX *ctx); 26 | int COMP_CTX_get_type(const COMP_CTX* comp); 27 | int COMP_get_type(const COMP_METHOD *meth); 28 | const char *COMP_get_name(const COMP_METHOD *meth); 29 | void COMP_CTX_free(COMP_CTX *ctx); 30 | 31 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 32 | unsigned char *in, int ilen); 33 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, 34 | unsigned char *in, int ilen); 35 | 36 | COMP_METHOD *COMP_zlib(void); 37 | 38 | #if OPENSSL_API_COMPAT < 0x10100000L 39 | #define COMP_zlib_cleanup() while(0) continue 40 | #endif 41 | 42 | # ifdef HEADER_BIO_H 43 | # ifdef ZLIB 44 | const BIO_METHOD *BIO_f_zlib(void); 45 | # endif 46 | # endif 47 | 48 | 49 | # ifdef __cplusplus 50 | } 51 | # endif 52 | # endif 53 | #endif 54 | -------------------------------------------------------------------------------- /include/pcre/config.h: -------------------------------------------------------------------------------- 1 | /* config.h for CMake builds */ 2 | 3 | #define HAVE_DIRENT_H 1 4 | #define HAVE_SYS_STAT_H 1 5 | #define HAVE_SYS_TYPES_H 1 6 | #define HAVE_UNISTD_H 1 7 | #define HAVE_WINDOWS_H 1 8 | #define HAVE_STDINT_H 1 9 | #define HAVE_INTTYPES_H 1 10 | 11 | /* #undef HAVE_TYPE_TRAITS_H */ 12 | /* #undef HAVE_BITS_TYPE_TRAITS_H */ 13 | 14 | /* #undef HAVE_BCOPY */ 15 | #define HAVE_MEMMOVE 1 16 | #define HAVE_STRERROR 1 17 | #define HAVE_STRTOLL 1 18 | /* #undef HAVE_STRTOQ */ 19 | #define HAVE__STRTOI64 1 20 | 21 | /* #undef PCRE_STATIC */ 22 | 23 | #define SUPPORT_PCRE8 1 24 | /* #undef SUPPORT_PCRE16 */ 25 | #define SUPPORT_PCRE32 1 26 | /* #undef SUPPORT_JIT */ 27 | #define SUPPORT_PCREGREP_JIT 1 28 | /* #undef SUPPORT_UTF */ 29 | /* #undef SUPPORT_UCP */ 30 | /* #undef EBCDIC */ 31 | /* #undef EBCDIC_NL25 */ 32 | /* #undef BSR_ANYCRLF */ 33 | /* #undef NO_RECURSE */ 34 | 35 | #define HAVE_LONG_LONG 1 36 | #define HAVE_UNSIGNED_LONG_LONG 1 37 | 38 | /* #undef SUPPORT_LIBBZ2 */ 39 | /* #undef SUPPORT_LIBZ */ 40 | /* #undef SUPPORT_LIBEDIT */ 41 | /* #undef SUPPORT_LIBREADLINE */ 42 | 43 | /* #undef SUPPORT_VALGRIND */ 44 | /* #undef SUPPORT_GCOV */ 45 | 46 | #define NEWLINE 10 47 | #define POSIX_MALLOC_THRESHOLD 10 48 | #define LINK_SIZE 2 49 | #define PARENS_NEST_LIMIT 250 50 | #define MATCH_LIMIT 10000000 51 | #define MATCH_LIMIT_RECURSION MATCH_LIMIT 52 | #define PCREGREP_BUFSIZE 20480 53 | 54 | #define MAX_NAME_SIZE 32 55 | #define MAX_NAME_COUNT 10000 56 | 57 | /* end config.h for CMake builds */ 58 | -------------------------------------------------------------------------------- /include/openssl/whrlpool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_WHRLPOOL_H 11 | # define HEADER_WHRLPOOL_H 12 | 13 | #include 14 | 15 | # ifndef OPENSSL_NO_WHIRLPOOL 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | # define WHIRLPOOL_DIGEST_LENGTH (512/8) 23 | # define WHIRLPOOL_BBLOCK 512 24 | # define WHIRLPOOL_COUNTER (256/8) 25 | 26 | typedef struct { 27 | union { 28 | unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; 29 | /* double q is here to ensure 64-bit alignment */ 30 | double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)]; 31 | } H; 32 | unsigned char data[WHIRLPOOL_BBLOCK / 8]; 33 | unsigned int bitoff; 34 | size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)]; 35 | } WHIRLPOOL_CTX; 36 | 37 | int WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 38 | int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes); 39 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits); 40 | int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c); 41 | unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md); 42 | 43 | # ifdef __cplusplus 44 | } 45 | # endif 46 | # endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /bin/cert/localhost.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEKjCCApKgAwIBAgIQYQ+5BfKxGnrzC98fsJLynTANBgkqhkiG9w0BAQsFADBv 3 | MR4wHAYDVQQKExVta2NlcnQgZGV2ZWxvcG1lbnQgQ0ExIjAgBgNVBAsMGVBaQ1w5 4 | MjcwNkBwemMgKOW9reazvei+sCkxKTAnBgNVBAMMIG1rY2VydCBQWkNcOTI3MDZA 5 | cHpjICjlva3ms73ovrApMB4XDTIzMDIxNTA0MzExMloXDTI1MDUxNTA0MzExMlow 6 | TTEnMCUGA1UEChMebWtjZXJ0IGRldmVsb3BtZW50IGNlcnRpZmljYXRlMSIwIAYD 7 | VQQLDBlQWkNcOTI3MDZAcHpjICjlva3ms73ovrApMIIBIjANBgkqhkiG9w0BAQEF 8 | AAOCAQ8AMIIBCgKCAQEAr2D7uOoCKB909jYJfT5P2Nd2GWxPPD62TSq7buQ5UJUY 9 | 6ogGgzqwR1wuaJYTvO1+0GWHY219lffJLCbUXXuLowITSWdym08/RZTp+ov4KwE/ 10 | G77RR81iN1sdgrJ5qgxelR2cTtAsg/Sllie60XHqI0Adryin/cN96jGa7laHHBNK 11 | gHxWqR9xaSOeNQOD7UFaMj5nxbcJC3esvJLRBFoL8RXyEk8mdfmUKBC/Ozo1rg8k 12 | n1dW7FJve1I8hYeogm1E3rEffFLwA35iJ8/XVx9TCfqrNpGtXnxSVlLDgGMZYmgn 13 | GUFEXYJwx7YPi9QWVF0rytkNxppQxNkacuDnVOxZ5QIDAQABo2QwYjAOBgNVHQ8B 14 | Af8EBAMCBaAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwHwYDVR0jBBgwFoAUzmYmkuYk 15 | KBjoYqheHmq2o4LpFC0wGgYDVR0RBBMwEYIJbG9jYWxob3N0hwR/AAABMA0GCSqG 16 | SIb3DQEBCwUAA4IBgQAkPJTsmsIXLWigsRxjuvZ8rzCNTL4oehEbgxqpHxXj4i/N 17 | GUQhgvO4MoxaZ1xjtDUUOc8hiBFgJbC3ARo3E427yFGpy9clozkO5zOBZbMCx3cO 18 | RJx79c+yc9tvN7rSsw40oYd6pBgL9s5R5ZWWJ8vXFDlp4lmSrVPOjrrIsFpjbuba 19 | YkPAGZgoQJ/G8toK5FPslRa7HB0v3DdL2uFARo8PURsfzO8sQP4gVpmKlZR3dcaQ 20 | NQyAMK9Yo4dcWUtSXRx05+bSF3H8y8zfdyuYOZBty7yTpNtyZL2pArxDlibC02dj 21 | keKbMGtXToOAuIMV6jPjhbnR8HwsKzj/z8VGDTTcHZjzpfaMN5SvyVkqOZT4+ZSk 22 | MALmnJH/fOE6UCEs65HLx/Lw2OcqUpgWMSakyeKzLIv95ZisLCS8ATuWXS2LH2eU 23 | E0ok7g6TQH9mHKYVRVy620v4l8n+rLZraSUUNfejnkTHMEJGfRzu8qCEZUWQEjRl 24 | UTrf6HmEUWqMBEscvDc= 25 | -----END CERTIFICATE----- 26 | -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/utility/dm_list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | 20 | #ifndef __DM_LIST_INCLUDE__ 21 | #define __DM_LIST_INCLUDE__ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | // 定义一个包含数据内容的结构体 28 | typedef struct Data_t { 29 | int value; 30 | } Data_t; 31 | 32 | // 定义一个节点结构体 33 | typedef struct Node { 34 | struct Node *next; 35 | Data_t data; 36 | } Node; 37 | 38 | // 定义一个列表结构体 39 | typedef struct List { 40 | Node *head; 41 | size_t size; 42 | } List; 43 | 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | List * list_create(); 50 | void list_append(List *list, Data_t data); 51 | size_t list_size(List *list); 52 | bool list_find(List *list, Data_t data); 53 | void list_destroy(List *list); 54 | 55 | #ifdef __cplusplus 56 | } /* end of the 'extern "C"' block */ 57 | #endif 58 | 59 | 60 | #endif // __DM_LIST_INCLUDE__ -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/utility/dm_stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __DM_STACK_INCLUDE__ 20 | #define __DM_STACK_INCLUDE__ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | // 定义一个包含数据内容的结构体 29 | typedef struct Data { 30 | int value; 31 | } Data; 32 | 33 | // 定义一个堆栈结构体 34 | typedef struct Stack { 35 | Data *data; 36 | size_t size; 37 | size_t capacity; 38 | pthread_mutex_t mutex; 39 | pthread_cond_t cond; 40 | } Stack; 41 | 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | Stack *stack_create(size_t capacity); 48 | void stack_push(Stack *stack, Data data); 49 | Data stack_pop(Stack *stack); 50 | Data stack_top(Stack *stack); 51 | size_t stack_size(Stack *stack); 52 | void stack_destroy(Stack *stack); 53 | 54 | 55 | 56 | #ifdef __cplusplus 57 | } /* end of the 'extern "C"' block */ 58 | #endif 59 | 60 | 61 | #endif // __DM_STACK_INCLUDE__ -------------------------------------------------------------------------------- /include/mysql/mysql/mysql_lex_string.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015, 2022, Oracle and/or its affiliates. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License, version 2.0, 5 | as published by the Free Software Foundation. 6 | 7 | This program is also distributed with certain software (including 8 | but not limited to OpenSSL) that is licensed under separate terms, 9 | as designated in a particular file or component or in included license 10 | documentation. The authors of MySQL hereby grant you an additional 11 | permission to link the program and your derivative works with the 12 | separately licensed software that they have included with MySQL. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License, version 2.0, for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 22 | 23 | #ifndef MYSQL_LEX_STRING_INCLUDED 24 | #define MYSQL_LEX_STRING_INCLUDED 25 | 26 | struct st_mysql_lex_string 27 | { 28 | char *str; 29 | size_t length; 30 | }; 31 | typedef struct st_mysql_lex_string MYSQL_LEX_STRING; 32 | 33 | struct st_mysql_const_lex_string 34 | { 35 | const char *str; 36 | size_t length; 37 | }; 38 | typedef struct st_mysql_const_lex_string MYSQL_LEX_CSTRING; 39 | 40 | #endif // MYSQL_LEX_STRING_INCLUDED 41 | -------------------------------------------------------------------------------- /include/mysql/mysql_embed.h: -------------------------------------------------------------------------------- 1 | #ifndef MYSQL_EMBED_INCLUDED 2 | #define MYSQL_EMBED_INCLUDED 3 | 4 | /* Copyright (c) 2000, 2022, Oracle and/or its affiliates. 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License, version 2.0, 8 | as published by the Free Software Foundation. 9 | 10 | This program is also distributed with certain software (including 11 | but not limited to OpenSSL) that is licensed under separate terms, 12 | as designated in a particular file or component or in included license 13 | documentation. The authors of MySQL hereby grant you an additional 14 | permission to link the program and your derivative works with the 15 | separately licensed software that they have included with MySQL. 16 | 17 | This program is distributed in the hope that it will be useful, 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | GNU General Public License, version 2.0, for more details. 21 | 22 | You should have received a copy of the GNU General Public License 23 | along with this program; if not, write to the Free Software 24 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 25 | 26 | /* Defines that are unique to the embedded version of MySQL */ 27 | 28 | #ifdef EMBEDDED_LIBRARY 29 | 30 | /* Things we don't need in the embedded version of MySQL */ 31 | /* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */ 32 | 33 | #undef HAVE_DLOPEN /* No udf functions */ 34 | 35 | #endif /* EMBEDDED_LIBRARY */ 36 | #endif /* MYSQL_EMBED_INCLUDED */ 37 | -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/utility/dm_timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __DM_TIMER_INCLUDE__ 20 | #define __DM_TIMER_INCLUDE__ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #ifdef __WIN32__ 27 | #include 28 | #else 29 | #include 30 | #endif 31 | 32 | 33 | // 以下是定时器的示例代码 34 | typedef struct Event { 35 | time_t timeout; 36 | void (*callback)(); 37 | } Event; 38 | 39 | typedef struct MinHeap { 40 | Event *events[1024]; 41 | int size; 42 | } MinHeap; 43 | 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | static void min_heap_push(MinHeap *heap, Event *event); 49 | static Event* min_heap_top(MinHeap *heap); 50 | static void min_heap_pop(MinHeap *heap); 51 | void handle_events(MinHeap *heap); 52 | void add_timer(MinHeap *heap, int timeout, void (*callback)()); 53 | #ifdef __cplusplus 54 | } /* end of the 'extern "C"' block */ 55 | #endif 56 | 57 | 58 | #endif // __DM_TIMER_INCLUDE__ -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/utility/dm_queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __DM_QUEUE_INCLUDE__ 20 | #define __DM_QUEUE_INCLUDE__ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | // 定义一个包含数据内容的结构体 29 | typedef struct Data { 30 | int value; 31 | } Data; 32 | 33 | // 定义一个节点结构体 34 | typedef struct Node { 35 | struct Node *next; 36 | Data data; 37 | } Node; 38 | 39 | // 定义一个队列结构体 40 | typedef struct Queue { 41 | Node *head; 42 | Node *tail; 43 | size_t size; 44 | pthread_mutex_t mutex; 45 | pthread_cond_t cond; 46 | } Queue; 47 | 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif 51 | 52 | Queue *queue_create(); 53 | void queue_enqueue(Queue *queue, Data data); 54 | Data queue_dequeue(Queue *queue); 55 | size_t queue_size(Queue *queue); 56 | void queue_destroy(Queue *queue); 57 | 58 | #ifdef __cplusplus 59 | } /* end of the 'extern "C"' block */ 60 | #endif 61 | 62 | 63 | #endif // __DM_QUEUE_INCLUDE__ -------------------------------------------------------------------------------- /include/openssl/rc2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_RC2_H 11 | # define HEADER_RC2_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_RC2 16 | # ifdef __cplusplus 17 | extern "C" { 18 | # endif 19 | 20 | typedef unsigned int RC2_INT; 21 | 22 | # define RC2_ENCRYPT 1 23 | # define RC2_DECRYPT 0 24 | 25 | # define RC2_BLOCK 8 26 | # define RC2_KEY_LENGTH 16 27 | 28 | typedef struct rc2_key_st { 29 | RC2_INT data[64]; 30 | } RC2_KEY; 31 | 32 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits); 33 | void RC2_ecb_encrypt(const unsigned char *in, unsigned char *out, 34 | RC2_KEY *key, int enc); 35 | void RC2_encrypt(unsigned long *data, RC2_KEY *key); 36 | void RC2_decrypt(unsigned long *data, RC2_KEY *key); 37 | void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 38 | RC2_KEY *ks, unsigned char *iv, int enc); 39 | void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, 40 | long length, RC2_KEY *schedule, unsigned char *ivec, 41 | int *num, int enc); 42 | void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out, 43 | long length, RC2_KEY *schedule, unsigned char *ivec, 44 | int *num); 45 | 46 | # ifdef __cplusplus 47 | } 48 | # endif 49 | # endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /include/mysql/mysql/get_password.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2022, Oracle and/or its affiliates. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License, version 2.0, 5 | as published by the Free Software Foundation. 6 | 7 | This program is also distributed with certain software (including 8 | but not limited to OpenSSL) that is licensed under separate terms, 9 | as designated in a particular file or component or in included license 10 | documentation. The authors of MySQL hereby grant you an additional 11 | permission to link the program and your derivative works with the 12 | separately licensed software that they have included with MySQL. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License, version 2.0, for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 22 | 23 | /* 24 | ** Ask for a password from tty 25 | ** This is an own file to avoid conflicts with curses 26 | */ 27 | 28 | #ifndef MYSQL_GET_PASSWORD_H_INCLUDED 29 | #define MYSQL_GET_PASSWORD_H_INCLUDED 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | typedef char *(* strdup_handler_t)(const char *, int); 36 | char *get_tty_password_ext(const char *opt_message, 37 | strdup_handler_t strdup_function); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif /* ! MYSQL_GET_PASSWORD_H_INCLUDED */ 44 | -------------------------------------------------------------------------------- /bin/cert/localhost-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCvYPu46gIoH3T2 3 | Ngl9Pk/Y13YZbE88PrZNKrtu5DlQlRjqiAaDOrBHXC5olhO87X7QZYdjbX2V98ks 4 | JtRde4ujAhNJZ3KbTz9FlOn6i/grAT8bvtFHzWI3Wx2CsnmqDF6VHZxO0CyD9KWW 5 | J7rRceojQB2vKKf9w33qMZruVoccE0qAfFapH3FpI541A4PtQVoyPmfFtwkLd6y8 6 | ktEEWgvxFfISTyZ1+ZQoEL87OjWuDySfV1bsUm97UjyFh6iCbUTesR98UvADfmIn 7 | z9dXH1MJ+qs2ka1efFJWUsOAYxliaCcZQURdgnDHtg+L1BZUXSvK2Q3GmlDE2Rpy 8 | 4OdU7FnlAgMBAAECggEBAJnggDyopafKofb9RqorKCfcNHTuAT+czps6aSZM/LTl 9 | fO0a2Iv/zHdwPA/rzfmwb9otmvL0OIKC3HHux9oV8ljeE0oOiBIZICzPEdSRRveE 10 | qniPnlRfslNbkLMCIZnALKStTF4ibUyCNV9gEJyAVK0FLoZnJ66R/kKjr4p7RSSt 11 | m7gMoC5vq/NH5unuRNgKMov9VdroJ/baTd4mPuCY3kHFxsCLGLja4TEWnL48hw+p 12 | YCltDOdNIHOUGASDGxUpxh9kjynuB4sIVGgETUDbnNv0iAssdMIvjjCRnRH9Ayos 13 | aMjtNTGSNAl3CbDaHRX62UhA/gkF1qzaJY0GLeDQi+kCgYEAxeBdyCKMcJtfWVmv 14 | AVEJajNeNjEvprKLcfmPqygNMRP1yVIKU4xHbNt4lMUqfOZy6O+8z7cneZdyaBF8 15 | 8LyIafUSV3PYy+e9HSgjwjY4m4QqIzcZC0gfycpaG0El3vFrvh4kiI6SiUKAOyRQ 16 | xWeSsu3AKqYP/lgqjnQkVKrqHpsCgYEA4uTf85Bg08EGkUx1pcehRQdBRmxoPiy2 17 | iPR7jXkcQL2tKUQckm4XggpXH2PCCYVMysd4TvfdBknJm3JqlJ5iCAGfW4/bkkX6 18 | fUeT+4h8qYJ6cCd71sLCkm4ATrEl7iDjHARxlqzPhaqcgYRjvh+o86Lz3zEDaxFe 19 | BFY6mL26sX8CgYB2tEEuNWOQjfSmMkHlBUsjlYs38UvHsaYrim2gXJeFUJcK3Zdq 20 | RWX3rLVqcdkqMkjO6jqXVSVuMOcl/Q+5jzA6eBU3tzxgHjX5zsGc2VAeIyvwEjaI 21 | 6QyAzk49uVhRpPxggc6iyPypMOaiFAgMVDTR+ARm0VYY26Uz7gJ5dEqcbwKBgHPi 22 | 1GOxjVL6VuFlfP1kXgFEuFlAy2leKwj+XhCfGAgVGNln2XQM2OLpZyA4MoXsWJGF 23 | mfQzcudgTqGfqcIotwdB1OPOMSafqVXNdk7Vol5trx2TfRPuu7RQjMWkgywCDh1k 24 | Q6PitceeoXshZFRaFVADHa4UeZt47l0msZ0L4sv/AoGAUqGsXxiasCn52oY4uULN 25 | AfdZLrDqElBeZXNQ4mDpJvhN2yH+jkF3ylCHZKI05OzflpFBdNz/aK0AorxC5Bge 26 | D0AC9RpOEYzEynhAL+bz6+d/lXQblsH13JjOFuZiqDTbezFe3fwCmXSI+S6yxwHZ 27 | bx9wPZs51T+d+0GZwKonjiI= 28 | -----END PRIVATE KEY----- 29 | -------------------------------------------------------------------------------- /include/openssl/hmac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_HMAC_H 11 | # define HEADER_HMAC_H 12 | 13 | # include 14 | 15 | # include 16 | 17 | # if OPENSSL_API_COMPAT < 0x10200000L 18 | # define HMAC_MAX_MD_CBLOCK 128 /* Deprecated */ 19 | # endif 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | size_t HMAC_size(const HMAC_CTX *e); 26 | HMAC_CTX *HMAC_CTX_new(void); 27 | int HMAC_CTX_reset(HMAC_CTX *ctx); 28 | void HMAC_CTX_free(HMAC_CTX *ctx); 29 | 30 | DEPRECATEDIN_1_1_0(__owur int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, 31 | const EVP_MD *md)) 32 | 33 | /*__owur*/ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, 34 | const EVP_MD *md, ENGINE *impl); 35 | /*__owur*/ int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, 36 | size_t len); 37 | /*__owur*/ int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, 38 | unsigned int *len); 39 | unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, 40 | const unsigned char *d, size_t n, unsigned char *md, 41 | unsigned int *md_len); 42 | __owur int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); 43 | 44 | void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); 45 | const EVP_MD *HMAC_CTX_get_md(const HMAC_CTX *ctx); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /include/openssl/dtls1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2005-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_DTLS1_H 11 | # define HEADER_DTLS1_H 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | # define DTLS1_VERSION 0xFEFF 18 | # define DTLS1_2_VERSION 0xFEFD 19 | # define DTLS_MIN_VERSION DTLS1_VERSION 20 | # define DTLS_MAX_VERSION DTLS1_2_VERSION 21 | # define DTLS1_VERSION_MAJOR 0xFE 22 | 23 | # define DTLS1_BAD_VER 0x0100 24 | 25 | /* Special value for method supporting multiple versions */ 26 | # define DTLS_ANY_VERSION 0x1FFFF 27 | 28 | /* lengths of messages */ 29 | /* 30 | * Actually the max cookie length in DTLS is 255. But we can't change this now 31 | * due to compatibility concerns. 32 | */ 33 | # define DTLS1_COOKIE_LENGTH 256 34 | 35 | # define DTLS1_RT_HEADER_LENGTH 13 36 | 37 | # define DTLS1_HM_HEADER_LENGTH 12 38 | 39 | # define DTLS1_HM_BAD_FRAGMENT -2 40 | # define DTLS1_HM_FRAGMENT_RETRY -3 41 | 42 | # define DTLS1_CCS_HEADER_LENGTH 1 43 | 44 | # define DTLS1_AL_HEADER_LENGTH 2 45 | 46 | /* Timeout multipliers */ 47 | # define DTLS1_TMO_READ_COUNT 2 48 | # define DTLS1_TMO_WRITE_COUNT 2 49 | 50 | # define DTLS1_TMO_ALERT_COUNT 12 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | #endif 56 | -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/mpool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __MPOOL_INCLUDE__ 20 | #define __MPOOL_INCLUDE__ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | typedef struct node_t { 29 | void *data; 30 | struct node_t *next; 31 | int used; 32 | } node_t; 33 | 34 | typedef struct { 35 | node_t *head; 36 | pthread_mutex_t lock; 37 | pthread_cond_t cond; 38 | 39 | // 当前可用块数 40 | int count; 41 | int block_size; 42 | int total_size; 43 | // 只申请一次内存 存放在 mem_pool 中 44 | char *mem_pool; 45 | } pool_t; 46 | 47 | 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif 51 | 52 | void pool_init(pool_t * pool, int block_size, int total_size); 53 | void pool_destroy(pool_t * pool); 54 | void * pool_alloc(pool_t * pool); 55 | void pool_free(pool_t * pool, void *data); 56 | 57 | 58 | #ifdef __cplusplus 59 | } /* end of the 'extern "C"' block */ 60 | #endif 61 | 62 | 63 | #endif // __MPOOL_INCLUDE__ -------------------------------------------------------------------------------- /include/mysql/mysql/client_authentication.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2022, Oracle and/or its affiliates. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License, version 2.0, 5 | as published by the Free Software Foundation. 6 | 7 | This program is also distributed with certain software (including 8 | but not limited to OpenSSL) that is licensed under separate terms, 9 | as designated in a particular file or component or in included license 10 | documentation. The authors of MySQL hereby grant you an additional 11 | permission to link the program and your derivative works with the 12 | separately licensed software that they have included with MySQL. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License, version 2.0, for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 22 | #ifndef CLIENT_AUTHENTICATION_H 23 | #define CLIENT_AUTHENTICATION_H 24 | #include 25 | #include "mysql.h" 26 | #include "mysql/client_plugin.h" 27 | 28 | C_MODE_START 29 | int sha256_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql); 30 | int sha256_password_init(char *, size_t, int, va_list); 31 | int sha256_password_deinit(void); 32 | int caching_sha2_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql); 33 | int caching_sha2_password_init(char *, size_t, int, va_list); 34 | int caching_sha2_password_deinit(void); 35 | C_MODE_END 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/model.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | 20 | #ifndef __MODEL_INCLUDE__ 21 | #define __MODEL_INCLUDE__ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | 31 | typedef struct _Model { 32 | mysql_conn * cc; 33 | MYSQL_RES * res_ptr; 34 | int row; 35 | int column; 36 | } Model; 37 | 38 | typedef Model* model_ptr_t; 39 | 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | // mysql_affected_rows(&my_connection) 返回int 46 | 47 | extern void exe_sql(char* sql); 48 | 49 | extern void model_init(model_ptr_t mPtr); 50 | 51 | extern int model_connection(model_ptr_t mPtr); 52 | 53 | extern int model_query(model_ptr_t mPtr, char* sql); 54 | 55 | static void get_model_result_info(model_ptr_t mPtr); 56 | 57 | extern int get_model_result(model_ptr_t mPtr); 58 | 59 | extern void model_close(model_ptr_t mPtr); 60 | 61 | #ifdef __cplusplus 62 | } /* end of the 'extern "C"' block */ 63 | #endif 64 | 65 | #endif // __MODEL_INCLUDE__ -------------------------------------------------------------------------------- /include/openssl/buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_BUFFER_H 11 | # define HEADER_BUFFER_H 12 | 13 | # include 14 | # ifndef HEADER_CRYPTO_H 15 | # include 16 | # endif 17 | # include 18 | 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | # include 25 | # include 26 | 27 | /* 28 | * These names are outdated as of OpenSSL 1.1; a future release 29 | * will move them to be deprecated. 30 | */ 31 | # define BUF_strdup(s) OPENSSL_strdup(s) 32 | # define BUF_strndup(s, size) OPENSSL_strndup(s, size) 33 | # define BUF_memdup(data, size) OPENSSL_memdup(data, size) 34 | # define BUF_strlcpy(dst, src, size) OPENSSL_strlcpy(dst, src, size) 35 | # define BUF_strlcat(dst, src, size) OPENSSL_strlcat(dst, src, size) 36 | # define BUF_strnlen(str, maxlen) OPENSSL_strnlen(str, maxlen) 37 | 38 | struct buf_mem_st { 39 | size_t length; /* current number of bytes */ 40 | char *data; 41 | size_t max; /* size of buffer */ 42 | unsigned long flags; 43 | }; 44 | 45 | # define BUF_MEM_FLAG_SECURE 0x01 46 | 47 | BUF_MEM *BUF_MEM_new(void); 48 | BUF_MEM *BUF_MEM_new_ex(unsigned long flags); 49 | void BUF_MEM_free(BUF_MEM *a); 50 | size_t BUF_MEM_grow(BUF_MEM *str, size_t len); 51 | size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len); 52 | void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); 53 | 54 | 55 | # ifdef __cplusplus 56 | } 57 | # endif 58 | #endif 59 | -------------------------------------------------------------------------------- /include/libxml/dict.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Summary: string dictionnary 3 | * Description: dictionary of reusable strings, just used to avoid allocation 4 | * and freeing operations. 5 | * 6 | * Copy: See Copyright for the status of this software. 7 | * 8 | * Author: Daniel Veillard 9 | */ 10 | 11 | #ifndef __XML_DICT_H__ 12 | #define __XML_DICT_H__ 13 | 14 | #include 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* 22 | * The dictionnary. 23 | */ 24 | typedef struct _xmlDict xmlDict; 25 | typedef xmlDict *xmlDictPtr; 26 | 27 | /* 28 | * Constructor and destructor. 29 | */ 30 | XMLPUBFUN xmlDictPtr XMLCALL 31 | xmlDictCreate (void); 32 | XMLPUBFUN xmlDictPtr XMLCALL 33 | xmlDictCreateSub(xmlDictPtr sub); 34 | XMLPUBFUN int XMLCALL 35 | xmlDictReference(xmlDictPtr dict); 36 | XMLPUBFUN void XMLCALL 37 | xmlDictFree (xmlDictPtr dict); 38 | 39 | /* 40 | * Lookup of entry in the dictionnary. 41 | */ 42 | XMLPUBFUN const xmlChar * XMLCALL 43 | xmlDictLookup (xmlDictPtr dict, 44 | const xmlChar *name, 45 | int len); 46 | XMLPUBFUN const xmlChar * XMLCALL 47 | xmlDictExists (xmlDictPtr dict, 48 | const xmlChar *name, 49 | int len); 50 | XMLPUBFUN const xmlChar * XMLCALL 51 | xmlDictQLookup (xmlDictPtr dict, 52 | const xmlChar *prefix, 53 | const xmlChar *name); 54 | XMLPUBFUN int XMLCALL 55 | xmlDictOwns (xmlDictPtr dict, 56 | const xmlChar *str); 57 | XMLPUBFUN int XMLCALL 58 | xmlDictSize (xmlDictPtr dict); 59 | 60 | /* 61 | * Cleanup function 62 | */ 63 | XMLPUBFUN void XMLCALL 64 | xmlDictCleanup (void); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | #endif /* ! __XML_DICT_H__ */ 70 | -------------------------------------------------------------------------------- /include/openssl/cast.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_CAST_H 11 | # define HEADER_CAST_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_CAST 16 | # ifdef __cplusplus 17 | extern "C" { 18 | # endif 19 | 20 | # define CAST_ENCRYPT 1 21 | # define CAST_DECRYPT 0 22 | 23 | # define CAST_LONG unsigned int 24 | 25 | # define CAST_BLOCK 8 26 | # define CAST_KEY_LENGTH 16 27 | 28 | typedef struct cast_key_st { 29 | CAST_LONG data[32]; 30 | int short_key; /* Use reduced rounds for short key */ 31 | } CAST_KEY; 32 | 33 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); 34 | void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, 35 | const CAST_KEY *key, int enc); 36 | void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key); 37 | void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key); 38 | void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, 39 | long length, const CAST_KEY *ks, unsigned char *iv, 40 | int enc); 41 | void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, 42 | long length, const CAST_KEY *schedule, 43 | unsigned char *ivec, int *num, int enc); 44 | void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, 45 | long length, const CAST_KEY *schedule, 46 | unsigned char *ivec, int *num); 47 | 48 | # ifdef __cplusplus 49 | } 50 | # endif 51 | # endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /include/openssl/txt_db.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_TXT_DB_H 11 | # define HEADER_TXT_DB_H 12 | 13 | # include 14 | # include 15 | # include 16 | # include 17 | 18 | # define DB_ERROR_OK 0 19 | # define DB_ERROR_MALLOC 1 20 | # define DB_ERROR_INDEX_CLASH 2 21 | # define DB_ERROR_INDEX_OUT_OF_RANGE 3 22 | # define DB_ERROR_NO_INDEX 4 23 | # define DB_ERROR_INSERT_INDEX_CLASH 5 24 | # define DB_ERROR_WRONG_NUM_FIELDS 6 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | typedef OPENSSL_STRING *OPENSSL_PSTRING; 31 | DEFINE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING) 32 | 33 | typedef struct txt_db_st { 34 | int num_fields; 35 | STACK_OF(OPENSSL_PSTRING) *data; 36 | LHASH_OF(OPENSSL_STRING) **index; 37 | int (**qual) (OPENSSL_STRING *); 38 | long error; 39 | long arg1; 40 | long arg2; 41 | OPENSSL_STRING *arg_row; 42 | } TXT_DB; 43 | 44 | TXT_DB *TXT_DB_read(BIO *in, int num); 45 | long TXT_DB_write(BIO *out, TXT_DB *db); 46 | int TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *), 47 | OPENSSL_LH_HASHFUNC hash, OPENSSL_LH_COMPFUNC cmp); 48 | void TXT_DB_free(TXT_DB *db); 49 | OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, 50 | OPENSSL_STRING *value); 51 | int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/mdb/mdb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __MDB_INCLUDE__ 20 | #define __MDB_INCLUDE__ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #ifdef __WIN32__ 27 | #include 28 | #endif // __WIN32__ 29 | 30 | 31 | 32 | /* cache Shared Memory */ 33 | #define SHARED_STR "cache_shared_memory" 34 | #define SHARED_MUTEX "cache_shared_memory_mutex" 35 | #define MAX_ENTRIES 512 36 | 37 | #define MAX_KEY_LEN 64 38 | #define MAX_VALUE_LEN 512 39 | typedef struct { 40 | int op; 41 | char key[MAX_KEY_LEN]; 42 | char value[MAX_VALUE_LEN]; 43 | } entry_t; 44 | /* cache Shared Memory */ 45 | 46 | 47 | 48 | 49 | 50 | /* Middle1 Shared Memory */ 51 | #define IP_LIMIT_SHARED_STR "ip_limit_shared_memory" 52 | #define IP_LIMIT_MUTEX "ip_limit_shared_memory_mutex" 53 | #define MAX_IP_LIMIT_HANDLE 1024 54 | 55 | typedef struct _IpLimit { 56 | char ip[16]; 57 | int time_start; 58 | int request_num; 59 | int invalid_num; 60 | int ab_ban; 61 | } IpLimit; 62 | /* Middle1 Shared Memory */ 63 | 64 | #endif // __MDB_INCLUDE__ -------------------------------------------------------------------------------- /include/mysql/mysql_com_server.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011, 2022, Oracle and/or its affiliates. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License, version 2.0, 5 | as published by the Free Software Foundation. 6 | 7 | This program is also distributed with certain software (including 8 | but not limited to OpenSSL) that is licensed under separate terms, 9 | as designated in a particular file or component or in included license 10 | documentation. The authors of MySQL hereby grant you an additional 11 | permission to link the program and your derivative works with the 12 | separately licensed software that they have included with MySQL. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License, version 2.0, for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 22 | 23 | /* 24 | Definitions private to the server, 25 | used in the networking layer to notify specific events. 26 | */ 27 | 28 | #ifndef _mysql_com_server_h 29 | #define _mysql_com_server_h 30 | 31 | struct st_net_server; 32 | 33 | typedef void (*before_header_callback_fn) 34 | (struct st_net *net, void *user_data, size_t count); 35 | 36 | typedef void (*after_header_callback_fn) 37 | (struct st_net *net, void *user_data, size_t count, my_bool rc); 38 | 39 | struct st_net_server 40 | { 41 | before_header_callback_fn m_before_header; 42 | after_header_callback_fn m_after_header; 43 | void *m_user_data; 44 | }; 45 | 46 | typedef struct st_net_server NET_SERVER; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/utility/dm_map.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | #ifndef __DM_MAP_INCLUDE__ 19 | #define __DM_MAP_INCLUDE__ 20 | 21 | #include 22 | #define HASH_FUNCTION BKDRHash 23 | 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | // 定义哈希映射的节点结构 31 | typedef struct hashmap_node_t { 32 | char * key; 33 | void * value; 34 | struct hashmap_node_t *next; 35 | } hashmap_node_t; 36 | 37 | // 定义哈希映射结构 38 | typedef struct hashmap_t { 39 | size_t size; 40 | hashmap_node_t ** buckets; 41 | } hashmap_t; 42 | 43 | typedef hashmap_t * hashmap_tp; 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | // 初始化哈希映射 50 | hashmap_tp hashmap_create( size_t size ); 51 | 52 | // 插入键值对到哈希映射 53 | int hashmap_insert(hashmap_tp hashmap, hashmap_node_t * node); 54 | 55 | // 获取指定键的值 56 | void * hashmap_get( hashmap_tp hashmap, char * key ); 57 | 58 | // 删除指定键的节点 59 | int hashmap_remove( hashmap_tp hashmap, char * key ); 60 | 61 | // 释放哈希映射的内存 62 | void hashmap_destroy( hashmap_tp hashmap ); 63 | 64 | // hashmap 测试 65 | int test_map(); 66 | 67 | #ifdef __cplusplus 68 | } /* end of the 'extern "C"' block */ 69 | #endif 70 | 71 | 72 | #endif // __DM_MAP_INCLUDE__ -------------------------------------------------------------------------------- /Src/middleware/jwt_token.c: -------------------------------------------------------------------------------- 1 | #ifdef __linux__ 2 | #include 3 | #include 4 | #else // linux 5 | #include 6 | #endif // windows 7 | #include 8 | 9 | void jwt_test_new(char token[]) 10 | { 11 | int ret = 0; 12 | jwt_t *jwt_parse = NULL; 13 | char* jwt_token = NULL; 14 | ret = jwt_new(&jwt_parse); 15 | time_t iat = time(NULL); 16 | 17 | jwt_set_alg(jwt_parse, JWT_ALG_HS256, "123", 3); 18 | 19 | jwt_add_grant(jwt_parse, "sub", "1234567890"); 20 | jwt_add_grant(jwt_parse, "name", "pzc"); 21 | jwt_add_grant(jwt_parse, "admin", "true"); 22 | jwt_add_grant_int(jwt_parse, "iat", iat); 23 | jwt_token = jwt_encode_str(jwt_parse); 24 | 25 | //jwt_dump_fp(jwt, stderr, 1); 26 | //fprintf(stderr, "jwt algo %s!\n", jwt_alg_str(JWT_ALG_HS256)); 27 | 28 | strcpy(token, jwt_token); 29 | 30 | jwt_free(jwt_parse); 31 | jwt_free_str(jwt_token); 32 | } 33 | 34 | void jwt_test_verify(char* token) 35 | { 36 | int ret; 37 | jwt_t *jwt_verify = NULL; 38 | jwt_valid_t *jwt_valid; 39 | jwt_valid_new(&jwt_valid, JWT_ALG_HS256); 40 | jwt_valid_set_headers(jwt_valid, 1); 41 | jwt_valid_set_now(jwt_valid, time(NULL)); 42 | 43 | if( jwt_valid_add_grant(jwt_valid, "sub", "1234567890") == 0 ) 44 | printf("sub ok\n"); 45 | if( jwt_valid_add_grant(jwt_valid, "name", "pzc") == 0 ) 46 | printf("name ok\n"); 47 | 48 | ret = jwt_decode(&jwt_verify, token, "123", 3); 49 | if (ret != 0 || jwt_verify == NULL) { 50 | return; 51 | fprintf(stderr, "invalid jwt\n"); 52 | } 53 | 54 | if (jwt_validate(jwt_verify, jwt_valid) != 0) { 55 | fprintf(stderr, "jwt failed to validate: %08x\n", jwt_valid_get_status(jwt_valid)); 56 | jwt_dump_fp(jwt_verify, stderr, 1); 57 | } 58 | } 59 | 60 | void jwt_test() 61 | { 62 | char token[512] = {0}; 63 | jwt_test_new(token); 64 | printf("%s\n", token); 65 | jwt_test_verify(token); 66 | 67 | } 68 | -------------------------------------------------------------------------------- /include/mysql/mysql/thread_type.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2022, Oracle and/or its affiliates. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License, version 2.0, 5 | as published by the Free Software Foundation. 6 | 7 | This program is also distributed with certain software (including 8 | but not limited to OpenSSL) that is licensed under separate terms, 9 | as designated in a particular file or component or in included license 10 | documentation. The authors of MySQL hereby grant you an additional 11 | permission to link the program and your derivative works with the 12 | separately licensed software that they have included with MySQL. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License, version 2.0, for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ 22 | 23 | /* Defines to make different thread packages compatible */ 24 | 25 | #ifndef THREAD_TYPE_INCLUDED 26 | #define THREAD_TYPE_INCLUDED 27 | 28 | #ifdef __cplusplus 29 | extern "C"{ 30 | #endif 31 | 32 | /* Flags for the THD::system_thread variable */ 33 | enum enum_thread_type 34 | { 35 | NON_SYSTEM_THREAD= 0, 36 | SYSTEM_THREAD_SLAVE_IO= 1, 37 | SYSTEM_THREAD_SLAVE_SQL= 2, 38 | SYSTEM_THREAD_NDBCLUSTER_BINLOG= 4, 39 | SYSTEM_THREAD_EVENT_SCHEDULER= 8, 40 | SYSTEM_THREAD_EVENT_WORKER= 16, 41 | SYSTEM_THREAD_INFO_REPOSITORY= 32, 42 | SYSTEM_THREAD_SLAVE_WORKER= 64, 43 | SYSTEM_THREAD_COMPRESS_GTID_TABLE= 128, 44 | SYSTEM_THREAD_BACKGROUND= 256 45 | }; 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif /* THREAD_TYPE_INCLUDED */ 52 | -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __TEMPLATE_INCLUDE__ 20 | #define __TEMPLATE_INCLUDE__ 21 | 22 | 23 | #define TEMPLATE_RESULT_SIZE 4096 24 | #define TEMPLATE_DEC_SIZE 20 25 | #define DEC_NUM 20 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | 32 | struct Kvmap { 33 | int type; 34 | char * key; 35 | char * value; // # 1 36 | 37 | char * dec[ DEC_NUM ]; 38 | void (*Func) (char*, char *); // 39 | }; 40 | 41 | typedef struct template_name_path { 42 | char name[64]; 43 | char* template_data; 44 | } template_name_path; 45 | 46 | typedef struct template_dec { 47 | int size; 48 | template_name_path template_np[ TEMPLATE_DEC_SIZE ]; 49 | } template_dec; 50 | 51 | #ifdef __cplusplus 52 | extern "C" { 53 | #endif 54 | 55 | extern void template_init(); 56 | 57 | extern void template_free(); 58 | 59 | extern char * get_template(char* template_name); 60 | 61 | extern char * local_template(char * template_path); 62 | 63 | static void parse_dec(char* tt, char* dec[], char* inner); 64 | 65 | extern char * parse_context(char *context, struct Kvmap *kv, int kv_num); 66 | 67 | #ifdef __cplusplus 68 | } /* end of the 'extern "C"' block */ 69 | #endif 70 | 71 | #endif // __TEMPLATE_INCLUDE__ -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/utility/dm_string.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | 20 | #ifndef __DM_STRING_INCLUDE__ 21 | #define __DM_STRING_INCLUDE__ 22 | 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | //定义 String 结构体 29 | typedef struct { 30 | char* str; 31 | int len; 32 | } dm_string; 33 | 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | dm_string* dm_str(char* s); 40 | void dm_str_free(dm_string* s); 41 | dm_string* dm_str_cat(dm_string* s1, dm_string* s2); 42 | int dm_str_cmp(dm_string* s1, dm_string* s2); 43 | dm_string* dm_str_rev(dm_string* s); 44 | dm_string* dm_str_up(dm_string* s); 45 | dm_string* dm_str_low(dm_string* s); 46 | int dm_str_find_sub(dm_string* s, char* sub); 47 | dm_string* dm_str_sub(dm_string* s, int start, int end); 48 | int dm_str_toint(dm_string* s); 49 | dm_string* dm_str_tostr(int num); 50 | dm_string* dm_str_trim(dm_string* s); 51 | int dm_str_start_with(dm_string* s, char* prefix); 52 | int dm_str_end_with(dm_string* s, char* suffix); 53 | dm_string* dm_str_replace(dm_string* s, char* oldStr, char* newStr); 54 | int dm_index_char(dm_string* s, char c); 55 | void print_str(dm_string *str); 56 | 57 | 58 | 59 | #ifdef __cplusplus 60 | } /* end of the 'extern "C"' block */ 61 | #endif 62 | 63 | #endif // __DM_STRING_INCLUDE__ -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/socket.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __SOCKET_INCLUDE__ 20 | #define __SOCKET_INCLUDE__ 21 | 22 | #include // 初始化 全局配置 23 | 24 | #include 25 | #include 26 | 27 | #ifdef __WIN32__ 28 | 29 | #include 30 | #include 31 | 32 | #else 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #endif // __WIN32__ 41 | 42 | #define SERVER_PORT 8080 43 | #define OutErr(a) printf("%s %s %d \n", a, __FILE__ , __LINE__ ); 44 | 45 | #ifdef __WIN32__ 46 | #define close_socket closesocket 47 | #else 48 | #define close_socket close 49 | #endif // __WIN32__ 50 | 51 | #ifdef __cplusplus 52 | extern "C" { 53 | #endif 54 | 55 | extern int create_socket(); 56 | extern int createSocket(); 57 | extern int create_socket_reuse(); 58 | 59 | #ifdef __WIN32__ 60 | 61 | static inline void wsa_init() { 62 | WSADATA wsd; 63 | if( WSAStartup(MAKEWORD(2, 2), &wsd) != 0) 64 | OutErr("WSAStartup()"); 65 | } 66 | 67 | static inline void wsa_cleanup() { 68 | WSACleanup(); 69 | } 70 | 71 | 72 | SOCKET iocp_bind_socket(int nPort); 73 | 74 | #endif 75 | 76 | 77 | #ifdef __cplusplus 78 | } /* end of the 'extern "C"' block */ 79 | #endif 80 | 81 | 82 | #endif // __SOCKET_INCLUDE__ -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/mdb/mdb_operate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __MDB_OPERATE_INCLUDE__ 20 | #define __MDB_OPERATE_INCLUDE__ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include "mdb.h" 29 | 30 | #ifdef __WIN32__ 31 | #define DLL_EXPORT __declspec(dllexport) 32 | #include 33 | #endif // WIN32 34 | 35 | #ifdef __linux__ 36 | #include 37 | #include 38 | #endif // LINUX 39 | 40 | 41 | 42 | 43 | #ifdef __cplusplus // If used by C++ code, 44 | extern "C" { // we need to export the C interface 45 | #endif 46 | 47 | #ifdef __WIN32__ 48 | 49 | DLL_EXPORT extern void mdb_operate_init(); 50 | 51 | DLL_EXPORT extern char* mdb_find(char* key); 52 | 53 | DLL_EXPORT extern void mdb_insert(char* key, char* value); 54 | 55 | DLL_EXPORT extern int ip_check_valid(char* ip); 56 | 57 | #elif __linux__ // WIN32 58 | extern void mdb_operate_init(); 59 | 60 | extern char* mdb_find(char* key); 61 | 62 | extern void mdb_insert(char* key, char* value); 63 | 64 | extern int ip_check_valid(char* ip); 65 | #endif // linux 66 | 67 | 68 | #ifdef __cplusplus 69 | } /* end of the 'extern "C"' block */ 70 | #endif 71 | 72 | #endif // __MDB_OPERATE_INCLUDE__ -------------------------------------------------------------------------------- /include/openssl/blowfish.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_BLOWFISH_H 11 | # define HEADER_BLOWFISH_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_BF 16 | # include 17 | # ifdef __cplusplus 18 | extern "C" { 19 | # endif 20 | 21 | # define BF_ENCRYPT 1 22 | # define BF_DECRYPT 0 23 | 24 | /*- 25 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 26 | * ! BF_LONG has to be at least 32 bits wide. ! 27 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 28 | */ 29 | # define BF_LONG unsigned int 30 | 31 | # define BF_ROUNDS 16 32 | # define BF_BLOCK 8 33 | 34 | typedef struct bf_key_st { 35 | BF_LONG P[BF_ROUNDS + 2]; 36 | BF_LONG S[4 * 256]; 37 | } BF_KEY; 38 | 39 | void BF_set_key(BF_KEY *key, int len, const unsigned char *data); 40 | 41 | void BF_encrypt(BF_LONG *data, const BF_KEY *key); 42 | void BF_decrypt(BF_LONG *data, const BF_KEY *key); 43 | 44 | void BF_ecb_encrypt(const unsigned char *in, unsigned char *out, 45 | const BF_KEY *key, int enc); 46 | void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 47 | const BF_KEY *schedule, unsigned char *ivec, int enc); 48 | void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, 49 | long length, const BF_KEY *schedule, 50 | unsigned char *ivec, int *num, int enc); 51 | void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, 52 | long length, const BF_KEY *schedule, 53 | unsigned char *ivec, int *num); 54 | const char *BF_options(void); 55 | 56 | # ifdef __cplusplus 57 | } 58 | # endif 59 | # endif 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /include/mysql/mysql/service_thd_engine_lock.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015, 2022, Oracle and/or its affiliates. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License, version 2.0, 5 | as published by the Free Software Foundation. 6 | 7 | This program is also distributed with certain software (including 8 | but not limited to OpenSSL) that is licensed under separate terms, 9 | as designated in a particular file or component or in included license 10 | documentation. The authors of MySQL hereby grant you an additional 11 | permission to link the program and your derivative works with the 12 | separately licensed software that they have included with MySQL. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License, version 2.0, for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 22 | 23 | #ifndef MYSQL_SERVICE_THD_EGINE_LOCK_INCLUDED 24 | #define MYSQL_SERVICE_THD_EGINE_LOCK_INCLUDED 25 | 26 | /** 27 | @file include/mysql/service_thd_engine_lock.h 28 | This service provides functions for storage engines to report 29 | lock related activities. 30 | 31 | SYNOPSIS 32 | thd_row_lock_wait() - call it just when the engine find a transaction should wait 33 | another transaction to realease a row lock 34 | thd The session which is waiting for the row lock to release. 35 | thd_wait_for The session which is holding the row lock. 36 | */ 37 | 38 | #ifdef __cplusplus 39 | class THD; 40 | #else 41 | #define THD void 42 | #endif 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | void thd_report_row_lock_wait(THD* self, THD *wait_for); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /include/mysql/mysql/client_plugin.h.pp: -------------------------------------------------------------------------------- 1 | struct st_mysql_client_plugin 2 | { 3 | int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(void); int (*options)(const char *option, const void *); 4 | }; 5 | struct st_mysql; 6 | #include "plugin_auth_common.h" 7 | typedef struct st_plugin_vio_info 8 | { 9 | enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET, 10 | MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol; 11 | int socket; 12 | } MYSQL_PLUGIN_VIO_INFO; 13 | typedef struct st_plugin_vio 14 | { 15 | int (*read_packet)(struct st_plugin_vio *vio, 16 | unsigned char **buf); 17 | int (*write_packet)(struct st_plugin_vio *vio, 18 | const unsigned char *packet, 19 | int packet_len); 20 | void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info); 21 | } MYSQL_PLUGIN_VIO; 22 | struct st_mysql_client_plugin_AUTHENTICATION 23 | { 24 | int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(void); int (*options)(const char *option, const void *); 25 | int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql); 26 | }; 27 | struct st_mysql_client_plugin * 28 | mysql_load_plugin(struct st_mysql *mysql, const char *name, int type, 29 | int argc, ...); 30 | struct st_mysql_client_plugin * 31 | mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type, 32 | int argc, va_list args); 33 | struct st_mysql_client_plugin * 34 | mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type); 35 | struct st_mysql_client_plugin * 36 | mysql_client_register_plugin(struct st_mysql *mysql, 37 | struct st_mysql_client_plugin *plugin); 38 | int mysql_plugin_options(struct st_mysql_client_plugin *plugin, 39 | const char *option, const void *value); 40 | -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/conf/conf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __CONF_INCLUDE__ 20 | 21 | #define __CONF_INCLUDE__ 22 | 23 | // #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | // server 模块 30 | 31 | typedef enum _ServerMode { 32 | SimpleServer, 33 | IOCPServer, 34 | SSLServer, 35 | #ifdef __linux__ 36 | EpollServer, 37 | #endif 38 | } ServerMode; 39 | 40 | typedef struct conf_server { 41 | int port; 42 | char host[64]; 43 | ServerMode mode; 44 | char cert_private[128]; 45 | char cert_public[128]; 46 | 47 | } conf_server; 48 | 49 | // model 模块 50 | typedef struct conf_model { 51 | char host[64]; 52 | int port; 53 | char username[32]; 54 | char password[32]; 55 | char database[32]; 56 | } conf_model; 57 | 58 | 59 | // Router 模块 60 | typedef struct conf_router { 61 | char static_dir[1024]; 62 | } conf_router; 63 | 64 | 65 | typedef struct server_cf_t { 66 | conf_model _conf_model; 67 | conf_server _conf_server; 68 | conf_router _conf_router; 69 | } server_cf_t; 70 | 71 | 72 | // conf 全局的配置变量 73 | extern server_cf_t g_server_conf_all; 74 | 75 | #ifdef __cplusplus 76 | extern "C" { 77 | #endif 78 | 79 | extern void test(); 80 | extern void conf_init(); 81 | 82 | #ifdef __cplusplus 83 | } /* end of the 'extern "C"' block */ 84 | #endif 85 | 86 | #endif // __CONF_INCLUDE__ -------------------------------------------------------------------------------- /include/elr_mpl/elr_mtx.h: -------------------------------------------------------------------------------- 1 | #ifndef __ELR_MTX_H__ 2 | #define __ELR_MTX_H__ 3 | 4 | 5 | #ifdef __WIN32__ 6 | #include 7 | 8 | /*! \brief platform independent mutex type. 9 | * 10 | * it is highly recommend that you declare a elr_mpl_t variable 11 | * with the following initializing statement 12 | * elr_mpl_t mpl = ELR_MPL_INITIALIZER; 13 | * an elr_mpl_t variable is only valid when 14 | * it was initialized directly or indirectly by elr_mpl_create`s return value. 15 | */ 16 | typedef struct __elr_mtx 17 | { 18 | CRITICAL_SECTION _cs;/*!< the windows critical section object. */ 19 | } 20 | elr_mtx; 21 | 22 | /** platform independent atomic counter type. */ 23 | typedef volatile LONG elr_atomic_t; 24 | 25 | /** platform independent counter integer type. */ 26 | typedef LONG elr_counter_t; 27 | 28 | /** platform independent zero initial value of atomic counter type. */ 29 | #define ELR_ATOMIC_ZERO 0 30 | 31 | #endif 32 | 33 | /* 34 | ** 原子自增操作 35 | */ 36 | /*! \brief atomic increment operation. 37 | * \param v pointer to a atomic counter type variable. 38 | * \retval the integer value of v after increment. 39 | * 40 | * make a increment of v by one atomicly. 41 | */ 42 | elr_counter_t elr_atomic_inc(elr_atomic_t* v); 43 | 44 | /* 45 | ** 原子自减操作 46 | */ 47 | /*! \brief atomic decrement operation. 48 | * \param v pointer to a atomic counter type variable. 49 | * \retval the integer value of v after decrement. 50 | * 51 | * make a decrement of v by one atomicly. 52 | */ 53 | elr_counter_t elr_atomic_dec(elr_atomic_t* v); 54 | 55 | /* 56 | ** 初始化互斥体,返回0表示初始化失败 57 | ** 如果初始化失败就不需要再调用elr_mtx_finalize 58 | */ 59 | /*! \brief initialize a mutex. 60 | * \param mtx pointer to a mutex. 61 | * \retval zero if failed. 62 | */ 63 | int elr_mtx_init(elr_mtx *mtx); 64 | 65 | /*! \brief waits on a mutex. 66 | * \param mtx pointer to a mutex. 67 | */ 68 | void elr_mtx_lock (elr_mtx *mtx); 69 | 70 | /*! \brief releases on a mutex. 71 | * \param mtx pointer to a mutex. 72 | */ 73 | void elr_mtx_unlock(elr_mtx *mtx); 74 | 75 | /*! \brief initialize a mutex. 76 | * \param mtx pointer to a mutex. 77 | */ 78 | void elr_mtx_finalize(elr_mtx *mtx); 79 | 80 | #endif -------------------------------------------------------------------------------- /include/mysql/plugin_validate_password.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2022, Oracle and/or its affiliates. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License, version 2.0, 5 | as published by the Free Software Foundation. 6 | 7 | This program is also distributed with certain software (including 8 | but not limited to OpenSSL) that is licensed under separate terms, 9 | as designated in a particular file or component or in included license 10 | documentation. The authors of MySQL hereby grant you an additional 11 | permission to link the program and your derivative works with the 12 | separately licensed software that they have included with MySQL. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License, version 2.0, for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 22 | 23 | #ifndef MYSQL_PLUGIN_VALIDATE_PASSWORD_INCLUDED 24 | #define MYSQL_PLUGIN_VALIDATE_PASSWORD_INCLUDED 25 | 26 | /* API for validate_password plugin. (MYSQL_VALIDATE_PASSWORD_PLUGIN) */ 27 | 28 | #include 29 | #define MYSQL_VALIDATE_PASSWORD_INTERFACE_VERSION 0x0100 30 | 31 | /* 32 | The descriptor structure for the plugin, that is referred from 33 | st_mysql_plugin. 34 | */ 35 | 36 | typedef void* mysql_string_handle; 37 | 38 | struct st_mysql_validate_password 39 | { 40 | int interface_version; 41 | /* 42 | This function retuns TRUE for passwords which satisfy the password 43 | policy (as choosen by plugin variable) and FALSE for all other 44 | password 45 | */ 46 | int (*validate_password)(mysql_string_handle password); 47 | /* 48 | This function returns the password strength (0-100) depending 49 | upon the policies 50 | */ 51 | int (*get_password_strength)(mysql_string_handle password); 52 | }; 53 | #endif 54 | -------------------------------------------------------------------------------- /include/libxml/threads.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Summary: interfaces for thread handling 3 | * Description: set of generic threading related routines 4 | * should work with pthreads, Windows native or TLS threads 5 | * 6 | * Copy: See Copyright for the status of this software. 7 | * 8 | * Author: Daniel Veillard 9 | */ 10 | 11 | #ifndef __XML_THREADS_H__ 12 | #define __XML_THREADS_H__ 13 | 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* 21 | * xmlMutex are a simple mutual exception locks. 22 | */ 23 | typedef struct _xmlMutex xmlMutex; 24 | typedef xmlMutex *xmlMutexPtr; 25 | 26 | /* 27 | * xmlRMutex are reentrant mutual exception locks. 28 | */ 29 | typedef struct _xmlRMutex xmlRMutex; 30 | typedef xmlRMutex *xmlRMutexPtr; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #include 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | XMLPUBFUN xmlMutexPtr XMLCALL 40 | xmlNewMutex (void); 41 | XMLPUBFUN void XMLCALL 42 | xmlMutexLock (xmlMutexPtr tok); 43 | XMLPUBFUN void XMLCALL 44 | xmlMutexUnlock (xmlMutexPtr tok); 45 | XMLPUBFUN void XMLCALL 46 | xmlFreeMutex (xmlMutexPtr tok); 47 | 48 | XMLPUBFUN xmlRMutexPtr XMLCALL 49 | xmlNewRMutex (void); 50 | XMLPUBFUN void XMLCALL 51 | xmlRMutexLock (xmlRMutexPtr tok); 52 | XMLPUBFUN void XMLCALL 53 | xmlRMutexUnlock (xmlRMutexPtr tok); 54 | XMLPUBFUN void XMLCALL 55 | xmlFreeRMutex (xmlRMutexPtr tok); 56 | 57 | /* 58 | * Library wide APIs. 59 | */ 60 | XMLPUBFUN void XMLCALL 61 | xmlInitThreads (void); 62 | XMLPUBFUN void XMLCALL 63 | xmlLockLibrary (void); 64 | XMLPUBFUN void XMLCALL 65 | xmlUnlockLibrary(void); 66 | XMLPUBFUN int XMLCALL 67 | xmlGetThreadId (void); 68 | XMLPUBFUN int XMLCALL 69 | xmlIsMainThread (void); 70 | XMLPUBFUN void XMLCALL 71 | xmlCleanupThreads(void); 72 | XMLPUBFUN xmlGlobalStatePtr XMLCALL 73 | xmlGetGlobalState(void); 74 | 75 | #if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && defined(LIBXML_STATIC_FOR_DLL) 76 | int XMLCALL xmlDllMain(void *hinstDLL, unsigned long fdwReason, void *lpvReserved); 77 | #endif 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | 83 | 84 | #endif /* __XML_THREADS_H__ */ 85 | -------------------------------------------------------------------------------- /include/mysql/mysql/plugin_validate_password.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2022, Oracle and/or its affiliates. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License, version 2.0, 5 | as published by the Free Software Foundation. 6 | 7 | This program is also distributed with certain software (including 8 | but not limited to OpenSSL) that is licensed under separate terms, 9 | as designated in a particular file or component or in included license 10 | documentation. The authors of MySQL hereby grant you an additional 11 | permission to link the program and your derivative works with the 12 | separately licensed software that they have included with MySQL. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License, version 2.0, for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 22 | 23 | #ifndef MYSQL_PLUGIN_VALIDATE_PASSWORD_INCLUDED 24 | #define MYSQL_PLUGIN_VALIDATE_PASSWORD_INCLUDED 25 | 26 | /* API for validate_password plugin. (MYSQL_VALIDATE_PASSWORD_PLUGIN) */ 27 | 28 | #include 29 | #define MYSQL_VALIDATE_PASSWORD_INTERFACE_VERSION 0x0100 30 | 31 | /* 32 | The descriptor structure for the plugin, that is referred from 33 | st_mysql_plugin. 34 | */ 35 | 36 | typedef void* mysql_string_handle; 37 | 38 | struct st_mysql_validate_password 39 | { 40 | int interface_version; 41 | /* 42 | This function retuns TRUE for passwords which satisfy the password 43 | policy (as choosen by plugin variable) and FALSE for all other 44 | password 45 | */ 46 | int (*validate_password)(mysql_string_handle password); 47 | /* 48 | This function returns the password strength (0-100) depending 49 | upon the policies 50 | */ 51 | int (*get_password_strength)(mysql_string_handle password); 52 | }; 53 | #endif 54 | -------------------------------------------------------------------------------- /include/openssl/rc5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_RC5_H 11 | # define HEADER_RC5_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_RC5 16 | # ifdef __cplusplus 17 | extern "C" { 18 | # endif 19 | 20 | # define RC5_ENCRYPT 1 21 | # define RC5_DECRYPT 0 22 | 23 | # define RC5_32_INT unsigned int 24 | 25 | # define RC5_32_BLOCK 8 26 | # define RC5_32_KEY_LENGTH 16/* This is a default, max is 255 */ 27 | 28 | /* 29 | * This are the only values supported. Tweak the code if you want more The 30 | * most supported modes will be RC5-32/12/16 RC5-32/16/8 31 | */ 32 | # define RC5_8_ROUNDS 8 33 | # define RC5_12_ROUNDS 12 34 | # define RC5_16_ROUNDS 16 35 | 36 | typedef struct rc5_key_st { 37 | /* Number of rounds */ 38 | int rounds; 39 | RC5_32_INT data[2 * (RC5_16_ROUNDS + 1)]; 40 | } RC5_32_KEY; 41 | 42 | void RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data, 43 | int rounds); 44 | void RC5_32_ecb_encrypt(const unsigned char *in, unsigned char *out, 45 | RC5_32_KEY *key, int enc); 46 | void RC5_32_encrypt(unsigned long *data, RC5_32_KEY *key); 47 | void RC5_32_decrypt(unsigned long *data, RC5_32_KEY *key); 48 | void RC5_32_cbc_encrypt(const unsigned char *in, unsigned char *out, 49 | long length, RC5_32_KEY *ks, unsigned char *iv, 50 | int enc); 51 | void RC5_32_cfb64_encrypt(const unsigned char *in, unsigned char *out, 52 | long length, RC5_32_KEY *schedule, 53 | unsigned char *ivec, int *num, int enc); 54 | void RC5_32_ofb64_encrypt(const unsigned char *in, unsigned char *out, 55 | long length, RC5_32_KEY *schedule, 56 | unsigned char *ivec, int *num); 57 | 58 | # ifdef __cplusplus 59 | } 60 | # endif 61 | # endif 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /Src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file( GLOB main_SRC "*.h" "*.c" ) 3 | aux_source_directory(./model model_SRC) 4 | aux_source_directory(./elr_mpl elr_mpl_SRC) 5 | aux_source_directory(./conf conf_SRC) 6 | aux_source_directory(./views views_SRC) 7 | aux_source_directory(./utility utility_SRC) 8 | aux_source_directory(./middleware middleware_SRC) 9 | include_directories(${PROJECT_SOURCE_DIR}/include/dmfserver) 10 | 11 | 12 | if( CMAKE_SYSTEM_NAME STREQUAL "Windows" ) 13 | include_directories(${PROJECT_SOURCE_DIR}/include) 14 | 15 | link_directories("${PROJECT_SOURCE_DIR}/lib") 16 | link_libraries("libssl") 17 | link_libraries("libmysql") 18 | link_libraries("pthreadVC2") 19 | link_libraries("ws2_32") 20 | link_libraries("libcrypto") 21 | link_libraries("libxml2") 22 | link_libraries("iconv") 23 | link_libraries("libjansson") 24 | link_libraries("libpcre32") 25 | link_libraries("libpcre") 26 | link_libraries("libjwt") 27 | 28 | # pthread 有冲突 29 | add_definitions("-DHAVE_STRUCT_TIMESPEC") 30 | 31 | #指定生成目标 32 | add_executable(server 33 | ${main_SRC} 34 | ${model_SRC} 35 | ${elr_mpl_SRC} 36 | ${conf_SRC} 37 | ${utility_SRC} 38 | ${middleware_SRC} 39 | "./mdb/mdb_operate.c" ) 40 | 41 | elseif( CMAKE_SYSTEM_NAME STREQUAL "Linux" ) 42 | 43 | #include_directories(${PROJECT_SOURCE_DIR}/includelinux) 44 | 45 | find_package(Threads REQUIRED) 46 | find_package(OpenSSL REQUIRED) 47 | find_package(LibXml2 REQUIRED) 48 | find_package(jansson REQUIRED) 49 | # find_package(pcre REQUIRED) 50 | # find_package(libjwt REQUIRED) 51 | 52 | link_libraries(pthread mysqlclient ssl crypto xml2 jansson pcre jwt) 53 | include_directories( 54 | ${MYSQL_INCLUDE_DIRS} 55 | ${OPENSSL_INCLUDE_DIRS} 56 | ${LIBXML2_INCLUDE_DIRS} 57 | ${JANNSON_INCLUDE_DIRS} 58 | ${PCRE_INCLUDE_DIRS} 59 | ${JWT_INCLUDE_DIRS}) 60 | 61 | #指定生成目标 62 | add_executable(server 63 | ${main_SRC} 64 | ${model_SRC} 65 | ${elr_mpl_SRC} 66 | ${conf_SRC} 67 | ${utility_SRC} 68 | ${middleware_SRC} 69 | "./mdb/mdb_operate.c" ) 70 | 71 | endif() 72 | 73 | # 构建mdb子目录 74 | add_subdirectory("${PROJECT_SOURCE_DIR}/Src/mdb") 75 | 76 | -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/elr_mpl/elr_mtx.h: -------------------------------------------------------------------------------- 1 | #ifndef __ELR_MTX_H__ 2 | #define __ELR_MTX_H__ 3 | 4 | #ifdef __WIN32__ 5 | #include 6 | 7 | /*! \brief platform independent mutex type. 8 | * 9 | * it is highly recommend that you declare a elr_mpl_t variable 10 | * with the following initializing statement 11 | * elr_mpl_t mpl = ELR_MPL_INITIALIZER; 12 | * an elr_mpl_t variable is only valid when 13 | * it was initialized directly or indirectly by elr_mpl_create`s return value. 14 | */ 15 | typedef struct __elr_mtx 16 | { 17 | CRITICAL_SECTION _cs;/*!< the windows critical section object. */ 18 | } 19 | elr_mtx; 20 | 21 | /** platform independent atomic counter type. */ 22 | typedef volatile LONG elr_atomic_t; 23 | 24 | /** platform independent counter integer type. */ 25 | typedef LONG elr_counter_t; 26 | 27 | /** platform independent zero initial value of atomic counter type. */ 28 | #define ELR_ATOMIC_ZERO 0 29 | 30 | 31 | 32 | /* 33 | ** 原子自增操作 34 | */ 35 | /*! \brief atomic increment operation. 36 | * \param v pointer to a atomic counter type variable. 37 | * \retval the integer value of v after increment. 38 | * 39 | * make a increment of v by one atomicly. 40 | */ 41 | elr_counter_t elr_atomic_inc(elr_atomic_t* v); 42 | 43 | /* 44 | ** 原子自减操作 45 | */ 46 | /*! \brief atomic decrement operation. 47 | * \param v pointer to a atomic counter type variable. 48 | * \retval the integer value of v after decrement. 49 | * 50 | * make a decrement of v by one atomicly. 51 | */ 52 | elr_counter_t elr_atomic_dec(elr_atomic_t* v); 53 | 54 | /* 55 | ** 初始化互斥体,返回0表示初始化失败 56 | ** 如果初始化失败就不需要再调用elr_mtx_finalize 57 | */ 58 | /*! \brief initialize a mutex. 59 | * \param mtx pointer to a mutex. 60 | * \retval zero if failed. 61 | */ 62 | int elr_mtx_init(elr_mtx *mtx); 63 | 64 | /*! \brief waits on a mutex. 65 | * \param mtx pointer to a mutex. 66 | */ 67 | void elr_mtx_lock (elr_mtx *mtx); 68 | 69 | /*! \brief releases on a mutex. 70 | * \param mtx pointer to a mutex. 71 | */ 72 | void elr_mtx_unlock(elr_mtx *mtx); 73 | 74 | /*! \brief initialize a mutex. 75 | * \param mtx pointer to a mutex. 76 | */ 77 | void elr_mtx_finalize(elr_mtx *mtx); 78 | 79 | #endif // win32 80 | 81 | #endif // elr_mpl 82 | -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __LOG_INCLUDE__ 20 | #define __LOG_INCLUDE__ 21 | 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | 31 | // 定义日志级别 32 | #define LOG_LEVEL_INFO 0 33 | #define LOG_LEVEL_DEBUG 1 34 | #define LOG_LEVEL_WARN 2 35 | #define LOG_LEVEL_ERROR 3 36 | 37 | // 定义日志格式 38 | #define LOG_FORMAT "[%d] %s %s:%d\n" 39 | 40 | // 定义日志文件名和大小 41 | #define LOG_FILE_NAME "server.log" 42 | #define LOG_FILE_SIZE (1024 * 1024 * 10) // 10MB 43 | 44 | // 定义日志缓冲区大小 45 | #define LOG_BUFFER_SIZE 2048 46 | 47 | // 定义日志记录 48 | typedef struct { 49 | int level; // 日志级别 50 | char message[1024]; // 日志内容 51 | char filename[256]; // 日志文件名 52 | int line; // 日志所在行数 53 | } log_record_t; 54 | 55 | 56 | #ifdef __cplusplus 57 | extern "C" { 58 | #endif 59 | 60 | static void *log_thread(void *arg); 61 | 62 | extern void log_init(); 63 | 64 | extern void log_write(int level, const char *filename, int line, const char *format, ...); 65 | 66 | extern void log_info(const char *filename, int line, const char *format, ...); 67 | 68 | extern void log_debug(const char *filename, int line, const char *format, ...); 69 | 70 | extern void log_warn(const char *filename, int line, const char *format, ...); 71 | 72 | extern void log_error(const char *filename, int line, const char *format, ...); 73 | 74 | #ifdef __cplusplus 75 | } /* end of the 'extern "C"' block */ 76 | #endif 77 | 78 | 79 | #endif // __LOG_INCLUDE__ -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/cpool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __MYSQL_POOL_INCLUDE__ 20 | #define __MYSQL_POOL_INCLUDE__ 21 | 22 | 23 | #include 24 | #include 25 | #include 26 | #define MAX_KEEP_CONNECTIONS 4 27 | 28 | //定义mysql连接链表结构 29 | typedef struct mysql_conn 30 | { 31 | struct mysql_conn * next; //下一个连接的指针 32 | struct mysql_conn * prev; //上一个的指针 33 | MYSQL conn; 34 | 35 | } mysql_conn; //相当于typedef struct mysql_conn mysql_conn; 第一个mysql_conn为类型,第二个为变量名 36 | 37 | 38 | 39 | //定义mysql连接池结构 40 | typedef struct mysql_pool 41 | { 42 | char host[64]; //主机名 43 | char username[32]; //用户名 44 | char password[32]; //密码 45 | char database[32]; //默认数据库 46 | int port; //端口号 默认3306 47 | int min_connections; //最小连接数 48 | int max_connections; //最大连接数 49 | int free_connections; //保持空闲的最大连接数 50 | 51 | 52 | pthread_mutex_t lock; //mysql链表锁 53 | 54 | int is_idle_block; //是否开启无可用 连接阻塞 55 | pthread_cond_t idle_signal; //等待可用连接的条件变量 56 | 57 | mysql_conn * mysql_list; //mysql连接池链表 58 | 59 | } mysql_pool; 60 | 61 | #ifdef __cplusplus 62 | extern "C" { 63 | #endif 64 | 65 | void mysql_pool_init(); //执行初始化方法 66 | void destroy_mysql_connection(mysql_conn *conn); 67 | void destroy_mysql_pool(); 68 | void release_mysql_connection(mysql_conn *conn); 69 | mysql_conn * get_mysql_connection(); 70 | mysql_conn * get_mysql_connection_block(); 71 | MYSQL_RES * mysql_execute_query(const char *sql,unsigned long length,int * flag); 72 | 73 | 74 | #ifdef __cplusplus 75 | } /* end of the 'extern "C"' block */ 76 | #endif 77 | 78 | #endif //__MYSQL_POOL_INCLUDE__ 79 | 80 | -------------------------------------------------------------------------------- /include/openssl/kdferr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_KDFERR_H 12 | # define HEADER_KDFERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_KDF_strings(void); 22 | 23 | /* 24 | * KDF function codes. 25 | */ 26 | # define KDF_F_PKEY_HKDF_CTRL_STR 103 27 | # define KDF_F_PKEY_HKDF_DERIVE 102 28 | # define KDF_F_PKEY_HKDF_INIT 108 29 | # define KDF_F_PKEY_SCRYPT_CTRL_STR 104 30 | # define KDF_F_PKEY_SCRYPT_CTRL_UINT64 105 31 | # define KDF_F_PKEY_SCRYPT_DERIVE 109 32 | # define KDF_F_PKEY_SCRYPT_INIT 106 33 | # define KDF_F_PKEY_SCRYPT_SET_MEMBUF 107 34 | # define KDF_F_PKEY_TLS1_PRF_CTRL_STR 100 35 | # define KDF_F_PKEY_TLS1_PRF_DERIVE 101 36 | # define KDF_F_PKEY_TLS1_PRF_INIT 110 37 | # define KDF_F_TLS1_PRF_ALG 111 38 | 39 | /* 40 | * KDF reason codes. 41 | */ 42 | # define KDF_R_INVALID_DIGEST 100 43 | # define KDF_R_MISSING_ITERATION_COUNT 109 44 | # define KDF_R_MISSING_KEY 104 45 | # define KDF_R_MISSING_MESSAGE_DIGEST 105 46 | # define KDF_R_MISSING_PARAMETER 101 47 | # define KDF_R_MISSING_PASS 110 48 | # define KDF_R_MISSING_SALT 111 49 | # define KDF_R_MISSING_SECRET 107 50 | # define KDF_R_MISSING_SEED 106 51 | # define KDF_R_UNKNOWN_PARAMETER_TYPE 103 52 | # define KDF_R_VALUE_ERROR 108 53 | # define KDF_R_VALUE_MISSING 102 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /Src/middleware/middleware.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright 2023 Ajax 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #ifdef __WIN32__ 25 | #include 26 | #include 27 | #endif // __win32__ 28 | 29 | #ifdef __linux__ 30 | #include 31 | #include 32 | #include // for close 33 | #endif // __LINUX__ 34 | 35 | extern void middleware_init() 36 | { 37 | printf("[SERVER: Info] middleware init successfully...\n"); 38 | } 39 | 40 | static int middleware_check_if_too_often(connection_tp conn) 41 | { 42 | // 得到客户端ip地址 43 | struct sockaddr_in client_addr; 44 | memset(&client_addr, 0x00, sizeof(client_addr)); 45 | socklen_t nl=sizeof(client_addr); 46 | getpeername(conn->per_handle_data->Socket , (struct sockaddr*)&client_addr, &nl); 47 | char* addr=inet_ntoa(client_addr.sin_addr); 48 | 49 | switch ( ip_check_valid(addr) ) { 50 | case 0: 51 | return 0; 52 | case 2: 53 | // printf("[Warn]%s request too often! \n", addr); 54 | return -2; 55 | case 3: 56 | // printf("[Warn]%s has been ban! \n", addr); 57 | return -3; 58 | default: return 0; 59 | } 60 | } 61 | 62 | // 返回值大于零说明所有中间件都经过检测 63 | // 返回值小于零则是相应的中间件未通过 64 | // 在返回之前要调用response模块返回请求错误 65 | extern int middleware_handle(connection_tp conn ) 66 | { 67 | request_t* req = conn->req; 68 | 69 | if( middleware_check_if_too_often(conn) != 0 ) { 70 | 71 | res_without_permission(conn); 72 | return -1001; 73 | } 74 | 75 | return 1; 76 | } -------------------------------------------------------------------------------- /include/openssl/idea.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_IDEA_H 11 | # define HEADER_IDEA_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_IDEA 16 | # ifdef __cplusplus 17 | extern "C" { 18 | # endif 19 | 20 | typedef unsigned int IDEA_INT; 21 | 22 | # define IDEA_ENCRYPT 1 23 | # define IDEA_DECRYPT 0 24 | 25 | # define IDEA_BLOCK 8 26 | # define IDEA_KEY_LENGTH 16 27 | 28 | typedef struct idea_key_st { 29 | IDEA_INT data[9][6]; 30 | } IDEA_KEY_SCHEDULE; 31 | 32 | const char *IDEA_options(void); 33 | void IDEA_ecb_encrypt(const unsigned char *in, unsigned char *out, 34 | IDEA_KEY_SCHEDULE *ks); 35 | void IDEA_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); 36 | void IDEA_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk); 37 | void IDEA_cbc_encrypt(const unsigned char *in, unsigned char *out, 38 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 39 | int enc); 40 | void IDEA_cfb64_encrypt(const unsigned char *in, unsigned char *out, 41 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 42 | int *num, int enc); 43 | void IDEA_ofb64_encrypt(const unsigned char *in, unsigned char *out, 44 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 45 | int *num); 46 | void IDEA_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks); 47 | 48 | # if OPENSSL_API_COMPAT < 0x10100000L 49 | # define idea_options IDEA_options 50 | # define idea_ecb_encrypt IDEA_ecb_encrypt 51 | # define idea_set_encrypt_key IDEA_set_encrypt_key 52 | # define idea_set_decrypt_key IDEA_set_decrypt_key 53 | # define idea_cbc_encrypt IDEA_cbc_encrypt 54 | # define idea_cfb64_encrypt IDEA_cfb64_encrypt 55 | # define idea_ofb64_encrypt IDEA_ofb64_encrypt 56 | # define idea_encrypt IDEA_encrypt 57 | # endif 58 | 59 | # ifdef __cplusplus 60 | } 61 | # endif 62 | # endif 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /include/libxml/nanohttp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Summary: minimal HTTP implementation 3 | * Description: minimal HTTP implementation allowing to fetch resources 4 | * like external subset. 5 | * 6 | * Copy: See Copyright for the status of this software. 7 | * 8 | * Author: Daniel Veillard 9 | */ 10 | 11 | #ifndef __NANO_HTTP_H__ 12 | #define __NANO_HTTP_H__ 13 | 14 | #include 15 | 16 | #ifdef LIBXML_HTTP_ENABLED 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | XMLPUBFUN void XMLCALL 22 | xmlNanoHTTPInit (void); 23 | XMLPUBFUN void XMLCALL 24 | xmlNanoHTTPCleanup (void); 25 | XMLPUBFUN void XMLCALL 26 | xmlNanoHTTPScanProxy (const char *URL); 27 | XMLPUBFUN int XMLCALL 28 | xmlNanoHTTPFetch (const char *URL, 29 | const char *filename, 30 | char **contentType); 31 | XMLPUBFUN void * XMLCALL 32 | xmlNanoHTTPMethod (const char *URL, 33 | const char *method, 34 | const char *input, 35 | char **contentType, 36 | const char *headers, 37 | int ilen); 38 | XMLPUBFUN void * XMLCALL 39 | xmlNanoHTTPMethodRedir (const char *URL, 40 | const char *method, 41 | const char *input, 42 | char **contentType, 43 | char **redir, 44 | const char *headers, 45 | int ilen); 46 | XMLPUBFUN void * XMLCALL 47 | xmlNanoHTTPOpen (const char *URL, 48 | char **contentType); 49 | XMLPUBFUN void * XMLCALL 50 | xmlNanoHTTPOpenRedir (const char *URL, 51 | char **contentType, 52 | char **redir); 53 | XMLPUBFUN int XMLCALL 54 | xmlNanoHTTPReturnCode (void *ctx); 55 | XMLPUBFUN const char * XMLCALL 56 | xmlNanoHTTPAuthHeader (void *ctx); 57 | XMLPUBFUN const char * XMLCALL 58 | xmlNanoHTTPRedir (void *ctx); 59 | XMLPUBFUN int XMLCALL 60 | xmlNanoHTTPContentLength( void * ctx ); 61 | XMLPUBFUN const char * XMLCALL 62 | xmlNanoHTTPEncoding (void *ctx); 63 | XMLPUBFUN const char * XMLCALL 64 | xmlNanoHTTPMimeType (void *ctx); 65 | XMLPUBFUN int XMLCALL 66 | xmlNanoHTTPRead (void *ctx, 67 | void *dest, 68 | int len); 69 | #ifdef LIBXML_OUTPUT_ENABLED 70 | XMLPUBFUN int XMLCALL 71 | xmlNanoHTTPSave (void *ctxt, 72 | const char *filename); 73 | #endif /* LIBXML_OUTPUT_ENABLED */ 74 | XMLPUBFUN void XMLCALL 75 | xmlNanoHTTPClose (void *ctx); 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif /* LIBXML_HTTP_ENABLED */ 81 | #endif /* __NANO_HTTP_H__ */ 82 | -------------------------------------------------------------------------------- /include/mysql/mysql/psi/mysql_memory.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2022, Oracle and/or its affiliates. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License, version 2.0, 5 | as published by the Free Software Foundation. 6 | 7 | This program is also distributed with certain software (including 8 | but not limited to OpenSSL) that is licensed under separate terms, 9 | as designated in a particular file or component or in included license 10 | documentation. The authors of MySQL hereby grant you an additional 11 | permission to link the program and your derivative works with the 12 | separately licensed software that they have included with MySQL. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License, version 2.0, for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software Foundation, 21 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 22 | 23 | #ifndef MYSQL_MEMORY_H 24 | #define MYSQL_MEMORY_H 25 | 26 | /** 27 | @file mysql/psi/mysql_memory.h 28 | Instrumentation helpers for memory allocation. 29 | */ 30 | 31 | #include "mysql/psi/psi.h" 32 | 33 | #ifndef PSI_MEMORY_CALL 34 | #define PSI_MEMORY_CALL(M) PSI_DYNAMIC_CALL(M) 35 | #endif 36 | 37 | /** 38 | @defgroup Memory_instrumentation Memory Instrumentation 39 | @ingroup Instrumentation_interface 40 | @{ 41 | */ 42 | 43 | /** 44 | @def mysql_memory_register(P1, P2, P3) 45 | Memory registration. 46 | */ 47 | #define mysql_memory_register(P1, P2, P3) \ 48 | inline_mysql_memory_register(P1, P2, P3) 49 | 50 | static inline void inline_mysql_memory_register( 51 | #ifdef HAVE_PSI_MEMORY_INTERFACE 52 | const char *category, 53 | PSI_memory_info *info, 54 | int count) 55 | #else 56 | const char *category MY_ATTRIBUTE((unused)), 57 | void *info MY_ATTRIBUTE((unused)), 58 | int count MY_ATTRIBUTE((unused))) 59 | #endif 60 | { 61 | #ifdef HAVE_PSI_MEMORY_INTERFACE 62 | PSI_MEMORY_CALL(register_memory)(category, info, count); 63 | #endif 64 | } 65 | 66 | /** @} (end of group Memory_instrumentation) */ 67 | 68 | #endif 69 | 70 | -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/connection.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __CONNECTION_INCLUDE__ 20 | #define __CONNECTION_INCLUDE__ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #define DATA_BUFSIZE 2048 28 | 29 | #ifdef __WIN32__ // Windows 30 | #include 31 | #include 32 | 33 | typedef struct { 34 | OVERLAPPED Overlapped; 35 | WSABUF DataBuf; 36 | CHAR Buffer[ DATA_BUFSIZE ]; 37 | } per_io_data_t, * per_io_data_tp; 38 | 39 | typedef struct { 40 | SOCKET Socket; 41 | struct _connection_t * conn; 42 | } per_handle_data_t, * per_handle_data_tp; 43 | 44 | #else // Windows 45 | 46 | typedef struct { 47 | char Buffer[ 5 ]; 48 | } per_io_data_t, * per_io_data_tp; 49 | 50 | typedef struct { 51 | int efd; 52 | int Socket; 53 | struct _connection_t * conn; 54 | } per_handle_data_t, * per_handle_data_tp; 55 | 56 | #endif // linux 57 | 58 | typedef struct _connection_t { 59 | per_io_data_tp per_io_data; 60 | per_handle_data_tp per_handle_data; 61 | request_t *req; 62 | } connection_t, * connection_tp; 63 | 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | 70 | 71 | 72 | extern connection_tp 73 | new_connection (); 74 | 75 | #ifdef __WIN32__ 76 | extern void 77 | send_next (connection_tp conn) ; 78 | #endif 79 | 80 | extern void 81 | connection_close (connection_tp conn); 82 | 83 | extern void 84 | connection_free_base (connection_tp conn); 85 | 86 | extern void 87 | connection_free (connection_tp conn); 88 | 89 | 90 | #ifdef __cplusplus 91 | } /* end of the 'extern "C"' block */ 92 | #endif 93 | 94 | 95 | #endif // __CONNECTION_INCLUDE__ -------------------------------------------------------------------------------- /include/mysql/mysql/service_my_plugin_log.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011, 2022, Oracle and/or its affiliates. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License, version 2.0, 5 | as published by the Free Software Foundation. 6 | 7 | This program is also distributed with certain software (including 8 | but not limited to OpenSSL) that is licensed under separate terms, 9 | as designated in a particular file or component or in included license 10 | documentation. The authors of MySQL hereby grant you an additional 11 | permission to link the program and your derivative works with the 12 | separately licensed software that they have included with MySQL. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License, version 2.0, for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 22 | 23 | /** 24 | @file 25 | This service provides functions to report error conditions and log to 26 | mysql error log. 27 | */ 28 | 29 | #ifndef MYSQL_SERVICE_MY_PLUGIN_LOG_INCLUDED 30 | #define MYSQL_SERVICE_MY_PLUGIN_LOG_INCLUDED 31 | 32 | #ifndef MYSQL_ABI_CHECK 33 | #include 34 | #endif 35 | 36 | /* keep in sync with the loglevel enum in my_sys.h */ 37 | enum plugin_log_level 38 | { 39 | MY_ERROR_LEVEL, 40 | MY_WARNING_LEVEL, 41 | MY_INFORMATION_LEVEL 42 | }; 43 | 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | extern struct my_plugin_log_service 50 | { 51 | /** write a message to the log */ 52 | int (*my_plugin_log_message)(MYSQL_PLUGIN *, enum plugin_log_level, const char *, ...); 53 | } *my_plugin_log_service; 54 | 55 | #ifdef MYSQL_DYNAMIC_PLUGIN 56 | 57 | #define my_plugin_log_message my_plugin_log_service->my_plugin_log_message 58 | 59 | #else 60 | 61 | int my_plugin_log_message(MYSQL_PLUGIN *plugin, enum plugin_log_level level, 62 | const char *format, ...); 63 | 64 | #endif 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /include/mysql/my_list.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2022, Oracle and/or its affiliates. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License, version 2.0, 5 | as published by the Free Software Foundation. 6 | 7 | This program is also distributed with certain software (including 8 | but not limited to OpenSSL) that is licensed under separate terms, 9 | as designated in a particular file or component or in included license 10 | documentation. The authors of MySQL hereby grant you an additional 11 | permission to link the program and your derivative works with the 12 | separately licensed software that they have included with MySQL. 13 | 14 | Without limiting anything contained in the foregoing, this file, 15 | which is part of C Driver for MySQL (Connector/C), is also subject to the 16 | Universal FOSS Exception, version 1.0, a copy of which can be found at 17 | http://oss.oracle.com/licenses/universal-foss-exception. 18 | 19 | This program is distributed in the hope that it will be useful, 20 | but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | GNU General Public License, version 2.0, for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with this program; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 27 | 28 | #ifndef _list_h_ 29 | #define _list_h_ 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | typedef struct st_list { 36 | struct st_list *prev,*next; 37 | void *data; 38 | } LIST; 39 | 40 | typedef int (*list_walk_action)(void *,void *); 41 | 42 | extern LIST *list_add(LIST *root,LIST *element); 43 | extern LIST *list_delete(LIST *root,LIST *element); 44 | extern LIST *list_cons(void *data,LIST *root); 45 | extern LIST *list_reverse(LIST *root); 46 | extern void list_free(LIST *root,unsigned int free_data); 47 | extern unsigned int list_length(LIST *); 48 | extern int list_walk(LIST *,list_walk_action action,unsigned char * argument); 49 | 50 | #define list_rest(a) ((a)->next) 51 | #define list_push(a,b) (a)=list_cons((b),(a)) 52 | #define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old); my_free(old); } 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | #endif 58 | -------------------------------------------------------------------------------- /include/jansson/jansson_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2016 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | * 7 | * 8 | * This file specifies a part of the site-specific configuration for 9 | * Jansson, namely those things that affect the public API in 10 | * jansson.h. 11 | * 12 | * The CMake system will generate the jansson_config.h file and 13 | * copy it to the build and install directories. 14 | */ 15 | 16 | #ifndef JANSSON_CONFIG_H 17 | #define JANSSON_CONFIG_H 18 | 19 | /* Define this so that we can disable scattered automake configuration in source files */ 20 | #ifndef JANSSON_USING_CMAKE 21 | #define JANSSON_USING_CMAKE 22 | #endif 23 | 24 | /* Note: when using cmake, JSON_INTEGER_IS_LONG_LONG is not defined nor used, 25 | * as we will also check for __int64 etc types. 26 | * (the definition was used in the automake system) */ 27 | 28 | /* Bring in the cmake-detected defines */ 29 | #define HAVE_STDINT_H 1 30 | /* #undef HAVE_INTTYPES_H */ 31 | #define HAVE_SYS_TYPES_H 1 32 | 33 | /* Include our standard type header for the integer typedef */ 34 | 35 | #if defined(HAVE_STDINT_H) 36 | # include 37 | #elif defined(HAVE_INTTYPES_H) 38 | # include 39 | #elif defined(HAVE_SYS_TYPES_H) 40 | # include 41 | #endif 42 | 43 | 44 | /* If your compiler supports the inline keyword in C, JSON_INLINE is 45 | defined to `inline', otherwise empty. In C++, the inline is always 46 | supported. */ 47 | #ifdef __cplusplus 48 | #define JSON_INLINE inline 49 | #else 50 | #define JSON_INLINE inline 51 | #endif 52 | 53 | 54 | #define json_int_t long long 55 | #define json_strtoint strtoll 56 | #define JSON_INTEGER_FORMAT "I64d" 57 | 58 | 59 | /* If locale.h and localeconv() are available, define to 1, otherwise to 0. */ 60 | #define JSON_HAVE_LOCALECONV 1 61 | 62 | /* If __atomic builtins are available they will be used to manage 63 | reference counts of json_t. */ 64 | #define JSON_HAVE_ATOMIC_BUILTINS 1 65 | 66 | /* If __atomic builtins are not available we try using __sync builtins 67 | to manage reference counts of json_t. */ 68 | #define JSON_HAVE_SYNC_BUILTINS 1 69 | 70 | /* Maximum recursion depth for parsing JSON input. 71 | This limits the depth of e.g. array-within-array constructions. */ 72 | #define JSON_PARSER_MAX_DEPTH 2048 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /include/openssl/cryptoerr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_CRYPTOERR_H 12 | # define HEADER_CRYPTOERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_CRYPTO_strings(void); 22 | 23 | /* 24 | * CRYPTO function codes. 25 | */ 26 | # define CRYPTO_F_CMAC_CTX_NEW 120 27 | # define CRYPTO_F_CRYPTO_DUP_EX_DATA 110 28 | # define CRYPTO_F_CRYPTO_FREE_EX_DATA 111 29 | # define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100 30 | # define CRYPTO_F_CRYPTO_MEMDUP 115 31 | # define CRYPTO_F_CRYPTO_NEW_EX_DATA 112 32 | # define CRYPTO_F_CRYPTO_OCB128_COPY_CTX 121 33 | # define CRYPTO_F_CRYPTO_OCB128_INIT 122 34 | # define CRYPTO_F_CRYPTO_SET_EX_DATA 102 35 | # define CRYPTO_F_FIPS_MODE_SET 109 36 | # define CRYPTO_F_GET_AND_LOCK 113 37 | # define CRYPTO_F_OPENSSL_ATEXIT 114 38 | # define CRYPTO_F_OPENSSL_BUF2HEXSTR 117 39 | # define CRYPTO_F_OPENSSL_FOPEN 119 40 | # define CRYPTO_F_OPENSSL_HEXSTR2BUF 118 41 | # define CRYPTO_F_OPENSSL_INIT_CRYPTO 116 42 | # define CRYPTO_F_OPENSSL_LH_NEW 126 43 | # define CRYPTO_F_OPENSSL_SK_DEEP_COPY 127 44 | # define CRYPTO_F_OPENSSL_SK_DUP 128 45 | # define CRYPTO_F_PKEY_HMAC_INIT 123 46 | # define CRYPTO_F_PKEY_POLY1305_INIT 124 47 | # define CRYPTO_F_PKEY_SIPHASH_INIT 125 48 | # define CRYPTO_F_SK_RESERVE 129 49 | 50 | /* 51 | * CRYPTO reason codes. 52 | */ 53 | # define CRYPTO_R_FIPS_MODE_NOT_SUPPORTED 101 54 | # define CRYPTO_R_ILLEGAL_HEX_DIGIT 102 55 | # define CRYPTO_R_ODD_NUMBER_OF_DIGITS 103 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /include/openssl/rand.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_RAND_H 11 | # define HEADER_RAND_H 12 | 13 | # include 14 | # include 15 | # include 16 | # include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | struct rand_meth_st { 23 | int (*seed) (const void *buf, int num); 24 | int (*bytes) (unsigned char *buf, int num); 25 | void (*cleanup) (void); 26 | int (*add) (const void *buf, int num, double randomness); 27 | int (*pseudorand) (unsigned char *buf, int num); 28 | int (*status) (void); 29 | }; 30 | 31 | int RAND_set_rand_method(const RAND_METHOD *meth); 32 | const RAND_METHOD *RAND_get_rand_method(void); 33 | # ifndef OPENSSL_NO_ENGINE 34 | int RAND_set_rand_engine(ENGINE *engine); 35 | # endif 36 | 37 | RAND_METHOD *RAND_OpenSSL(void); 38 | 39 | # if OPENSSL_API_COMPAT < 0x10100000L 40 | # define RAND_cleanup() while(0) continue 41 | # endif 42 | int RAND_bytes(unsigned char *buf, int num); 43 | int RAND_priv_bytes(unsigned char *buf, int num); 44 | DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num)) 45 | 46 | void RAND_seed(const void *buf, int num); 47 | void RAND_keep_random_devices_open(int keep); 48 | 49 | # if defined(__ANDROID__) && defined(__NDK_FPABI__) 50 | __NDK_FPABI__ /* __attribute__((pcs("aapcs"))) on ARM */ 51 | # endif 52 | void RAND_add(const void *buf, int num, double randomness); 53 | int RAND_load_file(const char *file, long max_bytes); 54 | int RAND_write_file(const char *file); 55 | const char *RAND_file_name(char *file, size_t num); 56 | int RAND_status(void); 57 | 58 | # ifndef OPENSSL_NO_EGD 59 | int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes); 60 | int RAND_egd(const char *path); 61 | int RAND_egd_bytes(const char *path, int bytes); 62 | # endif 63 | 64 | int RAND_poll(void); 65 | 66 | # if defined(_WIN32) && (defined(BASETYPES) || defined(_WINDEF_H)) 67 | /* application has to include in order to use these */ 68 | DEPRECATEDIN_1_1_0(void RAND_screen(void)) 69 | DEPRECATEDIN_1_1_0(int RAND_event(UINT, WPARAM, LPARAM)) 70 | # endif 71 | 72 | 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/session.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __SESSION_INCLUDE__ 20 | #define __SESSION_INCLUDE__ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | // #include 33 | 34 | #define HASH_DEC_LEN 512 35 | 36 | typedef struct _SessionData { 37 | char * key; 38 | char * data; 39 | int time_store; 40 | int expire; 41 | struct _SessionData * next; 42 | } SessionData; 43 | 44 | // Hash Map defination 45 | typedef struct _HashNode 46 | { 47 | char * key; 48 | SessionData * value; 49 | struct _HashNode * next; // 当下标相同时,指向集合中的下一个节点 50 | } HashNode ; 51 | 52 | #define SESSION_EXPIRE_DEFAULT 60 * 5 53 | 54 | // 在session模块中使用的全局变量 55 | static HashNode g_session_all_dec[ HASH_DEC_LEN ]; 56 | 57 | #ifdef __cplusplus 58 | extern "C" { 59 | #endif 60 | 61 | extern void session_init(); 62 | 63 | extern void SessionCreate(char* ,char*, char*); 64 | 65 | extern void SessionAll(); 66 | 67 | extern char * getSessionR(const request_t* req, char* key); 68 | 69 | extern int SessionAddR(const request_t* req, char* key, char* data); 70 | 71 | extern int UpdateSessionDataR(const request_t* req, char* key, char* newdata); 72 | 73 | extern char * getSession(char* session_str, char* key); 74 | 75 | extern int SessionAdd(char* session_str, char* key, char* value); 76 | 77 | extern int UpdateSessionData(char* session_str, char* key, char* newdata); 78 | 79 | #ifdef __cplusplus 80 | } /* end of the 'extern "C"' block */ 81 | #endif 82 | 83 | #endif // __SESSION_INCLUDE__ -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/utility/dm_thread_pool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __DM_THREAD_POOL_INCLUDE__ 20 | #define __DM_THREAD_POOL_INCLUDE__ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | #ifdef _WIN32 31 | #include 32 | #else 33 | #include 34 | #endif 35 | 36 | 37 | typedef struct task_t { 38 | void (*func)(void*); 39 | void* arg; 40 | struct task_t* next; 41 | 42 | } task_t; 43 | 44 | typedef struct thread_t { 45 | pthread_t tid; 46 | struct thread_pool_t *pool; 47 | struct thread_t* next; 48 | struct timeval end_time; 49 | 50 | } thread_t; 51 | 52 | /* 53 | typedef struct timer_t { 54 | struct timeval end_time; 55 | void (*func)(void*); 56 | void* arg; 57 | struct timer_t* next; 58 | 59 | } timer_t; 60 | */ 61 | 62 | typedef struct thread_pool_t { 63 | pthread_mutex_t lock; 64 | pthread_cond_t notify; 65 | 66 | task_t * task_list; 67 | thread_t* thread_list; 68 | //timer_t * timer_list; 69 | 70 | int thread_count; 71 | bool shutdown; 72 | 73 | } thread_pool_t; 74 | 75 | #ifdef __cplusplus 76 | extern "C" { 77 | #endif 78 | 79 | static void sleep_microseconds(int microseconds); 80 | void* thread_func(void *arg); 81 | void thread_pool_destroy(thread_pool_t *pool); 82 | thread_pool_t* thread_pool_create(int thread_count); 83 | int thread_pool_add_task(thread_pool_t *pool, void (*func)(void*), void *arg); 84 | //int add_timer(thread_pool_t *pool, int seconds, void (func)(void), void *arg); 85 | int is_thread_pool_empty(thread_pool_t *pool); 86 | 87 | #ifdef __cplusplus 88 | } /* end of the 'extern "C"' block */ 89 | #endif 90 | 91 | #endif // __DM_THREAD_POOL_INCLUDE__ -------------------------------------------------------------------------------- /include/mysql/mysql/services.h: -------------------------------------------------------------------------------- 1 | #ifndef MYSQL_SERVICES_INCLUDED 2 | /* Copyright (c) 2009, 2022, Oracle and/or its affiliates. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License, version 2.0, 6 | as published by the Free Software Foundation. 7 | 8 | This program is also distributed with certain software (including 9 | but not limited to OpenSSL) that is licensed under separate terms, 10 | as designated in a particular file or component or in included license 11 | documentation. The authors of MySQL hereby grant you an additional 12 | permission to link the program and your derivative works with the 13 | separately licensed software that they have included with MySQL. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License, version 2.0, for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program; if not, write to the Free Software 22 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 23 | 24 | 25 | /* 26 | Out of extern because of inclusion of files which include my_compiler.h 27 | which in turn complains about C-linkage of templates. 28 | service_srv_session.h and service_command.h use proper extern "C" for 29 | their exported symbols. 30 | */ 31 | #ifndef EMBEDDED_LIBRARY 32 | #include 33 | #include 34 | #include 35 | #endif 36 | 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #ifdef __cplusplus 62 | #include 63 | #endif 64 | 65 | #define MYSQL_SERVICES_INCLUDED 66 | #endif /* MYSQL_SERVICES_INCLUDED */ 67 | -------------------------------------------------------------------------------- /include/mysql/my_command.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015, 2022, Oracle and/or its affiliates. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License, version 2.0, 5 | as published by the Free Software Foundation. 6 | 7 | This program is also distributed with certain software (including 8 | but not limited to OpenSSL) that is licensed under separate terms, 9 | as designated in a particular file or component or in included license 10 | documentation. The authors of MySQL hereby grant you an additional 11 | permission to link the program and your derivative works with the 12 | separately licensed software that they have included with MySQL. 13 | 14 | Without limiting anything contained in the foregoing, this file, 15 | which is part of C Driver for MySQL (Connector/C), is also subject to the 16 | Universal FOSS Exception, version 1.0, a copy of which can be found at 17 | http://oss.oracle.com/licenses/universal-foss-exception. 18 | 19 | This program is distributed in the hope that it will be useful, 20 | but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | GNU General Public License, version 2.0, for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with this program; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 27 | 28 | #ifndef _mysql_command_h 29 | #define _mysql_command_h 30 | 31 | /** 32 | @enum enum_server_command 33 | @brief You should add new commands to the end of this list, otherwise old 34 | servers won't be able to handle them as 'unsupported'. 35 | */ 36 | enum enum_server_command 37 | { 38 | COM_SLEEP, 39 | COM_QUIT, 40 | COM_INIT_DB, 41 | COM_QUERY, 42 | COM_FIELD_LIST, 43 | COM_CREATE_DB, 44 | COM_DROP_DB, 45 | COM_REFRESH, 46 | COM_SHUTDOWN, 47 | COM_STATISTICS, 48 | COM_PROCESS_INFO, 49 | COM_CONNECT, 50 | COM_PROCESS_KILL, 51 | COM_DEBUG, 52 | COM_PING, 53 | COM_TIME, 54 | COM_DELAYED_INSERT, 55 | COM_CHANGE_USER, 56 | COM_BINLOG_DUMP, 57 | COM_TABLE_DUMP, 58 | COM_CONNECT_OUT, 59 | COM_REGISTER_SLAVE, 60 | COM_STMT_PREPARE, 61 | COM_STMT_EXECUTE, 62 | COM_STMT_SEND_LONG_DATA, 63 | COM_STMT_CLOSE, 64 | COM_STMT_RESET, 65 | COM_SET_OPTION, 66 | COM_STMT_FETCH, 67 | COM_DAEMON, 68 | COM_BINLOG_DUMP_GTID, 69 | COM_RESET_CONNECTION, 70 | /* don't forget to update const char *command_name[] in sql_parse.cc */ 71 | 72 | /* Must be last */ 73 | COM_END 74 | }; 75 | 76 | #endif /* _mysql_command_h */ 77 | -------------------------------------------------------------------------------- /include/dmfserver/dmfserver/router.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #ifndef __ROUTER_INCLUDE__ 20 | #define __ROUTER_INCLUDE__ 21 | 22 | #define STATIC_DIR "./static" 23 | #define STATIC_FILES_MAX_NUM 128 24 | 25 | #include // Router要接受req并把req传给 control function 26 | #include // Router找不到资源时直接调用 response 返回 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | 37 | #define MAX_PATH_LENGTH 1024 38 | #define MAX_FILES 500 39 | #define ContFunNUM 512 40 | 41 | #define RED "\033[0;32;31m" 42 | #define NONE "\033[m" 43 | #define YELLOW "\033[1;33m" 44 | 45 | 46 | 47 | // #define Router_Debug 48 | 49 | 50 | struct FileInfo { 51 | char path[MAX_PATH_LENGTH]; 52 | char type[16]; 53 | off_t size; 54 | char ext[16]; 55 | char content_type[64]; 56 | char url[512]; 57 | }; 58 | 59 | typedef void (*ContFun) (connection_tp conn, const request_t *req ); 60 | 61 | #define RouterAdd(name) void name() 62 | 63 | typedef struct _ContFunMap { 64 | 65 | ContFun cf[ ContFunNUM ]; 66 | char* keys[ ContFunNUM ]; 67 | int curr_num; 68 | 69 | } ctl_fun_map_t; 70 | 71 | // 全局 view 回调函数 72 | extern ctl_fun_map_t g_cmp; 73 | 74 | extern struct FileInfo g_file_list[MAX_FILES]; 75 | extern int g_num_files; 76 | 77 | #ifdef __cplusplus 78 | extern "C" { 79 | #endif 80 | 81 | extern void router_init(); 82 | 83 | extern void router_handle(connection_tp conn, request_t *req); 84 | 85 | static int search_local_file(char* local_paths[]); 86 | 87 | static void traverse_directory(const char *path, struct FileInfo file_list[], int *num_files); 88 | 89 | static char* get_content_type(char *file_ext); 90 | 91 | extern void router_add_app(ContFun cf[], char* keys[], const char* name); 92 | 93 | #ifdef __cplusplus 94 | } /* end of the 'extern "C"' block */ 95 | #endif 96 | 97 | #endif // __ROUTER_INCLUDE__ -------------------------------------------------------------------------------- /include/libxml/xmlsave.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Summary: the XML document serializer 3 | * Description: API to save document or subtree of document 4 | * 5 | * Copy: See Copyright for the status of this software. 6 | * 7 | * Author: Daniel Veillard 8 | */ 9 | 10 | #ifndef __XML_XMLSAVE_H__ 11 | #define __XML_XMLSAVE_H__ 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #ifdef LIBXML_OUTPUT_ENABLED 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /** 24 | * xmlSaveOption: 25 | * 26 | * This is the set of XML save options that can be passed down 27 | * to the xmlSaveToFd() and similar calls. 28 | */ 29 | typedef enum { 30 | XML_SAVE_FORMAT = 1<<0, /* format save output */ 31 | XML_SAVE_NO_DECL = 1<<1, /* drop the xml declaration */ 32 | XML_SAVE_NO_EMPTY = 1<<2, /* no empty tags */ 33 | XML_SAVE_NO_XHTML = 1<<3, /* disable XHTML1 specific rules */ 34 | XML_SAVE_XHTML = 1<<4, /* force XHTML1 specific rules */ 35 | XML_SAVE_AS_XML = 1<<5, /* force XML serialization on HTML doc */ 36 | XML_SAVE_AS_HTML = 1<<6, /* force HTML serialization on XML doc */ 37 | XML_SAVE_WSNONSIG = 1<<7 /* format with non-significant whitespace */ 38 | } xmlSaveOption; 39 | 40 | 41 | typedef struct _xmlSaveCtxt xmlSaveCtxt; 42 | typedef xmlSaveCtxt *xmlSaveCtxtPtr; 43 | 44 | XMLPUBFUN xmlSaveCtxtPtr XMLCALL 45 | xmlSaveToFd (int fd, 46 | const char *encoding, 47 | int options); 48 | XMLPUBFUN xmlSaveCtxtPtr XMLCALL 49 | xmlSaveToFilename (const char *filename, 50 | const char *encoding, 51 | int options); 52 | 53 | XMLPUBFUN xmlSaveCtxtPtr XMLCALL 54 | xmlSaveToBuffer (xmlBufferPtr buffer, 55 | const char *encoding, 56 | int options); 57 | 58 | XMLPUBFUN xmlSaveCtxtPtr XMLCALL 59 | xmlSaveToIO (xmlOutputWriteCallback iowrite, 60 | xmlOutputCloseCallback ioclose, 61 | void *ioctx, 62 | const char *encoding, 63 | int options); 64 | 65 | XMLPUBFUN long XMLCALL 66 | xmlSaveDoc (xmlSaveCtxtPtr ctxt, 67 | xmlDocPtr doc); 68 | XMLPUBFUN long XMLCALL 69 | xmlSaveTree (xmlSaveCtxtPtr ctxt, 70 | xmlNodePtr node); 71 | 72 | XMLPUBFUN int XMLCALL 73 | xmlSaveFlush (xmlSaveCtxtPtr ctxt); 74 | XMLPUBFUN int XMLCALL 75 | xmlSaveClose (xmlSaveCtxtPtr ctxt); 76 | XMLPUBFUN int XMLCALL 77 | xmlSaveSetEscape (xmlSaveCtxtPtr ctxt, 78 | xmlCharEncodingOutputFunc escape); 79 | XMLPUBFUN int XMLCALL 80 | xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt, 81 | xmlCharEncodingOutputFunc escape); 82 | #ifdef __cplusplus 83 | } 84 | #endif 85 | #endif /* LIBXML_OUTPUT_ENABLED */ 86 | #endif /* __XML_XMLSAVE_H__ */ 87 | 88 | 89 | -------------------------------------------------------------------------------- /include/openssl/async.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #include 11 | 12 | #ifndef HEADER_ASYNC_H 13 | # define HEADER_ASYNC_H 14 | 15 | #if defined(_WIN32) 16 | # if defined(BASETYPES) || defined(_WINDEF_H) 17 | /* application has to include to use this */ 18 | #define OSSL_ASYNC_FD HANDLE 19 | #define OSSL_BAD_ASYNC_FD INVALID_HANDLE_VALUE 20 | # endif 21 | #else 22 | #define OSSL_ASYNC_FD int 23 | #define OSSL_BAD_ASYNC_FD -1 24 | #endif 25 | # include 26 | 27 | 28 | # ifdef __cplusplus 29 | extern "C" { 30 | # endif 31 | 32 | typedef struct async_job_st ASYNC_JOB; 33 | typedef struct async_wait_ctx_st ASYNC_WAIT_CTX; 34 | 35 | #define ASYNC_ERR 0 36 | #define ASYNC_NO_JOBS 1 37 | #define ASYNC_PAUSE 2 38 | #define ASYNC_FINISH 3 39 | 40 | int ASYNC_init_thread(size_t max_size, size_t init_size); 41 | void ASYNC_cleanup_thread(void); 42 | 43 | #ifdef OSSL_ASYNC_FD 44 | ASYNC_WAIT_CTX *ASYNC_WAIT_CTX_new(void); 45 | void ASYNC_WAIT_CTX_free(ASYNC_WAIT_CTX *ctx); 46 | int ASYNC_WAIT_CTX_set_wait_fd(ASYNC_WAIT_CTX *ctx, const void *key, 47 | OSSL_ASYNC_FD fd, 48 | void *custom_data, 49 | void (*cleanup)(ASYNC_WAIT_CTX *, const void *, 50 | OSSL_ASYNC_FD, void *)); 51 | int ASYNC_WAIT_CTX_get_fd(ASYNC_WAIT_CTX *ctx, const void *key, 52 | OSSL_ASYNC_FD *fd, void **custom_data); 53 | int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd, 54 | size_t *numfds); 55 | int ASYNC_WAIT_CTX_get_changed_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *addfd, 56 | size_t *numaddfds, OSSL_ASYNC_FD *delfd, 57 | size_t *numdelfds); 58 | int ASYNC_WAIT_CTX_clear_fd(ASYNC_WAIT_CTX *ctx, const void *key); 59 | #endif 60 | 61 | int ASYNC_is_capable(void); 62 | 63 | int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *ctx, int *ret, 64 | int (*func)(void *), void *args, size_t size); 65 | int ASYNC_pause_job(void); 66 | 67 | ASYNC_JOB *ASYNC_get_current_job(void); 68 | ASYNC_WAIT_CTX *ASYNC_get_wait_ctx(ASYNC_JOB *job); 69 | void ASYNC_block_pause(void); 70 | void ASYNC_unblock_pause(void); 71 | 72 | 73 | # ifdef __cplusplus 74 | } 75 | # endif 76 | #endif 77 | -------------------------------------------------------------------------------- /Src/test/pcre_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __linux__ 6 | #include 7 | #include 8 | #elif __WIN32__ 9 | #include 10 | #include 11 | #endif 12 | #define OVECCOUNT 30 /* should be a multiple of 3 */ 13 | 14 | int pcre_test() 15 | { 16 | pcre *re; 17 | const char *error; 18 | int erroffset; 19 | int ovector[OVECCOUNT]; 20 | int rc, i; 21 | char src [] = "111 Hello World 222"; // 要被用来匹配的字符串 22 | char pattern [] = "(.*)</(tit)le>"; // 将要被编译的字符串形式的正则表达式 23 | printf("String : %s\n", src); 24 | printf("Pattern: \"%s\"\n", pattern); 25 | re = pcre_compile(pattern, // pattern, 输入参数,将要被编译的字符串形式的正则表达式 26 | 0, // options, 输入参数,用来指定编译时的一些选项 27 | &error, // errptr, 输出参数,用来输出错误信息 28 | &erroffset, // erroffset, 输出参数,pattern中出错位置的偏移量 29 | NULL); // tableptr, 输入参数,用来指定字符表,一般情况用NULL 30 | // 返回值:被编译好的正则表达式的pcre内部表示结构 31 | if (re == NULL) { //如果编译失败,返回错误信息 32 | printf("PCRE compilation failed at offset %d: %s\n", erroffset, error); 33 | return 1; 34 | } 35 | rc = pcre_exec(re, // code, 输入参数,用pcre_compile编译好的正则表达结构的指针 36 | NULL, // extra, 输入参数,用来向pcre_exec传一些额外的数据信息的结构的指针 37 | src, // subject, 输入参数,要被用来匹配的字符串 38 | strlen(src), // length, 输入参数, 要被用来匹配的字符串的指针 39 | 0, // startoffset, 输入参数,用来指定subject从什么位置开始被匹配的偏移量 40 | 0, // options, 输入参数, 用来指定匹配过程中的一些选项 41 | ovector, // ovector, 输出参数,用来返回匹配位置偏移量的数组 42 | OVECCOUNT); // ovecsize, 输入参数, 用来返回匹配位置偏移量的数组的最大大小 43 | // 返回值:匹配成功返回非负数,没有匹配返回负数 44 | if (rc < 0) { //如果没有匹配,返回错误信息 45 | if (rc == PCRE_ERROR_NOMATCH) 46 | printf("Sorry, no match ...\n"); 47 | else 48 | printf("Matching error %d\n", rc); 49 | pcre_free(re); 50 | return 1; 51 | } 52 | printf("\nOK, has matched ...\n\n"); //没有出错,已经匹配 53 | for (i = 0; i < rc; i++) { //分别取出捕获分组 $0整个正则公式 $1第一个() 54 | char *substring_start = src + ovector[2*i]; 55 | int substring_length = ovector[2*i+1] - ovector[2*i]; 56 | 57 | printf("$%2d: %.*s\n", i, substring_length, substring_start); 58 | } 59 | 60 | pcre_free(re); // 编译正则表达式re 释放内存 61 | } 62 | 63 | void jannson_test() 64 | { 65 | json_t val; 66 | int type = json_typeof(&val); 67 | bool Judge = json_is_object(&val); 68 | } 69 | -------------------------------------------------------------------------------- /include/mysql/sslopt-case.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2022, Oracle and/or its affiliates. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License, version 2.0, 5 | as published by the Free Software Foundation. 6 | 7 | This program is also distributed with certain software (including 8 | but not limited to OpenSSL) that is licensed under separate terms, 9 | as designated in a particular file or component or in included license 10 | documentation. The authors of MySQL hereby grant you an additional 11 | permission to link the program and your derivative works with the 12 | separately licensed software that they have included with MySQL. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License, version 2.0, for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 22 | 23 | #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) 24 | 25 | #ifndef MYSQL_CLIENT 26 | #error This header is supposed to be used only in the client 27 | #endif 28 | 29 | case OPT_SSL_MODE: 30 | opt_ssl_mode= find_type_or_exit(argument, &ssl_mode_typelib, 31 | opt->name); 32 | ssl_mode_set_explicitly= TRUE; 33 | break; 34 | case OPT_SSL_SSL: 35 | CLIENT_WARN_DEPRECATED("--ssl", "--ssl-mode"); 36 | if (!opt_use_ssl_arg) 37 | opt_ssl_mode= SSL_MODE_DISABLED; 38 | else if (opt_ssl_mode < SSL_MODE_REQUIRED) 39 | opt_ssl_mode= SSL_MODE_REQUIRED; 40 | break; 41 | case OPT_SSL_VERIFY_SERVER_CERT: 42 | CLIENT_WARN_DEPRECATED("--ssl-verify-server-cert", 43 | "--ssl-mode=VERIFY_IDENTITY"); 44 | if (!opt_ssl_verify_server_cert_arg) 45 | { 46 | if (opt_ssl_mode >= SSL_MODE_VERIFY_IDENTITY) 47 | opt_ssl_mode= SSL_MODE_VERIFY_CA; 48 | } 49 | else 50 | opt_ssl_mode= SSL_MODE_VERIFY_IDENTITY; 51 | break; 52 | case OPT_SSL_CA: 53 | case OPT_SSL_CAPATH: 54 | /* Don't change ssl-mode if set explicitly. */ 55 | if (!ssl_mode_set_explicitly) 56 | opt_ssl_mode= SSL_MODE_VERIFY_CA; 57 | break; 58 | case OPT_SSL_KEY: 59 | case OPT_SSL_CERT: 60 | case OPT_SSL_CIPHER: 61 | case OPT_SSL_CRL: 62 | case OPT_SSL_CRLPATH: 63 | case OPT_TLS_VERSION: 64 | break; 65 | #endif /* HAVE_OPENSSL */ 66 | -------------------------------------------------------------------------------- /Src/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Ajax 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | /* 20 | * MAIN 21 | * 22 | * It's show the simple usage of this server: 23 | * (1) init server 24 | * (2) load your own view 25 | * (3) start the server 26 | * (4) clean up resource 27 | */ 28 | 29 | #include <dmfserver/container.h> 30 | 31 | #include <dmfserver/session.h> // 初始化 session 32 | #include <dmfserver/cpool.h> // 初始化 mysqlpool 33 | #include <dmfserver/conf/conf.h> // 初始化 全局配置 34 | 35 | #include <dmfserver/elr_mpl/elr_mpl.h> // 初始化 内存池 36 | #include <dmfserver/mpool.h> 37 | #include <dmfserver/mdb/mdb_operate.h> 38 | #include <dmfserver/utility/dm_map.h> 39 | 40 | 41 | #include "./testviews/session.c" 42 | #include "./testviews/template.c" 43 | #include "./testviews/mysql.c" 44 | #include "./testviews/other.c" 45 | #include "./testviews/mdb.c" 46 | #include "./testviews/ws.c" 47 | 48 | typedef void (*worker_function)(); 49 | void multi_process_init(worker_function _wf); 50 | 51 | int main(int argc, char ** argv) 52 | { 53 | #if 1 54 | 55 | #ifdef __WIN32__ 56 | // system("cls"); 57 | // system("tasklist /nh | find /i \"mysqld.exe\""); 58 | // ShowWindow(GetConsoleWindow(), SW_HIDE); 59 | // FreeConsole(); 60 | #endif // WIN32 61 | 62 | // 安装信号 63 | // signal(SIGINT, handle_signal); 64 | // signal(SIGTERM, handle_signal); 65 | 66 | conf_init(); // 框架参数初始化 67 | log_init(); // 日志记录模块初始化 68 | middleware_init(); // 中间件初始化 69 | session_init(); // session 模块初始化 70 | template_init(); // 模板模块初始化 71 | router_init(); // 路由模块初始化 72 | mysql_pool_init(); // mysql 连接池初始化 73 | elr_mpl_init(); // 内存池初始化 74 | mdb_operate_init(); // mdb 模块初始化 75 | 76 | 77 | // *以下载入 views 的函数, 78 | // *载入以后,router 将根据载入的函数调用相对应的 view 79 | model(); 80 | other(); 81 | session(); 82 | apptemp(); 83 | mdb(); 84 | ws(); 85 | 86 | container_init(); 87 | container_start(); 88 | 89 | 90 | // 平滑退出时做相应的清理工作 91 | template_free(); 92 | 93 | #endif 94 | 95 | return 0; 96 | } 97 | -------------------------------------------------------------------------------- /include/mysql/mysql/innodb_priv.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010, 2022, Oracle and/or its affiliates. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License, version 2.0, 5 | as published by the Free Software Foundation. 6 | 7 | This program is also distributed with certain software (including 8 | but not limited to OpenSSL) that is licensed under separate terms, 9 | as designated in a particular file or component or in included license 10 | documentation. The authors of MySQL hereby grant you an additional 11 | permission to link the program and your derivative works with the 12 | separately licensed software that they have included with MySQL. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License, version 2.0, for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ 22 | 23 | #ifndef INNODB_PRIV_INCLUDED 24 | #define INNODB_PRIV_INCLUDED 25 | 26 | /** @file Declaring server-internal functions that are used by InnoDB. */ 27 | 28 | class THD; 29 | 30 | int get_quote_char_for_identifier(THD *thd, const char *name, size_t length); 31 | bool schema_table_store_record(THD *thd, TABLE *table); 32 | void localtime_to_TIME(MYSQL_TIME *to, struct tm *from); 33 | bool check_global_access(THD *thd, ulong want_access); 34 | size_t strconvert(CHARSET_INFO *from_cs, const char *from, 35 | CHARSET_INFO *to_cs, char *to, size_t to_length, 36 | uint *errors); 37 | void sql_print_error(const char *format, ...); 38 | 39 | /** 40 | Store record to I_S table, convert HEAP table to InnoDB table if necessary. 41 | 42 | @param[in] thd thread handler 43 | @param[in] table Information schema table to be updated 44 | @param[in] make_ondisk if true, convert heap table to on disk table. 45 | default value is true. 46 | @return 0 on success 47 | @return error code on failure. 48 | */ 49 | int schema_table_store_record2(THD *thd, TABLE *table, bool make_ondisk); 50 | 51 | /** 52 | Convert HEAP table to InnoDB table if necessary 53 | 54 | @param[in] thd thread handler 55 | @param[in] table Information schema table to be converted. 56 | @param[in] error the error code returned previously. 57 | @return false on success, true on error. 58 | */ 59 | bool convert_heap_table_to_ondisk(THD *thd, TABLE *table, int error); 60 | 61 | 62 | #endif /* INNODB_PRIV_INCLUDED */ 63 | --------------------------------------------------------------------------------