From fb5c14b28eb2bd9198fac1efe9e01cbeb164799a Mon Sep 17 00:00:00 2001 From: Maximilien LEDOUX Date: Tue, 15 Feb 2022 12:30:11 +0100 Subject: [PATCH 1/4] Standardized definitions --- .idea/.gitignore | 8 ++++++++ .idea/compiler.xml | 6 ++++++ .idea/jarRepositories.xml | 20 ++++++++++++++++++++ .idea/misc.xml | 10 ++++++++++ .idea/vcs.xml | 6 ++++++ app/src/main/resources/rules.txt | 21 +++++++++++++++++++++ 6 files changed, 71 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/compiler.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml create mode 100644 app/src/main/resources/rules.txt diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..fb7f4a8 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..fdc392f --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..5d98256 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/resources/rules.txt b/app/src/main/resources/rules.txt new file mode 100644 index 0000000..766386a --- /dev/null +++ b/app/src/main/resources/rules.txt @@ -0,0 +1,21 @@ +//Standardized definitions +digit = [0-9]; +port = [1-65536]{1,5}; TODO: Corriger +size = [0-9]{1,10}; +line = \r\n; +visiblechar = \p{Print}; +passchar = [^\s!]; +binary = .; +password = [^\s!]{5,50}; +bl = \s; +letter = [A-Za-z]; +digit_letter = [A-Za-z0-9]; +filename = [^\s!]{1,20}; +domain = [A-Za-z0-9.]{5,20}; +hash_filename = [A-Za-z0-9.]{50,200}; +hash_filecontent = [A-Za-z0-9.]{50,200}; +file_info = [A-Za-z0-9.]{50,200}\s[0-9]{1,10}\s[A-Za-z0-9.]{50,200}; +login = [A-Za-z0-9]{2,20}; + +//StorBackEnd to FileFrontEnd +sbe_hello = \ No newline at end of file From 90d36d38f9b1e2a6bc1e374ec02ec3dbc6cd572d Mon Sep 17 00:00:00 2001 From: Maximilien LEDOUX Date: Sun, 20 Feb 2022 10:22:39 +0100 Subject: [PATCH 2/4] =?UTF-8?q?Regex=20Port=20:=20Corrig=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/resources/rules.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/resources/rules.txt b/app/src/main/resources/rules.txt index 766386a..6af8e16 100644 --- a/app/src/main/resources/rules.txt +++ b/app/src/main/resources/rules.txt @@ -1,6 +1,6 @@ //Standardized definitions digit = [0-9]; -port = [1-65536]{1,5}; TODO: Corriger +port = ((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4})); size = [0-9]{1,10}; line = \r\n; visiblechar = \p{Print}; From 2aa2bb97cbb2780f3b4be5232925c1428bd76181 Mon Sep 17 00:00:00 2001 From: Maximilien LEDOUX Date: Sun, 20 Feb 2022 10:59:11 +0100 Subject: [PATCH 3/4] Regex : StorBackEnd to FileFrontEnd --- app/src/main/resources/rules.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/resources/rules.txt b/app/src/main/resources/rules.txt index 6af8e16..6a67a77 100644 --- a/app/src/main/resources/rules.txt +++ b/app/src/main/resources/rules.txt @@ -1,6 +1,6 @@ //Standardized definitions digit = [0-9]; -port = ((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4})); +port = (6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4}); size = [0-9]{1,10}; line = \r\n; visiblechar = \p{Print}; @@ -18,4 +18,4 @@ file_info = [A-Za-z0-9.]{50,200}\s[0-9]{1,10}\s[A-Za-z0-9.]{50,200}; login = [A-Za-z0-9]{2,20}; //StorBackEnd to FileFrontEnd -sbe_hello = \ No newline at end of file +sbe_hello = ^(HELLO)\s([A-Za-z0-9.]{5,20})\s((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([0-5][0-9]{4})|([0-9]{1,4}))$; //\r\n -> à tester \ No newline at end of file From a72317a9fcaec7127da460e7e61d52c36ae3c5dc Mon Sep 17 00:00:00 2001 From: Maximilien LEDOUX Date: Sun, 20 Feb 2022 11:15:36 +0100 Subject: [PATCH 4/4] Regex : FileFrontEnd to StorBackEnd --- app/src/main/resources/rules.txt | 44 +++++++++++++++++++------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/app/src/main/resources/rules.txt b/app/src/main/resources/rules.txt index 6a67a77..2cfa297 100644 --- a/app/src/main/resources/rules.txt +++ b/app/src/main/resources/rules.txt @@ -1,21 +1,29 @@ //Standardized definitions -digit = [0-9]; -port = (6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4}); -size = [0-9]{1,10}; -line = \r\n; -visiblechar = \p{Print}; -passchar = [^\s!]; -binary = .; -password = [^\s!]{5,50}; -bl = \s; -letter = [A-Za-z]; -digit_letter = [A-Za-z0-9]; -filename = [^\s!]{1,20}; -domain = [A-Za-z0-9.]{5,20}; -hash_filename = [A-Za-z0-9.]{50,200}; -hash_filecontent = [A-Za-z0-9.]{50,200}; -file_info = [A-Za-z0-9.]{50,200}\s[0-9]{1,10}\s[A-Za-z0-9.]{50,200}; -login = [A-Za-z0-9]{2,20}; +digit = [0-9] +port = (6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4}) +size = [0-9]{1,10} +line = \r\n +visiblechar = \p{Print} +passchar = [^\s!] +binary = . +password = [^\s!]{5,50} +bl = \s +letter = [A-Za-z] +digit_letter = [A-Za-z0-9] +filename = [^\s!]{1,20} +domain = [A-Za-z0-9.]{5,20} +hash_filename = [A-Za-z0-9.]{50,200} +hash_filecontent = [A-Za-z0-9.]{50,200} +file_info = [A-Za-z0-9.]{50,200}\s[0-9]{1,10}\s[A-Za-z0-9.]{50,200} +login = [A-Za-z0-9]{2,20} //StorBackEnd to FileFrontEnd -sbe_hello = ^(HELLO)\s([A-Za-z0-9.]{5,20})\s((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([0-5][0-9]{4})|([0-9]{1,4}))$; //\r\n -> à tester \ No newline at end of file +sbe_hello = ^(HELLO)\s([A-Za-z0-9.]{5,20})\s((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([0-5][0-9]{4})|([0-9]{1,4}))\r\n$ //TODO \r\n -> à tester pour voir si déjà dans le flux ou doit être construit + +//FileFrontEnd to StorBackEnd +ffe_sendfile = ^(SENDFILE)\s([A-Za-z0-9.]{50,200}\s[0-9]{1,10}\s[A-Za-z0-9.]{50,200})\r\n(.*)$ +sbe_sendresult = ^(SEND_OK|SEND_ERROR)\r\n$ +ffe_erasefile = ^(ERASEFILE)\s([A-Za-z0-9.]{50,200})\r\n$ +sbe_eraseresult = ^(ERASE_OK|ERASE_ERROR)\r\n$ +ffe_retrievefile = ^(RETRIEVEFILE)\s([A-Za-z0-9.]{50,200})\r\n$ +sbe_retrieveresult = ^(RETRIEVE_OK)\s([A-Za-z0-9.]{50,200}\s[0-9]{1,10}\s[A-Za-z0-9.]{50,200})\r\n(.*)|(RETRIEVE_ERROR)$ \ No newline at end of file