From: Russ Combs (rucombs) Date: Mon, 1 May 2017 20:18:10 +0000 (-0400) Subject: Merge pull request #877 in SNORT/snort3 from spell to master X-Git-Tag: 3.0.0-233~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e1b25ca3ff768c01e6776e7403bf8bb93d4f7adb;p=thirdparty%2Fsnort3.git Merge pull request #877 in SNORT/snort3 from spell to master Squashed commit of the following: commit c07087e3943f18b3d2ac32b7267e91fa23b73f00 Author: Russ Combs Date: Mon May 1 11:50:42 2017 -0400 spell check user manual text files commit d0a970845da721f3cf35219186f5e4d706796887 Author: Russ Combs Date: Mon May 1 08:47:48 2017 -0400 go with endianness commit 269c1c0b93b84b18a46c92da3a277ba3f47251bc Author: Russ Combs Date: Sat Apr 29 12:44:49 2017 -0400 fix typos in comments commit ff18dc38fded36310c99ebbdad8a1be0e195f112 Author: Russ Combs Date: Sat Apr 29 10:36:04 2017 -0400 fix typos in strings commit 5f8d717c58f3e1c89e031f0d42b6023246272fd2 Author: Russ Combs Date: Sat Apr 29 10:35:35 2017 -0400 disable spell check on hex foo --- diff --git a/doc/connectors.txt b/doc/connectors.txt index 6be0306e4..020bbab2f 100644 --- a/doc/connectors.txt +++ b/doc/connectors.txt @@ -14,7 +14,7 @@ The TcpConnector is duplex while the FileConnector is simplex. All subtypes of Connector have a 'direction' configuration element and a 'connector' element. The 'connector' string is the key used to identify the -element for sidechannel configiration. The 'direction' element may have a +element for sidechannel configuration. The 'direction' element may have a default value, for instance TcpConnector's are 'duplex'. @@ -62,7 +62,7 @@ CONN_TRANSMIT or CONN_RECEIVE. FileConnector configuration adds two additional element: -* name = string - used as part of the messsage file name +* name = string - used as part of the message file name * format = 'text' or 'binary' - FileConnector supports two file types diff --git a/doc/dcerpc.txt b/doc/dcerpc.txt index adbe17861..d9d6bc269 100644 --- a/doc/dcerpc.txt +++ b/doc/dcerpc.txt @@ -170,12 +170,12 @@ effectively disabling SMB file inspection in rules. An argument of 0 to ==== TCP -dce_tcp inspector supports defragementation, reassembling, and policy that is +dce_tcp inspector supports defragmentation, reassembling, and policy that is similar to SMB. ==== UDP -dce_udp is a very simple inspector that only supports defragementation +dce_udp is a very simple inspector that only supports defragmentation ==== Rule Options diff --git a/doc/file_processing.txt b/doc/file_processing.txt index 6b15c0d2b..fc8b76088 100644 --- a/doc/file_processing.txt +++ b/doc/file_processing.txt @@ -74,7 +74,7 @@ Example: magic = { { content = "| 47 49 46 38 39 61 |",offset = 0 } } }, The previous two rules define GIF format, because two file magics are -different. File magics are specifed by content and offset, which look +different. File magics are specified by content and offset, which look at content at particular file offset to identify the file type. In this case, two magics look at the beginning of the file. You can use character if it is printable or hex value in between "|". diff --git a/doc/high_availability.txt b/doc/high_availability.txt index e57d842c8..8f1ee2d25 100644 --- a/doc/high_availability.txt +++ b/doc/high_availability.txt @@ -1,4 +1,4 @@ -HighAvailability (or HA) is a Snort module that provides state coherancy +HighAvailability (or HA) is a Snort module that provides state coherency between two partner snort instances. It uses SideChannel for messaging. There can be multiple types of HA within Snort and Snort plugins. HA diff --git a/doc/http_inspect.txt b/doc/http_inspect.txt index e169051e4..275470064 100644 --- a/doc/http_inspect.txt +++ b/doc/http_inspect.txt @@ -228,7 +228,7 @@ is on by default and you should not turn it off unless you have no interest in URI paths. backslash_to_slash is a tweak to path simplification for servers that allow -directories to be separated by backslashs: +directories to be separated by backslashes: /this/is/the/normal/way/to/write/a/path @@ -377,7 +377,7 @@ If you don't specify a header you get all of the headers except for the cookie headers Cookie and Set-Cookie. http_raw_header includes the unmodified header names and values as they appeared in the original message. http_header is the same except percent encodings are removed and -pathes are simplified exactly as if the headers were a URI. +paths are simplified exactly as if the headers were a URI. In most cases specifying individual headers creates a more efficient and accurate rule. It is recommended that new rules be written using individual @@ -436,7 +436,7 @@ message. This is usually "HTTP/1.0" or "HTTP/1.1". These are the unmodified first header line of the HTTP request and response messages respectively. These rule options are a safety valve in case you need to do something you cannot otherwise do. In most cases it is better to -use a rule option for a specifc part of the first header line. For a +use a rule option for a specific part of the first header line. For a request message those are http_method, http_raw_uri, and http_version. For a response message those are http_version, http_stat_code, and http_stat_msg. diff --git a/doc/perf_monitor.txt b/doc/perf_monitor.txt index be65f9c1a..98c9bb4c6 100644 --- a/doc/perf_monitor.txt +++ b/doc/perf_monitor.txt @@ -100,6 +100,6 @@ format is also available if Flatbuffers is present at build. A utility for accessing the statistics generated in this format has been included for convenience (see fbstreamer in tools). This tool generates a YAML array of records found, allowing the data to be read by humans or passed into other -analysis tools. For information on working direclty with the Flatbuffers file +analysis tools. For information on working directly with the Flatbuffers file format used by Performance monitor, see the developer notes for Performance monitor or the code provided for fbstreamer. diff --git a/doc/side_channel.txt b/doc/side_channel.txt index 3a3d3320b..74b9f8249 100644 --- a/doc/side_channel.txt +++ b/doc/side_channel.txt @@ -24,9 +24,9 @@ applications. The SideChannel configuration mostly serves to map a port number to a Connector or set of connectors. Each port mapping can have at most one transmit plus one receive connector or one duplex connector. Multiple SideChannel's -may be configured and instatiated to support multiple applications. +may be configured and instantiated to support multiple applications. -An example SideChannel configuration along with the corresponing Connector +An example SideChannel configuration along with the corresponding Connector configuration: side_channel = diff --git a/doc/snort2lua.txt b/doc/snort2lua.txt index 790a2df9c..25046c27d 100644 --- a/doc/snort2lua.txt +++ b/doc/snort2lua.txt @@ -69,9 +69,9 @@ that variable in the Lua string. * Snort2Lua currently does not handle variables well. First, that means variables will not always be parsed correctly. Second, sometimes a -variables value will be outoput in the lua file rather than a variable +variables value will be output in the lua file rather than a variable For instance, if Snort2Lua attempted to convert the line -'include $RULE_PATH/example.rule', the output may ouput +'include $RULE_PATH/example.rule', the output may output 'include /etc/rules/example.rule' instead. * When Snort2Lua parses a ‘binding’ configuration file, the rules and @@ -81,7 +81,7 @@ extension. There is currently no way to specify or change that files name. * If a rule's action is a custom ruletype, that rule action will be silently converted to the rultype's 'type'. No warnings or errors are currently -emmitted. Additionally, the custom ruletypes outputs will be silently +emitted. Additionally, the custom ruletypes outputs will be silently discarded. * If the original configuration contains a binding that points to another diff --git a/doc/style.txt b/doc/style.txt index 1b087f590..f95957584 100644 --- a/doc/style.txt +++ b/doc/style.txt @@ -163,7 +163,7 @@ yet firm so feedback is welcome to get something we can live with. multiple error returns. The C-style use of zero for success and -1 for error is less readable and often leads to messy code that either ignores the various errors anyway or needlessly and ineffectively tries to do - something aobut them. Generally that code is not updated if new errors + something about them. Generally that code is not updated if new errors are added. === Macros (aka defines) diff --git a/extra/src/codecs/cd_token_ring/cd_token_ring.cc b/extra/src/codecs/cd_token_ring/cd_token_ring.cc index 165f98d3b..8451fc168 100644 --- a/extra/src/codecs/cd_token_ring/cd_token_ring.cc +++ b/extra/src/codecs/cd_token_ring/cd_token_ring.cc @@ -130,7 +130,7 @@ bool TrCodec::decode(const RawData& raw, CodecData& codec, DecodeData&) /* * DSAP != SSAP != 0xAA .. either we are having frame which doesn't * carry IP datagrams or has RIF information present. We assume - * lattest ... + * the latter ... */ if (cap_len < (sizeof(token_ring::Trh_hdr) + sizeof(token_ring::Trh_llc) + diff --git a/extra/src/loggers/alert_unixsock/alert_unixsock.cc b/extra/src/loggers/alert_unixsock/alert_unixsock.cc index e397c88b1..0c5855541 100644 --- a/extra/src/loggers/alert_unixsock/alert_unixsock.cc +++ b/extra/src/loggers/alert_unixsock/alert_unixsock.cc @@ -52,8 +52,7 @@ struct Alertpkt uint32_t nethdr; /* network header offset. (ip etc...) */ uint32_t transhdr; /* transport header offset (tcp/udp/icmp ..) */ uint32_t data; - uint32_t val; /* which fields are valid. (NULL could be - * valids also) */ + uint32_t val; /* which fields are valid. (NULL could be valid also) */ /* Packet struct --> was null */ #define NOPACKET_STRUCT 0x1 /* no transport headers in packet */ diff --git a/extra/src/search_engines/lowmem/sfksearch.cc b/extra/src/search_engines/lowmem/sfksearch.cc index eadbfa950..8945bf104 100644 --- a/extra/src/search_engines/lowmem/sfksearch.cc +++ b/extra/src/search_engines/lowmem/sfksearch.cc @@ -26,7 +26,7 @@ * - use for token testing after parsing the language tokens using lex or the like. * * Keyword-Search: searches the input text for one of multiple keywords, -* and supports case sensitivite and case insensitive patterns. +* and supports case sensitive and case insensitive patterns. */ #include "sfksearch.h" @@ -334,7 +334,7 @@ static int KTrieInsert(KTRIE_STRUCT* ts, KTRIEPATTERN* px) else { /* - * Start a new sibling bracnch to finish this Keyword + * Start a new sibling branch to finish this Keyword */ root->sibling= KTrieCreateNode(ts); if ( !root->sibling ) @@ -396,7 +396,7 @@ static void Build_Bad_Character_Shifts(KTRIE_STRUCT* kt) } /* - * Initialze the Bad Character shift table. + * Initialize the Bad Character shift table. */ for ( int i = 0; i < KTRIE_ROOT_NODES; i++ ) { diff --git a/src/codecs/codec_api.cc b/src/codecs/codec_api.cc index bd0b06a09..6bde3f5fd 100644 --- a/src/codecs/codec_api.cc +++ b/src/codecs/codec_api.cc @@ -28,9 +28,9 @@ extern const BaseApi* cd_ipv4[]; // static due to dependence on fpdetect extern const BaseApi* cd_hopopts[]; // static to ensure the symbols CheckIPV6HopOptions - // and CheckIPv6ExtensionOrder the final executuable. + // and CheckIPv6ExtensionOrder the final executable. extern const BaseApi* cd_tcp[]; // static because only file that specific functions - // (symbols will be removed from final executabel) + // (symbols will be removed from final executable) #ifdef STATIC_CODECS extern const BaseApi* cd_ah[]; diff --git a/src/codecs/ip/cd_auth.cc b/src/codecs/ip/cd_auth.cc index 19d0bf91f..b6b4bba15 100644 --- a/src/codecs/ip/cd_auth.cc +++ b/src/codecs/ip/cd_auth.cc @@ -72,7 +72,7 @@ struct AuthHdr }; constexpr uint8_t MIN_AUTH_LEN = 16; // this is in minimum number of bytes ... -// no relatino to the AuthHdr.len field. +// no relation to the AuthHdr.len field. } // anonymous namespace void AuthCodec::get_protocol_ids(std::vector& v) diff --git a/src/codecs/ip/cd_frag.cc b/src/codecs/ip/cd_frag.cc index ef37e5944..b8cb4ee5d 100644 --- a/src/codecs/ip/cd_frag.cc +++ b/src/codecs/ip/cd_frag.cc @@ -81,7 +81,7 @@ bool Ipv6FragCodec::decode(const RawData& raw, CodecData& codec, DecodeData& sno data.decode_flags |= DECODE_RF; #endif - // three least signifigant bits are all flags + // three least significant bits are all flags const uint16_t frag_offset = ip6frag_hdr->off(); if (frag_offset || (snort.decode_flags & DECODE_MF)) diff --git a/src/codecs/ip/cd_icmp4.cc b/src/codecs/ip/cd_icmp4.cc index aa656604e..4c3357ac5 100644 --- a/src/codecs/ip/cd_icmp4.cc +++ b/src/codecs/ip/cd_icmp4.cc @@ -450,7 +450,7 @@ void Icmp4Codec::log(TextLog* const log, const uint8_t* raw_pkt, break; case icmp::IcmpType::ROUTER_ADVERTISE: - TextLog_Print(log, "ROUTER ADVERTISMENT: " + TextLog_Print(log, "ROUTER ADVERTISEMENT: " "Num addrs: %d Addr entry size: %d Lifetime: %u", icmph->s_icmp_num_addrs, icmph->s_icmp_wpa, ntohs(icmph->s_icmp_lifetime)); diff --git a/src/codecs/ip/cd_ipv4.cc b/src/codecs/ip/cd_ipv4.cc index 2fea855f2..4e7a9e7a4 100644 --- a/src/codecs/ip/cd_ipv4.cc +++ b/src/codecs/ip/cd_ipv4.cc @@ -485,7 +485,7 @@ default_case: if ((tot_len + 1) >= o_len) code = tcp::OPT_TRUNC; - /* RFC sez that we MUST have atleast this much data */ + /* RFC says that we MUST have at least this much data */ else if (option->len < 2) code = tcp::OPT_BADLEN; diff --git a/src/codecs/ip/cd_ipv6.cc b/src/codecs/ip/cd_ipv6.cc index 2aced27b8..d1236bc10 100644 --- a/src/codecs/ip/cd_ipv6.cc +++ b/src/codecs/ip/cd_ipv6.cc @@ -444,7 +444,7 @@ void Ipv6Codec::CheckIPV6Multicast(const ip::IP6Hdr* const ip6h, const CodecData else if ((ntohl(ip6h->ip6_dst.u6_addr32[3]) >= 0x80000000) && (ntohl(ip6h->ip6_dst.u6_addr32[3]) <= 0xFFFFFFFF)) { - return; // Dynamiclly allocated by hosts when needed + return; // Dynamically allocated by hosts when needed } else { diff --git a/src/codecs/ip/cd_tcp.cc b/src/codecs/ip/cd_tcp.cc index e6d7b44a4..ec77ea474 100644 --- a/src/codecs/ip/cd_tcp.cc +++ b/src/codecs/ip/cd_tcp.cc @@ -503,7 +503,7 @@ int TcpCodec::OptLenValidate(const tcp::TcpOption* const opt, } else /* expected_len < 0 (i.e. variable length) */ { - /* RFC sez that we MUST have atleast this much data */ + /* RFC says that we MUST have at least this much data */ if (opt->len < 2) return tcp::OPT_BADLEN; diff --git a/src/codecs/ip/cd_udp.cc b/src/codecs/ip/cd_udp.cc index 70a3a402f..870f85c4a 100644 --- a/src/codecs/ip/cd_udp.cc +++ b/src/codecs/ip/cd_udp.cc @@ -341,7 +341,7 @@ void UdpCodec::log(TextLog* const text_log, const uint8_t* raw_pkt, bool UdpCodec::encode(const uint8_t* const raw_in, const uint16_t /*raw_len*/, EncState& enc, Buffer& buf, Flow*) { - // If we enter this function, this packe is some sort of tunnel. + // If we enter this function, this packet is some sort of tunnel. if (!buf.allocate(udp::UDP_HEADER_LEN)) return false; diff --git a/src/codecs/ip/checksum.h b/src/codecs/ip/checksum.h index 7fcff77be..8e4afbd61 100644 --- a/src/codecs/ip/checksum.h +++ b/src/codecs/ip/checksum.h @@ -59,13 +59,13 @@ inline uint16_t ip_cksum(const uint16_t* buf, std::size_t len); * is to either include all of the checksum details in a header, * or ensure I include these symbols for every linker which * can be used. Obviously, setting correct linker flags is - * signifigantly more difficult, so these functions will all + * significantly more difficult, so these functions will all * stay in a header file */ /* * IT IS HIGHLY RECOMMENDED to use the above API. Rathern than calling - * any of of the following recomendations directly + * any of of the following recommendations directly */ namespace detail { diff --git a/src/codecs/link/cd_ciscometadata.cc b/src/codecs/link/cd_ciscometadata.cc index a5029ce72..6d7816904 100644 --- a/src/codecs/link/cd_ciscometadata.cc +++ b/src/codecs/link/cd_ciscometadata.cc @@ -98,7 +98,7 @@ bool CiscoMetaDataCodec::decode(const RawData& raw, CodecData& codec, DecodeData const CiscoMetaDataOpt* cmd_options = reinterpret_cast(raw.data + sizeof(CiscoMetaDataHdr)); // validate options, lengths, and SGTs - cmdh_rem_len -= sizeof(CiscoMetaDataHdr) + sizeof(uint16_t); //2 octects for ethertype + cmdh_rem_len -= sizeof(CiscoMetaDataHdr) + sizeof(uint16_t); //2 octets for ethertype if(cmdh_rem_len == 0) cmd_options = nullptr; diff --git a/src/codecs/link/cd_pppoe.cc b/src/codecs/link/cd_pppoe.cc index 6249b4373..ffd1f4af8 100644 --- a/src/codecs/link/cd_pppoe.cc +++ b/src/codecs/link/cd_pppoe.cc @@ -320,7 +320,7 @@ public: // *** NOTE: THE CODEC AND MODULE HAVE A DIFFERENT NAME! // since the module is only creating a rule stub and is NOT -// used for configurtion, it doesn't matter. However, if you want to use the module +// used for configuration, it doesn't matter. However, if you want to use the module // for configuration, ensure the names are identical before continuing! static Module* mod_ctor() { return new PPPoEModule; } diff --git a/src/codecs/misc/cd_default.cc b/src/codecs/misc/cd_default.cc index 36c641be7..eeaa67b39 100644 --- a/src/codecs/misc/cd_default.cc +++ b/src/codecs/misc/cd_default.cc @@ -24,7 +24,7 @@ #include "framework/codec.h" #define CD_DEFAULT_NAME "unknown" -#define CD_DEFAULT_HELP "support for unkown protocols" +#define CD_DEFAULT_HELP "support for unknown protocols" namespace { diff --git a/src/codecs/misc/cd_gtp.cc b/src/codecs/misc/cd_gtp.cc index 036b6ba5b..756609ce3 100644 --- a/src/codecs/misc/cd_gtp.cc +++ b/src/codecs/misc/cd_gtp.cc @@ -28,7 +28,7 @@ #include "packet_io/active.h" #define CD_GTP_NAME "gtp" -#define CD_GTP_HELP "support for general-packet-radio-service tunnelling protocol" +#define CD_GTP_HELP "support for general-packet-radio-service tunneling protocol" namespace { diff --git a/src/codecs/misc/cd_icmp4_ip.cc b/src/codecs/misc/cd_icmp4_ip.cc index 71b895359..f28253b71 100644 --- a/src/codecs/misc/cd_icmp4_ip.cc +++ b/src/codecs/misc/cd_icmp4_ip.cc @@ -146,7 +146,7 @@ void Icmp4IpCodec::log(TextLog* const text_log, const uint8_t* raw_pkt, TextLog_NewLine(text_log); TextLog_Puts(text_log, "\tIPv4\n\t\t"); - // COPIED DIRECTLY FROM ipv4 CODEC. This is specificially replicated since + // COPIED DIRECTLY FROM ipv4 CODEC. This is specifically replicated since // the two are not necessarily the same. // FIXIT-H this does NOT obfuscate correctly diff --git a/src/connectors/tcp_connector/tcp_connector.cc b/src/connectors/tcp_connector/tcp_connector.cc index 6121fca96..5852ba509 100644 --- a/src/connectors/tcp_connector/tcp_connector.cc +++ b/src/connectors/tcp_connector/tcp_connector.cc @@ -253,7 +253,7 @@ bool TcpConnector::transmit_message(ConnectorMsgHandle* msg) if ( sock_fd < 0 ) { - ErrorMessage("TcpConnector: tranmitting to a closed socket\n"); + ErrorMessage("TcpConnector: transmitting to a closed socket\n"); delete tmsg; return false; } diff --git a/src/decompress/file_decomp.cc b/src/decompress/file_decomp.cc index 95644beee..61fa34dc7 100644 --- a/src/decompress/file_decomp.cc +++ b/src/decompress/file_decomp.cc @@ -117,7 +117,7 @@ static fd_status_t Locate_Sig_Here(fd_session_p_t SessionPtr) at least MAX_SIG_LENGTH bytes in the output buffer. This assumption is valid for the current implementation where the signature only occurs at the beginning of the file. For the generic case of the sig - begin embedded with the file, the seach will need to modified.*/ + begin embedded with the file, the search will need to modified.*/ while ( 1 ) { /* if we get to the end of the sig table (or the table is empty), diff --git a/src/decompress/file_decomp.h b/src/decompress/file_decomp.h index 8fb559dec..c8fda0145 100644 --- a/src/decompress/file_decomp.h +++ b/src/decompress/file_decomp.h @@ -56,7 +56,7 @@ enum file_compression_type_t FILE_COMPRESSION_TYPE_MAX }; -/* Potential decompression modes, passed in at initalization time. */ +/* Potential decompression modes, passed in at initialization time. */ #define FILE_SWF_LZMA_BIT (0x00000001) #define FILE_SWF_ZLIB_BIT (0x00000002) #define FILE_PDF_DEFL_BIT (0x00000004) @@ -189,7 +189,7 @@ inline bool Get_1(fd_session_p_t SessionPtr, uint8_t* c) } /* If available, get N bytes from the input queue. All N must be - availble for this call to succeed. */ + available for this call to succeed. */ inline bool Get_N(fd_session_p_t SessionPtr, uint8_t** c, uint16_t N) { if ( (SessionPtr->Next_In != NULL) && (SessionPtr->Avail_In >= N) ) diff --git a/src/decompress/file_decomp_pdf.cc b/src/decompress/file_decomp_pdf.cc index ef03e9198..152529ac8 100644 --- a/src/decompress/file_decomp_pdf.cc +++ b/src/decompress/file_decomp_pdf.cc @@ -178,7 +178,7 @@ static inline void Process_One_Filter(fd_session_p_t SessionPtr, uint8_t* Token, } /* Parse the buffered Filter_Spec and create a stream decompression - mode and/or event alerts. Return File_Decomp_OK if successfui. + mode and/or event alerts. Return File_Decomp_OK if successful. Return File_Decomp_Error for a parsing error. */ static fd_status_t Process_Filter_Spec(fd_session_p_t SessionPtr) { @@ -279,7 +279,7 @@ static inline void Init_Parser(fd_session_p_t SessionPtr) fd_PDF_Parse_p_t p = &(SessionPtr->PDF->Parse); /* The parser starts in the P_COMMENT state we start parsing the file just after the signature is located - and the signature is syntactially a comment. */ + and the signature is syntactically a comment. */ p->State = P_COMMENT; p->Parse_Stack_Index = 0; // Stack is empty } @@ -729,7 +729,7 @@ static inline fd_status_t Handle_State_XREF(fd_session_p_t SessionPtr, uint8_t c if ( p->State != P_XREF ) { p->Sub_State = P_XREF_TOKEN; - p->Elem_Index = 1; // Aready matched the first char in START state + p->Elem_Index = 1; // already matched the first char in START state p->State = P_XREF; Xref_Tok = (uint8_t*)((c == TOK_XRF_XREF[0]) ? TOK_XRF_XREF : TOK_XRF_STARTXREF); return( File_Decomp_OK ); @@ -978,7 +978,7 @@ static fd_status_t Decomp_Stream(fd_session_p_t SessionPtr) return( File_Decomp_OK ); } -/* After processing a stream, close the decompession engine +/* After processing a stream, close the decompression engine and return the state of the parser. */ static fd_status_t Close_Stream(fd_session_p_t SessionPtr) { diff --git a/src/detection/detect.cc b/src/detection/detect.cc index 6a103f51d..60f3e5c87 100644 --- a/src/detection/detect.cc +++ b/src/detection/detect.cc @@ -261,7 +261,7 @@ bool snort_detect(Packet* p) } // FIXIT-M restrict detect to current ip layer - // Curently, if a rule is found on any IP layer, we perform the detect routine + // Currently, if a rule is found on any IP layer, we perform the detect routine // on the entire packet. Instead, we should only perform detect on that layer!! switch ( p->type() ) { diff --git a/src/detection/fp_create.cc b/src/detection/fp_create.cc index d623489cb..cae065c25 100644 --- a/src/detection/fp_create.cc +++ b/src/detection/fp_create.cc @@ -512,7 +512,7 @@ static int fpAddPortGroupRule( * * PORT_RULE_MAP -> srcPortGroup,dstPortGroup,genericPortGroup * PortGroup -> pgPatData, pgPatDataUri (acsm objects), (also rule_node lists 1/rule, - * not neeed). each rule content added to an acsm object has a PMX data ptr + * not needed). each rule content added to an acsm object has a PMX data ptr * associated with it. * RULE_NODE -> iRuleNodeID (used for bitmap object index) * PMX -> RULE_NODE(->otn), PatternMatchData @@ -531,7 +531,7 @@ static int fpAddPortGroupRule( * Implementation: * * Each PortList Object will be translated into a PortGroup, then pointed to by the - * PortGroup array in the PORT_RULE_MAP for the procotocol + * PortGroup array in the PORT_RULE_MAP for the protocol * * protocol = tcp, udp, ip, icmp - one port_rule_map for each of these protocols * { create a port_rule_map @@ -561,7 +561,7 @@ static int fpAddPortGroupRule( /* ** Build a Pattern group for the Uri-Content rules in this group ** -** The patterns added for each rule must be suffcient so if we find any of them +** The patterns added for each rule must be sufficient so if we find any of them ** we proceed to fully analyze the OTN and RTN against the packet. ** */ @@ -727,7 +727,7 @@ static int fpGetFinalPattern( // pattern matcher as is since the content won't be evaluated as a rule // option. // - // 2. negated contents since truncating them could inadvertantly + // 2. negated contents since truncating them could inadvertently // disable evaluation of a rule - the shorter pattern may be found, // while the unaltered pattern may not be found, disabling inspection // of a rule we should inspect. @@ -767,7 +767,7 @@ static int fpGetFinalPattern( if (bytes < (int)pmd->pattern_size) { - /* The patten is all '\0' - use the whole pattern + /* The pattern is all '\0' - use the whole pattern * XXX This potentially hurts the performance boost * gained by stripping leading zeros */ if (bytes == 0) @@ -817,7 +817,7 @@ static void fpDeletePMX(void* pv) } /* - * Create the PortGroup for these PortObject2 entitiies + * Create the PortGroup for these PortObject2 entities * * This builds the 1st pass multi-pattern state machines for * content and uricontent based on the rules in the PortObjects @@ -952,7 +952,7 @@ static int fpCreatePortTablePortGroups( * Create port group objects for all port tables * * note: any ports are standard PortObjects not PortObject2s so we have to - * uprade them for the create port group function + * upgrade them for the create port group function */ static int fpCreatePortGroups(SnortConfig* sc, RulePortTables* p) { @@ -1169,7 +1169,7 @@ static void fpBuildServicePortGroupByServiceOtnList( * For each service we create a PortGroup based on the otn's defined to * be applicable to that service by the metadata option. * - * Then we lookup the protocol/srvc oridinal in the target-based area + * Then we lookup the protocol/srvc ordinal in the target-based area * and assign the PortGroup for the srvc to it. * * spg - service port group (lookup should be by service id/tag) diff --git a/src/detection/fp_detect.cc b/src/detection/fp_detect.cc index 39e27a1f3..04faad4d5 100644 --- a/src/detection/fp_detect.cc +++ b/src/detection/fp_detect.cc @@ -234,7 +234,7 @@ int fpLogEvent(const RuleTreeNode* rtn, const OptTreeNode* otn, Packet* p) ** Add and Event to the appropriate Match Queue: Alert, Pass, or Log. ** This allows us to find multiple events per packet and pick the 'best' ** one. This function also allows us to change the order of alert, -** pass, and log signatures by cacheing them for decision later. +** pass, and log signatures by caching them for decision later. ** ** IMPORTANT NOTE: ** fpAddMatch must be called even when the queue has been maxed @@ -418,7 +418,7 @@ static int rule_tree_match( if (eval_data.flowbit_failed) return -1; - /* If this is for an IP rule set, evalute the rules from + /* If this is for an IP rule set, evaluate the rules from * the inner IP offset as well */ if (eval_data.p->packet_flags & PKT_IP_RULE) { @@ -433,7 +433,7 @@ static int rule_tree_match( const uint8_t* tmp_data = eval_data.p->data; uint16_t tmp_dsize = eval_data.p->dsize; - /* clear so we dont keep recursing */ + /* clear so we don't keep recursing */ eval_data.p->packet_flags &= ~PKT_IP_RULE; eval_data.p->packet_flags |= PKT_IP_RULE_2ND; @@ -627,7 +627,7 @@ static inline int fpSessionAlerted(Packet* p, const OptTreeNode* otn) ** flag causes any drop/sdrop/reject rules to be loaded as alert rules. ** The default has been to ignore them on parsing. ** -** If this is less than clear, herese the $.02 version: +** If this is less than clear, here's the $.02 version: ** default order -> pass drop alert log ( --alert-before-pass reverts ** to -> drop alert pass log ) the 1st action-type of events in the rule ** ordering to be seen gets logged by default the --flush-all-events @@ -662,7 +662,7 @@ static inline int fpFinalSelectEvent(OTNX_MATCH_DATA* o, Packet* p) for ( i = 0; i < o->iMatchInfoArraySize; i++ ) { /* bail if were not dumping events in all the action groups, - * and we've alresady got some events */ + * and we've already got some events */ if (!SnortConfig::process_all_events() && (tcnt > 0)) return 1; @@ -671,7 +671,7 @@ static inline int fpFinalSelectEvent(OTNX_MATCH_DATA* o, Packet* p) /* * We must always sort so if we que 8 and log 3 and they are * all from the same action group we want them sorted so we get - * the highest 3 in priority, priority and lenght sort do NOT + * the highest 3 in priority, priority and length sort do NOT * take precedence over 'alert drop pass ...' ordering. If * order is 'drop alert', and we log 3 for drop alerts do not * get logged. IF order is 'alert drop', and we log 3 for @@ -951,7 +951,7 @@ static int fp_search( ** ** FORMAL OUTPUTS ** int - 0 for failed pattern match -** 1 for sucessful pattern match +** 1 for successful pattern match ** */ static inline int fpEvalHeaderSW(PortGroup* port_group, Packet* p, @@ -1158,7 +1158,7 @@ static inline bool fpEvalHeaderSvc(Packet* p, OTNX_MATCH_DATA* omd, int proto) "file:%p\n",p->ptrs.sp,p->ptrs.dp,proto_ordinal,proto,(void*)svc,(void*)file); } // FIXIT-P put alert service rules with file data fp in alert file group and - // verfiy ports and service during rule eval to avoid searching file data 2x. + // verify ports and service during rule eval to avoid searching file data 2x. int check_ports = (proto == SNORT_PROTO_USER) ? 2 : 1; if ( file ) diff --git a/src/detection/fp_utils.cc b/src/detection/fp_utils.cc index e3f0abd9e..eeb855049 100644 --- a/src/detection/fp_utils.cc +++ b/src/detection/fp_utils.cc @@ -137,7 +137,7 @@ bool is_fast_pattern_only(OptFpList* ofl) * * returns * length - of trimmed pattern - * buff - ptr to new beggining of trimmed buffer + * buff - ptr to new beginning of trimmed buffer */ int flp_trim(const char* p, int plen, const char** buff) { diff --git a/src/detection/pattern_match_data.h b/src/detection/pattern_match_data.h index 9678854ac..d57595f7e 100644 --- a/src/detection/pattern_match_data.h +++ b/src/detection/pattern_match_data.h @@ -41,7 +41,7 @@ struct PatternMatchData // FIXIT-L wasting some memory here: // - this is not used by content option logic directly // - and only used on current eval (not across packets) - // (partly mitigated by only allocating if excpetion_flag is set) + // (partly mitigated by only allocating if exception_flag is set) // /* Set if fast pattern matcher found a content in the packet, but the rule option specifies a negated content. Only diff --git a/src/detection/pcrm.cc b/src/detection/pcrm.cc index 779337fb4..81774eeeb 100644 --- a/src/detection/pcrm.cc +++ b/src/detection/pcrm.cc @@ -25,8 +25,7 @@ ** NOTES ** 5.15.02 - Initial version of pcrm.c distributed. - Norton/Roelker ** -** Packet Classificationa and Rule Manager -** +** Packet Classification and Rule Manager ** ** A Fast Packet Classification method for Rule and Pattern Matching in SNORT ** -------------------------------------------------------------------------- @@ -112,7 +111,7 @@ static int prmFindRuleGroup( /* ** The following functions are wrappers to the pcrm routines, -** that utilize the variables that we have intialized by +** that utilize the variables that we have initialized by ** calling fpCreateFastPacketDetection(). These functions ** are also used in the file fpdetect.c, where we do lookups ** on the initialized variables. diff --git a/src/detection/pcrm.h b/src/detection/pcrm.h index dd751fa2f..c2fa51cb2 100644 --- a/src/detection/pcrm.h +++ b/src/detection/pcrm.h @@ -26,7 +26,7 @@ #define PCRM_H // Packet Classification-Rule Manager -// runle groups by source and dest ports as well as any +// rule groups by source and dest ports as well as any // (generic refers to any) #include "ports/port_group.h" diff --git a/src/detection/service_map.h b/src/detection/service_map.h index bde842ca7..0eebd44b6 100644 --- a/src/detection/service_map.h +++ b/src/detection/service_map.h @@ -52,7 +52,7 @@ void ServicePortGroupMapFree(srmm_table_t*); void fpPrintServicePortGroupSummary(SnortConfig*, srmm_table_t*); int fpCreateServiceMaps(SnortConfig*); -// Service/Protocol Oridinal To PortGroup table +// Service/Protocol Ordinal To PortGroup table typedef std::vector PortGroupVector; struct sopg_table_t diff --git a/src/detection/tag.cc b/src/detection/tag.cc index 7e1b8f8c7..6f1e33e11 100644 --- a/src/detection/tag.cc +++ b/src/detection/tag.cc @@ -154,7 +154,7 @@ static inline unsigned int memory_per_node( /** Allocate a TagNode * - * Alocates a TagNode while guaranteeing that total memory usage remains within TAG_MEMCAP. + * Allocates a TagNode while guaranteeing that total memory usage remains within TAG_MEMCAP. * Least used nodes may be deleted from ssn_tag_cache and host_tag_cache to make space if * the limit is being exceeded. * diff --git a/src/events/event_queue.cc b/src/events/event_queue.cc index ce4a308cb..4b64c5d57 100644 --- a/src/events/event_queue.cc +++ b/src/events/event_queue.cc @@ -31,7 +31,7 @@ ** 11/1/05 Updates to add support for rules for all events in ** decoders and preprocessors and the detection engine. ** Added support for rule by rule flushing control via -** metadata. Also added code to check fo an otn for every +** metadata. Also added code to check for an otn for every ** event (gid,sid pair). This is now required to get events ** to be logged. The decoders and preprocessors are still ** configured independently, which allows them to inspect and @@ -39,8 +39,8 @@ ** and GenerateEvent2() for portscan.cc. The GenerateSnortEvent() ** function now finds and otn and calls fpLogEvent. ** -** Any event that has no otn associated with it's gid,sid pair, -** will/should not alert, even if the preprocessor or decoiderr is +** Any event that has no otn associated with it's gid,sid pair +** will/should not alert, even if the preprocessor or decoder is ** configured to detect an alertable event. ** ** In the future, preporcessor may have an api that gets called diff --git a/src/events/event_wrapper.cc b/src/events/event_wrapper.cc index 9f756ac02..4a50b00f9 100644 --- a/src/events/event_wrapper.cc +++ b/src/events/event_wrapper.cc @@ -50,7 +50,7 @@ * This function has been updated to find an otn and route the call to fpLogEvent * if possible. This requires a rule be written for each decoder event, * and possibly some preporcessor events. The bulk of eventing is handled vie the - * SnortEventqAdd() and SnortEventLog() functions - whichalready route the events to + * SnortEventqAdd() and SnortEventLog() functions - which already route the events to * the fpLogEvent()function. */ uint32_t GenerateSnortEvent(Packet* p, uint32_t gid, uint32_t sid) diff --git a/src/file_api/file_capture.h b/src/file_api/file_capture.h index ef8d8a726..621056577 100644 --- a/src/file_api/file_capture.h +++ b/src/file_api/file_capture.h @@ -29,7 +29,7 @@ // allow file data remains in mempool. Even if a session is closed, the file // data will stay in the mempool. // 3) Then file data can be read through file_capture_read() -// 4) Finally, fila data must be released from mempool file_capture_release() +// 4) Finally, file data must be released from mempool file_capture_release() #include #include @@ -84,7 +84,7 @@ public: // Store file to disk asynchronously void store_file_async(); - // Log file capture mempoofile_contentl usage + // Log file capture mempool usage static void print_mem_usage(); // Exit file capture, release all file capture memory etc, diff --git a/src/file_api/file_enforcer.h b/src/file_api/file_enforcer.h index c9fd696be..1e30bc2b3 100644 --- a/src/file_api/file_enforcer.h +++ b/src/file_api/file_enforcer.h @@ -22,7 +22,7 @@ #ifndef FILE_ENFORCER_H #define FILE_ENFORCER_H -// If a file transfered through HTTP is blocked, a new session might be created +// If a file transferred through HTTP is blocked, a new session might be created // to request the file data left. To block the new session, we use URL and IPs // to continue blocking the same file. diff --git a/src/filters/sfthd.cc b/src/filters/sfthd.cc index a951afa1b..dfee62803 100644 --- a/src/filters/sfthd.cc +++ b/src/filters/sfthd.cc @@ -275,15 +275,15 @@ the current event should be logged or dropped. @param thd Threshold object from sfthd_new() @param gen_id Generator id -@param sig_id Signauture id +@param sig_id Signature id @param tracking Selects tracking by src ip or by dst ip -@param type Thresholding type: Limit, Threshold, or Limt+Threshold, Suppress +@param type Thresholding type: Limit, Threshold, or Limit+Threshold, Suppress @param priority Assigns a relative priority to this object, higher numbers imply higher priority @param count Number of events @param seconds Time duration over which this threshold object acts. -@param ip IP address, for supression -@param ip-mask IP mask, applied with ip_mask, for supression +@param ip IP address, for suppression +@param ip-mask IP mask, applied with ip_mask, for suppression @return integer @retval 0 successfully added the thresholding object @@ -386,7 +386,7 @@ static int sfthd_create_threshold_local( return -10; } p = (THD_NODE*)sfthd_item->sfthd_node_list->tail->ndata; - if (p) /* just to be safe- if thers a tail, there is is node data */ + if (p) /* just to be safe- if there is a tail, there is is node data */ { if ( p->type != THD_TYPE_SUPPRESS && config->type != THD_TYPE_SUPPRESS ) { @@ -405,7 +405,7 @@ static int sfthd_create_threshold_local( /* Create a THD_NODE for this THD_ITEM (Object) */ sfthd_node = (THD_NODE*)snort_calloc(sizeof(THD_NODE)); - /* Limit priorities to force supression nodes to highest priority */ + /* Limit priorities to force suppression nodes to highest priority */ if ( config->priority >= THD_PRIORITY_SUPPRESS ) { config->priority = THD_PRIORITY_SUPPRESS - 1; @@ -436,7 +436,7 @@ static int sfthd_create_threshold_local( objects is done above. Suppressions have the highest priority and are at the front of the - list, the tail node is either a supprssion node or the only pure + list, the tail node is either a suppression node or the only pure thresholding node. */ { @@ -577,15 +577,15 @@ the current event should be logged or dropped. @param thd Threshold object from sfthd_new() @param gen_id Generator id -@param sig_id Signauture id +@param sig_id Signature id @param tracking Selects tracking by src ip or by dst ip -@param type Thresholding type: Limit, Threshold, or Limt+Threshold, Suppress +@param type Thresholding type: Limit, Threshold, or Limit+Threshold, Suppress @param priority Assigns a relative priority to this object, higher numbers imply higher priority @param count Number of events @param seconds Time duration over which this threshold object acts. -@param ip IP address, for supression -@param ip-mask IP mask, applied with ip_mask, for supression +@param ip IP address, for suppression +@param ip-mask IP mask, applied with ip_mask, for suppression @return integer @retval 0 successfully added the thresholding object @@ -1178,7 +1178,7 @@ int sfthd_test_threshold( /* * Test for a global threshold object - * we're here cause ther were no threshold objects for this gen_id/sig_id pair + * we're here cause there were no threshold objects for this gen_id/sig_id pair */ global_test: diff --git a/src/filters/sfthd.h b/src/filters/sfthd.h index f32cff1d8..0efe1d297 100644 --- a/src/filters/sfthd.h +++ b/src/filters/sfthd.h @@ -176,7 +176,7 @@ struct tThdItemKey The main thresholding data structure. - Local and global threshold thd_id's are all unqiue, so we use just one + Local and global threshold thd_id's are all unique, so we use just one ip_nodes lookup table */ struct THD_STRUCT diff --git a/src/flow/flow_key.cc b/src/flow/flow_key.cc index 8b8a1b6be..20036b2d8 100644 --- a/src/flow/flow_key.cc +++ b/src/flow/flow_key.cc @@ -295,7 +295,7 @@ uint32_t FlowKey::hash(SFHASHFCN* hf, unsigned char* p, int) a += d[9]; // vlan tag, packet type, & version b += d[10]; // mpls label - c += d[11]; // address space id and 16bits of zero'd pad + c += d[11]; // address space id and 16bits of zeroed pad finalize(a, b, c); diff --git a/src/flow/ha.cc b/src/flow/ha.cc index bfdc2a4d3..08a9f4733 100644 --- a/src/flow/ha.cc +++ b/src/flow/ha.cc @@ -79,7 +79,7 @@ FlowHAState::FlowHAState() state |= (NEW | NEW_SESSION); pending = NONE_PENDING; - // Set the initial upate time to now+min_session_lifetime + // Set the initial update time to now+min_session_lifetime packet_gettimeofday(&next_update); next_update.tv_usec += min_session_lifetime.tv_usec; if (next_update.tv_usec > USEC_PER_SEC) @@ -380,7 +380,7 @@ static void consume_receive_update_message(HAMessage* msg) if ( (content_end - msg->cursor + 1) < header->length ) { - ErrorMessage("Consuming HA Update memssage - message too short\n"); + ErrorMessage("Consuming HA Update message - message too short\n"); break; } diff --git a/src/framework/codec.h b/src/framework/codec.h index c1132d5f6..902dc2439 100644 --- a/src/framework/codec.h +++ b/src/framework/codec.h @@ -87,7 +87,7 @@ constexpr uint16_t CODEC_SAVE_LAYER = 0x0004; // DECODE_ENCAP_LAYER for the next layer (and only the next layer). constexpr uint16_t CODEC_ENCAP_LAYER = (CODEC_SAVE_LAYER | CODEC_UNSURE_ENCAP ); -// used to check ip6 extensino order +// used to check ip6 extension order constexpr uint16_t CODEC_ROUTING_SEEN = 0x0008; // used by icmp4 for alerting @@ -120,7 +120,7 @@ struct CodecData /* Reset before each decode of packet begins */ - /* Codec specific fields. These fields are only relevent to codecs. */ + /* Codec specific fields. These fields are only relevant to codecs. */ uint16_t proto_bits; /* protocols contained within this packet -- will be propogated to Snort++ Packet struct*/ uint16_t codec_flags; /* flags used while decoding */ @@ -129,7 +129,7 @@ struct CodecData /* The following values have junk values after initialization */ uint8_t ip6_extension_count; /* initialized in cd_ipv6.cc */ uint8_t curr_ip6_extension; /* initialized in cd_ipv6.cc */ - IpProtocol ip6_csum_proto; /* initalized in cd_ipv6.cc. Used for IPv6 checksums */ + IpProtocol ip6_csum_proto; /* initialized in cd_ipv6.cc. Used for IPv6 checksums */ CodecData(ProtocolId init_prot) : next_prot_id(init_prot), lyr_len(0), invalid_bytes(0), proto_bits(0), codec_flags(0), ip_layer_cnt(0) @@ -264,7 +264,7 @@ public: * Main decoding function! Will get called when decoding a packet. * * PARAMS: - * const RawData& = struct containing informatin about the + * const RawData& = struct containing information about the * current packet's raw data * * CodecData& = Pass information the PacketManager and other @@ -311,12 +311,12 @@ public: * like IPv4 (original ipv4 header may contain invalid options * which we don't want to copy) and GTP have dynamic lengths. * So, this parameter ensure the encode() function doesn't - * need to revalidatae and recalculate the length. + * need to revalidate and recalculate the length. * EncState& = The current EncState struct * Buffer& = the packet which will be sent. All inward layers will already * be set. * - * NOTE: all funtions MUST call the Buffer.allocate() function before + * NOTE: all functions MUST call the Buffer.allocate() function before * manipulating memory. */ virtual bool encode(const uint8_t* const /*raw_in */, diff --git a/src/hash/sfghash.cc b/src/hash/sfghash.cc index d4db34702..2156de4e1 100644 --- a/src/hash/sfghash.cc +++ b/src/hash/sfghash.cc @@ -484,7 +484,7 @@ static void sfghash_next(SFGHASH* t) } /* Next row - Get 1st node in next non-emtoy row/node list */ + Get 1st node in next non-empty row/node list */ for ( t->crow++; t->crow < t->nrows; t->crow++ ) { t->cnode = t->table[ t->crow ]; @@ -547,7 +547,7 @@ SFGHASH_NODE* sfghash_findnext(SFGHASH* t) * * @param h sfhashfcn ptr * @param hash_fcn user specified hash function - * @param keycmp_fcn user specified key comparisoin function + * @param keycmp_fcn user specified key comparison function */ int sfghash_set_keyops(SFGHASH* h, diff --git a/src/hash/sfhashfcn.cc b/src/hash/sfhashfcn.cc index 161b44fe0..f12102b18 100644 --- a/src/hash/sfhashfcn.cc +++ b/src/hash/sfhashfcn.cc @@ -97,7 +97,7 @@ unsigned sfhashfcn_hash(SFHASHFCN* p, unsigned char* d, int n) * * @param h sfhashfcn ptr * @param hash_fcn user specified hash function - * @param keycmp_fcn user specified key comparisoin function + * @param keycmp_fcn user specified key comparison function */ int sfhashfcn_set_keyops(SFHASHFCN* h, unsigned (* hash_fcn)(SFHASHFCN* p, unsigned char* d, int n), diff --git a/src/hash/sfprimetable.cc b/src/hash/sfprimetable.cc index 2d3fa0a11..ea7306350 100644 --- a/src/hash/sfprimetable.cc +++ b/src/hash/sfprimetable.cc @@ -22,7 +22,7 @@ * * Prime number calculation via Table lookups. * -* This was implemented for use with the hasing functions +* This was implemented for use with the hashing functions * in sfghash, and sfxhash. * */ diff --git a/src/hash/sfxhash.cc b/src/hash/sfxhash.cc index 2e551a280..ff0391d97 100644 --- a/src/hash/sfxhash.cc +++ b/src/hash/sfxhash.cc @@ -24,18 +24,18 @@ * This table incorporates a memory manager (memcap.c) to provide a memory cap, * and an automatic node recovery system for out of memory management. Keys and * Data are copied into the hash table during the add operation. The data may - * be allocated and free'd by the user (by setting the datasize to zero ). A + * be allocated and freed by the user (by setting the datasize to zero ). A * user callback is provided to allow the user to do cleanup whenever a node - * is released, by either the ANR system or the relase() function. + * is released, by either the ANR system or the release() function. * * Users can and should delete nodes when they know they are not needed anymore, * but this custom table is designed for the case where nodes are allocated * permanently, we have to limit memory, and we wish to recycle old nodes. - * Many problems have a natural node ageing paradigm working in our favor, + * Many problems have a natural node aging paradigm working in our favor, * so automated node aging makes sense. i.e. thresholding, tcp state. * * This hash table maps keys to data. All keys must be unique. - * Uniqueness is enforcedby the code. + * Uniqueness is enforced by the code. * * Features: * @@ -556,7 +556,7 @@ static SFXHASH_NODE* sfxhash_newnode(SFXHASH* t) */ if ( !hnode && t->anr_flag && t->gtail ) { - /* Find the oldes node the users willing to let go. */ + /* Find the oldest node the users willing to let go. */ for (hnode = t->gtail; hnode; hnode = hnode->gprev ) { if ( t->anrfree ) /* User has provided a permission+release callback function */ @@ -590,7 +590,7 @@ static SFXHASH_NODE* sfxhash_newnode(SFXHASH* t) * * Find a Node based on the key, return the node and the index. * The index is valid even if the return value is nullptr, in which - * case the index is the corect row in which the node should be + * case the index is the correct row in which the node should be * created. * */ @@ -640,7 +640,7 @@ static SFXHASH_NODE* sfxhash_find_node_row(SFXHASH* t, const void* key, int* rin * key users key pointer * data users data pointer * - * eturn integer + * return integer * retval SFXHASH_OK success * retval SFXHASH_INTABLE already in the table, t->cnode points to the node * retval SFXHASH_NOMEM not enough memory @@ -1066,7 +1066,7 @@ static void sfxhash_next(SFXHASH* t) } /* Next row - Get 1st node in next non-emtoy row/node list */ + Get 1st node in next non-empty row/node list */ for ( t->crow++; t->crow < t->nrows; t->crow++ ) { t->cnode = t->table[ t->crow ]; @@ -1181,9 +1181,9 @@ int usrfree(void* key, void* data) /* Auto Node Recovery Callback - optional - This is called to ask the user to kill a node, if it reutrns !0 than the hash + This is called to ask the user to kill a node, if it returns !0 than the hash library does not kill this node. If the user os willing to let the node die, - the user must do any free'ing or clean up on the node during this call. + the user must do any freeing or clean up on the node during this call. */ int anrfree(void* key, void* data) { diff --git a/src/hash/sfxhash.h b/src/hash/sfxhash.h index 2371deac9..ca10fc53d 100644 --- a/src/hash/sfxhash.h +++ b/src/hash/sfxhash.h @@ -37,7 +37,7 @@ struct SFHASHFCN; struct SFXHASH_NODE { - struct SFXHASH_NODE* gnext; // global node list - used for ageing nodes + struct SFXHASH_NODE* gnext; // global node list - used for aging nodes struct SFXHASH_NODE* gprev; struct SFXHASH_NODE* next; // row node list struct SFXHASH_NODE* prev; @@ -73,7 +73,7 @@ struct SFXHASH unsigned find_success; SFXHASH_NODE* ghead, * gtail; // global - root of all nodes allocated in table - SFXHASH_NODE* fhead, * ftail; // list of free nodes, which are recyled + SFXHASH_NODE* fhead, * ftail; // list of free nodes, which are recycled SFXHASH_NODE* gnode; // gfirst/gnext node ptr */ int recycle_nodes; // recycle nodes. Nodes are not freed, but are used for // subsequent new nodes @@ -83,7 +83,7 @@ struct SFXHASH * the new node. anr_tries indicates # of ANR tries.*/ unsigned anr_tries; - unsigned anr_count; // # ANR ops performaed + unsigned anr_count; // # ANR ops performed int anr_flag; // 0=off, !0=on SFXHASH_FREE_FCN anrfree; @@ -118,11 +118,11 @@ inline unsigned sfxhash_anr_count(SFXHASH* t) inline unsigned sfxhash_find_total(SFXHASH* t) { return t->find_success + t->find_fail; } -// Get the # unsucessful finds +// Get the # unsuccessful finds inline unsigned sfxhash_find_fail(SFXHASH* t) { return t->find_fail; } -// Get the # sucessful finds +// Get the # successful finds inline unsigned sfxhash_find_success(SFXHASH* t) { return t->find_success; } diff --git a/src/hash/test/lru_cache_shared_test.cc b/src/hash/test/lru_cache_shared_test.cc index c5ad7c988..50e2cd904 100644 --- a/src/hash/test/lru_cache_shared_test.cc +++ b/src/hash/test/lru_cache_shared_test.cc @@ -71,9 +71,9 @@ TEST(lru_cache_shared, insert_test) CHECK(false == lru_cache.find(3, data)); // Verify that insert will replace data if key exists already. - lru_cache.insert(1, "newone"); + lru_cache.insert(1, "new one"); CHECK(true == lru_cache.find(1, data)); - CHECK("newone" == data); + CHECK("new one" == data); // Verify current number of entries in cache. CHECK(3 == lru_cache.size()); @@ -81,7 +81,7 @@ TEST(lru_cache_shared, insert_test) // Verify that the data is in LRU order. auto vec = lru_cache.get_all_data(); CHECK(3 == vec.size()); - CHECK((vec[0] == std::make_pair(1, std::string("newone")))); + CHECK((vec[0] == std::make_pair(1, std::string("new one")))); CHECK((vec[1] == std::make_pair(2, std::string("two")))); CHECK((vec[2] == std::make_pair(0, std::string("zero")))); } @@ -185,7 +185,7 @@ TEST(lru_cache_shared, stats_test) lru_cache.find(8, data); // Misses now that they're removed. lru_cache.find(9, data); - lru_cache.remove(100); // Removing a non-existant entry does not + lru_cache.remove(100); // Removing a non-existent entry does not // increase remove count. lru_cache.clear(); diff --git a/src/host_tracker/host_tracker.h b/src/host_tracker/host_tracker.h index 833a3bf41..12e434870 100644 --- a/src/host_tracker/host_tracker.h +++ b/src/host_tracker/host_tracker.h @@ -35,7 +35,7 @@ #include "sfip/sf_ip.h" // FIXIT-M For now this emulates the Snort++ attribute table. -// Need to add in sfrnaincludes/host_tracker.h data eventually. +// Need to add in host_tracker.h data eventually. typedef uint16_t Port; typedef uint16_t Protocol; diff --git a/src/ips_options/asn1_detect.cc b/src/ips_options/asn1_detect.cc index 5862df0b3..e3aa21bd4 100644 --- a/src/ips_options/asn1_detect.cc +++ b/src/ips_options/asn1_detect.cc @@ -65,7 +65,7 @@ ** BitStringOverflow:: */ /** -** The neccessary info to detect possible bitstring overflows. Thanks +** The necessary info to detect possible bitstring overflows. Thanks ** once again to microsoft for keeping us in business. ** ** @return integer @@ -139,7 +139,7 @@ static int DoubleOverflow(ASN1_TYPE* asn1, void*) /* ** Here's what this does. ** - ** There is a vulnerablity in the MSASN1 library when decoding + ** There is a vulnerability in the MSASN1 library when decoding ** a double (real) type. If the encoding is ASCII (specified by ** not setting bit 7 or 8), and the buffer is greater than 256, ** then you overflow the array in the function. diff --git a/src/ips_options/asn1_util.cc b/src/ips_options/asn1_util.cc index 96e75744f..a15536a37 100644 --- a/src/ips_options/asn1_util.cc +++ b/src/ips_options/asn1_util.cc @@ -544,7 +544,7 @@ static int asn1_decode_type(const u_char** data, u_int* len, ASN1_TYPE** asn1_ty } /* - ** Set this varible here, so we can set the data_len for + ** Set this variable here, so we can set the data_len for ** indeterminate constructs. */ uiRawLen = asn1data.end - asn1data.data; @@ -686,7 +686,7 @@ int asn1_decode(const u_char* data, u_int len, ASN1_TYPE** asn1_type) /* ** This is where we decode the ASN.1 constructs. We do while() ** because we may have back to back constructs. We bail on the - ** first indentifier that isn't a construct. + ** first identifier that isn't a construct. */ while (cur && cur->ident.flag == SF_ASN1_FLAG_CONSTRUCT) { diff --git a/src/ips_options/extract.cc b/src/ips_options/extract.cc index 9ac373a9e..900af9474 100644 --- a/src/ips_options/extract.cc +++ b/src/ips_options/extract.cc @@ -51,7 +51,7 @@ void set_byte_order(uint8_t& order, uint8_t flag, const char* opt) * This method will read either a big or little endian value in binary * data from the packet and return an uint32_t value. * - * @param endianess value to read the byte as + * @param endianness value to read the byte as * @param bytes_to_grab how many bytes should we grab from the packet * @param data pointer to where to grab the data from * @param start pointer to start range of buffer @@ -60,11 +60,11 @@ void set_byte_order(uint8_t& order, uint8_t flag, const char* opt) * * @returns 0 on success, otherwise failure */ -int byte_extract(int endianess, int bytes_to_grab, const uint8_t* ptr, +int byte_extract(int endianness, int bytes_to_grab, const uint8_t* ptr, const uint8_t* start, const uint8_t* end, uint32_t* value) { - if (endianess != ENDIAN_LITTLE && endianess != ENDIAN_BIG) + if (endianness != ENDIAN_LITTLE && endianness != ENDIAN_BIG) { /* we only support 2 byte formats */ return -2; @@ -91,7 +91,7 @@ int byte_extract(int endianess, int bytes_to_grab, const uint8_t* ptr, *value = (*ptr) & 0xFF; break; case 2: - if (endianess == ENDIAN_LITTLE) + if (endianness == ENDIAN_LITTLE) { *value = (*ptr) & 0xFF; *value |= (*(ptr + 1) & 0xFF) << 8; @@ -103,7 +103,7 @@ int byte_extract(int endianess, int bytes_to_grab, const uint8_t* ptr, } break; case 3: - if (endianess == ENDIAN_LITTLE) + if (endianness == ENDIAN_LITTLE) { *value = (*ptr) & 0xFF; *value |= ((*(ptr + 1)) & 0xFF) << 8; @@ -117,7 +117,7 @@ int byte_extract(int endianess, int bytes_to_grab, const uint8_t* ptr, } break; case 4: - if (endianess == ENDIAN_LITTLE) + if (endianness == ENDIAN_LITTLE) { *value = (*ptr) & 0xFF; *value |= ((*(ptr + 1)) & 0xFF) << 8; diff --git a/src/ips_options/extract.h b/src/ips_options/extract.h index 0f745cbde..d06048d1d 100644 --- a/src/ips_options/extract.h +++ b/src/ips_options/extract.h @@ -34,7 +34,7 @@ SO_PUBLIC int string_extract( const uint8_t* start, const uint8_t* end, uint32_t* value); SO_PUBLIC int byte_extract( - int endianess, int bytes_to_grab, const uint8_t* ptr, + int endianness, int bytes_to_grab, const uint8_t* ptr, const uint8_t* start, const uint8_t* end, uint32_t* value); SO_PUBLIC void set_byte_order(uint8_t& order, uint8_t flag, const char* opt); diff --git a/src/ips_options/ips_byte_extract.cc b/src/ips_options/ips_byte_extract.cc index eeb80fb6c..e8510d1b6 100644 --- a/src/ips_options/ips_byte_extract.cc +++ b/src/ips_options/ips_byte_extract.cc @@ -52,7 +52,7 @@ struct ByteExtractData uint8_t relative_flag; uint8_t data_string_convert_flag; uint8_t align; - uint8_t endianess; + uint8_t endianness; uint32_t base; uint32_t multiplier; uint32_t bitmask_val; @@ -106,7 +106,7 @@ uint32_t ByteExtractOption::hash() const a += (data->relative_flag << 24 | data->data_string_convert_flag << 16 | data->align << 8 | - data->endianess); + data->endianness); b += data->multiplier; c += data->var_number; @@ -134,7 +134,7 @@ bool ByteExtractOption::operator==(const IpsOption& ips) const (left->relative_flag == right->relative_flag) && (left->data_string_convert_flag == right->data_string_convert_flag) && (left->align == right->align) && - (left->endianess == right->endianess) && + (left->endianness == right->endianness) && (left->base == right->base) && (left->multiplier == right->multiplier) && (left->var_number == right->var_number) && @@ -168,8 +168,8 @@ int ByteExtractOption::eval(Cursor& c, Packet* p) if (ptr < start || ptr >= end) return DETECTION_OPTION_NO_MATCH; - uint8_t endian = data->endianess; - if (data->endianess == ENDIAN_FUNC) + uint8_t endian = data->endianness; + if (data->endianness == ENDIAN_FUNC) { if (!p->endianness || !p->endianness->get_offset_endianness(ptr - p->data, endian)) @@ -207,7 +207,7 @@ int ByteExtractOption::eval(Cursor& c, Packet* p) } } - /* mulitply */ + /* multiply */ *value *= data->multiplier; /* align to next 32-bit or 16-bit boundary */ @@ -462,8 +462,8 @@ bool ExtractModule::begin(const char*, int, SnortConfig*) bool ExtractModule::end(const char*, int, SnortConfig*) { - if ( !data.endianess ) - data.endianess = ENDIAN_BIG; + if ( !data.endianness ) + data.endianness = ENDIAN_BIG; return ByteExtractVerify(&data); } @@ -488,13 +488,13 @@ bool ExtractModule::set(const char*, Value& v, SnortConfig*) data.multiplier = v.get_long(); else if ( v.is("big") ) - set_byte_order(data.endianess, ENDIAN_BIG, "byte_extract"); + set_byte_order(data.endianness, ENDIAN_BIG, "byte_extract"); else if ( v.is("little") ) - set_byte_order(data.endianess, ENDIAN_LITTLE, "byte_extract"); + set_byte_order(data.endianness, ENDIAN_LITTLE, "byte_extract"); else if ( v.is("dce") ) - set_byte_order(data.endianess, ENDIAN_FUNC, "byte_extract"); + set_byte_order(data.endianness, ENDIAN_FUNC, "byte_extract"); else if ( v.is("string") ) { diff --git a/src/ips_options/ips_byte_jump.cc b/src/ips_options/ips_byte_jump.cc index b547ac60a..0481053f3 100644 --- a/src/ips_options/ips_byte_jump.cc +++ b/src/ips_options/ips_byte_jump.cc @@ -39,11 +39,11 @@ * ["dce"]: let the DCE/RPC 2 preprocessor determine the byte order of the * value to be converted * ["string"]: converted bytes represented as a string needing conversion - * ["hex"]: converted string data is represented in hexidecimal + * ["hex"]: converted string data is represented in hexadecimal * ["dec"]: converted string data is represented in decimal * ["oct"]: converted string data is represented in octal * ["align"]: round the number of converted bytes up to the next - * 32-bit boundry + * 32-bit boundary * ["post_offset"]: number of bytes to adjust after applying * ["from beginning"]: Skip forward from the beginning of the packet * payload instead of from the current position in @@ -104,7 +104,7 @@ typedef struct _ByteJumpData uint8_t data_string_convert_flag; uint8_t from_beginning_flag; uint8_t align_flag; - uint8_t endianess; + uint8_t endianness; uint32_t base; uint32_t multiplier; int32_t post_offset; @@ -155,7 +155,7 @@ uint32_t ByteJumpOption::hash() const data->data_string_convert_flag << 16 | data->from_beginning_flag << 8 | data->align_flag); - b += data->endianess; + b += data->endianness; c += data->multiplier; mix(a,b,c); @@ -188,7 +188,7 @@ bool ByteJumpOption::operator==(const IpsOption& ips) const ( left->data_string_convert_flag == right->data_string_convert_flag) && ( left->from_beginning_flag == right->from_beginning_flag) && ( left->align_flag == right->align_flag) && - ( left->endianess == right->endianess) && + ( left->endianness == right->endianness) && ( left->base == right->base) && ( left->multiplier == right->multiplier) && ( left->post_offset == right->post_offset) && @@ -229,7 +229,7 @@ int ByteJumpOption::eval(Cursor& c, Packet* p) uint32_t jump = 0; uint32_t payload_bytes_grabbed = 0; - uint8_t endian = bjd->endianess; + uint8_t endian = bjd->endianness; if (endian == ENDIAN_FUNC) { @@ -280,7 +280,7 @@ int ByteJumpOption::eval(Cursor& c, Packet* p) if (bjd->multiplier) jump *= bjd->multiplier; - // if we need to align on 32-bit boundries, round up to the next 32-bit value + // if we need to align on 32-bit boundaries, round up to the next 32-bit value if (bjd->align_flag) { if ((jump % 4) != 0) @@ -407,8 +407,8 @@ bool ByteJumpModule::end(const char*, int, SnortConfig*) return false; } } - if ( !data.endianess ) - data.endianess = ENDIAN_BIG; + if ( !data.endianness ) + data.endianness = ENDIAN_BIG; if (data.from_beginning_flag && data.from_end_flag) { @@ -462,13 +462,13 @@ bool ByteJumpModule::set(const char*, Value& v, SnortConfig*) data.post_offset = v.get_long(); else if ( v.is("big") ) - set_byte_order(data.endianess, ENDIAN_BIG, "byte_jump"); + set_byte_order(data.endianness, ENDIAN_BIG, "byte_jump"); else if ( v.is("little") ) - set_byte_order(data.endianess, ENDIAN_LITTLE, "byte_jump"); + set_byte_order(data.endianness, ENDIAN_LITTLE, "byte_jump"); else if ( v.is("dce") ) - set_byte_order(data.endianess, ENDIAN_FUNC, "byte_jump"); + set_byte_order(data.endianness, ENDIAN_FUNC, "byte_jump"); else if ( v.is("string") ) { diff --git a/src/ips_options/ips_byte_test.cc b/src/ips_options/ips_byte_test.cc index 6ecb6a4d7..a9305feb9 100644 --- a/src/ips_options/ips_byte_test.cc +++ b/src/ips_options/ips_byte_test.cc @@ -22,7 +22,7 @@ * * Purpose: * Test a byte field against a specific value (with opcode). Capable - * of testing binary values or converting represenative byte strings + * of testing binary values or converting representative byte strings * to their binary equivalent and testing them. * * @@ -37,7 +37,7 @@ * ["big"]: process data as big endian (default) * ["little"]: process data as little endian * ["string"]: converted bytes represented as a string needing conversion - * ["hex"]: converted string data is represented in hexidecimal + * ["hex"]: converted string data is represented in hexadecimal * ["dec"]: converted string data is represented in decimal * ["oct"]: converted string data is represented in octal * ["bitmask"]: applies the AND operator on the bytes converted. The @@ -140,7 +140,7 @@ typedef struct _ByteTestData uint8_t not_flag; uint8_t relative_flag; uint8_t data_string_convert_flag; - uint8_t endianess; + uint8_t endianness; uint32_t base; uint32_t bitmask_val; int8_t cmp_value_var; @@ -248,7 +248,7 @@ uint32_t ByteTestOption::hash() const b += (data->not_flag << 24 | data->relative_flag << 16 | data->data_string_convert_flag << 8 | - data->endianess); + data->endianness); c += data->base; mix(a,b,c); @@ -280,7 +280,7 @@ bool ByteTestOption::operator==(const IpsOption& ips) const ( left->not_flag == right->not_flag) && ( left->relative_flag == right->relative_flag) && ( left->data_string_convert_flag == right->data_string_convert_flag) && - ( left->endianess == right->endianess) && + ( left->endianness == right->endianness) && ( left->base == right->base) && ( left->cmp_value_var == right->cmp_value_var) && ( left->offset_var == right->offset_var) && @@ -323,7 +323,7 @@ int ByteTestOption::eval(Cursor& c, Packet* p) const uint8_t* start_ptr = btd->relative_flag ? c.start() : c.buffer(); start_ptr += offset; - uint8_t endian = btd->endianess; + uint8_t endian = btd->endianness; if (endian == ENDIAN_FUNC) { if (!p->endianness || @@ -538,8 +538,8 @@ bool ByteTestModule::end(const char*, int, SnortConfig*) return false; } } - if ( !data.endianess ) - data.endianess = ENDIAN_BIG; + if ( !data.endianness ) + data.endianness = ENDIAN_BIG; if (numBytesInBitmask(data.bitmask_val) > data.bytes_to_compare) { @@ -578,13 +578,13 @@ bool ByteTestModule::set(const char*, Value& v, SnortConfig*) data.relative_flag = 1; else if ( v.is("big") ) - set_byte_order(data.endianess, ENDIAN_BIG, "byte_test"); + set_byte_order(data.endianness, ENDIAN_BIG, "byte_test"); else if ( v.is("little") ) - set_byte_order(data.endianess, ENDIAN_LITTLE, "byte_test"); + set_byte_order(data.endianness, ENDIAN_LITTLE, "byte_test"); else if ( v.is("dce") ) - set_byte_order(data.endianess, ENDIAN_FUNC, "byte_test"); + set_byte_order(data.endianness, ENDIAN_FUNC, "byte_test"); else if ( v.is("string") ) { diff --git a/src/ips_options/ips_cvs.cc b/src/ips_options/ips_cvs.cc index 2dc9026f5..ad39204a9 100644 --- a/src/ips_options/ips_cvs.cc +++ b/src/ips_options/ips_cvs.cc @@ -195,7 +195,7 @@ static int CvsDecode(const uint8_t* data, uint16_t data_len, return CVS_NO_ALERT; DebugFormat(DEBUG_IPS_OPTION, "CVS command\n" - " comand: %.*s\n" + " command: %.*s\n" "argument: %.*s\n", command.cmd_str_len, (char*)command.cmd_str, command.cmd_arg == NULL ? 4 : command.cmd_arg_len, diff --git a/src/ips_options/ips_flags.cc b/src/ips_options/ips_flags.cc index 03390c383..9edebab91 100644 --- a/src/ips_options/ips_flags.cc +++ b/src/ips_options/ips_flags.cc @@ -198,7 +198,7 @@ static void flags_parse_test(const char* rule, TcpFlagCheckData* idx) fptr = rule; - /* make sure there is atleast a split pointer */ + /* make sure there is at least a split pointer */ if (fptr == NULL) { ParseError("flags missing in TCP flag rule"); @@ -284,7 +284,7 @@ static void flags_parse_test(const char* rule, TcpFlagCheckData* idx) default: ParseError( "bad TCP flag = '%c'" - "Valid otions: UAPRSFCE or 0 for NO flags (e.g. NULL scan)," + "Valid options: UAPRSFCE or 0 for NO flags (e.g. NULL scan)," " and !, + or * for modifiers", *fptr); return; @@ -301,7 +301,7 @@ static void flags_parse_mask(const char* rule, TcpFlagCheckData* idx) fptr = rule; - /* make sure there is atleast a split pointer */ + /* make sure there is at least a split pointer */ if (fptr == NULL) { ParseError("flags missing in TCP flag rule"); @@ -367,7 +367,7 @@ static void flags_parse_mask(const char* rule, TcpFlagCheckData* idx) idx->tcp_mask |= R_ECE; /* ECN echo, RFC 3168 */ break; default: - ParseError("bad TCP flag = '%c'. Valid otions: UAPRSFCE", *fptr); + ParseError("bad TCP flag = '%c'. Valid options: UAPRSFCE", *fptr); return; } diff --git a/src/ips_options/ips_fragbits.cc b/src/ips_options/ips_fragbits.cc index 3d414b5ae..9a6c2003f 100644 --- a/src/ips_options/ips_fragbits.cc +++ b/src/ips_options/ips_fragbits.cc @@ -230,7 +230,7 @@ void FragBitsData::parse_fragbits(const char* data) switch ( bit_string.at( a ) ) { - case 'd': // dont fragment + case 'd': // don't fragment case 'D': set_dont_fragment_bit(); break; diff --git a/src/ips_options/ips_ipopts.cc b/src/ips_options/ips_ipopts.cc index 96009b46e..5f4b76b59 100644 --- a/src/ips_options/ips_ipopts.cc +++ b/src/ips_options/ips_ipopts.cc @@ -105,7 +105,7 @@ int IpOptOption::eval(Cursor&, Packet* p) DebugMessage(DEBUG_IPS_OPTION, "CheckIpOptions:"); if ( !p->is_ip4() ) - // if error occured while ip header + // if error occurred while ip header // was processed, return 0 automatically. return DETECTION_OPTION_NO_MATCH; diff --git a/src/ips_options/ips_isdataat.cc b/src/ips_options/ips_isdataat.cc index 0c7a093bf..55a038665 100644 --- a/src/ips_options/ips_isdataat.cc +++ b/src/ips_options/ips_isdataat.cc @@ -20,7 +20,7 @@ /* sp_isdataat * * Purpose: - * Test a specific byte to see if there is data. (Basicly, rule keyword + * Test a specific byte to see if there is data. (Basically, rule keyword * into inBounds) * * Arguments: diff --git a/src/ips_options/ips_pcre.cc b/src/ips_options/ips_pcre.cc index 423311946..c1d1fbcdb 100644 --- a/src/ips_options/ips_pcre.cc +++ b/src/ips_options/ips_pcre.cc @@ -65,7 +65,7 @@ struct PcreData pcre* re; /* compiled regex */ pcre_extra* pe; /* studied regex foo */ bool free_pe; - int options; /* sp_pcre specfic options (relative & inverse) */ + int options; /* sp_pcre specific options (relative & inverse) */ char* expression; }; @@ -80,7 +80,7 @@ struct PcreData // exactly correct is obviated and thus the need to reload as well. /* Since SO rules are loaded 1 time at startup, regardless of - * configuraton, we won't pcre_capture count again, so save the max. */ + * configuration, we won't pcre_capture count again, so save the max. */ static int s_ovector_max = 0; // this is a temporary value used during parsing and set in snort conf @@ -147,7 +147,7 @@ static void pcre_check_anchored(PcreData* pcre_data) if ((options & PCRE_ANCHORED) && !(options & PCRE_MULTILINE)) { - /* This means that this pcre rule option shouldn't be reevaluted + /* This means that this pcre rule option shouldn't be reevaluated * even if any of it's relative children should fail to match. * It is anchored to the cursor set by the previous cursor setting * rule option */ @@ -356,7 +356,7 @@ syntax: * @param len size of buffer * @param found_offset pointer to an integer so that we know where the search ended * - * *found_offset will be set to -1 when the find is unsucessful OR the routine is inverted + * *found_offset will be set to -1 when the find is unsuccessful OR the routine is inverted * * @return 1 when we find the string, 0 when we don't (unless we've been passed a flag to invert) */ diff --git a/src/ips_options/ips_session.cc b/src/ips_options/ips_session.cc index bfeecbf4a..c3f77e7b5 100644 --- a/src/ips_options/ips_session.cc +++ b/src/ips_options/ips_session.cc @@ -32,7 +32,7 @@ * This plugin can take two arguments: * printable => only log the "printable" ASCII characters. * all => log all traffic in the session, logging non-printable - * chars in "\xNN" hexidecimal format + * chars in "\xNN" hexadecimal format * * Effect: * @@ -281,7 +281,7 @@ static void DumpSessionData(FILE* fp, Packet* p, SessionData* sessionData) { if ((*idx > 0x1f && *idx < 0x7f) || *idx == 0x0a || *idx == 0x0d) { - /* Escape all occurences of '\' */ + /* Escape all occurrences of '\' */ if (*idx == '\\') fputc('\\', fp); fputc(*idx, fp); diff --git a/src/log/log_text.cc b/src/log/log_text.cc index addffae61..eb990294a 100644 --- a/src/log/log_text.cc +++ b/src/log/log_text.cc @@ -143,7 +143,7 @@ static void LogGREHeader(TextLog* log, Packet* p) /*-------------------------------------------------------------------- * Function: Log2ndHeader(TextLog* , Packet p) * - * Purpose: Log2ndHeader -- prints second layber header info. + * Purpose: Log2ndHeader -- prints second layer header info. * * Arguments: log => pointer to TextLog to print to * @@ -1019,7 +1019,7 @@ void LogICMPHeader(TextLog* log, Packet* p) break; case ICMP_ROUTER_ADVERTISE: - TextLog_Print(log, "ROUTER ADVERTISMENT: " + TextLog_Print(log, "ROUTER ADVERTISEMENT: " "Num addrs: %d Addr entry size: %d Lifetime: %u", p->ptrs.icmph->s_icmp_num_addrs, p->ptrs.icmph->s_icmp_wpa, ntohs(p->ptrs.icmph->s_icmp_lifetime)); diff --git a/src/loggers/unified2.cc b/src/loggers/unified2.cc index c8ecebf7d..d61b9e3dd 100644 --- a/src/loggers/unified2.cc +++ b/src/loggers/unified2.cc @@ -21,7 +21,7 @@ * Adam Keeton * * 09/26/06 - * This file is litterally unified.c converted to write unified2 + * This file is literally unified.c converted to write unified2 * */ @@ -611,7 +611,7 @@ static void Unified2Write(uint8_t* buf, uint32_t buf_len, Unified2Config* config ((ffstatus = fflush(u2.stream)) != 0)) { /* errno is saved just to avoid other intervening calls - * (e.g. ErrorMessage) potentially reseting it to something else. */ + * (e.g. ErrorMessage) potentially resetting it to something else. */ int error = errno; int max_retries = 3; diff --git a/src/main.cc b/src/main.cc index e7830c03f..6bae350a8 100644 --- a/src/main.cc +++ b/src/main.cc @@ -572,7 +572,7 @@ static bool set_mode() } #endif #ifdef UNIT_TEST - // FIXIT-M X we should move this out of set_mode and not do Snort bringup/teardown at all + // FIXIT-M X we should move this out of set_mode and not do Snort bring up/teardown at all if ( catch_enabled() ) { main_exit_code = catch_test(); diff --git a/src/main/policy.h b/src/main/policy.h index 46b51fd3e..cb156e64e 100644 --- a/src/main/policy.h +++ b/src/main/policy.h @@ -163,7 +163,7 @@ public: // FIXIT-M make impl private //------------------------------------------------------------------------- // FIXIT-L may be inlined at some point; on lockdown for now -// FIXIT-L SO_PUBLIC requierd because SnortConfig::inline_mode(), etc. uses the function +// FIXIT-L SO_PUBLIC required because SnortConfig::inline_mode(), etc. uses the function SO_PUBLIC NetworkPolicy* get_network_policy(); SO_PUBLIC InspectionPolicy* get_inspection_policy(); SO_PUBLIC IpsPolicy* get_ips_policy(); diff --git a/src/main/snort_config.h b/src/main/snort_config.h index 338e572fa..7b41cf24c 100644 --- a/src/main/snort_config.h +++ b/src/main/snort_config.h @@ -303,7 +303,7 @@ public: srmm_table_t* srmmTable = nullptr; /* srvc rule map master table */ srmm_table_t* spgmmTable = nullptr; /* srvc port_group map master table */ - sopg_table_t* sopgTable = nullptr; /* service-oridnal to port_group table */ + sopg_table_t* sopgTable = nullptr; /* service-ordinal to port_group table */ SFXHASH* detection_option_hash_table = nullptr; SFXHASH* detection_option_tree_hash_table = nullptr; @@ -393,7 +393,7 @@ public: void free_rule_state_list(); //------------------------------------------------------ - // Static convenience accesor methods + // Static convenience accessor methods static long int get_mpls_stack_depth() { return snort_conf->mpls_stack_depth; } diff --git a/src/managers/codec_manager.cc b/src/managers/codec_manager.cc index a532e3557..d7c1f4fa7 100644 --- a/src/managers/codec_manager.cc +++ b/src/managers/codec_manager.cc @@ -63,9 +63,9 @@ static THREAD_LOCAL rand_t* s_rand = NULL; /* * Begin search from index 1. 0 is a special case in that it is the default * codec and is actually a duplicate. i.e., we can find the 0 indexed - * codec somehwere else in the array too. + * codec somewhere else in the array too. * - * Returns: 0 on failure, induex on success + * Returns: 0 on failure, index on success */ uint8_t CodecManager::get_codec(const char* const keyword) { @@ -116,7 +116,7 @@ void CodecManager::release_plugins() if (wrap.api->pterm) { wrap.api->pterm(); - wrap.init = false; // Future proofing this functin. + wrap.init = false; // Future proofing this function. } uint8_t index = get_codec(wrap.api->base.name); @@ -235,7 +235,7 @@ void CodecManager::thread_init(SnortConfig* sc) if ( s_rand ) rand_close(s_rand); - // rand_open() can yield valgriind errors because the + // rand_open() can yield valgrind errors because the // starting seed may come from "random stack contents" // (see man 3 dnet) s_rand = rand_open(); diff --git a/src/managers/codec_manager.h b/src/managers/codec_manager.h index 2b0359e59..6a94427f9 100644 --- a/src/managers/codec_manager.h +++ b/src/managers/codec_manager.h @@ -104,7 +104,7 @@ private: /* * Private helper functions. These are all declared here - * because they need access to private varaibles. + * because they need access to private variables. */ // Private struct defined in an anonymous namespace. diff --git a/src/managers/module_manager.cc b/src/managers/module_manager.cc index 269fedfaf..9b502f174 100644 --- a/src/managers/module_manager.cc +++ b/src/managers/module_manager.cc @@ -457,7 +457,7 @@ static bool set_value(const char* fqn, Value& v) bool found = set_var(fqn, v); if ( !found && !ignored(fqn) ) - ParseWarning(WARN_SYMBOLS, "uknown symbol %s", fqn); + ParseWarning(WARN_SYMBOLS, "unknown symbol %s", fqn); return found; } diff --git a/src/memory/memory_cap.cc b/src/memory/memory_cap.cc index 86ac7a446..74742000c 100644 --- a/src/memory/memory_cap.cc +++ b/src/memory/memory_cap.cc @@ -190,7 +190,7 @@ void MemoryCap::calculate(unsigned num_threads) { preemptive_threshold = memory::calculate_threshold(thread_cap, config.threshold); DebugFormat(DEBUG_MEMORY, - "per-thread pre-emptive action threshold set to %zu\n", preemptive_threshold); + "per-thread preemptive action threshold set to %zu\n", preemptive_threshold); } } diff --git a/src/mime/file_mime_log.cc b/src/mime/file_mime_log.cc index f9bb6eaf7..9f52c4307 100644 --- a/src/mime/file_mime_log.cc +++ b/src/mime/file_mime_log.cc @@ -185,7 +185,7 @@ void MailLogState::set_file_name_from_log(Flow* flow) } } -/* Accumulate EOL seperated headers, one or more at a time */ +/* Accumulate EOL separated headers, one or more at a time */ int MailLogState::log_email_hdrs(const uint8_t* start, int length) { int log_avail = 0; diff --git a/src/mime/file_mime_paf.cc b/src/mime/file_mime_paf.cc index f615b8429..0b1528b4d 100644 --- a/src/mime/file_mime_paf.cc +++ b/src/mime/file_mime_paf.cc @@ -32,7 +32,7 @@ static const char* boundary_str = "boundary="; -/* Save the bounday string into paf state*/ +/* Save the boundary string into paf state*/ static inline bool store_boundary(MimeDataPafInfo* data_info, uint8_t val) { if (!data_info->boundary_search) @@ -92,7 +92,7 @@ static inline bool store_boundary(MimeDataPafInfo* data_info, uint8_t val) return false; } -/* check the bounday string in the mail body*/ +/* check the boundary string in the mail body*/ static inline bool check_boundary(MimeDataPafInfo* data_info, uint8_t data) { /* Search for boundary signature "--"*/ @@ -153,11 +153,11 @@ bool process_mime_paf_data(MimeDataPafInfo* data_info, uint8_t data) switch (data_info->data_state) { case MIME_PAF_FINDING_BOUNDARY_STATE: - /* Search for boundary Store bounday string in PAF state*/ + /* Search for boundary Store boundary string in PAF state*/ if (store_boundary(data_info, data)) { /* End of boundary, move to MIME_PAF_FOUND_BOUNDARY_STATE*/ - DebugFormat(DEBUG_FILE, "Create boudary string: %s\n", data_info->boundary); + DebugFormat(DEBUG_FILE, "Create boundary string: %s\n", data_info->boundary); data_info->data_state = MIME_PAF_FOUND_BOUNDARY_STATE; } break; @@ -166,7 +166,7 @@ bool process_mime_paf_data(MimeDataPafInfo* data_info, uint8_t data) if (check_boundary(data_info, data)) { /* End of boundary, move to MIME_PAF_FOUND_BOUNDARY_STATE*/ - DebugFormat(DEBUG_FILE, "Found Boudary string: %s\n", data_info->boundary); + DebugFormat(DEBUG_FILE, "Found boundary string: %s\n", data_info->boundary); return true; } break; diff --git a/src/mime/file_mime_process.cc b/src/mime/file_mime_process.cc index 387c92325..b3e32f554 100644 --- a/src/mime/file_mime_process.cc +++ b/src/mime/file_mime_process.cc @@ -339,7 +339,7 @@ const uint8_t* MimeSession::process_mime_header(const uint8_t* ptr, /* check if we're in a content-type header and not folding. if so we have the whole * header line/lines for content-type - see if we got a multipart with boundary * we don't check each folded line, but wait until we have the complete header - * because boundary=BOUNDARY can be split across mulitple folded lines before + * because boundary=BOUNDARY can be split across multiple folded lines before * or after the '=' */ if ((state_flags & (MIME_FLAG_IN_CONTENT_TYPE | MIME_FLAG_FOLDING)) == MIME_FLAG_IN_CONTENT_TYPE) diff --git a/src/network_inspectors/appid/appid_api.h b/src/network_inspectors/appid/appid_api.h index a0aa85fe8..c2edd16e8 100644 --- a/src/network_inspectors/appid/appid_api.h +++ b/src/network_inspectors/appid/appid_api.h @@ -45,7 +45,7 @@ enum class IpProtocol : uint8_t; #define APPID_SESSION_HTTP_SESSION (1ULL << 13) /**Service protocol was detected */ #define APPID_SESSION_SERVICE_DETECTED (1ULL << 14) -/**Finsihed with client app detection */ +/**Finished with client app detection */ #define APPID_SESSION_CLIENT_DETECTED (1ULL << 15) /**Flow is a data connection not a service */ #define APPID_SESSION_NOT_A_SERVICE (1ULL << 16) diff --git a/src/network_inspectors/appid/appid_stats_counter.cc b/src/network_inspectors/appid/appid_stats_counter.cc index c592002d9..ab35de9ce 100644 --- a/src/network_inspectors/appid/appid_stats_counter.cc +++ b/src/network_inspectors/appid/appid_stats_counter.cc @@ -17,7 +17,7 @@ //-------------------------------------------------------------------------- // appid_module.cc author Steve Chew -// Created on: Auguest 18, 2016 +// Created on: August 18, 2016 #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/src/network_inspectors/appid/appid_utils/sf_mlmp.cc b/src/network_inspectors/appid/appid_utils/sf_mlmp.cc index 96c5ecf66..410ac1c9a 100644 --- a/src/network_inspectors/appid/appid_utils/sf_mlmp.cc +++ b/src/network_inspectors/appid/appid_utils/sf_mlmp.cc @@ -43,7 +43,7 @@ struct tPatternNode /**Total number of parts.*/ uint32_t partTotal; - /**Uniq non-zero identifier to tie parts of a multi-part patterns together. */ + /**Unique non-zero identifier to tie parts of a multi-part patterns together. */ uint32_t patternId; tPatternNode* nextPattern; @@ -184,7 +184,7 @@ void mlmpDump(tMlmpTree* root) } /**tMlmpPattern comparator: compares patterns based on pattern, patternSize. This will - * result in alphabatical order. Notice that patternId is ignored here. + * result in alphabetical order. Notice that patternId is ignored here. */ static int compareMlmpPatterns(const void* p1, const void* p2) { diff --git a/src/network_inspectors/appid/client_plugins/client_app_timbuktu.cc b/src/network_inspectors/appid/client_plugins/client_app_timbuktu.cc index 0d359e7e9..c2e140ca4 100644 --- a/src/network_inspectors/appid/client_plugins/client_app_timbuktu.cc +++ b/src/network_inspectors/appid/client_plugins/client_app_timbuktu.cc @@ -124,7 +124,7 @@ int TimbuktuClientDetector::validate(AppIdDiscoveryArgs& args) } fd->pos++; break; - /* cheeck any 2 bytes fisrt */ + /* check any 2 bytes first */ case TIMBUKTU_STATE_ANY_MESSAGE_LEN: fd->pos++; if (fd->pos >= MAX_ANY_SIZE) diff --git a/src/network_inspectors/appid/detector_plugins/detector_dns.cc b/src/network_inspectors/appid/detector_plugins/detector_dns.cc index 4bba2e279..717663b4d 100644 --- a/src/network_inspectors/appid/detector_plugins/detector_dns.cc +++ b/src/network_inspectors/appid/detector_plugins/detector_dns.cc @@ -676,7 +676,7 @@ inprocess: add_app(args.asd, APP_ID_NONE, APP_ID_DNS, nullptr); service_inprocess(args.asd, args.pkt, args.dir); // FIXIT - incrementing stat early so its counted in case of blocks... not great solution - // refer to this PR for more details on the issue and possible soluitons: + // refer to this PR for more details on the issue and possible solutions: // https://bitbucket-eng-rtp1.cisco.com/bitbucket/projects/SNORT/repos/snort3/pull-requests/779/overview appid_stats.dns_udp_flows++; return APPID_INPROCESS; diff --git a/src/network_inspectors/appid/lua_detector_api.cc b/src/network_inspectors/appid/lua_detector_api.cc index 5a988e46c..20a486684 100644 --- a/src/network_inspectors/appid/lua_detector_api.cc +++ b/src/network_inspectors/appid/lua_detector_api.cc @@ -291,7 +291,7 @@ static int service_analyze_payload(lua_State* L) // FIXIT-M - the comments and code below for service_get_service_id don't appear to be useful // the ud->server.service_id field is set to APP_ID_UNKNOWN at init time and never updated // is this function ever used? -/**design: dont store service_id in detector structure since a single detector +/**design: don't store service_id in detector structure since a single detector * can get service_id for multiple protocols. For example SIP which gets Id for RTP and * SIP services. */ @@ -544,8 +544,8 @@ static int detector_get_packet_size(lua_State* L) return 1; } -/**Get packet direction. A flow/session maintains initiater and responder sides. A packet direction - * is determined wrt to the original initiater. +/**Get packet direction. A flow/session maintains initiator and responder sides. A packet direction + * is determined wrt to the original initiator. * * @param Lua_State* - Lua state variable. * @param detector/stack - detector object @@ -638,7 +638,7 @@ static int detector_get_pcre_groups(lua_State* L) * @param Lua_State* - Lua state variable. * @param detector/stack - detector object * @param pattern/stack - pattern to be matched. - * @param patternLenght/stack - length of pattern + * @param patternLength/stack - length of pattern * @param offset/stack - offset into packet payload where matching should start. * * @return int - Number of group matches. May be 1 if successful, and 0 if error is encountered. @@ -687,7 +687,7 @@ static int detector_get_protocol_type(lua_State* L) * @param Lua_State* - Lua state variable. * @param detector/stack - detector object * @return int - Number of elements on stack, which is 1 if successful, 0 otherwise. - * @return IPv4/stack - Source IPv4 addresss. + * @return IPv4/stack - Source IPv4 address. */ static int detector_get_packet_src_addr(lua_State* L) { @@ -705,7 +705,7 @@ static int detector_get_packet_src_addr(lua_State* L) * @param Lua_State* - Lua state variable. * @param detector/stack - detector object * @return int - Number of elements on stack, which is 1 if successful, 0 otherwise. - * @return IPv4/stack - destination IPv4 addresss. + * @return IPv4/stack - destination IPv4 address. */ static int detector_get_packet_dst_addr(lua_State* L) { @@ -783,7 +783,7 @@ static int client_register_pattern(lua_State* L) give a local callback function, which will do demuxing and then call lua callback function. */ - /*mpse library does not hold reference to pattern therefore we dont need to allocate it. */ + /*mpse library does not hold reference to pattern therefore we don't need to allocate it. */ if ( protocol == IpProtocol::TCP) ClientDiscovery::get_instance().register_tcp_pattern(ud, (const uint8_t*)pattern, @@ -965,7 +965,7 @@ static int detector_add_http_pattern(lua_State* L) pattern->pattern_size = (int)pattern_size; pattern->appId = appId; - // for apps that should not show up in 4.10 and ealier, we cannot include an entry in + // for apps that should not show up in 4.10 and earlier, we cannot include an entry in // the legacy client app or payload tables. We will use the appId instead. This is only for // user-agents that ID clients. if you want a user-agent to ID a payload, include it in the // payload database. If you want a host pattern ID, use the other API. @@ -1806,7 +1806,7 @@ static int detector_add_rtmp_url(lua_State* L) return 0; } -/*Lua should inject patterns in format. */ +/*Lua should inject patterns in format. */ static int detector_add_sip_user_agent(lua_State* L) { int index = 1; @@ -1976,7 +1976,7 @@ static int add_url_pattern(lua_State* L) assert(!(*UserData::check(L, DETECTOR, index))->validate_params.pkt); uint32_t service_app_id = lua_tointeger(L, ++index); - uint32_t clienAppId = lua_tointeger(L, ++index); + uint32_t clientAppId = lua_tointeger(L, ++index); uint32_t payload_app_id = lua_tointeger(L, ++index); /* Verify that host pattern is a valid string */ @@ -2019,7 +2019,7 @@ static int add_url_pattern(lua_State* L) DetectorAppUrlPattern* pattern = (DetectorAppUrlPattern*)snort_calloc(sizeof(DetectorAppUrlPattern)); pattern->userData.service_id = service_app_id; - pattern->userData.client_app = clienAppId; + pattern->userData.client_app = clientAppId; pattern->userData.payload = payload_app_id; pattern->userData.appId = APP_ID_NONE; pattern->userData.query.pattern = nullptr; @@ -2034,7 +2034,7 @@ static int add_url_pattern(lua_State* L) AppInfoManager& app_info_manager = AppInfoManager::get_instance(); app_info_manager.set_app_info_active(service_app_id); - app_info_manager.set_app_info_active(clienAppId); + app_info_manager.set_app_info_active(clientAppId); app_info_manager.set_app_info_active(payload_app_id); return 0; @@ -2048,7 +2048,7 @@ static int add_url_pattern(lua_State* L) * IPPROTO_UDP/DC.ipproto.udp (17)). * @param port/stack - port number to register. * @param pattern/stack - pattern to be matched. - * @param patternLenght/stack - length of pattern + * @param patternLength/stack - length of pattern * @param offset/stack - offset into packet payload where matching should start. * @param appId/stack - App ID to use for this detector. * @return int - Number of elements on stack, which is always 0. @@ -2095,7 +2095,7 @@ static int add_port_pattern_client(lua_State* L) * IPPROTO_UDP/DC.ipproto.udp (17)). * @param port/stack - port number to register. * @param pattern/stack - pattern to be matched. - * @param patternLenght/stack - length of pattern + * @param patternLength/stack - length of pattern * @param offset/stack - offset into packet payload where matching should start. * @param appId/stack - App ID to use for this detector. * @return int - Number of elements on stack, which is always 0. @@ -2127,7 +2127,7 @@ static int add_port_pattern_service(lua_State* L) return 0; } -/*Lua should inject patterns in format. */ +/*Lua should inject patterns in format. */ static int detector_add_sip_server(lua_State* L) { int index = 1; @@ -2364,7 +2364,7 @@ static const luaL_reg detector_methods[] = * If in future, one needs to free any of these buffers then one should consider * references to detector buffer in ServiceDetector stored in flows and hostServices * data structures. Other detectors at this time create one static instance for the - * lifetime of RNA, and therefore we have adopted the same principle for Lua Detecotors. + * lifetime of RNA, and therefore we have adopted the same principle for Lua Detectors. */ static int Detector_gc(lua_State*) { @@ -2449,7 +2449,7 @@ int LuaDetector::lua_validate(AppIdDiscoveryArgs& args) { // Runtime Lua errors are suppressed in production code since detectors are written for // efficiency and with defensive minimum checks. Errors are dealt as exceptions - // that dont impact processing by other detectors or future packets by the same detector. + // that don't impact processing by other detectors or future packets by the same detector. ErrorMessage("lua detector %s: error validating %s\n", package_info.name.c_str(), lua_tostring(my_lua_state, -1)); validate_params.pkt = nullptr; diff --git a/src/network_inspectors/appid/lua_detector_module.cc b/src/network_inspectors/appid/lua_detector_module.cc index 4223111fc..286c1fc8a 100644 --- a/src/network_inspectors/appid/lua_detector_module.cc +++ b/src/network_inspectors/appid/lua_detector_module.cc @@ -221,7 +221,7 @@ static inline void set_lua_tracker_size(lua_State* L, uint32_t numTrackers) } else { - DebugMessage(DEBUG_LOG, "hostServiceTrackerModule.setHosServiceTrackerSize not found"); + DebugMessage(DEBUG_LOG, "hostServiceTrackerModule.setHostServiceTrackerSize not found"); } lua_pop(L, 1); diff --git a/src/network_inspectors/appid/service_plugins/service_discovery.cc b/src/network_inspectors/appid/service_plugins/service_discovery.cc index 29312ead1..e4bd1abce 100644 --- a/src/network_inspectors/appid/service_plugins/service_discovery.cc +++ b/src/network_inspectors/appid/service_plugins/service_discovery.cc @@ -239,7 +239,7 @@ static int pattern_match(void* id, void*, int match_end_pos, void* data, void*) * returned. The list itself is saved in ServiceDiscoveryState. If * appId is already identified, then use it instead of searching again. RNA will capability * to try out other inferior matches. If appId is unknown i.e. searched and not found by FRE then - * dont do any pattern match. This is a way degrades RNA detector selection if FRE is running on + * don't do any pattern match. This is a way degrades RNA detector selection if FRE is running on * this sensor. */ void ServiceDiscovery::match_services_by_pattern(AppIdSession* asd, const Packet* pkt, IpProtocol @@ -577,7 +577,7 @@ bool ServiceDiscovery::do_service_discovery(AppIdSession& asd, Packet* p, int di if (asd.tp_app_id > APP_ID_NONE) { //tp has positively identified appId, Dig deeper only if sourcefire - // detector identifies additional information or flow is UDP reveresed. + // detector identifies additional information or flow is UDP reversed. AppInfoTableEntry* entry = asd.app_info_mgr->get_app_info_entry(asd.tp_app_id); if ( entry && entry->service_detector && ( ( entry->flags & APPINFO_FLAG_SERVICE_ADDITIONAL ) || diff --git a/src/network_inspectors/appid/service_plugins/service_ftp.cc b/src/network_inspectors/appid/service_plugins/service_ftp.cc index 9053c6c03..55dc79ffd 100644 --- a/src/network_inspectors/appid/service_plugins/service_ftp.cc +++ b/src/network_inspectors/appid/service_plugins/service_ftp.cc @@ -841,7 +841,7 @@ int FtpServiceDetector::validate(AppIdDiscoveryArgs& args) //ignore packets while encryption is on in explicit mode. In future, this will be changed //to direct traffic to SSL detector to extract payload from certs. This will require - // manintaining + // maintaining //two detector states at the same time. if (asd->get_session_flags(APPID_SESSION_ENCRYPTED)) { @@ -928,18 +928,18 @@ int FtpServiceDetector::validate(AppIdDiscoveryArgs& args) case 225: /* data connection open */ case 226: /* Transfer complete */ case 227: /*entering passive mode */ - case 230: /*user loggined */ + case 230: /*user logged in */ case 250: /* CWD command successful */ case 257: /* PATHNAME created */ case 331: /* login ok need password */ case 332: /*new account for login */ - case 350: /*requested file action pending futher information */ + case 350: /*requested file action pending further information */ case 450: /*requested file action not taken */ case 451: /*requested file action aborted */ case 452: /*requested file action not taken not enough space */ case 500: /*syntax error */ - case 501: /*not recognozed */ - case 502: /*not recognozed */ + case 501: /*not recognized */ + case 502: /*not recognized */ case 503: /*bad sequence of commands */ case 504: /*command not implemented */ case 530: /*login incorrect */ diff --git a/src/network_inspectors/appid/service_plugins/service_mdns.cc b/src/network_inspectors/appid/service_plugins/service_mdns.cc index e4a7ed885..9ca5048c9 100644 --- a/src/network_inspectors/appid/service_plugins/service_mdns.cc +++ b/src/network_inspectors/appid/service_plugins/service_mdns.cc @@ -340,7 +340,7 @@ int MdnsServiceDetector::analyze_user(AppIdSession* asd, const Packet* pkt, uint { user_name_len = user_original - srv_original - start_index; user_name_bkp = (char*)(srv_original + start_index); - /* Non-Printable characters in the begining */ + /* Non-Printable characters in the beginning */ while (user_index < user_name_len) { diff --git a/src/network_inspectors/appid/service_plugins/service_rtmp.cc b/src/network_inspectors/appid/service_plugins/service_rtmp.cc index f9b589257..010710979 100644 --- a/src/network_inspectors/appid/service_plugins/service_rtmp.cc +++ b/src/network_inspectors/appid/service_plugins/service_rtmp.cc @@ -399,7 +399,7 @@ static int parse_rtmp_message(const uint8_t** data_inout, uint16_t* size_inout, } else { - /* Something we dont care about... */ + /* Something we don't care about... */ ADVANCE_DATA(field_len); if (!skip_property_value(&data, &size)) goto parse_rtmp_message_fail; diff --git a/src/network_inspectors/appid/service_state.h b/src/network_inspectors/appid/service_state.h index 0aa105f8e..cd7711032 100644 --- a/src/network_inspectors/appid/service_state.h +++ b/src/network_inspectors/appid/service_state.h @@ -119,11 +119,11 @@ private: unsigned detract_count = 0; SfIp last_detract; - // consecutive incompatible flows - incompatibile means client packet did not match. + // consecutive incompatible flows - incompatible means client packet did not match. unsigned invalid_client_count = 0; /**IP address of client in last flow that was declared incompatible. If client IP address is - * different everytime, then consecutive incompatible status indicate that flow is not using + * different every time, then consecutive incompatible status indicate that flow is not using * specific service. */ SfIp last_invalid_client; diff --git a/src/network_inspectors/arp_spoof/arp_spoof.cc b/src/network_inspectors/arp_spoof/arp_spoof.cc index 286474c43..828855e84 100644 --- a/src/network_inspectors/arp_spoof/arp_spoof.cc +++ b/src/network_inspectors/arp_spoof/arp_spoof.cc @@ -33,7 +33,7 @@ * arpspoof: -unicast * * WARNING: this can generate false positives as Linux systems send unicast - * ARP requests repetatively for entries in their cache. + * ARP requests repetitively for entries in their cache. * * This plugin also takes a list of IP addresses and MAC address in the form: * arpspoof_detect_host: 10.10.10.10 29:a2:9a:29:a2:9a diff --git a/src/network_inspectors/normalize/norm.cc b/src/network_inspectors/normalize/norm.cc index 465c44e17..2f0d4358e 100644 --- a/src/network_inspectors/normalize/norm.cc +++ b/src/network_inspectors/normalize/norm.cc @@ -72,7 +72,7 @@ const PegInfo norm_names[] = { "icmp6_echo", "icmp6 echo normalizations" }, { "tcp_syn_options", "SYN only options cleared from non-SYN packets" }, { "tcp_options", "packets with options cleared" }, - { "tcp_paddding", "packets with padding cleared" }, + { "tcp_padding", "packets with padding cleared" }, { "tcp_reserved", "packets with reserved bits cleared" }, { "tcp_nonce", "packets with nonce bit cleared" }, { "tcp_urgent_ptr", "packets without data with urgent pointer cleared" }, @@ -338,7 +338,7 @@ static int Norm_ICMP6( //----------------------------------------------------------------------- // we assume here that the decoder has not pushed ip6 option extension -// headers unless the basic sizing is correct (size = N*8 octetes, N>0). +// headers unless the basic sizing is correct (size = N*8 octets, N>0). struct ExtOpt { diff --git a/src/network_inspectors/packet_capture/packet_capture.cc b/src/network_inspectors/packet_capture/packet_capture.cc index dc264e5a3..ff981f2bc 100644 --- a/src/network_inspectors/packet_capture/packet_capture.cc +++ b/src/network_inspectors/packet_capture/packet_capture.cc @@ -16,7 +16,7 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -// packet_cpture.cc author Carter Waxman +// packet_capture.cc author Carter Waxman #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/src/network_inspectors/perf_monitor/perf_tracker.h b/src/network_inspectors/perf_monitor/perf_tracker.h index 67b41bd7f..12713fc65 100644 --- a/src/network_inspectors/perf_monitor/perf_tracker.h +++ b/src/network_inspectors/perf_monitor/perf_tracker.h @@ -23,13 +23,13 @@ // // This class defines the data gathering layer of perfmon. PerfMonitor will -// create an instance of each configued class for each packet processing +// create an instance of each configured class for each packet processing // thread. Subclasses of PerfTrackers should implement or call the following // methods, leaving the others for internal use by PerfMonitor: // // reset() - perform initialization after the output handle has been opened. // -// update(Packet*) - update statistics basied on the current packet. +// update(Packet*) - update statistics based on the current packet. // // process(bool) - summarize data and report. This is called after the // reporting thresholds have been reached. diff --git a/src/network_inspectors/port_scan/ipobj.cc b/src/network_inspectors/port_scan/ipobj.cc index 78c8e9160..22af1f572 100644 --- a/src/network_inspectors/port_scan/ipobj.cc +++ b/src/network_inspectors/port_scan/ipobj.cc @@ -48,7 +48,7 @@ These can all be handled via the CIDR block notation : IP/MaskBits We use collections (lists) of cidr blocks to represent address blocks - and indivdual addresses. + and individual addresses. For a single IPAddress the implied Mask is 32 bits,or 255.255.255.255, or 0xffffffff, or -1. diff --git a/src/network_inspectors/port_scan/ipobj.h b/src/network_inspectors/port_scan/ipobj.h index b99873b79..46467eeb8 100644 --- a/src/network_inspectors/port_scan/ipobj.h +++ b/src/network_inspectors/port_scan/ipobj.h @@ -68,7 +68,7 @@ struct IPSET These can all be handled via the CIDR block notation : IP/MaskBits We use collections (lists) of cidr blocks to represent address blocks - and indivdual addresses. + and individual addresses. For a single IPAddress the implied Mask is 32 bits,or 255.255.255.255, or 0xffffffff, or -1. diff --git a/src/network_inspectors/port_scan/port_scan.cc b/src/network_inspectors/port_scan/port_scan.cc index 52fb246a6..949d2dc3f 100644 --- a/src/network_inspectors/port_scan/port_scan.cc +++ b/src/network_inspectors/port_scan/port_scan.cc @@ -398,7 +398,7 @@ static int MakePortscanPkt(PS_PKT* ps_pkt, PS_PROTO* proto, int proto_type, */ PacketManager::encode_update(g_tmp_pkt); - // FIXIT-L IP4 is gauranteed to have been set in update(). Is IP6() also gauranteed? + // FIXIT-L IP4 is guaranteed to have been set in update(). Is IP6() also guaranteed? if (g_tmp_pkt->ptrs.ip_api.is_ip6()) ((ip::IP6Hdr*)g_tmp_pkt->ptrs.ip_api.get_ip6h())->set_len((uint16_t)ip_size); @@ -911,7 +911,7 @@ void PortScan::eval(Packet* p) memset(&ps_pkt, 0x00, sizeof(PS_PKT)); // FIXIT-P don't zap unless necessary ps_pkt.pkt = (void*)p; - /* See if there is already an exisiting node in the hash table */ + /* See if there is already an existing node in the hash table */ ps_detect(&ps_pkt); if (ps_pkt.scanner && ps_pkt.scanner->proto.alerts && diff --git a/src/network_inspectors/port_scan/ps_detect.cc b/src/network_inspectors/port_scan/ps_detect.cc index 7ce61660f..95f0c1a92 100644 --- a/src/network_inspectors/port_scan/ps_detect.cc +++ b/src/network_inspectors/port_scan/ps_detect.cc @@ -835,7 +835,7 @@ int PortScan::ps_tracker_update_tcp(PS_PKT* ps_pkt, PS_TRACKER* scanner, } } /* - ** We only get here on the server's response to the intial + ** We only get here on the server's response to the initial ** client connection. ** ** That's why we use the sp, because that's the port that is @@ -1070,7 +1070,7 @@ int PortScan::ps_tracker_update_icmp( ** ps_tracker_update:: */ /** -** At this point, we should only be looking at tranport protocols +** At this point, we should only be looking at transport protocols ** that we want to. For instance, if we aren't doing UDP portscans ** then we won't see UDP packets here because they were ignored. ** diff --git a/src/packet_io/sfdaq.cc b/src/packet_io/sfdaq.cc index 7817099df..41a775083 100644 --- a/src/packet_io/sfdaq.cc +++ b/src/packet_io/sfdaq.cc @@ -544,7 +544,8 @@ int SFDAQInstance::modify_flow_opaque(const DAQ_PktHdr_t* hdr, uint32_t opaque) return daq_modify_flow(daq_mod, daq_hand, hdr, &mod); } -// FIXIT-L X Add Snort flag defitions for callers to use and translate/pass them through to the DAQ module +// FIXIT-L X Add Snort flag definitions for callers to use and translate/pass them through to +// the DAQ module int SFDAQInstance::add_expected(const Packet* ctrlPkt, const SfIp* cliIP, uint16_t cliPort, const SfIp* srvIP, uint16_t srvPort, IpProtocol protocol, unsigned timeout_ms, unsigned /* flags */) { diff --git a/src/packet_io/trough.h b/src/packet_io/trough.h index a74684da3..93757fdaf 100644 --- a/src/packet_io/trough.h +++ b/src/packet_io/trough.h @@ -32,7 +32,7 @@ public: { SOURCE_FILE_LIST, // a file containing a list of sources SOURCE_LIST, // a list of sources (eg from cmd line) - SOURCE_DIR // a directory of sources; often used wiht filter + SOURCE_DIR // a directory of sources; often used with filter }; static void set_loop_count(long int c) diff --git a/src/parser/config_file.cc b/src/parser/config_file.cc index cd323f53e..acbef1723 100644 --- a/src/parser/config_file.cc +++ b/src/parser/config_file.cc @@ -189,7 +189,7 @@ void SetSnortConfDir(const char* file) { const char* path_sep = strrchr(file, '/'); - /* is there a directory seperator in the filename */ + /* is there a directory separator in the filename */ if (path_sep != NULL) { path_sep++; /* include path separator */ diff --git a/src/parser/mstring.cc b/src/parser/mstring.cc index 0836882b7..1be111f91 100644 --- a/src/parser/mstring.cc +++ b/src/parser/mstring.cc @@ -38,7 +38,7 @@ static char* mSplitAddTok(const char*, const int, const char*, const char); * char * * The string to be split * char * - * A string of token seperaters + * A string of token separators * int * The maximum number of tokens to be returned. A value * of 0 means to get them all. @@ -46,7 +46,7 @@ static char* mSplitAddTok(const char*, const int, const char*, const char); * Place to store the number of tokens returned * char * The "escape metacharacter", treat the character after - * this character as a literal and "escape" a seperator. + * this character as a literal and "escape" a separator. * * Note if max_toks is reached, the last tok in the returned * token array will possibly have separator characters in it. @@ -287,7 +287,7 @@ char** mSplit(const char* str, const char* sep_chars, const int max_toks, } /* Last character was not a separator character so we've got - * one more tok. Unescape escaped sepatator charactors */ + * one more tok. Unescape escaped separator characters */ if (toks != toks_alloc) { retstr = (char**)snort_calloc(cur_tok + 1, sizeof(char*)); diff --git a/src/parser/parse_ports.cc b/src/parser/parse_ports.cc index ea6fcc47f..b136942c2 100644 --- a/src/parser/parse_ports.cc +++ b/src/parser/parse_ports.cc @@ -596,9 +596,7 @@ const char* PortObjectParseError(POParser* pop) { case POPERR_NO_NAME: return "no name"; case POPERR_NO_ENDLIST_BRACKET: return "no end of list bracket." - " Elements must be comma seperated," - " and no spaces may appear between" - " brackets."; + " Elements must be comma separated, and no spaces may appear between brackets."; case POPERR_NOT_A_NUMBER: return "not a number"; case POPERR_EXTRA_BRACKET: return "extra list bracket"; case POPERR_NO_DATA: return "no data"; diff --git a/src/parser/parse_rule.cc b/src/parser/parse_rule.cc index 39244e9a0..0934b3e92 100644 --- a/src/parser/parse_rule.cc +++ b/src/parser/parse_rule.cc @@ -537,7 +537,7 @@ static PortObject* ParsePortListTcpUdpPort( { DebugFormat(DEBUG_PORTLISTS, "parser.c: already have '%s' as a PortObject - " - "calling PortObjectFree(portbject) line=%d\n",port_str,__LINE__); + "calling PortObjectFree(portobject) line=%d\n",port_str,__LINE__); PortObjectFree(portobject); portobject = pox; } @@ -599,7 +599,7 @@ static int ParsePortList( DebugFormat(DEBUG_PORTLISTS,"Rule-PortVar Parsed: %s \n",port_str); /* !ports - port lists can be mixed 80:90,!82, - * so the old NOT flag is depracated for port lists + * so the old NOT flag is deprecated for port lists */ /* set up any any flags */ @@ -1220,9 +1220,9 @@ const char* parse_rule_close(SnortConfig* sc, RuleTreeNode& rtn, OptTreeNode* ot } } - /* The IPs in the test node get free'd in ProcessHeadNode if there is - * already a matching RTN. The portobjects will get free'd when the - * port var table is free'd */ + /* The IPs in the test node get freed in ProcessHeadNode if there is + * already a matching RTN. The portobjects will get freed when the + * port var table is freed */ RuleTreeNode* new_rtn = ProcessHeadNode(sc, &rtn, rtn.listhead); addRtnToOtn(otn, new_rtn); @@ -1237,7 +1237,7 @@ const char* parse_rule_close(SnortConfig* sc, RuleTreeNode& rtn, OptTreeNode* ot if ( mergeDuplicateOtn(sc, otn_dup, otn, new_rtn) ) { /* We are keeping the old/dup OTN and trashing the new one - * we just created - it's free'd in the remove dup function */ + * we just created - it's freed in the remove dup function */ return nullptr; } } diff --git a/src/parser/parser.cc b/src/parser/parser.cc index 302019020..133184bfe 100644 --- a/src/parser/parser.cc +++ b/src/parser/parser.cc @@ -112,7 +112,7 @@ static void FreeRuleTreeNodes(SnortConfig* sc) otn = (OptTreeNode*)hashNode->data; /* Autogenerated OTNs along with their respective pseudo RTN - * will get cleaned up when the OTN is free'd */ + * will get cleaned up when the OTN is freed */ if (otn->generated) continue; @@ -674,7 +674,7 @@ void PrintRuleOrder(RuleListNode* rule_lists) * * Function: OrderRuleLists * - * Purpose: Orders the rule lists into the specefied order. + * Purpose: Orders the rule lists into the specified order. * * Returns: void function * diff --git a/src/parser/vars.cc b/src/parser/vars.cc index d316ae599..fd1124ed7 100644 --- a/src/parser/vars.cc +++ b/src/parser/vars.cc @@ -351,7 +351,7 @@ int VarIsIpList(vartable_t* ip_vartable, const char* value) * * Purpose: ParseErrors if the a variable name is redefined across variable * types. Enforcing this mutual exclusion prevents the - * catatrophe where the variable lookup fall-through (see VarSearch) + * catastrophe where the variable lookup fall-through (see VarSearch) * finds an unintended variable from the wrong table. Note: VarSearch * is only necessary for ExpandVars. * @@ -477,7 +477,7 @@ VarEntry* VarDefine( /* Verify a variable by this name is not already used as either a * portvar or regular var. Enforcing this mutual exclusion prevents the - * catatrophe where the variable lookup fall-through (see VarSearch) + * catastrophe where the variable lookup fall-through (see VarSearch) * finds an unintended variable from the wrong table. Note: VarSearch * is only necessary for ExpandVars. */ DisallowCrossTableDuplicateVars(sc, name, VAR_TYPE__IPVAR); @@ -698,7 +698,7 @@ const char* VarGet(SnortConfig*, const char* name) sfip_var_t* var; // XXX-IPv6 This function should never be used if IP6 support is enabled! -// Infact it won't presently even work for IP variables since the raw ASCII +// In fact it won't presently even work for IP variables since the raw ASCII // value is never stored, and is never meant to be used. if ((var = sfvt_lookup_var(ip_vartable, name)) == NULL) @@ -885,7 +885,7 @@ const char* ExpandVars(SnortConfig* sc, const char* string) void AddVarToTable(SnortConfig* sc, const char* name, const char* value) { - //TODO: snort.cfg and rules should use PortVar instead ...this allows compatability for now. + //TODO: snort.cfg and rules should use PortVar instead ...this allows compatibility for now. if (strstr(name, "_PORT") || strstr(name, "PORT_")) { DebugMessage(DEBUG_CONFIGRULES,"PortVar\n"); diff --git a/src/piglet_plugins/pp_codec_iface.cc b/src/piglet_plugins/pp_codec_iface.cc index ff5cbcdd5..bb476409f 100644 --- a/src/piglet_plugins/pp_codec_iface.cc +++ b/src/piglet_plugins/pp_codec_iface.cc @@ -171,7 +171,7 @@ static const luaL_Reg methods[] = { Lua::Args args(L); - // FIXIT-M this hacky arg offset stuff is for backwards compatibilty + // FIXIT-M this hacky arg offset stuff is for backwards compatibility // it will be removed in later updates int off = 0; diff --git a/src/piglet_plugins/pp_raw_buffer_iface.cc b/src/piglet_plugins/pp_raw_buffer_iface.cc index 6dbf58673..84539c2ce 100644 --- a/src/piglet_plugins/pp_raw_buffer_iface.cc +++ b/src/piglet_plugins/pp_raw_buffer_iface.cc @@ -27,7 +27,7 @@ // FIXIT-H a lot of users keep references to this data. Need to prevent // Lua's garbage collection from destroying RawBuffer while other C++ types -// are using the data (unbeknowest to Lua). Add a container data type +// are using the data (unbeknownst to Lua). Add a container data type // which hold ref counts to RawBuffer and only frees when the ref count is // zero. diff --git a/src/ports/port_table.cc b/src/ports/port_table.cc index d403f9d34..4e49da581 100644 --- a/src/ports/port_table.cc +++ b/src/ports/port_table.cc @@ -207,7 +207,7 @@ static unsigned PortObject_hash(SFHASHFCN* p, unsigned char* d, int) * 1) check if it's in the plx table-mhashx, this uses the list of * addresses of the Input PortObjects as it's key, not the ports. * This is quick and does not require assembling/merging the port - * objects intoa PortObject2 1st. + * objects into a PortObject2 1st. * 2) if found were done, otherwise * 3) make a merged PortObject2 * 4) Try adding the PortObject2 to it's table - mhash @@ -219,7 +219,7 @@ static unsigned PortObject_hash(SFHASHFCN* p, unsigned char* d, int) * 5) Create a plx object * 6) Add the plx object to the plx Table * 1) if it's already in the object - fail this contradicts 1) - * 7) return the create PortObject2, or the one retrived from the + * 7) return the create PortObject2, or the one retrieved from the * PortObject table. * * pol - list of input PortObject pointers @@ -984,7 +984,7 @@ void PortTablePrintInput(PortTable* p) /* Prints the original (normalized) PortGroups and - as sepcified by the user + as specified by the user */ void PortTablePrintUserRules(PortTable* p) { diff --git a/src/protocols/icmp4.h b/src/protocols/icmp4.h index b4340d41e..ce89e7cc8 100644 --- a/src/protocols/icmp4.h +++ b/src/protocols/icmp4.h @@ -28,7 +28,7 @@ namespace icmp constexpr uint32_t ICMP_BASE_LEN = 4; constexpr uint8_t ICMP_UNREACH_DATA_LEN = 8; -// do NOT add 'ICMP_' to the begining of these const because they +// do NOT add 'ICMP_' to the beginning of these const because they // will overlap with dnet macros //enum class IcmpType : std::uint8_t { @@ -73,7 +73,7 @@ enum IcmpCode : std::uint8_t PREC_VIOLATION = 14, PREC_CUTOFF = 15, - /* Code for ICMP Source Quence (4) */ + /* Code for ICMP Source Quench (4) */ SOURCE_QUENCH_CODE = 0, /* Codes for an ICMP Redirect (5) */ @@ -85,7 +85,7 @@ enum IcmpCode : std::uint8_t /* Codes for ICMP Echo (8) */ ECHO_CODE = 0, - /* Codes for ICMP time excceeded (11) */ + /* Codes for ICMP time exceeded (11) */ TIMEOUT_TRANSIT = 0, TIMEOUT_REASSY = 1, diff --git a/src/protocols/ipv4.h b/src/protocols/ipv4.h index 988c5e1ac..03e6d9031 100644 --- a/src/protocols/ipv4.h +++ b/src/protocols/ipv4.h @@ -39,7 +39,7 @@ constexpr uint8_t IP4_MULTICAST = 0x0E; // ms nibble constexpr uint8_t IP4_RESERVED = 0x0F; // ms nibble constexpr uint8_t IP4_LOOPBACK = 0x7F; // msb -// This must be a standard layour struct! +// This must be a standard layer struct! struct IP4Hdr { uint8_t ip_verhl; /* version & header length */ diff --git a/src/protocols/ipv4_options.h b/src/protocols/ipv4_options.h index 2e37797b3..15cc0057c 100644 --- a/src/protocols/ipv4_options.h +++ b/src/protocols/ipv4_options.h @@ -76,8 +76,8 @@ struct IpOptions }; /* - * relly creative name ... right - * Use IpOptionIter ... this is the placehold + * really creative name ... right + * Use IpOptionIter ... this is the placeholder */ class SO_PUBLIC IpOptionIteratorIter { @@ -90,7 +90,7 @@ public: bool operator!=(const IpOptionIteratorIter& rhs) { return opt != rhs.opt; } - // I'd suggest just using IpOptionIterator and completley ignoring this + // I'd suggest just using IpOptionIterator and completely ignoring this // horror of a ++ operation. IpOptionIteratorIter& operator++() { @@ -105,7 +105,7 @@ private: }; /* - * relly creative name ... right + * really creative name ... right * Use IP ranged for loop rather than calling this directly. * i.e., * IpOptionIter iter(ip4h, p) @@ -126,7 +126,7 @@ public: /* If you already know the validated option length (for instance, * if you are in a decode() method), then call this constructor. * You MUST validate the a;; ip_options within len before - * using this constuctor*/ + * using this constructor*/ IpOptionIterator(const IP4Hdr* const, const uint8_t valid_hdr_len); IpOptionIteratorIter begin() const; IpOptionIteratorIter end() const; diff --git a/src/protocols/ipv6.h b/src/protocols/ipv6.h index 451e29f4f..93b98b4e3 100644 --- a/src/protocols/ipv6.h +++ b/src/protocols/ipv6.h @@ -88,7 +88,7 @@ struct IP6Hdr inline uint32_t flow() const { return (uint16_t)((ntohl(ip6_vtf) & 0x000FFFFF) >> 20); } - // becaise Snort expects this in terms of 32 bit words. + // because Snort expects this in terms of 32 bit words. inline uint8_t hlen() const { return IP6_HEADER_LEN; } @@ -223,7 +223,7 @@ struct IP6Frag { return ip6f_ident; } }; -// Reflects the recomended IPv6 order in RFC 2460 4.1 +// Reflects the recommended IPv6 order in RFC 2460 4.1 constexpr int IPV6_ORDER_MAX = 7; inline int IPV6IdExtensionOrder(const ProtocolId prot_id) { diff --git a/src/protocols/layer.cc b/src/protocols/layer.cc index 9349ef962..d463f7550 100644 --- a/src/protocols/layer.cc +++ b/src/protocols/layer.cc @@ -220,7 +220,7 @@ const udp::UDPHdr* get_outer_udp_lyr(const Packet* const p) const uint8_t* get_root_layer(const Packet* const p) { - // since token ring is the grinder, its the begining of the packet. + // since token ring is the grinder, its the beginning of the packet. if (p->num_layers > 0) return p->layers[0].start; return nullptr; diff --git a/src/protocols/layer.h b/src/protocols/layer.h index 34691fcb4..d25543484 100644 --- a/src/protocols/layer.h +++ b/src/protocols/layer.h @@ -30,7 +30,7 @@ struct Layer uint16_t length; }; -// forward declaring relevent structs. Since we're only return a pointer, +// forward declaring relevant structs. Since we're only return a pointer, // there is no need for the actual header files namespace vlan @@ -140,7 +140,7 @@ SO_PUBLIC const icmp::ICMPHdr* get_icmp_embed_icmp(const ip::IpApi&); * layer refer to packet get_next_ip_proto() * for more information. * int8_t curr_layer = the current, zero based layer from which to - * start searching inward. After the function returs, + * start searching inward. After the function returns, * This field will be set to the layer before * the Ip Api. If no IP layer is found, * it will be set to -1. @@ -151,7 +151,7 @@ SO_PUBLIC const icmp::ICMPHdr* get_icmp_embed_icmp(const ip::IpApi&); * false: if the api has NOT been set * * NOTE: curr_layer is zero based. That means to get all of the ip - * layers (starting from teh innermost layer), during the first call + * layers (starting from the innermost layer), during the first call * 'curr_layer == p->num_layers'. * * NOTE: This functions is extremely useful in a loop diff --git a/src/protocols/packet.h b/src/protocols/packet.h index 91868434b..b9f837820 100644 --- a/src/protocols/packet.h +++ b/src/protocols/packet.h @@ -44,7 +44,7 @@ #define PKT_PDU_TAIL 0x00000200 /* end of PDU */ #define PKT_HTTP_DECODE 0x00000400 /* this packet has normalized http */ -#define PKT_ALLOW_MULTIPLE_DETECT 0x00000800 /* packet has either pipelined mime attachements +#define PKT_ALLOW_MULTIPLE_DETECT 0x00000800 /* packet has either pipelined mime attachments or pipeline http requests */ #define PKT_PAYLOAD_OBFUSCATE 0x00001000 diff --git a/src/protocols/packet_manager.cc b/src/protocols/packet_manager.cc index 84e0d4e59..790646803 100644 --- a/src/protocols/packet_manager.cc +++ b/src/protocols/packet_manager.cc @@ -733,7 +733,7 @@ int PacketManager::encode_format( pkth->pktlen = len; pkth->ts = p->pkth->ts; - layer::set_packet_pointer(c); // set layer pointer to ensure lookin at the new packet + layer::set_packet_pointer(c); // set layer pointer to ensure looking at the new packet total_rebuilt_pkts++; // update local counter return 0; } diff --git a/src/protocols/packet_manager.h b/src/protocols/packet_manager.h index e40f23510..31088cd02 100644 --- a/src/protocols/packet_manager.h +++ b/src/protocols/packet_manager.h @@ -54,7 +54,7 @@ enum class UnreachResponse class SO_PUBLIC PacketManager { public: - // decode this packet and set all relevent packet fields. + // decode this packet and set all relevant packet fields. static void decode(Packet*, const struct _daq_pkthdr*, const uint8_t*, bool cooked = false); // when encoding, rather than copy the destination MAC address from the @@ -129,7 +129,7 @@ public: /* Accessor functions -- any object in Snort++ can now convert a * protocol to its mapped value. * - * The equivelant of Snort's PROTO_ID */ + * The equivalent of Snort's PROTO_ID */ static constexpr std::size_t max_protocols() // compile time constant { return CodecManager::s_protocols.size(); } diff --git a/src/protocols/protocol_ids.h b/src/protocols/protocol_ids.h index f56d662dd..c1e2ba072 100644 --- a/src/protocols/protocol_ids.h +++ b/src/protocols/protocol_ids.h @@ -120,7 +120,7 @@ enum class ProtocolId : std::uint16_t /* * Undefined Protocols! */ - FINISHED_DECODE = 0x0100, // Indicates Codecs have succesfully decoded packet + FINISHED_DECODE = 0x0100, // Indicates Codecs have successfully decoded packet TEREDO = 0x0101, GTP = 0x0102, IP_EMBEDDED_IN_ICMP4 = 0x0103, diff --git a/src/protocols/ssl.cc b/src/protocols/ssl.cc index 11c013378..b83beb7a9 100644 --- a/src/protocols/ssl.cc +++ b/src/protocols/ssl.cc @@ -526,7 +526,7 @@ uint32_t SSL_decode( if (pkt[9] == 3) { /* Saw a TLS version, but this could also be an SSHv2 length. - * If it is, check if a hypothetical TLS record-data length agress + * If it is, check if a hypothetical TLS record-data length agrees * with its record length */ datalen = THREE_BYTE_LEN( (pkt+6) ); @@ -545,7 +545,7 @@ uint32_t SSL_decode( else if (size >= 8 && pkt[7] == 2) { /* A version of '2' at byte 7 overlaps with TLS record-data length. - * Check if a hypothetical TLS record-data length agress with its + * Check if a hypothetical TLS record-data length agrees with its * record length */ datalen = THREE_BYTE_LEN( (pkt+6) ); diff --git a/src/protocols/tcp_options.cc b/src/protocols/tcp_options.cc index 71169b19c..f9b14b5b2 100644 --- a/src/protocols/tcp_options.cc +++ b/src/protocols/tcp_options.cc @@ -45,7 +45,7 @@ TcpOptIterator::TcpOptIterator(const TCPHdr* const tcp_header, const Packet* con { if (p->layers[i].start == (const uint8_t*)tcp_header) { - // Can't use the tph_header->hlen() becuase the entire may + // Can't use the tph_header->hlen() because the entire may // be an EOF or invalid options. However, this layers length // has been valid by the codecs. end_ptr = (hdr + p->layers[i].length); diff --git a/src/protocols/tcp_options.h b/src/protocols/tcp_options.h index 2f2fcd278..9210c084b 100644 --- a/src/protocols/tcp_options.h +++ b/src/protocols/tcp_options.h @@ -83,7 +83,7 @@ const uint8_t TCPOLEN_TIMESTAMP = 10; /* Timestamp [RFC1323], 10 bytes */ const uint8_t TCPOLEN_PARTIAL_PERM = 2; /* Partial Order Permitted/ Experimental [RFC1693] */ const uint8_t TCPOLEN_PARTIAL_SVC = 3; /* 3 bytes long -- Experimental - [RFC1693] */ -/* atleast decode T/TCP options... */ +/* at least decode T/TCP options... */ const uint8_t TCPOLEN_CC = 6; /* page 17 of rfc1644 */ const uint8_t TCPOLEN_CC_NEW = 6; /* page 17 of rfc1644 */ const uint8_t TCPOLEN_CC_ECHO = 6; /* page 17 of rfc1644 */ diff --git a/src/protocols/wlan.h b/src/protocols/wlan.h index 0d05d0fc8..6b879d6c3 100644 --- a/src/protocols/wlan.h +++ b/src/protocols/wlan.h @@ -38,7 +38,7 @@ struct WifiHdr uint8_t addr4[6]; }; -/* Frame type/subype combinations with version = 0 +/* Frame type/subtype combinations with version = 0 ** FRAME TYPE ***** HEX **** SUBTYPE TYPE DESCRIPT ********/ #define WLAN_TYPE_MGMT_ASREQ 0x0 /* 0000 00 Association Req */ #define WLAN_TYPE_MGMT_ASRES 0x10 /* 0001 00 Assocaition Res */ @@ -54,7 +54,7 @@ struct WifiHdr #define WLAN_TYPE_CONT_PS 0xa4 /* 1010 01 Power Save */ #define WLAN_TYPE_CONT_RTS 0xb4 /* 1011 01 Request to send */ -#define WLAN_TYPE_CONT_CTS 0xc4 /* 1100 01 Clear to sene */ +#define WLAN_TYPE_CONT_CTS 0xc4 /* 1100 01 Clear to send */ #define WLAN_TYPE_CONT_ACK 0xd4 /* 1101 01 Acknowledgement */ #define WLAN_TYPE_CONT_CFE 0xe4 /* 1110 01 Cont. Free end */ #define WLAN_TYPE_CONT_CFACK 0xf4 /* 1111 01 CF-End + CF-Ack */ diff --git a/src/search_engines/acsmx.cc b/src/search_engines/acsmx.cc index b202a60a3..5119a3111 100644 --- a/src/search_engines/acsmx.cc +++ b/src/search_engines/acsmx.cc @@ -25,7 +25,7 @@ ** ** Reference - Efficient String matching: An Aid to Bibliographic Search ** Alfred V Aho and Margaret J Corasick -** Bell Labratories +** Bell Laboratories ** Copyright (C) 1975 Association for Computing Machinery,Inc ** ** Implemented from the 4 algorithms in the paper by Aho & Corasick @@ -36,7 +36,7 @@ ** 2) This algorithm finds all occurrences of all patterns within a ** body of text. ** 3) Support is included to handle upper and lower case matching. -** 4) Some comopilers optimize the search routine well, others don't, this makes all the difference. +** 4) Some compilers optimize the search routine well, others don't, this makes all the difference. ** 5) Aho inspects all bytes of the search text, but only once so it's very efficient, ** if the patterns are all large than the Modified Wu-Manbar method is often faster. ** 6) I don't subscribe to any one method is best for all searching needs, @@ -219,7 +219,7 @@ static void Build_NFA(ACSM_STRUCT* acsm) acsm->acsmStateTable[s].FailState = next; /* - * Copy 'next'states MatchList to 's' states MatchList, + * Copy 'next' states MatchList to 's' states MatchList, * we copy them so each list can be AC_FREE'd later, * else we could just manipulate pointers to fake the copy. */ diff --git a/src/search_engines/acsmx2.cc b/src/search_engines/acsmx2.cc index 47f3e638f..799d22bab 100644 --- a/src/search_engines/acsmx2.cc +++ b/src/search_engines/acsmx2.cc @@ -30,7 +30,7 @@ ** ** Reference - Efficient String matching: An Aid to Bibliographic Search ** Alfred V Aho and Margaret J Corasick -** Bell Labratories +** Bell Laboratories ** Copyright (C) 1975 Association for Computing Machinery,Inc ** ** +++ @@ -54,7 +54,7 @@ ** only use 1/4 of what we use to. The caching performance is better in ** pure benchmarking tests, but does not show overall improvement in Snort. ** Unfortunately, once a pattern match test has been performed Snort moves -** on to doing many other things before we get back to a patteren match test, +** on to doing many other things before we get back to a pattern match test, ** so the cache is voided. ** ** This versions has better caching performance characteristics, reduced @@ -89,7 +89,7 @@ ** You can use any of the 4 storage modes above -full, sparse, banded, ** sparse-bands, set the structure directly. ** For applications where you have lots of data and a pattern set to -** search, this version was up to 3x faster than the previous verion, due +** search, this version was up to 3x faster than the previous version, due ** to caching performance. This cannot be fully realized in Snort yet, ** but other applications may have better caching opportunities. ** Snort only needs to use the banded or full storage. @@ -651,7 +651,7 @@ static void Build_NFA(ACSM_STRUCT2* acsm) FailState[s] = next; /* - * Copy 'next'states MatchList to 's' states MatchList, + * Copy 'next' states MatchList to 's' states MatchList, * we copy them so each list can be AC_FREE'd later, * else we could just manipulate pointers to fake the copy. */ @@ -777,7 +777,7 @@ static int Conv_List_To_Full(ACSM_STRUCT2* acsm) * 1-1 fmt(0-full,1-sparse,2-banded,3-sparsebands) * 2-2 bool match flag (indicates this state has pattern matches) * 3-3 sparse state count ( # of input/next-state pairs ) -* 4-3+2*cnt 'input,next-state' pairs... each sizof(acstate_t) +* 4-3+2*cnt 'input,next-state' pairs... each sizeof(acstate_t) * * above example case yields: * Full Format: 0, 1 7 0 0 0 3 0 0 0 0 0 0 0 0 0 0 ... @@ -1183,7 +1183,7 @@ static inline int _acsmCompile2(ACSM_STRUCT2* acsm) ACSM2_MEMORY_TYPE__TRANSTABLE); MEMASSERT(acsm->acsmTransTable, "_acsmCompile2"); - /* Alloc a MatchList table - this has a lis tof pattern matches for each state, if any */ + /* Alloc a MatchList table - this has a list of pattern matches for each state, if any */ acsm->acsmMatchList = (ACSM_PATTERN2**)AC_MALLOC(sizeof(ACSM_PATTERN2*) * acsm->acsmMaxStates, ACSM2_MEMORY_TYPE__MATCHLIST); @@ -2062,7 +2062,7 @@ int acsmPrintDetailInfo2(ACSM_STRUCT2* acsm) } /* - * Global sumary of all info and all state machines built during this run + * Global summary of all info and all state machines built during this run * This feeds off of the last pattern groupd built within snort, * all groups use the same format, state size, etc.. * Combined with accrued stats, we get an average picture of things. diff --git a/src/search_engines/acsmx2.h b/src/search_engines/acsmx2.h index 1c247feb9..db97049c5 100644 --- a/src/search_engines/acsmx2.h +++ b/src/search_engines/acsmx2.h @@ -92,7 +92,7 @@ enum }; /* -* Aho-Corasick State Machine Struct - one per group of pattterns +* Aho-Corasick State Machine Struct - one per group of patterns */ struct ACSM_STRUCT2 { diff --git a/src/search_engines/bnfa_search.cc b/src/search_engines/bnfa_search.cc index d9e9ed6b0..148b5555c 100644 --- a/src/search_engines/bnfa_search.cc +++ b/src/search_engines/bnfa_search.cc @@ -50,7 +50,7 @@ ** word 3+ : transition word = input<<24 | next-state-index ** input : 8 bit character, input to state machine from search text ** next-state-index: 24 bits for index of next state -** (if we reallly need 16M states, we can add a state->index lookup array) +** (if we really need 16M states, we can add a state->index lookup array) ** ...repeat for each state ... ** ** * if a state is empty it has words 1 and 2, but no transition words. @@ -82,7 +82,7 @@ ** a binary search if there are more than 5 elements in the state to test for ** a match. This allows us to use a simple sparse memory design with an ** acceptable worst case search scenario. The binary search over 256 elements -** is limtied to a max of 8 tests. The zero'th state may use a full 256 state +** is limited to a max of 8 tests. The zero'th state may use a full 256 state ** array, so a quick index lookup provides the next state transition. The ** zero'th state is generally visited much more than other states. ** @@ -99,7 +99,7 @@ ** instruction pipelining. Aren't we all. To this end, the number of ** patterns, length of search text, and cpu cache L1,L2,L3 all affect ** performance. The relative performance of the sparse and full format NFA and -** DFA varies as you vary the pattern charactersitics,and search text length, +** DFA varies as you vary the pattern characteristics, and search text length, ** but strong performance trends are present and stable. ** ** @@ -116,14 +116,14 @@ ** ** Reference - Efficient String matching: An Aid to Bibliographic Search ** Alfred V Aho and Margaret J Corasick -** Bell Labratories +** Bell Laboratories ** Copyright (C) 1975 Association for Computing Machinery,Inc ** ** 12/4/06 - man - modified summary ** 6/26/07 - man - Added last_match tracking, and accounted for nocase/case by -** preseting the last match state, and reverting if we fail the +** presetting the last match state, and reverting if we fail the ** case memcmp test for any rule in the states matching rule -** list. The states in the defaul matcher represent either +** list. The states in the default matcher represent either ** case or nocase states, so they are dual mode, that makes ** this a bit tricky. When we sue the pure exact match, or ** pure don't care matching routines, we just track the last @@ -132,7 +132,7 @@ ** 01/2008 - man - added 2 phase pattern matcher using a pattern match queue. ** Text is scanned and matching states are queued, duplicate ** matches are dropped, and after the complete buffer scan the -** queued matches are processed. This improves cacheing +** queued matches are processed. This improves caching ** performance, and reduces duplicate rule processing. The ** queue is limited in size and is flushed if it becomes full ** during the scan. This allows simple insertions. Tracking @@ -650,7 +650,7 @@ static int KcontainsJ(bnfa_trans_node_t* tk, bnfa_trans_node_t* tj) bnfa_state_t full[BNFA_MAX_ALPHABET_SIZE]; if ( !_bnfa_conv_node_to_full(tk,full) ) - return 1; /* emtpy state */ + return 1; /* empty state */ while ( tj ) { @@ -758,7 +758,7 @@ static int _bnfa_build_nfa(bnfa_struct_t* bnfa) FailState[s] = next; /* - * Copy 'next'states MatchList into 's' states MatchList, + * Copy 'next' states MatchList into 's' states MatchList, * we just create a new list nodes, the patterns are not copied. */ for ( mlist = MatchList[next]; mlist; mlist = mlist->next) @@ -789,7 +789,7 @@ static int _bnfa_build_nfa(bnfa_struct_t* bnfa) #ifdef ALLOW_NFA_FULL /* -* Conver state machine to full format +* Convert state machine to full format */ static int _bnfa_conv_list_to_full(bnfa_struct_t* bnfa) { @@ -826,7 +826,7 @@ static int _bnfa_conv_list_to_full(bnfa_struct_t* bnfa) * The transition and failure states are replaced with the start index of * transition state, this eliminates the NextState[] lookup.... * -* The compaction of multiple arays into a single array reduces the total +* The compaction of multiple arrays into a single array reduces the total * number of states that can be handled since the max index is 2^24-1, * whereas without compaction we had 2^24-1 states. */ @@ -917,7 +917,7 @@ static int _bnfa_conv_list_to_csparse_array(bnfa_struct_t* bnfa) ps_index++; /* skip past state word */ - /* conver state 'k' to full format */ + /* convert state 'k' to full format */ _bnfa_list_conv_row_to_full(bnfa, (bnfa_state_t)k, full); /* count transitions */ @@ -2135,8 +2135,8 @@ void bnfaAccumInfo(bnfa_struct_t* p) * sindex - state tracker, set value to zero to reset the state machine, * zero should be the value passed in on the 1st buffer or each buffer * that is to be analyzed on its own, the state machine updates this -* during searches. This allows for sequential buffer searchs without -* reseting the state machine. Save this value as returned from the +* during searches. This allows for sequential buffer searches without +* resetting the state machine. Save this value as returned from the * previous search for the next search. * * returns diff --git a/src/search_engines/bnfa_search.h b/src/search_engines/bnfa_search.h index 49c142811..0f5443e86 100644 --- a/src/search_engines/bnfa_search.h +++ b/src/search_engines/bnfa_search.h @@ -175,7 +175,7 @@ void bnfaPrint(bnfa_struct_t* pstruct); /* prints the nfa states-verbose!! */ void bnfaPrintInfo(bnfa_struct_t* pstruct); /* print info on this search engine */ /* - * Summary - this tracks search engine information accross multiple instances of + * Summary - this tracks search engine information across multiple instances of * search engines. It helps in snort where we have many search engines, each using * rule grouping, to track total patterns, states, memory, etc... * @@ -183,7 +183,7 @@ void bnfaPrintInfo(bnfa_struct_t* pstruct); /* print info on this search engi void bnfaPrintInfoEx(bnfa_struct_t* p, const char* text); void bnfaAccumInfo(bnfa_struct_t* pstruct); // add info to summary over multiple search engines void bnfaPrintSummary(); /* print current summary */ -void bnfaInitSummary(); /* reset accumulator foir global summary over multiple engines */ +void bnfaInitSummary(); /* reset accumulator for global summary over multiple engines */ void bnfa_print_qinfo(); #endif diff --git a/src/service_inspectors/dce_rpc/dce_co.cc b/src/service_inspectors/dce_rpc/dce_co.cc index 58b0b4dbf..34cc64f35 100644 --- a/src/service_inspectors/dce_rpc/dce_co.cc +++ b/src/service_inspectors/dce_rpc/dce_co.cc @@ -683,7 +683,7 @@ static void dce_co_process_ctx_result(DCE2_SsnData* sd,DCE2_CoTracker* cot, } /* Dequeue context item in pending queue - this will get put in the permanent - * context id list or free'd */ + * context id list or freed */ ctx_node = (DCE2_CoCtxIdNode*)DCE2_QueueDequeue(cot->pending_ctx_ids); if (ctx_node == nullptr) { @@ -1319,7 +1319,7 @@ static Packet* dce_co_reassemble(DCE2_SsnData* sd, DCE2_CoTracker* cot, /******************************************************************** * Function: DCE2_CoReassemble() * - * Gets a reassemly packet based on the transport and the type of + * Gets a reassembly packet based on the transport and the type of * reassembly we want to do. Sets rule options and calls detect * on the reassembled packet. * @@ -2050,7 +2050,7 @@ static DCE2_Ret DCE2_CoSegEarlyRequest(DCE2_CoTracker* cot, * the current data in fragmentation and segmentation buffers * to the detection engine. Whether we do or not is based on * whether or not we are configured to do so. The number of bytes - * in the fragmentation and segmentation buffers are calulated + * in the fragmentation and segmentation buffers are calculated * and if they exceed the amount we are configured for, we * reassemble. * diff --git a/src/service_inspectors/dce_rpc/dce_co.h b/src/service_inspectors/dce_rpc/dce_co.h index 8ec97ef95..6dbb00e49 100644 --- a/src/service_inspectors/dce_rpc/dce_co.h +++ b/src/service_inspectors/dce_rpc/dce_co.h @@ -175,8 +175,8 @@ struct DCE2_CoFragTracker DCE2_Buffer* cli_stub_buf; DCE2_Buffer* srv_stub_buf; - int opnum; /* Opnum that is ultimatley used for request */ - int ctx_id; /* Context id that is ultimatley used for request */ + int opnum; /* Opnum that is ultimately used for request */ + int ctx_id; /* Context id that is ultimately used for request */ /* These are set on a first fragment received */ int expected_call_id; /* Expected call id for fragments */ @@ -205,7 +205,7 @@ struct DCE2_CoTracker * numbers, but in the order they were in the client packet */ DCE2_Queue* pending_ctx_ids; - /* Keeps track of fragmentation buffer and frag specfic data */ + /* Keeps track of fragmentation buffer and frag specific data */ DCE2_CoFragTracker frag_tracker; int max_xmit_frag; /* The maximum negotiated size of a client request */ diff --git a/src/service_inspectors/dce_rpc/dce_smb_commands.cc b/src/service_inspectors/dce_rpc/dce_smb_commands.cc index 8c59bde36..65eedb4fd 100644 --- a/src/service_inspectors/dce_rpc/dce_smb_commands.cc +++ b/src/service_inspectors/dce_rpc/dce_smb_commands.cc @@ -922,7 +922,7 @@ DCE2_Ret DCE2_SmbWriteAndUnlock(DCE2_SmbSsnData* ssd, const SmbNtHdr* smb_hdr, return DCE2_RET__ERROR; // These are special cases. The write succeeds but the unlock fails - // so an error reponse is returned but the data was actually written. + // so an error response is returned but the data was actually written. if (DCE2_ComInfoIsResponse(com_info) && DCE2_ComInfoIsStatusError(com_info)) { if (DCE2_SmbIsTidIPC(ssd, ssd->cur_rtracker->tid)) diff --git a/src/service_inspectors/dce_rpc/dce_smb_utils.cc b/src/service_inspectors/dce_rpc/dce_smb_utils.cc index fe358ec4b..08bd51879 100644 --- a/src/service_inspectors/dce_rpc/dce_smb_utils.cc +++ b/src/service_inspectors/dce_rpc/dce_smb_utils.cc @@ -811,10 +811,7 @@ DCE2_SmbFileTracker* DCE2_SmbDequeueTmpFileTracker(DCE2_SmbSsnData* ssd, DCE2_SmbRequestTracker* rtracker, const uint16_t fid) { Profile profile(dce2_smb_pstat_smb_fid); - - DebugFormat(DEBUG_DCE_SMB, "Dequeueing file tracker " - "and binding to fid: 0x%04X\n", fid); - + DebugFormat(DEBUG_DCE_SMB, "Dequeuing file tracker and binding to fid: 0x%04X\n", fid); DCE2_SmbFileTracker* ftracker = (DCE2_SmbFileTracker*)DCE2_QueueDequeue(rtracker->ft_queue); if (ftracker == nullptr) @@ -853,7 +850,7 @@ DCE2_SmbFileTracker* DCE2_SmbDequeueTmpFileTracker(DCE2_SmbSsnData* ssd, } } - // Other values were intialized when queueing. + // Other values were initialized when queuing. ftracker->fid_v1 = (int)fid; return ftracker; @@ -1051,7 +1048,7 @@ void DCE2_SmbQueueTmpFileTracker(DCE2_SmbSsnData* ssd, { Profile profile(dce2_smb_pstat_smb_fid); - DebugFormat(DEBUG_DCE_SMB, "Queueing file tracker " + DebugFormat(DEBUG_DCE_SMB, "Queuing file tracker " "with Uid: %hu, Tid: %hu\n", uid, tid); DCE2_SmbFileTracker* ftracker = (DCE2_SmbFileTracker*) @@ -1361,7 +1358,7 @@ Packet* DCE2_SmbGetRpkt(DCE2_SmbSsnData* ssd, * * Returns: * DCE2_Ret - * DCE2_RET__ERROR if an error occured. Nothing can + * DCE2_RET__ERROR if an error occurred. Nothing can * be trusted. * DCE2_RET__SUCCESS if data was successfully added. * diff --git a/src/service_inspectors/dce_rpc/dce_utils.cc b/src/service_inspectors/dce_rpc/dce_utils.cc index 5211c6eb6..5f1070c63 100644 --- a/src/service_inspectors/dce_rpc/dce_utils.cc +++ b/src/service_inspectors/dce_rpc/dce_utils.cc @@ -56,7 +56,7 @@ * DCE2_Ret * DCE2_RET__SUCCESS if we were able to successfully parse the * integer to the type specified. - * DCE2_RET__ERROR if an error occured in parsing. + * DCE2_RET__ERROR if an error occurred in parsing. * ********************************************************************/ DCE2_Ret DCE2_GetValue(char* start, char* end, void* int_value, int negate, diff --git a/src/service_inspectors/dce_rpc/smb_common.h b/src/service_inspectors/dce_rpc/smb_common.h index 4b6a3a49c..6b365895c 100644 --- a/src/service_inspectors/dce_rpc/smb_common.h +++ b/src/service_inspectors/dce_rpc/smb_common.h @@ -345,7 +345,7 @@ struct SmbNtHdr uint16_t smb_mid; /* multiplex id */ }; -/* For server empty respones indicating client error or interim response */ +/* For server empty responses indicating client error or interim response */ struct SmbEmptyCom { uint8_t smb_wct; /* value = 0 */ diff --git a/src/service_inspectors/dce_rpc/smb_message.cc b/src/service_inspectors/dce_rpc/smb_message.cc index a3fb2ee69..4c3d4c2f4 100644 --- a/src/service_inspectors/dce_rpc/smb_message.cc +++ b/src/service_inspectors/dce_rpc/smb_message.cc @@ -367,13 +367,13 @@ static uint32_t DCE2_IgnoreJunkData(const uint8_t* data_ptr, uint16_t data_len, * * Checks some relevant fields in the header to make sure they're * sane. - * Side effects are potential alerts for anomolous behavior. + * Side effects are potential alerts for anomalous behavior. * * Arguments: * DCE2_SmbSsnData * * Pointer to the session data structure. * SmbNtHdr * - * Pointer to the header struct layed over the packet data. + * Pointer to the header struct laid over the packet data. * * Returns: * DCE2_Ret @@ -1380,7 +1380,7 @@ static DCE2_SmbSsnData* dce2_create_new_smb_session(Packet* p, dce2SmbProtoConf* * initial Session Request / Session Positive/Negative response * followed by the normal SMB conversation, i.e. Negotiate, * SessionSetupAndX, etc. - * Side effects are potential alerts for anomolous behavior. + * Side effects are potential alerts for anomalous behavior. * * Arguments: * DCE2_SmbSsnData * - the session data structure. @@ -1529,7 +1529,7 @@ static void DCE2_Smb1Process(DCE2_SmbSsnData* ssd) if (data_len < data_need) { DebugFormat(DEBUG_DCE_SMB, "Data len(%hu) < NetBIOS SS header(%u). " - "Queueing data.\n", data_len, data_need); + "Queuing data.\n", data_len, data_need); if (DCE2_SmbHandleSegmentation(seg_buf, data_ptr, data_len, sizeof(NbssHdr)) != DCE2_RET__SUCCESS) @@ -1623,7 +1623,7 @@ static void DCE2_Smb1Process(DCE2_SmbSsnData* ssd) if (data_len < data_need) { DebugFormat(DEBUG_DCE_SMB, "Data len (%hu) < " - "NetBIOS SS header + SMB header (%u). Queueing data.\n", + "NetBIOS SS header + SMB header (%u). Queuing data.\n", data_len, data_need); if (DCE2_SmbHandleSegmentation(seg_buf, data_ptr, data_len, @@ -1688,7 +1688,7 @@ static void DCE2_Smb1Process(DCE2_SmbSsnData* ssd) continue; } - // Check the SMB header for anomolies + // Check the SMB header for anomalies if (DCE2_SmbHdrChecks(ssd, smb_hdr) != DCE2_RET__SUCCESS) { DebugMessage(DEBUG_DCE_SMB, "Bad SMB header.\n"); @@ -1741,7 +1741,7 @@ static void DCE2_Smb1Process(DCE2_SmbSsnData* ssd) { DebugFormat(DEBUG_DCE_SMB, "Data len(%hu) < " "NetBIOS SS header + NetBIOS len(%zu). " - "Queueing data.\n", data_len, sizeof(NbssHdr) + nb_len); + "Queuing data.\n", data_len, sizeof(NbssHdr) + nb_len); if (DCE2_SmbHandleSegmentation(seg_buf, data_ptr, data_len, sizeof(NbssHdr) + nb_len) != DCE2_RET__SUCCESS) @@ -1876,7 +1876,7 @@ void DCE2_SmbInitGlobals() // Sets up the function to call for the command and valid word and byte // counts for the command. Ensuring valid word and byte counts is very // important to processing the command as it will assume the command is - // legitimate and can access data that is acutally there. Note that + // legitimate and can access data that is actually there. Note that // commands with multiple word counts indicate a different command // structure, however most, if not all just have an extended version // of the structure for which the extended part isn't used. If the diff --git a/src/service_inspectors/dns/dns.cc b/src/service_inspectors/dns/dns.cc index aa0c3a755..9f6d26cbf 100644 --- a/src/service_inspectors/dns/dns.cc +++ b/src/service_inspectors/dns/dns.cc @@ -901,7 +901,7 @@ static void ParseDNSResponseMessage(Packet* p, DNSData* dnsSessionData) { case DNS_RESP_STATE_RR_RDATA_START: DebugFormat(DEBUG_DNS, - "DNS ADDITONAL RR %d: type %hu, class %hu, " + "DNS ADDITIONAL RR %d: type %hu, class %hu, " "ttl %u rdlength %hu\n", i, dnsSessionData->curr_rr.type, dnsSessionData->curr_rr.dns_class, diff --git a/src/service_inspectors/ftp_telnet/ftp_data.cc b/src/service_inspectors/ftp_telnet/ftp_data.cc index 4dfc3fed6..b15ab8d90 100644 --- a/src/service_inspectors/ftp_telnet/ftp_data.cc +++ b/src/service_inspectors/ftp_telnet/ftp_data.cc @@ -129,7 +129,7 @@ static int SnortFTPData(Packet* p) if (!PROTO_IS_FTP(ftp_ssn)) { DebugMessage(DEBUG_FTPTELNET, - "FTP-DATA Invalid FTP_SESSION retrieved durring lookup\n"); + "FTP-DATA Invalid FTP_SESSION retrieved during lookup\n"); if (data_ssn->data_chan) p->flow->set_ignore_direction(SSN_DIR_BOTH); diff --git a/src/service_inspectors/ftp_telnet/ftp_parse.h b/src/service_inspectors/ftp_telnet/ftp_parse.h index 130a1db71..658ac5a43 100644 --- a/src/service_inspectors/ftp_telnet/ftp_parse.h +++ b/src/service_inspectors/ftp_telnet/ftp_parse.h @@ -48,7 +48,7 @@ #define F_DATE "date" #define F_LITERAL "'" #define F_STRING "string" -#define F_STRING_FMT "formated_string" +#define F_STRING_FMT "formatted_string" #define F_HOST_PORT "host_port" #define F_LONG_HOST_PORT "long_host_port" #define F_EXTD_HOST_PORT "extd_host_port" diff --git a/src/service_inspectors/ftp_telnet/ftpp_si.h b/src/service_inspectors/ftp_telnet/ftpp_si.h index 80a6385e5..f2906d7f8 100644 --- a/src/service_inspectors/ftp_telnet/ftpp_si.h +++ b/src/service_inspectors/ftp_telnet/ftpp_si.h @@ -165,7 +165,7 @@ struct FTP_SESSION SfIp serverIP; uint16_t serverPort; - /* A file is being transfered on ftp-data channel */ + /* A file is being transferred on ftp-data channel */ char* filename; int file_xfer_info; /* -1: ignore, 0: unknown, >0: filename length */ unsigned char flags; diff --git a/src/service_inspectors/ftp_telnet/pp_telnet.cc b/src/service_inspectors/ftp_telnet/pp_telnet.cc index 29253501b..1247dea59 100644 --- a/src/service_inspectors/ftp_telnet/pp_telnet.cc +++ b/src/service_inspectors/ftp_telnet/pp_telnet.cc @@ -33,7 +33,7 @@ * * Arguments: None * - * Effect: The telnet nogiation data is removed from the data + * Effect: The telnet negotiation data is removed from the data * * Comments: * @@ -117,7 +117,7 @@ int normalize_telnet( read_ptr = p->data; end = p->data + p->dsize; - /* look to see if we have any telnet negotiaion codes in the data */ + /* look to see if we have any telnet negotiation codes in the data */ while (!normalization_required && (read_ptr < end)) { /* look for the start of a negotiation string */ @@ -182,7 +182,7 @@ int normalize_telnet( /* rewind the data stream to p->data */ read_ptr = p->data; - /* setup for overwriting the negotaiation strings with + /* setup for overwriting the negotiation strings with * the follow-on data */ write_ptr = (unsigned char*)DecodeBuffer.data; diff --git a/src/service_inspectors/ftp_telnet/pp_telnet.h b/src/service_inspectors/ftp_telnet/pp_telnet.h index ff9c30fe7..e29007c56 100644 --- a/src/service_inspectors/ftp_telnet/pp_telnet.h +++ b/src/service_inspectors/ftp_telnet/pp_telnet.h @@ -26,7 +26,7 @@ /* RFC 885 defines an End of Record telnet option */ #define RFC885 -/* RFC 1184 defines Abort, Suspend, and End of File telnet optinos */ +/* RFC 1184 defines Abort, Suspend, and End of File telnet options */ #define RFC1184 #include "ftpp_si.h" diff --git a/src/service_inspectors/gtp/gtp_parser.cc b/src/service_inspectors/gtp/gtp_parser.cc index 94011b4e5..fb143326c 100644 --- a/src/service_inspectors/gtp/gtp_parser.cc +++ b/src/service_inspectors/gtp/gtp_parser.cc @@ -151,7 +151,7 @@ static void printInfoElements(GTP_IEData* info_elements, GTPMsg* msg) * GTP_Ret * true if we were able to successfully parse the * port list. - * false if an error occured in parsing the port list. + * false if an error occurred in parsing the port list. * ********************************************************************/ static int gtp_processInfoElements(GTPMsg* msg, const uint8_t* buff, uint16_t len) diff --git a/src/service_inspectors/http_inspect/http_cutter.cc b/src/service_inspectors/http_inspect/http_cutter.cc index f7fc5ccbf..0066c3bcd 100644 --- a/src/service_inspectors/http_inspect/http_cutter.cc +++ b/src/service_inspectors/http_inspect/http_cutter.cc @@ -67,7 +67,7 @@ ScanResult HttpStartCutter::cut(const uint8_t* buffer, uint32_t length, if (!validated) { // The purpose of validate() is to quickly and efficiently dispose of obviously wrong - // bindings. Passing is no guarentee that the connection is really HTTP, but failing + // bindings. Passing is no guarantee that the connection is really HTTP, but failing // makes it clear that it isn't. switch (validate(buffer[k])) { diff --git a/src/service_inspectors/http_inspect/http_enum.h b/src/service_inspectors/http_inspect/http_enum.h index 8535b1eb9..92f25542a 100644 --- a/src/service_inspectors/http_inspect/http_enum.h +++ b/src/service_inspectors/http_inspect/http_enum.h @@ -101,7 +101,7 @@ enum MethodId { enum UriType { URI__NOT_COMPUTE=-14, URI__PROBLEMATIC=-12, URI_ASTERISK = 2, URI_AUTHORITY, URI_ABSPATH, URI_ABSOLUTE }; -// Body compression tpyes +// Body compression types enum CompressId { CMP_NONE=2, CMP_GZIP, CMP_DEFLATE }; // Message section in which an IPS option provides the buffer diff --git a/src/service_inspectors/http_inspect/http_msg_head_shared.h b/src/service_inspectors/http_inspect/http_msg_head_shared.h index 1c93ca4ae..4e0d58ca9 100644 --- a/src/service_inspectors/http_inspect/http_msg_head_shared.h +++ b/src/service_inspectors/http_inspect/http_msg_head_shared.h @@ -60,7 +60,7 @@ protected: ~HttpMsgHeadShared(); // Get the next item in a comma-separated header value and convert it to an enum value static int32_t get_next_code(const Field& field, int32_t& offset, const StrCode table[]); - // Do a case insensitve search for "boundary=" in a Field + // Do a case insensitive search for "boundary=" in a Field static bool boundary_present(const Field& field); #ifdef REG_TEST diff --git a/src/service_inspectors/http_inspect/http_uri_norm.cc b/src/service_inspectors/http_inspect/http_uri_norm.cc index d0e210db8..185c6a47f 100644 --- a/src/service_inspectors/http_inspect/http_uri_norm.cc +++ b/src/service_inspectors/http_inspect/http_uri_norm.cc @@ -500,6 +500,7 @@ void UriNormalizer::load_default_unicode_map(uint8_t map[65536]) // Default unicode map is just a single string of tokens of the form // HHHH:HH (HHHH = unicode, HH = ascii char) +// __STRDUMP_DISABLE__ std::stringstream ss( "0100:41 0101:61 0102:41 0103:61 0104:41 0105:61 0106:43 0107:63 0108:43 0109:63 010a:43 010b:63 " "010c:43 010d:63 010e:44 010f:64 0111:64 0112:45 0113:65 0114:45 0115:65 0116:45 0117:65 0118:45 " @@ -534,6 +535,7 @@ void UriNormalizer::load_default_unicode_map(uint8_t map[65536]) "ff41:61 ff42:62 ff43:63 ff44:64 ff45:65 ff46:66 ff47:67 ff48:68 ff49:69 ff4a:6a ff4b:6b ff4c:6c " "ff4d:6d ff4e:6e ff4f:6f ff50:70 ff51:71 ff52:72 ff53:73 ff54:74 ff55:75 ff56:76 ff57:77 ff58:78 " "ff59:79 ff5a:7a ff5b:7b ff5c:7c ff5d:7d ff5e:7e"); +// __STRDUMP_ENABLE__ std::string token; diff --git a/src/service_inspectors/imap/imap_paf.cc b/src/service_inspectors/imap/imap_paf.cc index 887a0effa..f6ca5df71 100644 --- a/src/service_inspectors/imap/imap_paf.cc +++ b/src/service_inspectors/imap/imap_paf.cc @@ -76,7 +76,7 @@ static bool parse_literal_length(const uint8_t ch, uint32_t* len) } } else if (ch != '}') - *len = 0; // ALERT!! charachter should be a digit or ''}'' + *len = 0; // ALERT!! character should be a digit or ''}'' return true; } diff --git a/src/service_inspectors/imap/imap_paf.h b/src/service_inspectors/imap/imap_paf.h index cd3e98da2..778c8fa04 100644 --- a/src/service_inspectors/imap/imap_paf.h +++ b/src/service_inspectors/imap/imap_paf.h @@ -33,7 +33,7 @@ struct ImapDataInfo const char* next_letter; // The current command in fetch bool found_len; uint32_t length; - bool esc_nxt_char; // true if the next charachter has been escaped + bool esc_nxt_char; // true if the next character has been escaped }; // States for IMAP PAF diff --git a/src/service_inspectors/modbus/modbus.h b/src/service_inspectors/modbus/modbus.h index 11d36c7c8..876256f4c 100644 --- a/src/service_inspectors/modbus/modbus.h +++ b/src/service_inspectors/modbus/modbus.h @@ -17,7 +17,7 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -// modubs.h author Russ Combs +// modbus.h author Russ Combs #ifndef MODBUS_H #define MODBUS_H diff --git a/src/service_inspectors/pop/pop_paf.cc b/src/service_inspectors/pop/pop_paf.cc index f96380fc8..c6dfdded3 100644 --- a/src/service_inspectors/pop/pop_paf.cc +++ b/src/service_inspectors/pop/pop_paf.cc @@ -162,7 +162,7 @@ static inline int valid_response(const uint8_t data) /* * Client PAF calls this command to set the server's state. This is the - * function which ensure's the server know the correct expected + * function which ensures the server know the correct expected * DATA */ static inline void set_server_state(Flow* ssn, PopExpectedResp state) @@ -231,7 +231,7 @@ static bool find_data_end_multi_line(PopPafData* pfdata, const uint8_t ch, bool * PARAMS: * * RETURNS: - * 0 - if terminatino sequence not found + * 0 - if termination sequence not found * 1 - if termination sequence found */ static inline bool find_data_end_single_line(PopPafData* pfdata, const uint8_t ch, bool client) diff --git a/src/service_inspectors/rpc_decode/rpc_decode.cc b/src/service_inspectors/rpc_decode/rpc_decode.cc index dc668050e..f990e4317 100644 --- a/src/service_inspectors/rpc_decode/rpc_decode.cc +++ b/src/service_inspectors/rpc_decode/rpc_decode.cc @@ -23,7 +23,7 @@ * Purpose: * * This preprocessor normalizes the RPC requests from remote machines by - * converting all fragments into one continous stream. + * converting all fragments into one continuous stream. * This is very useful for doing things like defeating hostile attackers * trying to stealth themselves from IDSs by fragmenting the request so the * string 0186A0 is broken up. @@ -702,7 +702,7 @@ static int ConvertRPC(RpcDecodeConfig* rconfig, RpcSsnData* rsdata, Packet* p) uint8_t* data_end; /* points to the end of the payload for loop control */ uint32_t length; /* length of current fragment */ int last_fragment = 0; /* have we seen the last fragment sign? */ - uint32_t decoded_len; /* our decoded length is always atleast a 0 byte header */ + uint32_t decoded_len; /* our decoded length is always at least a 0 byte header */ uint32_t fraghdr; /* Used to store the RPC fragment header data */ int fragcount = 0; /* How many fragment counters have we seen? */ size_t decode_buf_rem = sizeof(DecodeBuffer.data); @@ -769,7 +769,7 @@ static int ConvertRPC(RpcDecodeConfig* rconfig, RpcSsnData* rsdata, Packet* p) decoded_len = 4; decode_buf_rem -= 4; - /* always make sure that we have enough data to process atleast + /* always make sure that we have enough data to process at least * the header and that we only process at most, one fragment */ @@ -833,8 +833,7 @@ static int ConvertRPC(RpcDecodeConfig* rconfig, RpcSsnData* rsdata, Packet* p) else if ((data_index + length) > data_end) { DebugMessage(DEBUG_RPC, - "returning LARGE_FRAGSIZE" - "since we'd read past our end\n"); + "returning LARGE_FRAGSIZE since we'd read past our end\n"); return RPC_LARGE_FRAGSIZE; } else @@ -890,7 +889,7 @@ static int ConvertRPC(RpcDecodeConfig* rconfig, RpcSsnData* rsdata, Packet* p) //------------------------------------------------------------------------- // splitter stuff: // -// see above commments on MIN_CALL_BODY_SZ +// see above comments on MIN_CALL_BODY_SZ // why flush_point == 28 instead of 32 IDK // // we don't set a flush point to flush_point (= 28 above) because that will @@ -952,7 +951,7 @@ void RpcDecode::show(SnortConfig*) /* * Purpose: Inspects the packet's payload for fragment records and - * converts them into one infragmented record. + * converts them into one unfragmented record. */ void RpcDecode::eval(Packet* p) { @@ -965,7 +964,7 @@ void RpcDecode::eval(Packet* p) // In this case we don't look at server packets. // There is the case were stream configuration requires a 3 way handshake. // If no 3 way, then the packet flags won't be set, so don't look at it - // since we won't be able to determeine who's the client and who's the + // since we won't be able to determine who's the client and who's the // server. if ( !p->is_from_client() ) return; diff --git a/src/service_inspectors/sip/sip_config.h b/src/service_inspectors/sip/sip_config.h index e5add0439..42d4e2653 100644 --- a/src/service_inspectors/sip/sip_config.h +++ b/src/service_inspectors/sip/sip_config.h @@ -95,7 +95,7 @@ struct SIP_PROTO_CONF uint32_t maxNumDialogsInSession; uint32_t methodsConfig; SIPMethodlist methods; // Which methods to check - uint16_t maxUriLen; // Maximum requst_URI size + uint16_t maxUriLen; // Maximum request_URI size uint16_t maxCallIdLen; // Maximum call_ID size. uint16_t maxRequestNameLen; // Maximum length of request name in the CSeqID. uint16_t maxFromLen; // Maximum From field size diff --git a/src/service_inspectors/smtp/smtp.cc b/src/service_inspectors/smtp/smtp.cc index 74ca1ebec..9909f92db 100644 --- a/src/service_inspectors/smtp/smtp.cc +++ b/src/service_inspectors/smtp/smtp.cc @@ -107,7 +107,7 @@ const SMTPToken smtp_resps[] = { "250", 3, RESP_250, SMTP_CMD_TYPE_NORMAL }, /* Requested mail action okay, completed */ { "334", 3, RESP_334, SMTP_CMD_TYPE_NORMAL }, /* Auth intermediate response */ { "354", 3, RESP_354, SMTP_CMD_TYPE_NORMAL }, /* Start mail input - data response */ - { "421", 3, RESP_421, SMTP_CMD_TYPE_NORMAL }, /* Service not availiable - closes connection + { "421", 3, RESP_421, SMTP_CMD_TYPE_NORMAL }, /* Service not available - closes connection */ { "450", 3, RESP_450, SMTP_CMD_TYPE_NORMAL }, /* Mailbox unavailable */ { "451", 3, RESP_451, SMTP_CMD_TYPE_NORMAL }, /* Local error in processing */ @@ -305,7 +305,7 @@ static int AddCmd(SMTP_PROTO_CONF* config, const char* name, SMTPCmdTypeEnum typ config->num_cmds++; - /* allocate enough memory for new commmand - alloc one extra for NULL entry */ + /* allocate enough memory for new command - alloc one extra for NULL entry */ // FIXIT-L this constant reallocation is not necessary; use vector cmds = (SMTPToken*)snort_calloc((config->num_cmds + 1) * sizeof(*cmds)); cmd_config = (SMTPCmdConfig*)snort_calloc((config->num_cmds + 1) * sizeof(*cmd_config)); @@ -1372,7 +1372,7 @@ static int SMTP_GetRcptTo(Flow* flow, uint8_t** buf, uint32_t* len, uint32_t* ty return 1; } -/* Calback to return the email headers */ +/* Callback to return the email headers */ static int SMTP_GetEmailHdrs(Flow* flow, uint8_t** buf, uint32_t* len, uint32_t* type) { SMTPData* ssn = get_session_data(flow); diff --git a/src/service_inspectors/smtp/smtp_normalize.cc b/src/service_inspectors/smtp/smtp_normalize.cc index 202c226fa..7cb4d0e93 100644 --- a/src/service_inspectors/smtp/smtp_normalize.cc +++ b/src/service_inspectors/smtp/smtp_normalize.cc @@ -62,7 +62,7 @@ * @param eol end of end of line marker * * @return response - * @retval 0 function succeded without error + * @retval 0 function succeeded without error * @retval -1 there were errors */ int SMTP_NormalizeCmd(Packet* p, const uint8_t* ptr, const uint8_t* eolm, const uint8_t* eol) diff --git a/src/service_inspectors/ssh/ssh.cc b/src/service_inspectors/ssh/ssh.cc index f95d4667b..dd7ed2e4e 100644 --- a/src/service_inspectors/ssh/ssh.cc +++ b/src/service_inspectors/ssh/ssh.cc @@ -663,7 +663,7 @@ static unsigned int ProcessSSHKeyExchange(SSHData* sessionp, Packet* p, * key exchange. Both server and client should * send one, but as per Alex Kirk's note on this, * in some implementations the server does not - * actually send this message. So receving a new + * actually send this message. So receiving a new * keys msg from the client is sufficient. */ if ( direction == SSH_DIR_FROM_CLIENT ) diff --git a/src/sfip/sf_cidr.cc b/src/sfip/sf_cidr.cc index bd7b51c4d..2150b47f2 100644 --- a/src/sfip/sf_cidr.cc +++ b/src/sfip/sf_cidr.cc @@ -39,7 +39,7 @@ SfIpRet SfCidr::contains(const SfIp* ip) const const uint32_t* pn, * pi; /* SFIP_CONTAINS is returned here due to how sfvar_ip_in - * handles zero'ed IPs" */ + * handles zeroed IPs" */ if (!ip) return SFIP_CONTAINS; diff --git a/src/sfip/sf_ip.cc b/src/sfip/sf_ip.cc index 6ab6f6e73..540b7bf58 100644 --- a/src/sfip/sf_ip.cc +++ b/src/sfip/sf_ip.cc @@ -396,7 +396,7 @@ void snort_inet_ntop(int family, const void* ip_raw, char* buf, int bufsize) if (!ip_raw || !buf || (family != AF_INET && family != AF_INET6) || /* Make sure if it's IPv6 that the buf is large enough. */ - /* Need atleast a max of 8 fields of 4 bytes plus 7 for colons in + /* Need at least a max of 8 fields of 4 bytes plus 7 for colons in * between. Need 1 more byte for null. */ (family == AF_INET6 && bufsize < INET6_ADDRSTRLEN) || /* Make sure if it's IPv4 that the buf is large enough. diff --git a/src/sfip/sf_ipvar.cc b/src/sfip/sf_ipvar.cc index 303f137e8..f0436d12e 100644 --- a/src/sfip/sf_ipvar.cc +++ b/src/sfip/sf_ipvar.cc @@ -72,7 +72,7 @@ void sfvar_free(sfip_var_t* var) snort_free(var); } -/* Allocaties and returns an IP node described by 'str' */ +/* Allocates and returns an IP node described by 'str' */ static sfip_node_t* sfipnode_alloc(const char* str, SfIpRet* status) { // FIXIT-L rename variables from ret to something with more descriptive @@ -138,7 +138,7 @@ static sfip_node_t* sfipnode_alloc(const char* str, SfIpRet* status) } } - /* Check if this is a negated, zero'ed IP (equivalent of a "!any") */ + /* Check if this is a negated, zeroed IP (equivalent of a "!any") */ if (!ret->ip->is_set() && (ret->flags & SFIP_NEGATED)) { if (status) @@ -308,7 +308,7 @@ static SfIpRet sfvar_add_node(sfip_var_t* var, sfip_node_t* node, int negated) } /* If we're here, the head node was lesser than the new node */ - /* Before searching the list, verify there is atleast two nodes. + /* Before searching the list, verify there is at least two nodes. * (This saves an extra check during the loop below) */ if (!(*head)->next) { @@ -588,7 +588,7 @@ SfIpRet sfvar_parse_iplist(vartable_t* table, sfip_var_t* var, return SFIP_NOT_ANY; } - /* Check if this is a negated, zero'ed IP (equivalent of a "!any") */ + /* Check if this is a negated, zeroed IP (equivalent of a "!any") */ if (copy_var->head && !copy_var->head->ip->is_set()) { snort_free(tok); @@ -643,7 +643,7 @@ SfIpRet sfvar_parse_iplist(vartable_t* table, sfip_var_t* var, _negate_node(node); } - /* Check if this is a negated, zero'ed IP (equivalent of a "!any") */ + /* Check if this is a negated, zeroed IP (equivalent of a "!any") */ if (!node->ip->is_set() && (node->flags & SFIP_NEGATED)) { sfip_node_free(node); diff --git a/src/sfip/sf_ipvar.h b/src/sfip/sf_ipvar.h index 1dce60839..511cdb016 100644 --- a/src/sfip/sf_ipvar.h +++ b/src/sfip/sf_ipvar.h @@ -56,8 +56,8 @@ typedef struct _ip_node struct _ip_node* next; int flags; // XXX - int addr_flags; /* Flags used exlusively by Snort */ - /* Keeping these variables seperate keeps + int addr_flags; /* Flags used exclusively by Snort */ + /* Keeping these variables separate keeps * this from stepping on Snort's toes. */ /* Should merge them later */ } sfip_node_t; diff --git a/src/sfip/sfip_test.cc b/src/sfip/sfip_test.cc index 54dadc669..57cdde88a 100644 --- a/src/sfip/sfip_test.cc +++ b/src/sfip/sfip_test.cc @@ -66,6 +66,7 @@ struct FuncTest }; //--------------------------------------------------------------- +// __STRDUMP_DISABLE__ static FuncTest ftests[] = { @@ -232,6 +233,7 @@ static FuncTest ftests[] = #define NUM_TESTS (sizeof(ftests)/sizeof(ftests[0])) +// __STRDUMP_ENABLE__ //--------------------------------------------------------------- static int RunFunc(const char* func, const char* arg1, const char* arg2) diff --git a/src/sfrt/sfrt.cc b/src/sfrt/sfrt.cc index 15059bd38..cfecb72e0 100644 --- a/src/sfrt/sfrt.cc +++ b/src/sfrt/sfrt.cc @@ -34,7 +34,7 @@ * then more specific information will be written into the routing tables * from RNA. Ideally, information will only move from less specific to more * specific. If a more general information is to overwrite existing entries, - * the table should be free'ed and rebuilt. + * the table should be freed and rebuilt. * * * Implementation: @@ -47,13 +47,13 @@ * Inserts are performed by specifying a CIDR and a pointer to its associated * data. Since a new routing table entry may overwrite previous entries, * a flag selects whether the insert favors the most recent or favors the most - * specific. Favoring most specific should be the default behvior. If + * specific. Favoring most specific should be the default behavior. If * the user wishes to overwrite routing entries with more general data, the * table should be flushed, rather than using favor-most-recent. * * Before modifying the routing or data tables, the insert function performs a - * lookup on the CIDR-to-be-insertted. If no entry or an entry *of differing - * bit length* is found, the data is insertted into the data table, and its + * lookup on the CIDR-to-be-inserted. If no entry or an entry *of differing + * bit length* is found, the data is inserted into the data table, and its * index is used for the new routing table entry. If an entry is found that * is as specific as the new CIDR, the index stored points to where the new * data is written into the data table. @@ -109,7 +109,7 @@ table_t* sfrt_new(char table_type, char ip_type, long data_size, uint32_t mem_ca table_t* table = (table_t*)snort_alloc(sizeof(table_t)); /* If this limit is exceeded, there will be no way to distinguish - * between pointers and indeces into the data table. Only + * between pointers and indices into the data table. Only * applies to DIR-n-m. */ #if SIZEOF_LONG_INT == 8 if (data_size >= 0x800000000000000) diff --git a/src/sfrt/sfrt_dir.cc b/src/sfrt/sfrt_dir.cc index 6053df06b..437933331 100644 --- a/src/sfrt/sfrt_dir.cc +++ b/src/sfrt/sfrt_dir.cc @@ -275,7 +275,7 @@ static inline void _dir_fill_less_specific(int index, int fill, * a specific subnet. table->data[] entry for more specific subnet is not cleared. * * @note RT_FAVOR_TIME can cause orphaned table->data[] entries if the entire subnet - * is replaced by more specific sudnets. + * is replaced by more specific subnets. */ static inline uint32_t _dir_remove_all(uint32_t* allocated, uint32_t index, uint32_t fill, word length, dir_sub_table_t* table) @@ -683,7 +683,7 @@ static int _dir_sub_remove(IPLOOKUP* ip, int length, int cur_len, fill += index; - /* Remove and overwrite without consedering CIDR specificity*/ + /* Remove and overwrite without considering CIDR specificity*/ if (behavior == RT_FAVOR_TIME) { valueIndex = _dir_remove_all(&root_table->allocated, index, fill, length, sub_table); diff --git a/src/sfrt/sfrt_dir.h b/src/sfrt/sfrt_dir.h index 9e8a8c636..a362f40c5 100644 --- a/src/sfrt/sfrt_dir.h +++ b/src/sfrt/sfrt_dir.h @@ -47,8 +47,8 @@ typedef struct * are used. */ int cur_num; /* Present number of used nodes */ - /** number of entries filled including chidren sub_tables. This is used - * for freeing sub_tables when all entried are freed by delete operation. + /** number of entries filled including children sub_tables. This is used + * for freeing sub_tables when all entries are freed by delete operation. */ int filledEntries; } dir_sub_table_t; diff --git a/src/sfrt/sfrt_flat.cc b/src/sfrt/sfrt_flat.cc index 222f09e92..c02a85bdb 100644 --- a/src/sfrt/sfrt_flat.cc +++ b/src/sfrt/sfrt_flat.cc @@ -56,7 +56,7 @@ table_flat_t* sfrt_flat_new(char table_flat_type, char ip_type, long data_size, table = (table_flat_t*)(&base[table_ptr]); /* If this limit is exceeded, there will be no way to distinguish - * between pointers and indeces into the data table. Only + * between pointers and indices into the data table. Only * applies to DIR-n-m. */ #if SIZEOF_LONG_INT == 8 diff --git a/src/stream/ip/ip_defrag.cc b/src/stream/ip/ip_defrag.cc index 9ebf6412c..171cc3b00 100644 --- a/src/stream/ip/ip_defrag.cc +++ b/src/stream/ip/ip_defrag.cc @@ -33,7 +33,7 @@ * The mechanism for processing frags is based on the Linux IP stack * implementation of IP defragmentation with proper amounts of paranoia * and an IDS perspective applied. Some of this code was derived from - * frag2 originally, but it's basically unrecognizeable if you compare + * frag2 originally, but it's basically unrecognizable if you compare * it to frag2 IMO. * * I switched from using the UBI libs to using sfxhash and linked lists for @@ -55,7 +55,7 @@ * Frag3 is also capable of performing "engine-based" IP defragmentation. * What this means practically is that frag3 can model the IP stack of a * engine on the network to avoid Ptacek-Newsham evasions of the IDS through - * sensor/engine desynchronization. In terms of implentation, this is + * sensor/engine desynchronization. In terms of implementation, this is * reflected by passing a "engine" into the defragmentation engine that has * a specific configuration for a specific engine type. Windows can put * fragments back together differently than Linux/BSD/etc, so we model that @@ -256,7 +256,7 @@ static inline void EventExcessiveOverlap(FragEngine*) } /** - * Generate an event due to a fragment being too short, typcially based + * Generate an event due to a fragment being too short, typically based * on a non-last fragment that doesn't properly end on an 8-byte boundary * * @param engine Current run engine @@ -415,7 +415,7 @@ static inline int FragCheckFirstLast(const Packet* const p, /* Use the actual length here because packet may have been * truncated. Don't want to try to copy more than we actually * captured. Use dsize as the frag length since it is distance - * between the last sucesfully decoded layer (which is ip6_frag + * between the last succesfully decoded layer (which is ip6_frag * or ipv4) and the end of packet, */ fragLength = p->dsize; endOfThisFrag = frag_offset + fragLength; @@ -674,7 +674,7 @@ static inline int FragIsComplete(FragTracker* ft) /* * if we've accumulated enough data to match the calculated size - * of the defragg'd packet, return 1 + * of the defragged packet, return 1 */ if (ft->frag_bytes == ft->calculated_size) { @@ -902,7 +902,7 @@ static void FragRebuild(FragTracker* ft, Packet* p) * Plug a Fragment into the fraglist of a FragTracker * * @param ft FragTracker to put the new node into - * @param prev ptr to preceeding Fragment in fraglist + * @param prev ptr to preceding Fragment in fraglist * @param next ptr to following Fragment in fraglist * @param node ptr to node to put in list * @@ -1178,7 +1178,7 @@ void Defrag::process(Packet* p, FragTracker* ft) ft->frag_time.tv_sec = p->pkth->ts.tv_sec; ft->frag_time.tv_usec = p->pkth->ts.tv_usec; - //dont forward fragments to engine if some previous fragment was dropped + //don't forward fragments to engine if some previous fragment was dropped if ( ft->frag_flags & FRAG_DROP_FRAGMENTS ) { DisableDetect(); @@ -1343,7 +1343,7 @@ int Defrag::insert(Packet* p, FragTracker* ft, FragEngine* fe) /* Use the actual length here because packet may have been * truncated. Don't want to try to copy more than we actually * captured. Use dsize as the frag length since it is distance - * between the last sucesfully decoded layer (which is ip6_frag + * between the last succesfully decoded layer (which is ip6_frag * or ipv4) and the end of packet, */ len = fragLength = p->dsize; fragStart = p->data; @@ -1376,7 +1376,7 @@ int Defrag::insert(Packet* p, FragTracker* ft, FragEngine* fe) { uint16_t oldfrag_end; /* - * all non-last frags are supposed to end on 8-byte boundries + * all non-last frags are supposed to end on 8-byte boundaries */ if (frag_end & 7) { @@ -1595,7 +1595,7 @@ int Defrag::insert(Packet* p, FragTracker* ft, FragEngine* fe) * existing frag -- existing frag needs to be split * and the new frag inserted in the middle. * - * Need to duplciate left. Adjust that guys + * Need to duplicate left. Adjust that guys * offset by + (frag_offset + len) and * size by - (frag_offset + len - left->offset). */ @@ -2029,7 +2029,7 @@ int Defrag::new_tracker(Packet* p, FragTracker* ft) /* Use the actual length here because packet may have been * truncated. Don't want to try to copy more than we actually * captured. Use dsize as the frag length since it is distance - * between the last sucesfully decoded layer (which is ip6_frag + * between the last succesfully decoded layer (which is ip6_frag * or ipv4) and the end of packet, */ fragLength = p->dsize; fragStart = p->data; @@ -2113,7 +2113,7 @@ int Defrag::new_tracker(Packet* p, FragTracker* ft) else { /* - * all non-last frags are supposed to end on 8-byte boundries + * all non-last frags are supposed to end on 8-byte boundaries */ if (frag_end & 7) { @@ -2138,7 +2138,7 @@ int Defrag::new_tracker(Packet* p, FragTracker* ft) /* insert the fragment into the frag list */ ft->fraglist = f; ft->fraglist_tail = f; - ft->fraglist_count = 1; /* XXX: Are these duplciates? */ + ft->fraglist_count = 1; /* XXX: Are these duplicates? */ ft->frag_pkts = 1; /* @@ -2163,9 +2163,9 @@ int Defrag::new_tracker(Packet* p, FragTracker* ft) * @param fragLength Length of packet data * @param len Length of this fragment * @param slide Adjustment to make to left side of data (for left overlaps) - * @param trunc Adjustment to maek to right side of data (for right overlaps) + * @param trunc Adjustment to make to right side of data (for right overlaps) * @param frag_offset Offset for this fragment - * @prarm left FragNode prior to this one + * @param left FragNode prior to this one * @param retFrag this one after its inserted (returned) * * @return status @@ -2285,7 +2285,7 @@ int Defrag::add_frag_node( * Duplicate a frag node and insert it into the list. * * @param ft FragTracker to hold the packet - * @prarm left FragNode prior to this one (to be dup'd) + * @param left FragNode prior to this one (to be dup'd) * @param retFrag this one after its inserted (returned) * * @return status diff --git a/src/stream/ip/ip_session.h b/src/stream/ip/ip_session.h index 6eec4a281..c175bedc9 100644 --- a/src/stream/ip/ip_session.h +++ b/src/stream/ip/ip_session.h @@ -45,7 +45,7 @@ struct FragTracker * last frag offset */ - uint32_t frag_pkts; /* nummber of frag pkts stored under this tracker */ + uint32_t frag_pkts; /* number of frag pkts stored under this tracker */ struct timeval frag_time; /* time we started tracking this frag */ diff --git a/src/stream/libtcp/tcp_stream_session.cc b/src/stream/libtcp/tcp_stream_session.cc index 609fb4964..4901b5c9e 100644 --- a/src/stream/libtcp/tcp_stream_session.cc +++ b/src/stream/libtcp/tcp_stream_session.cc @@ -179,7 +179,7 @@ bool TcpStreamSession::is_sequenced(uint8_t dir) return true; } -/* This will falsely return SSN_MISSING_BEFORE on the first reassembed +/* This will falsely return SSN_MISSING_BEFORE on the first reassembled * packet if reassembly for this direction was set mid-session */ uint8_t TcpStreamSession::missing_in_reassembled(uint8_t dir) { diff --git a/src/stream/stream.cc b/src/stream/stream.cc index e659a10d7..f8c4f40d0 100644 --- a/src/stream/stream.cc +++ b/src/stream/stream.cc @@ -98,7 +98,7 @@ void Stream::populate_flow_key(Packet* p, FlowKey* key) p->type(), p->get_ip_proto_next(), p->ptrs.ip_api.get_src(), p->ptrs.sp, p->ptrs.ip_api.get_dst(), p->ptrs.dp, - // if the vlan protocol bit is defined, vlan layer gauranteed to exist + // if the vlan protocol bit is defined, vlan layer guaranteed to exist (p->proto_bits & PROTO_BIT__VLAN) ? layer::get_vlan_layer(p)->vid() : 0, (p->proto_bits & PROTO_BIT__MPLS) ? p->ptrs.mplsHdr.label : 0, p->pkth->address_space_id); diff --git a/src/stream/stream.h b/src/stream/stream.h index 707a47987..11e1e5c21 100644 --- a/src/stream/stream.h +++ b/src/stream/stream.h @@ -72,7 +72,7 @@ public: static Flow* new_flow(FlowKey*); // Looks in the flow cache for flow session with specified key and returns - // pointer to flow session oject if found, otherwise null. + // pointer to flow session object if found, otherwise null. static Flow* get_flow(const FlowKey*); // Allocates a flow session object from the flow cache table for the protocol diff --git a/src/stream/tcp/segment_overlap_editor.cc b/src/stream/tcp/segment_overlap_editor.cc index 4ef45ee8f..b112aee45 100644 --- a/src/stream/tcp/segment_overlap_editor.cc +++ b/src/stream/tcp/segment_overlap_editor.cc @@ -400,7 +400,7 @@ int SegmentOverlapEditor::full_right_overlap_os2() int SegmentOverlapEditor::full_right_overlap_os3() { // If this packet is wholly overlapping and the same size as a previous one and we have not - // received the one immediately preceeding, we take the FIRST. + // received the one immediately preceding, we take the FIRST. if ( SEQ_EQ(right->seq, seq) && ( right->payload_size == len ) && ( left && !SEQ_EQ(left->seq + left->payload_size, seq) ) ) { diff --git a/src/stream/tcp/tcp_normalizer.cc b/src/stream/tcp/tcp_normalizer.cc index 50250e5a8..c9a24fa8f 100644 --- a/src/stream/tcp/tcp_normalizer.cc +++ b/src/stream/tcp/tcp_normalizer.cc @@ -34,7 +34,7 @@ static const PegInfo pegName[] = { { "tcp_trim_syn", "tcp segments trimmed on SYN" }, { "tcp_trim_rst", "RST packets with data trimmed" }, - { "tcp_trim_win", "data trimed to window" }, + { "tcp_trim_win", "data trimmed to window" }, { "tcp_trim_mss", "data trimmed to MSS" }, { "tcp_ecn_session", "ECN bits cleared" }, { "tcp_ts_nop", "timestamp options cleared" }, diff --git a/src/stream/tcp/tcp_normalizers.cc b/src/stream/tcp/tcp_normalizers.cc index 54a7de5bb..b54450faa 100644 --- a/src/stream/tcp/tcp_normalizers.cc +++ b/src/stream/tcp/tcp_normalizers.cc @@ -199,8 +199,8 @@ public: static inline int handle_repeated_syn_mswin(TcpStreamTracker* talker, TcpStreamTracker* listener, TcpSegmentDescriptor& tsd, TcpSession* session) { - /* Windows has some strange behaviour here. If the sequence of the reset is the - * next expected sequence, it Resets. Otherwise it ignores the 2nd SYN. + /* Windows has some strange behavior here. If the sequence of the reset is the + * next expected sequence, it Resets. Otherwise it ignores the 2nd SYN. */ if (SEQ_EQ(tsd.get_seg_seq(), listener->r_nxt_ack)) { diff --git a/src/stream/tcp/tcp_reassembler.cc b/src/stream/tcp/tcp_reassembler.cc index d3dd1b5a3..340f0d8db 100644 --- a/src/stream/tcp/tcp_reassembler.cc +++ b/src/stream/tcp/tcp_reassembler.cc @@ -16,7 +16,7 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- -// tcp_reassember.cc author davis mcpherson +// tcp_reassembler.cc author davis mcpherson // Created on: Jul 31, 2015 #ifdef HAVE_CONFIG_H @@ -369,7 +369,7 @@ int TcpReassembler::purge_to_seq(uint32_t flush_seq) * Without doing it this way, the timestamp would be 20. With * the next packet to arrive (P4, seq 40), the ts_last value * wouldn't be updated for the talker in ProcessTcp() since that - * code specificially looks for the NEXT sequence number. + * code specifically looks for the NEXT sequence number. */ if ( !last_ts ) return purged_bytes; diff --git a/src/stream/tcp/tcp_session.cc b/src/stream/tcp/tcp_session.cc index d4f6bb122..ce2892f3c 100644 --- a/src/stream/tcp/tcp_session.cc +++ b/src/stream/tcp/tcp_session.cc @@ -383,7 +383,7 @@ int TcpSession::process_tcp_data(TcpSegmentDescriptor& tsd) return STREAM_UNALIGNED; } - /* move the ack boundry up, this is the only way we'll accept data */ + /* move the ack boundary up, this is the only way we'll accept data */ // FIXIT-L for ips, must move all the way to first hole or right end listener->r_nxt_ack = tsd.get_end_seq(); @@ -679,7 +679,7 @@ void TcpSession::check_for_session_hijack(TcpSegmentDescriptor& tsd) if ( tsd.get_pkt()->is_eth() ) { - // if flag is set, gauranteed to have an eth layer + // if flag is set, guaranteed to have an eth layer Packet* p = tsd.get_pkt(); const eth::EtherHdr* eh = layer::get_eth_layer(p); bool t_hijack = !talker->compare_mac_addresses(eh->ether_src); @@ -767,7 +767,7 @@ void TcpSession::handle_data_segment(TcpSegmentDescriptor& tsd) // FIXIT-M move this to normalizer base class, handle OS_PROXY in derived class if (config->policy != StreamPolicy::OS_PROXY) { - /* check for valid seqeuence/retrans */ + /* check for valid sequence/retrans */ if (!listener->is_segment_seq_valid(tsd) ) return; diff --git a/src/target_based/sftarget_hostentry.cc b/src/target_based/sftarget_hostentry.cc index 14a630303..9789e775e 100644 --- a/src/target_based/sftarget_hostentry.cc +++ b/src/target_based/sftarget_hostentry.cc @@ -42,13 +42,13 @@ static bool hasService(const HostAttributeEntry* host_entry, { if (!application) { - /* match of ipproto, proto. application not speicifed */ + /* match of ipproto, proto. application not specified */ return true; } } else if (!protocol) { - /* match of ipproto. protocol not speicifed */ + /* match of ipproto. protocol not specified */ return true; } } @@ -74,13 +74,13 @@ static bool hasClient(const HostAttributeEntry* host_entry, { if (!application) { - /* match of ipproto, proto. application not speicifed */ + /* match of ipproto, proto. application not specified */ return true; } } else if (!protocol) { - /* match of ipproto. protocol not speicifed */ + /* match of ipproto. protocol not specified */ return true; } } diff --git a/src/time/timersub.h b/src/time/timersub.h index a74b06358..02e7cfe13 100644 --- a/src/time/timersub.h +++ b/src/time/timersub.h @@ -21,7 +21,7 @@ #ifndef TIMERSUB_H #define TIMERSUB_H -// never worry about timersub type activies again -- from GLIBC and upcased. +// never worry about timersub type activities again -- from GLIBC and upcased. #define TIMERSUB(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ diff --git a/src/utils/kmap.cc b/src/utils/kmap.cc index 7b8c3f303..9764f3605 100644 --- a/src/utils/kmap.cc +++ b/src/utils/kmap.cc @@ -214,7 +214,7 @@ int KMapAdd(KMAP* km, void* key, int n, void* userdata) root = km->root[ *P ]; } - /* Walk exisitng Patterns */ + /* Walk existing Patterns */ while ( n ) { if ( root->nodechar == *P ) @@ -268,7 +268,7 @@ int KMapAdd(KMAP* km, void* key, int n, void* userdata) else { /* - * Start a new sibling bracnch to finish this Keyword + * Start a new sibling branch to finish this Keyword */ //printf("added sibling branch nodechar = %c \n",*P); root->sibling= KMapCreateNode(km); diff --git a/src/utils/kmap.h b/src/utils/kmap.h index c8940806f..30273499a 100644 --- a/src/utils/kmap.h +++ b/src/utils/kmap.h @@ -25,7 +25,7 @@ // Keyword Trie based Map Table // The tree uses linked lists to build the finite automata // -// MapKeyFind(): Performs a setwise strcmp() equivalant. +// MapKeyFind(): Performs a setwise strcmp() equivalent. // // Keys may be ascii or binary, both may be of random sizes. Each key may // be a different size, or all one size. Fast dictionary lookup, diff --git a/src/utils/stats.cc b/src/utils/stats.cc index 9ecac3d31..bc2ab8078 100644 --- a/src/utils/stats.cc +++ b/src/utils/stats.cc @@ -224,7 +224,7 @@ const PegInfo proc_names[] = void pc_sum() { - // must sum explicitly; can't zero; daq stats are cuumulative ... + // must sum explicitly; can't zero; daq stats are cumulative ... const DAQ_Stats_t* daq_stats = SFDAQ::get_stats(); g_daq_stats.hw_packets_received += daq_stats->hw_packets_received; diff --git a/src/utils/util_cstring.cc b/src/utils/util_cstring.cc index d652bc5c7..8fb5ac17b 100644 --- a/src/utils/util_cstring.cc +++ b/src/utils/util_cstring.cc @@ -108,7 +108,7 @@ int SnortSnprintfAppend(char* buf, size_t buf_size, const char* format, ...) if (buf[buf_size - 1] != '\0' || (size_t)ret >= buf_size) { - /* truncation occured */ + /* truncation occurred */ buf[buf_size - 1] = '\0'; return SNORT_SNPRINTF_TRUNCATION; } @@ -315,7 +315,7 @@ int sfsnprintfappend(char* dest, int dsize, const char* format, ...) appendLen = vsnprintf(dest+currLen, dsize-currLen, format, ap); va_end(ap); - dest[dsize-1]=0; /* guarantee a null tremination */ + dest[dsize-1]=0; /* guarantee a null termination */ return appendLen; } diff --git a/tools/flatbuffers/fbstreamer.cc b/tools/flatbuffers/fbstreamer.cc index 40f245185..f0199f1fe 100644 --- a/tools/flatbuffers/fbstreamer.cc +++ b/tools/flatbuffers/fbstreamer.cc @@ -19,7 +19,7 @@ // This program is a simple utility for reading the flatbuffers files // Snort generates. The files consist of a schema with a stream of -// timetamped records that this program converts into a YAML array for +// timestamped records that this program converts into a YAML array for // further data processing. #include diff --git a/tools/snort2lua/config_states/config_default_rule_state.cc b/tools/snort2lua/config_states/config_default_rule_state.cc index ed8ed8e2d..0ca546eed 100644 --- a/tools/snort2lua/config_states/config_default_rule_state.cc +++ b/tools/snort2lua/config_states/config_default_rule_state.cc @@ -45,7 +45,7 @@ bool DefaultRuleState::convert(std::istringstream& data_stream) table_api.open_table("alerts"); if (data_stream >> val && - util::case_compare(val, "disableD")) + util::case_compare(val, "disabled")) { table_api.add_option("default_rule_state", false); } diff --git a/tools/snort2lua/config_states/config_ignore_ports.cc b/tools/snort2lua/config_states/config_ignore_ports.cc index 211f6c381..7538ba1d2 100644 --- a/tools/snort2lua/config_states/config_ignore_ports.cc +++ b/tools/snort2lua/config_states/config_ignore_ports.cc @@ -73,7 +73,7 @@ bool IgnorePorts::convert(std::istringstream& data_stream) if (!port.compare("any")) { - // Possible Snort bug, but only port zero is ignrored + // Possible Snort bug, but only port zero is ignored bind.add_when_port("0"); } else if (colon_pos == std::string::npos) @@ -116,13 +116,13 @@ bool IgnorePorts::convert(std::istringstream& data_stream) { data_api.failed_conversion(data_stream, "can't convert " + port); retval = false; - bind.print_binding(false); // don't print the binding if an error occured + bind.print_binding(false); // don't print the binding if an error occurred } catch (std::out_of_range) { data_api.failed_conversion(data_stream, "Port" + port + " must be <= 65535"); retval = false; - bind.print_binding(false); // don't print the binding if an error occured + bind.print_binding(false); // don't print the binding if an error occurred } } diff --git a/tools/snort2lua/conversion_defines.h b/tools/snort2lua/conversion_defines.h index 280d17a09..87bb91ad1 100644 --- a/tools/snort2lua/conversion_defines.h +++ b/tools/snort2lua/conversion_defines.h @@ -23,8 +23,8 @@ #include /* - * This file was specifically created to avoid cyclic depencies - * and should therefore avoid ANY local depencies. + * This file was specifically created to avoid cyclic dependencies + * and should therefore avoid ANY local dependencies. */ class ConversionState; diff --git a/tools/snort2lua/conversion_state.h b/tools/snort2lua/conversion_state.h index 8dadbedb5..8f36ecc4a 100644 --- a/tools/snort2lua/conversion_state.h +++ b/tools/snort2lua/conversion_state.h @@ -58,7 +58,7 @@ protected: RuleApi& rule_api; #if 0 - Forward declaration fo parsing methods.Since these are all inline, + Forward declaration of parsing methods.Since these are all inline, unable to forward declare in regular code. inline bool eat_option(std::istringstream& stream); @@ -204,8 +204,9 @@ protected: } else { - table_api.add_comment("Unable to convert " + elem + - "!! The element must be a single charachter or number between 0 - 255 inclusive"); + table_api.add_comment( + "Unable to convert " + elem + "!! " + "The element must be a single character or number between 0 - 255 inclusive"); retval = false; } } @@ -225,7 +226,7 @@ protected: while (stream >> elem && elem != "}") tmp += " " + elem; - // remove the extra space at the beginig of the string + // remove the extra space at the beginning of the string if (tmp.size() > 0) tmp.erase(tmp.begin()); diff --git a/tools/snort2lua/data/data_types/dt_comment.cc b/tools/snort2lua/data/data_types/dt_comment.cc index e189ca56b..ad47cc0d1 100644 --- a/tools/snort2lua/data/data_types/dt_comment.cc +++ b/tools/snort2lua/data/data_types/dt_comment.cc @@ -115,13 +115,13 @@ std::ostream& operator<<(std::ostream& out, const Comments& c) std::string curr_pre_str = pre_str; std::size_t max_line_length = c.max_line_length - pre_str_length - 1; - // print a newline betweens strings, but not before the first line. + // print a newline between strings, but not before the first line. if (first_str) first_str = false; else out << "\n"; - // if the line is emptry, we need a newline. the loop won't print it. + // if the line is empty, we need a newline. the loop won't print it. if (str.size() == 0) out << "\n"; diff --git a/tools/snort2lua/data/data_types/dt_comment.h b/tools/snort2lua/data/data_types/dt_comment.h index 1c5309385..baf1668a2 100644 --- a/tools/snort2lua/data/data_types/dt_comment.h +++ b/tools/snort2lua/data/data_types/dt_comment.h @@ -31,7 +31,7 @@ static const std::string start_comments = static const std::string start_errors = "\nERRORS:\n" - " all of these occured during the attempted conversion:\n\n"; + " all of these occurred during the attempted conversion:\n\n"; static const std::string start_bad_rules = "\nFAILED RULES CONVERSIONS:\n" diff --git a/tools/snort2lua/data/data_types/dt_var.cc b/tools/snort2lua/data/data_types/dt_var.cc index 3d64a1f7f..18e59dabe 100644 --- a/tools/snort2lua/data/data_types/dt_var.cc +++ b/tools/snort2lua/data/data_types/dt_var.cc @@ -114,7 +114,7 @@ bool Variable::add_value(std::string elem) VarData* vd = new VarData(); vd->type = VarType::STRING; - // if the previous variable was a symbol, we need a space seperator. + // if the previous variable was a symbol, we need a space separator. if (!vars.empty()) s.insert(0, " "); diff --git a/tools/snort2lua/data/dt_data.cc b/tools/snort2lua/data/dt_data.cc index 28901e8f4..6480337e0 100644 --- a/tools/snort2lua/data/dt_data.cc +++ b/tools/snort2lua/data/dt_data.cc @@ -69,7 +69,7 @@ std::string DataApi::translate_variable(const std::string& var_name) * I copied the Snort version of ExpandVars and made some * minor adjustments. * - * Given a Snort style string to expand, this funcion will return + * Given a Snort style string to expand, this function will return * the expanded string */ std::string DataApi::expand_vars(const std::string& string) diff --git a/tools/snort2lua/data/dt_data.h b/tools/snort2lua/data/dt_data.h index f5c034cbb..bee0897c4 100644 --- a/tools/snort2lua/data/dt_data.h +++ b/tools/snort2lua/data/dt_data.h @@ -29,19 +29,19 @@ #include "data/dt_rule_api.h" // FIXIT-L change name to data_api -// FIXIT-L remove all unecessary includes +// FIXIT-L remove all unnecessary includes // FIXIT-L set_default_print name should be change to print_all // As a heads up to whoever reads this file. This one API is really three // distinct API's rolled into one. One API for rules, one api for misc // data (variables, includes, etcs), one api for creating tables. Hoever, -// the reason they are together is becasue this class is not static, and I +// the reason they are together is because this class is not static, and I // did not want to be pass three pointers to the three API's when creating -// new convesion states. There are comments in in all caps which show the -// seperate the sections. +// new conversion states. There are comments in in all caps which show the +// separate the sections. // The first section of this file is really DataApi creation and -// initialization, and adding miscelaneous objects to the DataApi data. +// initialization, and adding miscellaneous objects to the DataApi data. // The second section is for creating tables and their options. The third // section is for creating rules. @@ -89,7 +89,7 @@ public: bool empty() const { return vars.empty() && includes.empty(); } - // functions specifically usefull when parsing includes. + // functions specifically useful when parsing includes. // allows for easy swapping of data. These two functions // swap data which will be printed in 'print_rules()' and // 'print_conf_options()' @@ -103,7 +103,7 @@ public: bool add_variable(std::string name, std::string value); // add a Snort style include file bool add_include_file(std::string name); - // add a 'comment' to the Lua file. shoudl ONLY be used when + // add a 'comment' to the Lua file. should ONLY be used when // adding a comment from the original Snort file. void add_comment(std::string); // Call when failed to convert a line. diff --git a/tools/snort2lua/data/dt_rule_api.cc b/tools/snort2lua/data/dt_rule_api.cc index 33acb5bf1..e42631e32 100644 --- a/tools/snort2lua/data/dt_rule_api.cc +++ b/tools/snort2lua/data/dt_rule_api.cc @@ -108,7 +108,7 @@ void RuleApi::include_rule_file(std::string file_name) { if (curr_rule) { - DataApi::developer_error("Attempting to include a file while buliding a rule!"); + DataApi::developer_error("Attempting to include a file while building a rule!"); } else { diff --git a/tools/snort2lua/data/dt_rule_api.h b/tools/snort2lua/data/dt_rule_api.h index 28b740011..afa38830e 100644 --- a/tools/snort2lua/data/dt_rule_api.h +++ b/tools/snort2lua/data/dt_rule_api.h @@ -49,7 +49,7 @@ public: void print_rules(std::ostream&, bool in_rule_file); void print_rejects(std::ostream&); - // functions specifically usefull when parsing includes. + // functions specifically useful when parsing includes. // allows for easy swapping of data. These two functions // swap data which will be printed in 'print_rules()' and // 'print_conf_options()' diff --git a/tools/snort2lua/data/dt_table_api.cc b/tools/snort2lua/data/dt_table_api.cc index d9e4fe2cc..f933d587b 100644 --- a/tools/snort2lua/data/dt_table_api.cc +++ b/tools/snort2lua/data/dt_table_api.cc @@ -189,7 +189,7 @@ void TableApi::create_append_data(std::string& fqn, Table*& t) // I need to iterate over the stack of open tables. However, // stack's don't allow iteration without popping. So, rather // than change the underlying stack data structure, I am going - // to just copy the entire data structure. Innedficciant, but + // to just copy the entire data structure. Inefficient, but // not pressed for speed here. std::stack copy(open_tables); diff --git a/tools/snort2lua/data/dt_table_api.h b/tools/snort2lua/data/dt_table_api.h index cf3e46a27..265f4a7c7 100644 --- a/tools/snort2lua/data/dt_table_api.h +++ b/tools/snort2lua/data/dt_table_api.h @@ -32,13 +32,13 @@ * really three distinct API's rolled into one. One API for rules, * one api for misc data (variables, includes, etcs), one api * for creating tables. Hoever, the reason they are -* together is becasue this class is not static, and I did not +* together is because this class is not static, and I did not * want to be pass three pointers to the three API's when -* creating new convesion states. There are comments in -* in all caps which show the seperate the sections. +* creating new conversion states. There are comments in +* in all caps which show the separate the sections. * * The first section of this file is really DataApi creation -* and initialization, and adding miscelaneous objects +* and initialization, and adding miscellaneous objects * to the DataApi data. The second section is for creating * tables and their options. The third section is for * creating rules. @@ -109,7 +109,7 @@ public: // add an option with a list of variables --> table = { name = 'elem1 elem2 ...' } // corresponds to Parameter::PT_MULTI bool add_list(std::string list_name, std::string next_elem); -// add a commment to be printed in the table --> table = { -- comment \n ... } +// add a comment to be printed in the table --> table = { -- comment \n ... } bool add_comment(std::string comment); // add a comment about an option change to the table bool add_diff_option_comment(std::string orig_var, std::string new_var); diff --git a/tools/snort2lua/helpers/converter.cc b/tools/snort2lua/helpers/converter.cc index cb28723f6..008c1c3b9 100644 --- a/tools/snort2lua/helpers/converter.cc +++ b/tools/snort2lua/helpers/converter.cc @@ -175,7 +175,7 @@ int Converter::parse_file(std::string input_file) if (!tmp.empty()) { - // first charachter is either a '#' or a ';' + // first character is either a '#' or a ';' tmp.erase(tmp.begin()); util::ltrim(tmp); } diff --git a/tools/snort2lua/helpers/converter.h b/tools/snort2lua/helpers/converter.h index 629897b24..4ed65a8a6 100644 --- a/tools/snort2lua/helpers/converter.h +++ b/tools/snort2lua/helpers/converter.h @@ -61,7 +61,7 @@ public: std::string rules, // defaults to output_file std::string errors); // defaults to output_file - // parse a file without creating an entirely new Lua configuation + // parse a file without creating an entirely new Lua configuration int parse_include_file(std::string input_file); // set the next parsing state. diff --git a/tools/snort2lua/helpers/parse_cmd_line.cc b/tools/snort2lua/helpers/parse_cmd_line.cc index 57f55d87e..ecb698198 100644 --- a/tools/snort2lua/helpers/parse_cmd_line.cc +++ b/tools/snort2lua/helpers/parse_cmd_line.cc @@ -202,7 +202,7 @@ static void parse_config_file(const char* key, const char* val) std::size_t path_sep = conf_file.find_last_of("\\"); #endif - /* is there a directory seperator in the filename */ + /* is there a directory separator in the filename */ if (path_sep != std::string::npos) { path_sep++; /* include path separator */ @@ -353,18 +353,18 @@ static ConfigFunc basic_opts[] = "output the new Snort++ lua configuration to " }, { "q", print_quiet, "", - "quiet mode. Only output valid confiration information to the " }, + "quiet mode. Only output valid configuration information to the " }, { "r", parse_rule_file, "", "output any converted rule to " }, { "s", sing_rule_files, "", "when parsing , write 's rules to " - ". Meaningles if '-i' provided" }, + ". Meaningless if '-i' provided" }, { "t", sing_conf_files, "", "when parsing , write 's information, " - "excluding rules, to . Meaningles if '-i' provided" }, + "excluding rules, to . Meaningless if '-i' provided" }, { "V", print_version, "", "Print the current Snort2Lua version" }, @@ -396,7 +396,7 @@ static ConfigFunc basic_opts[] = "between the Snort and Snort++ configurations to the " }, { "quiet", print_quiet, "", - "Same as '-q'. quiet mode. Only output valid confiration information to the " }, + "Same as '-q'. quiet mode. Only output valid configuration information to the " }, { "remark", add_remark, "", "same as '-m'. add a remark to the end of every converted rule" }, diff --git a/tools/snort2lua/helpers/parse_cmd_line.h b/tools/snort2lua/helpers/parse_cmd_line.h index e01ac6867..cb6bbb872 100644 --- a/tools/snort2lua/helpers/parse_cmd_line.h +++ b/tools/snort2lua/helpers/parse_cmd_line.h @@ -25,7 +25,7 @@ namespace parser { /* * This file is directly copied (and then edited) - * from Snrot++'s cmd_line.h + * from Snort++'s cmd_line.h */ bool parse_cmd_line(int argc, char* argv[]); diff --git a/tools/snort2lua/helpers/s2l_util.cc b/tools/snort2lua/helpers/s2l_util.cc index 27d56ddde..b918bb747 100644 --- a/tools/snort2lua/helpers/s2l_util.cc +++ b/tools/snort2lua/helpers/s2l_util.cc @@ -164,16 +164,16 @@ std::size_t get_substr_length(std::string str, std::size_t max_length) bool get_string(std::istringstream& stream, std::string& option, - const std::string delimeters) + const std::string delimiters) { - if (delimeters.empty() || !stream.good()) + if (delimiters.empty() || !stream.good()) { option = std::string(); return false; } - else if (delimeters.size() == 1) + else if (delimiters.size() == 1) { - std::getline(stream, option, delimeters[0]); + std::getline(stream, option, delimiters[0]); trim(option); return !option.empty(); } @@ -186,18 +186,18 @@ bool get_string(std::istringstream& stream, while (stream.good() && option.empty()) { pos = stream.tellg(); - std::getline(stream, option, delimeters[0]); + std::getline(stream, option, delimiters[0]); } - // find the first non-delimeter charachter - const std::size_t first_char = option.find_first_not_of(delimeters); + // find the first non-delimiter character + const std::size_t first_char = option.find_first_not_of(delimiters); - // if there are no characters between a delimeter, empty string. return false + // if there are no characters between a delimiter, empty string. return false if (first_char == std::string::npos) return false; - // find the first delimeter after the first non-delimeter - std::size_t first_delim = option.find_first_of(delimeters, first_char); + // find the first delimiter after the first non-delimiter + std::size_t first_delim = option.find_first_of(delimiters, first_char); if (first_delim == std::string::npos) first_delim = option.size(); // set value to take proper substr diff --git a/tools/snort2lua/helpers/s2l_util.h b/tools/snort2lua/helpers/s2l_util.h index 5f90a8bb5..6514a15c5 100644 --- a/tools/snort2lua/helpers/s2l_util.h +++ b/tools/snort2lua/helpers/s2l_util.h @@ -43,7 +43,7 @@ const ConvertMap* find_map(const std::vector&, const std::str const std::unique_ptr& find_map( const std::vector >&, const std::string& keyword, bool strict_case = true); -// trim from begining +// trim from beginning std::string& ltrim(std::string& s); // trim from end @@ -56,27 +56,27 @@ std::string& trim(std::string& s); bool file_exists(const std::string& name); /* - * Takes in a stream and a string of delimeters. The function will extract the characters - * from the stream until it hits one of the delimeters. The substring will be set to the - * third parameter. The stream itself will point to the chrachter after the first delim. + * Takes in a stream and a string of delimiters. The function will extract the characters + * from the stream until it hits one of the delimiters. The substring will be set to the + * third parameter. The stream itself will point to the character after the first delim. * * PARAMS: * data_stream - the data stream from which to find a substring. - * delimeters - The string of delimeters. + * delimiters - The string of delimiters. * options - The found substring will be place in this parameter. If the * stream is empty or no characters have been extracted, then - * this parameter wil be set to an empty string. + * this parameter will be set to an empty string. * RETURNS: * True - when the string is found. - * False - whenma substing was unable to be extracted. + * False - when the substring was unable to be extracted. */ bool get_string(std::istringstream& data_stream, std::string& option, - const std::string delimeters); + const std::string delimiters); /* * Returns the rest of the data_streams data as one argument. - * Usefule when parsing filenames with spaces or other + * Useful when parsing filenames with spaces or other * characters which can get removed by c++ libraries * * NO SIDE EFFECTS @@ -93,7 +93,7 @@ std::string get_rule_option_args(std::istringstream& data_stream); * * PARAMS: * data_stream - the rule's data stream - * opt_name - the option name for which to seach. + * opt_name - the option name for which to search. * RETURN: * the opt_names value or an empty string if the opt_name * is not found. @@ -105,7 +105,7 @@ std::string rule_option_find_val(std::istringstream& data_stream, // remove any ']]' and double spaces from this string. std::string& sanitize_lua_string(std::string& s); -// find the location of the first space before max_str_lenght. +// find the location of the first space before max_str_length. // if no space exists before max_str_length, return the first space // after max_length. Otherwise, return std::string::npos std::size_t get_substr_length(std::string s, std::size_t max_length); diff --git a/tools/snort2lua/helpers/util_binder.h b/tools/snort2lua/helpers/util_binder.h index 7c98e09e9..27eaf589b 100644 --- a/tools/snort2lua/helpers/util_binder.h +++ b/tools/snort2lua/helpers/util_binder.h @@ -25,7 +25,7 @@ class TableApi; -// The Binders destrutor will add the Objects configuration to the +// The Binders destructor will add the Objects configuration to the // table_api. class Binder { diff --git a/tools/snort2lua/keyword_states/kws_attribute_table.cc b/tools/snort2lua/keyword_states/kws_attribute_table.cc index f449c48f1..715e5c8a9 100644 --- a/tools/snort2lua/keyword_states/kws_attribute_table.cc +++ b/tools/snort2lua/keyword_states/kws_attribute_table.cc @@ -63,7 +63,7 @@ bool AttributeTable::get_next_element(std::string& elem) if (!elem.empty() && elem.front() != '<') { - // add the '<' charachter back for next call + // add the '<' character back for next call attr_file.unget(); return true; } @@ -76,7 +76,7 @@ bool AttributeTable::get_next_element(std::string& elem) } /* - * Parse the 'SERVICE' element and add elemnts to Lua configuration + * Parse the 'SERVICE' element and add elements to Lua configuration */ void AttributeTable::parse_service() { @@ -466,7 +466,7 @@ bool AttributeTable::convert(std::istringstream& data_stream) parse_attr_table(); /* - * While there probaby should be another else, + * While there probably should be another else, * I have absolutely NO idea what correct * 'grammar' entails. So, in this case and all others * just ignore any extra data. diff --git a/tools/snort2lua/keyword_states/kws_include.cc b/tools/snort2lua/keyword_states/kws_include.cc index 4924cad54..b48f740bd 100644 --- a/tools/snort2lua/keyword_states/kws_include.cc +++ b/tools/snort2lua/keyword_states/kws_include.cc @@ -72,8 +72,7 @@ bool Include::convert(std::istringstream& data_stream) } else { - data_api.failed_conversion(data_stream, "include requires a" - "'filename' argument"); + data_api.failed_conversion(data_stream, "include requires a 'filename' argument"); } return false; diff --git a/tools/snort2lua/keyword_states/kws_rule.cc b/tools/snort2lua/keyword_states/kws_rule.cc index e31cdb73b..a096cd655 100644 --- a/tools/snort2lua/keyword_states/kws_rule.cc +++ b/tools/snort2lua/keyword_states/kws_rule.cc @@ -58,7 +58,7 @@ bool RuleHeader::convert(std::istringstream& data_stream) std::string rule_string = data_stream.str(); std::size_t end_pos = rule_string.rfind(')'); rule_string = rule_string.substr(0, end_pos); - util::rtrim(rule_string); // gaurantee last char is a rule opt/subopt + util::rtrim(rule_string); // guarantee last char is a rule opt/subopt data_stream.str(rule_string); data_stream.seekg(curr_pos); // position was reset. so find curr position diff --git a/tools/snort2lua/keyword_states/kws_ruletype.cc b/tools/snort2lua/keyword_states/kws_ruletype.cc index 60a733a54..37771c3c2 100644 --- a/tools/snort2lua/keyword_states/kws_ruletype.cc +++ b/tools/snort2lua/keyword_states/kws_ruletype.cc @@ -121,7 +121,7 @@ bool RuleType::convert(std::istringstream& stream) if (map) { - // using smart pointer to gaurantee new Map is deleted + // using smart pointer to guarantee new Map is deleted const std::vector >& ruletype_map = ruletype_api; std::unique_ptr new_map(new ConvertMap()); diff --git a/tools/snort2lua/output_states/out_fast.cc b/tools/snort2lua/output_states/out_fast.cc index 81001cd53..3216f331a 100644 --- a/tools/snort2lua/output_states/out_fast.cc +++ b/tools/snort2lua/output_states/out_fast.cc @@ -69,7 +69,7 @@ bool AlertFast::convert(std::istringstream& data_stream) std::string units = "B"; std::istringstream tmp_stream(keyword); - tmp_stream >> limit; // gauranteed success since keyword is non-empty + tmp_stream >> limit; // guaranteed success since keyword is non-empty if (tmp_stream >> c) { if (c == 'K' || c == 'k') diff --git a/tools/snort2lua/preprocessor_states/pps_dcerpc_server.cc b/tools/snort2lua/preprocessor_states/pps_dcerpc_server.cc index 39f3c0f4b..509904bbb 100644 --- a/tools/snort2lua/preprocessor_states/pps_dcerpc_server.cc +++ b/tools/snort2lua/preprocessor_states/pps_dcerpc_server.cc @@ -134,7 +134,7 @@ bool DcerpcServer::get_bracket_list(std::istringstream& data_stream, std::string } // Read from data_stream either a single value x or list : [x,y,z ... ] -// Put in str either a single value 'x', or space sperated list 'x y z' +// Put in str either a single value 'x', or space separated list 'x y z' bool DcerpcServer::convert_val_or_list(std::istringstream& data_stream, std::string& str) { if (!(data_stream >> str)) @@ -165,7 +165,7 @@ bool DcerpcServer::convert_val_or_list(std::istringstream& data_stream, std::str // remove "" str.erase(std::remove(str.begin(), str.end(), '"'), str.end()); - // convert ',' seperators to spaces + // convert ',' separators to spaces replace(str.begin(), str.end(), ',', ' '); return true; @@ -405,7 +405,7 @@ bool DcerpcServer::parse_detect(std::istringstream& data_stream, ((ports.find('[') == std::string::npos) && (ports.find(']') != std::string::npos))) { - // found outer list seperator + // found outer list separator if (one_type) { return false; @@ -465,7 +465,7 @@ bool DcerpcServer::parse_detect(std::istringstream& data_stream, { return true; } - else // wait for list terminator or item seperator + else // wait for list terminator or item separator { if (!data_stream.get(c)) return false; diff --git a/tools/snort2lua/preprocessor_states/pps_frag3_global.cc b/tools/snort2lua/preprocessor_states/pps_frag3_global.cc index 5a97484c7..52a03d3d6 100644 --- a/tools/snort2lua/preprocessor_states/pps_frag3_global.cc +++ b/tools/snort2lua/preprocessor_states/pps_frag3_global.cc @@ -42,12 +42,12 @@ bool Frag3Global::convert(std::istringstream& data_stream) table_api.open_table("stream_ip"); - // full options are comma seperated + // full options are comma separated while (util::get_string(data_stream, keyword, ",")) { bool tmpval = true; - // suboptions are space seperated + // suboptions are space separated std::istringstream args_stream(keyword); args_stream >> keyword; diff --git a/tools/snort2lua/preprocessor_states/pps_ftp_telnet_protocol.cc b/tools/snort2lua/preprocessor_states/pps_ftp_telnet_protocol.cc index 26ea81bae..a7f53dcd8 100644 --- a/tools/snort2lua/preprocessor_states/pps_ftp_telnet_protocol.cc +++ b/tools/snort2lua/preprocessor_states/pps_ftp_telnet_protocol.cc @@ -454,7 +454,7 @@ bool FtpClient::convert(std::istringstream& data_stream) retval = false; } - table_api.close_table(); // anonymouse + table_api.close_table(); // anonymous } table_api.close_table(); // "bounce_to" } @@ -551,7 +551,7 @@ bool Telnet::convert(std::istringstream& data_stream) } } - // adding the defualt port. + // adding the default port. if (!ports_set) bind.add_when_port("23"); diff --git a/tools/snort2lua/preprocessor_states/pps_reputation.cc b/tools/snort2lua/preprocessor_states/pps_reputation.cc index 31e8ea6ce..3f0098682 100644 --- a/tools/snort2lua/preprocessor_states/pps_reputation.cc +++ b/tools/snort2lua/preprocessor_states/pps_reputation.cc @@ -49,7 +49,7 @@ bool Reputation::convert(std::istringstream& data_stream) bool tmpval = true; std::istringstream arg_stream(keyword); - // should be gauranteed to happen. Checking for error just cause + // should be guaranteed to happen. Checking for error just cause if (!(arg_stream >> keyword)) tmpval = false; diff --git a/tools/snort2lua/preprocessor_states/pps_sfportscan.cc b/tools/snort2lua/preprocessor_states/pps_sfportscan.cc index b74bde63c..9ee93eefc 100644 --- a/tools/snort2lua/preprocessor_states/pps_sfportscan.cc +++ b/tools/snort2lua/preprocessor_states/pps_sfportscan.cc @@ -157,7 +157,7 @@ bool PortScan::convert(std::istringstream& data_stream) retval = tmpval; } - table_api.close_table(); // unecessary since the state will be reset + table_api.close_table(); // unnecessary since the state will be reset return retval; } diff --git a/tools/snort2lua/preprocessor_states/pps_sip.cc b/tools/snort2lua/preprocessor_states/pps_sip.cc index 4409940aa..27345de6b 100644 --- a/tools/snort2lua/preprocessor_states/pps_sip.cc +++ b/tools/snort2lua/preprocessor_states/pps_sip.cc @@ -57,7 +57,7 @@ bool Sip::convert(std::istringstream& data_stream) bool tmpval = true; std::istringstream arg_stream(keyword); - // should be gauranteed to happen. Checking for error just cause + // should be guaranteed to happen. Checking for error just cause if (!(arg_stream >> keyword)) tmpval = false; diff --git a/tools/snort2lua/preprocessor_states/pps_ssl.cc b/tools/snort2lua/preprocessor_states/pps_ssl.cc index 324a2e997..e3cf834bf 100644 --- a/tools/snort2lua/preprocessor_states/pps_ssl.cc +++ b/tools/snort2lua/preprocessor_states/pps_ssl.cc @@ -55,7 +55,7 @@ bool Ssl::convert(std::istringstream& data_stream) bool tmpval = true; std::istringstream arg_stream(keyword); - // should be gauranteed to happen. Checking for error just cause + // should be guaranteed to happen. Checking for error just cause if (!(arg_stream >> keyword)) tmpval = false; diff --git a/tools/snort2lua/preprocessor_states/pps_stream5_global.cc b/tools/snort2lua/preprocessor_states/pps_stream5_global.cc index 2d8903641..dc5e29161 100644 --- a/tools/snort2lua/preprocessor_states/pps_stream5_global.cc +++ b/tools/snort2lua/preprocessor_states/pps_stream5_global.cc @@ -49,7 +49,7 @@ bool StreamGlobal::convert(std::istringstream& data_stream) bool tmpval = true; std::istringstream arg_stream(keyword); - // should be gauranteed to happen. Checking for error just cause + // should be guaranteed to happen. Checking for error just cause if (!(arg_stream >> keyword)) tmpval = false; diff --git a/tools/snort2lua/preprocessor_states/pps_stream5_tcp.cc b/tools/snort2lua/preprocessor_states/pps_stream5_tcp.cc index 643e40867..0e48bfec4 100644 --- a/tools/snort2lua/preprocessor_states/pps_stream5_tcp.cc +++ b/tools/snort2lua/preprocessor_states/pps_stream5_tcp.cc @@ -271,7 +271,7 @@ bool StreamTcp::convert(std::istringstream& data_stream) server.set_when_role("server"); any.set_when_role("any"); - // create pointers so other member functinos can access binders + // create pointers so other member functions can access binders bind_client = &client; bind_server = &server; bind_any = &any; @@ -287,7 +287,7 @@ bool StreamTcp::convert(std::istringstream& data_stream) bool tmpval = true; std::istringstream arg_stream(keyword); - // should be gauranteed to happen. Checking for error just cause + // should be guaranteed to happen. Checking for error just cause if (!(arg_stream >> keyword)) tmpval = false; diff --git a/tools/snort2lua/rule_states/rule_content.cc b/tools/snort2lua/rule_states/rule_content.cc index 19c44e212..6f39e26c4 100644 --- a/tools/snort2lua/rule_states/rule_content.cc +++ b/tools/snort2lua/rule_states/rule_content.cc @@ -219,7 +219,7 @@ bool Content::convert(std::istringstream& data_stream) std::string tmp_str; val = ""; - opts >> keyword; // gauranteed to work since get_string is true + opts >> keyword; // guaranteed to work since get_string is true std::getline(opts, val); util::trim(keyword); @@ -254,7 +254,7 @@ bool Content::convert(std::istringstream& data_stream) add_sticky_buffer(data_stream, "pkt_data"); // since this option is not an content modifier, - // lets coninue parsing the rest of the rule. + // lets continue parsing the rest of the rule. data_stream.clear(); data_stream.seekg(pos); return set_next_rule_state(data_stream); diff --git a/tools/snort2lua/rule_states/rule_convert_comma_list.cc b/tools/snort2lua/rule_states/rule_convert_comma_list.cc index c9361d844..1cb41ffce 100644 --- a/tools/snort2lua/rule_states/rule_convert_comma_list.cc +++ b/tools/snort2lua/rule_states/rule_convert_comma_list.cc @@ -27,7 +27,7 @@ namespace rules { /* - * Convert rule option from comma list to a space sperated list in qoutes: + * Convert rule option from comma list to a space separated list in qoutes: * x,y,z to "x y z" */ diff --git a/tools/snort2lua/rule_states/rule_dnp3_obj.cc b/tools/snort2lua/rule_states/rule_dnp3_obj.cc index 5470c2c1b..bf2eda8a6 100644 --- a/tools/snort2lua/rule_states/rule_dnp3_obj.cc +++ b/tools/snort2lua/rule_states/rule_dnp3_obj.cc @@ -49,7 +49,7 @@ bool DNP3Obj::convert(std::istringstream& data) val.insert(0, group); size_t start_pos = val.find(','); if (start_pos == std::string::npos) - rule_api.bad_rule(data, "dnp3_obj:expecting 2 args seperated by comma"); + rule_api.bad_rule(data, "dnp3_obj:expecting 2 args separated by comma"); else val.insert(start_pos+1, var); diff --git a/tools/snort2lua/rule_states/rule_react.cc b/tools/snort2lua/rule_states/rule_react.cc index 41879ecc0..0ce9b984f 100644 --- a/tools/snort2lua/rule_states/rule_react.cc +++ b/tools/snort2lua/rule_states/rule_react.cc @@ -114,7 +114,7 @@ static ConversionState* ctor(Converter& c) { // react may not have arguments. So, set this information now. - // create this table to ensure react is instatiated + // create this table to ensure react is instantiated c.get_table_api().open_table("react"); c.get_table_api().close_table(); diff --git a/tools/snort2lua/rule_states/rule_resp.cc b/tools/snort2lua/rule_states/rule_resp.cc index ac34d3515..f4d1ffda6 100644 --- a/tools/snort2lua/rule_states/rule_resp.cc +++ b/tools/snort2lua/rule_states/rule_resp.cc @@ -83,7 +83,7 @@ bool Resp::convert(std::istringstream& data_stream) !tmp.compare("reset_source") || !tmp.compare("icmp_port")) { - // Now that we have confirmed this is a vlid option, parse it!! + // Now that we have confirmed this is a valid option, parse it!! table_api.open_table("reject"); do @@ -167,7 +167,7 @@ static ConversionState* ctor(Converter& c) { // reject may not have arguments. So, set this information now. - // create this table to ensure reject is instatiated + // create this table to ensure reject is instantiated c.get_table_api().open_table("reject"); c.get_table_api().close_table(); diff --git a/tools/u2spewfoo/u2spewfoo.cc b/tools/u2spewfoo/u2spewfoo.cc index 57fc585ed..c6c87868c 100644 --- a/tools/u2spewfoo/u2spewfoo.cc +++ b/tools/u2spewfoo/u2spewfoo.cc @@ -302,7 +302,7 @@ static void event_dump(u2record* record) /* network to host ordering In the event structure, only the last 40 bits are not 32 bit fields - The first 11 fields need to be convertted */ + The first 11 fields need to be converted */ field = (uint8_t*)&event; for (i=0; i<11; i++, field+=4) { @@ -341,7 +341,7 @@ static void event6_dump(u2record* record) /* network to host ordering In the event structure, only the last 40 bits are not 32 bit fields - The first fields need to be convertted */ + The first fields need to be converted */ field = (uint8_t*)&event; for (i=0; i<9; i++, field+=4) { @@ -387,7 +387,7 @@ static void event2_dump(u2record* record) /* network to host ordering In the event structure, only the last 40 bits are not 32 bit fields - The first 11 fields need to be convertted */ + The first 11 fields need to be converted */ field = (uint8_t*)&event; for (i=0; i<11; i++, field+=4) { @@ -436,7 +436,7 @@ static void event2_6_dump(u2record* record) /* network to host ordering In the event structure, only the last 40 bits are not 32 bit fields - The first fields need to be convertted */ + The first fields need to be converted */ field = (uint8_t*)&event; for (i=0; i<9; i++, field+=4) { @@ -522,7 +522,7 @@ static void packet_dump(u2record* record) memcpy(&packet, record->data, offset); /* network to host ordering - The first 7 fields need to be convertted */ + The first 7 fields need to be converted */ field = (uint8_t*)&packet; for (counter=0; counter<7; counter++, field+=4) {