From c6a35d09b7e31db0acc81eccf3eec3b21e464462 Mon Sep 17 00:00:00 2001 From: Juliana Fajardini Date: Tue, 23 Mar 2021 17:59:58 +0000 Subject: [PATCH] templates: fix typos - *template*files[ch][rs]: fix typos - scripts/setup-app-layer: fix typos --- rust/src/applayertemplate/template.rs | 2 +- scripts/setup-app-layer.py | 14 +++++++------- src/app-layer-template-rust.c | 2 +- src/app-layer-template.c | 12 ++++++------ src/app-layer-template.h | 2 +- src/detect-template-buffer.c | 2 +- src/detect-template-rust-buffer.c | 2 +- src/detect-template.h | 2 +- src/detect-template2.c | 2 +- src/tests/detect-template2.c | 8 ++++---- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/rust/src/applayertemplate/template.rs b/rust/src/applayertemplate/template.rs index e331779c84..50af3526ea 100644 --- a/rust/src/applayertemplate/template.rs +++ b/rust/src/applayertemplate/template.rs @@ -335,7 +335,7 @@ pub extern "C" fn rs_template_parse_request( }; if eof { - // If needed, handled EOF, or pass it into the parser. + // If needed, handle EOF, or pass it into the parser. return AppLayerResult::ok(); } diff --git a/scripts/setup-app-layer.py b/scripts/setup-app-layer.py index d0f0b0e72b..d43d5869a1 100755 --- a/scripts/setup-app-layer.py +++ b/scripts/setup-app-layer.py @@ -344,7 +344,7 @@ def detect_patch_makefile_am(protoname, buffername): output.write(line) open(filename, "w").write(output.getvalue()) -def detect_patch_detect_enginer_register_c(protoname, buffername): +def detect_patch_detect_engine_register_c(protoname, buffername): filename = "src/detect-engine-register.c" print("Patching %s." % (filename)) output = io.StringIO() @@ -364,7 +364,7 @@ def detect_patch_detect_enginer_register_c(protoname, buffername): output.write(line) open(filename, "w").write(output.getvalue()) -def detect_patch_detect_enginer_register_h(protoname, buffername): +def detect_patch_detect_engine_register_h(protoname, buffername): filename = "src/detect-engine-register.h" print("Patching %s." % (filename)) output = io.StringIO() @@ -392,7 +392,7 @@ name specified on the command line. This is done by copying and patching src/app-layer-template.[ch] then linking the new files into the build system. -By default both the parser and logger will be generate. To generate +By default both the parser and logger will be generated. To generate just one or the other use the --parser or --logger command line flags. Examples: @@ -486,13 +486,13 @@ def main(): raise SetupError("no app-layer parser exists for %s" % (proto)) detect_copy_templates(proto, args.buffer, args.rust) detect_patch_makefile_am(proto, args.buffer) - detect_patch_detect_enginer_register_c(proto, args.buffer) - detect_patch_detect_enginer_register_h(proto, args.buffer) + detect_patch_detect_engine_register_c(proto, args.buffer) + detect_patch_detect_engine_register_h(proto, args.buffer) if parser: if args.rust: print(""" -An application detector and parser for the protocol %(proto)s has +An application detector and parser for the protocol %(proto)s have now been setup in the files: rust/src/applayer%(proto_lower)s/mod.rs @@ -502,7 +502,7 @@ now been setup in the files: }) else: print(""" -An application detector and parser for the protocol %(proto)s has +An application detector and parser for the protocol %(proto)s have now been setup in the files: src/app-layer-%(proto_lower)s.h diff --git a/src/app-layer-template-rust.c b/src/app-layer-template-rust.c index fd2e689eef..3ba9349f30 100644 --- a/src/app-layer-template-rust.c +++ b/src/app-layer-template-rust.c @@ -27,7 +27,7 @@ * \author FirstName LastName * * TemplateRust application layer detector and parser for learning and - * templaterust pruposes. + * templaterust purposes. * * This templaterust implements a simple application layer for something * like the echo protocol running on port 7. diff --git a/src/app-layer-template.c b/src/app-layer-template.c index 5604654d33..234d7affbd 100644 --- a/src/app-layer-template.c +++ b/src/app-layer-template.c @@ -27,7 +27,7 @@ * \author FirstName LastName * * Template application layer detector and parser for learning and - * template pruposes. + * template purposes. * * This template implements a simple application layer for something * like the echo protocol running on port 7. @@ -280,7 +280,7 @@ static AppLayerResult TemplateParseRequest(Flow *f, void *statev, * * But note that if a "protocol data unit" is not received in one * chunk of data, and the buffering is done on the transaction, we - * may need to look for the transaction that this newly recieved + * may need to look for the transaction that this newly received * data belongs to. */ TemplateTransaction *tx = TemplateTxAlloc(state); @@ -416,7 +416,7 @@ static void *TemplateGetTx(void *statev, uint64_t tx_id) * considered complete. * * For the response to be considered done, the response for a request - * needs to be seen. The response_done flag is set on response for + * needs to be seen. The response_done flag is set on response for * checking here. */ static int TemplateGetStateProgress(void *txv, uint8_t direction) @@ -486,7 +486,7 @@ void RegisterTemplateParsers(void) if (RunmodeIsUnittests()) { - SCLogNotice("Unittest mode, registeringd default configuration."); + SCLogNotice("Unittest mode, registering default configuration."); AppLayerProtoDetectPPRegister(IPPROTO_TCP, TEMPLATE_DEFAULT_PORT, ALPROTO_TEMPLATE, 0, TEMPLATE_MIN_FRAME_LEN, STREAM_TOSERVER, TemplateProbingParserTs, TemplateProbingParserTc); @@ -511,7 +511,7 @@ void RegisterTemplateParsers(void) } else { - SCLogNotice("Protocol detecter and parser disabled for Template."); + SCLogNotice("Protocol detector and parser disabled for Template."); return; } @@ -561,7 +561,7 @@ void RegisterTemplateParsers(void) AppLayerParserRegisterGetEventsFunc(IPPROTO_TCP, ALPROTO_TEMPLATE, TemplateGetEvents); - /* Leave this is if you parser can handle gaps, otherwise + /* Leave this is if your parser can handle gaps, otherwise * remove. */ AppLayerParserRegisterOptionFlags(IPPROTO_TCP, ALPROTO_TEMPLATE, APP_LAYER_PARSER_OPT_ACCEPT_GAPS); diff --git a/src/app-layer-template.h b/src/app-layer-template.h index bf0cb86cc4..79960e21a5 100644 --- a/src/app-layer-template.h +++ b/src/app-layer-template.h @@ -66,7 +66,7 @@ typedef struct TemplateState { TAILQ_HEAD(, TemplateTransaction) tx_list; /** A count of the number of transactions created. The - * transaction ID for each transaction is allocted + * transaction ID for each transaction is allocated * by incrementing this value. */ uint64_t transaction_max; } TemplateState; diff --git a/src/detect-template-buffer.c b/src/detect-template-buffer.c index e988255b9e..c294bb1fe6 100644 --- a/src/detect-template-buffer.c +++ b/src/detect-template-buffer.c @@ -59,7 +59,7 @@ void DetectTemplateBufferRegister(void) /* TEMPLATE_END_REMOVE */ sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].name = "template_buffer"; sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].desc = - "Template content modififier to match on the template buffers"; + "Template content modifier to match on the template buffers"; sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].Setup = DetectTemplateBufferSetup; #ifdef UNITTESTS sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].RegisterTests = diff --git a/src/detect-template-rust-buffer.c b/src/detect-template-rust-buffer.c index d8806c4fb9..4392567006 100644 --- a/src/detect-template-rust-buffer.c +++ b/src/detect-template-rust-buffer.c @@ -61,7 +61,7 @@ void DetectTemplateRustBufferRegister(void) sigmatch_table[DETECT_AL_TEMPLATE_RUST_BUFFER].name = "template_rust_buffer"; sigmatch_table[DETECT_AL_TEMPLATE_RUST_BUFFER].desc = - "Template content modififier to match on the template buffers"; + "Template content modifier to match on the template buffers"; sigmatch_table[DETECT_AL_TEMPLATE_RUST_BUFFER].Setup = DetectTemplateRustBufferSetup; #ifdef UNITTESTS diff --git a/src/detect-template.h b/src/detect-template.h index 7e4aa75834..2d72c84aab 100644 --- a/src/detect-template.h +++ b/src/detect-template.h @@ -25,7 +25,7 @@ #define __DETECT_TEMPLATE_H__ /** Per keyword data. This is set up by the DetectTemplateSetup() function. - * Each signature will have an instance of DetectTemplateData per occurence + * Each signature will have an instance of DetectTemplateData per occurrence * of the keyword. * The structure should be considered static/readonly after initialization. */ diff --git a/src/detect-template2.c b/src/detect-template2.c index ee7ca5d0ff..60c715a83b 100644 --- a/src/detect-template2.c +++ b/src/detect-template2.c @@ -281,7 +281,7 @@ error: } /** - * \brief this function is used to atemplate2d the parsed template2 data into the current signature + * \brief this function is used to add the parsed template2 data into the current signature * * \param de_ctx pointer to the Detection Engine Context * \param s pointer to the Current Signature diff --git a/src/tests/detect-template2.c b/src/tests/detect-template2.c index e40d6542a5..7cf086247b 100644 --- a/src/tests/detect-template2.c +++ b/src/tests/detect-template2.c @@ -80,7 +80,7 @@ static int DetectTemplate2ParseTest03 (void) /** * \test DetectTemplate2ParseTest04 is a test for setting up an valid template2 value with - * ">" operator and include spaces arround the given values. + * ">" operator and include spaces around the given values. */ static int DetectTemplate2ParseTest04 (void) @@ -98,7 +98,7 @@ static int DetectTemplate2ParseTest04 (void) /** * \test DetectTemplate2ParseTest05 is a test for setting up an valid template2 values with - * "-" operator and include spaces arround the given values. + * "-" operator and include spaces around the given values. */ static int DetectTemplate2ParseTest05 (void) @@ -117,7 +117,7 @@ static int DetectTemplate2ParseTest05 (void) /** * \test DetectTemplate2ParseTest06 is a test for setting up an valid template2 values with - * invalid "=" operator and include spaces arround the given values. + * invalid "=" operator and include spaces around the given values. */ static int DetectTemplate2ParseTest06 (void) @@ -129,7 +129,7 @@ static int DetectTemplate2ParseTest06 (void) /** * \test DetectTemplate2ParseTest07 is a test for setting up an valid template2 values with - * invalid "<>" operator and include spaces arround the given values. + * invalid "<>" operator and include spaces around the given values. */ static int DetectTemplate2ParseTest07 (void)