]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #2790 in SNORT/snort3 from ~RUCOMBS/snort3:stylez to master
authorRuss Combs (rucombs) <rucombs@cisco.com>
Tue, 16 Mar 2021 15:57:26 +0000 (15:57 +0000)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Tue, 16 Mar 2021 15:57:26 +0000 (15:57 +0000)
Squashed commit of the following:

commit 498f2ec03eda4d563554358acb56da12fa323a33
Author: russ <rucombs@cisco.com>
Date:   Thu Mar 11 11:13:08 2021 -0500

    style: Change C++ comment NULL to null

    To make inappropriate use of NULL vs nullptr easier to spot.
    Also, keep MPLS "NULL label" comments since that is normative.

commit 3cf4fc89961d26585a091ca2f04526f3098c9302
Author: russ <rucombs@cisco.com>
Date:   Thu Mar 11 10:51:59 2021 -0500

    style: Remove unnecessary cruft

commit e8ec4040b2deabe46d7322191fc4087e92525d8e
Author: russ <rucombs@cisco.com>
Date:   Thu Mar 11 10:38:41 2021 -0500

    style: Remove unused cruft

57 files changed:
src/codecs/ip/cd_esp.cc
src/codecs/ip/cd_icmp4.cc
src/codecs/ip/cd_tcp.cc
src/decompress/file_decomp_pdf.cc
src/detection/fp_create.cc
src/detection/tag.cc
src/events/sfeventq.cc
src/filters/sfrf_test.cc
src/filters/sfthd.cc
src/ips_options/asn1_util.cc
src/ips_options/ips_cvs.cc
src/ips_options/ips_flags.cc
src/ips_options/ips_pcre.cc
src/log/log.cc
src/log/log_text.cc
src/loggers/alert_unixsock.cc
src/main/snort.cc
src/main/snort.h
src/network_inspectors/appid/detector_plugins/http_url_patterns.h
src/network_inspectors/appid/service_plugins/test/service_rsync_test.cc
src/network_inspectors/appid/tp_lib_handler.h
src/network_inspectors/normalize/norm.h
src/network_inspectors/reputation/reputation_module.cc
src/ports/port_object.cc
src/protocols/packet_manager.cc
src/protocols/packet_manager.h
src/service_inspectors/cip/cip_parsing.cc
src/service_inspectors/dce_rpc/dce_common.h
src/service_inspectors/dce_rpc/dce_list.cc
src/service_inspectors/dce_rpc/dce_list.h
src/service_inspectors/dce_rpc/dce_smb_commands.cc
src/service_inspectors/dce_rpc/dce_smb_module.cc
src/service_inspectors/dce_rpc/dce_smb_transaction.cc
src/service_inspectors/dce_rpc/dce_smb_utils.cc
src/service_inspectors/dce_rpc/dce_utils.h
src/service_inspectors/dce_rpc/ips_dce_opnum.cc
src/service_inspectors/dce_rpc/smb_common.h
src/service_inspectors/dce_rpc/smb_message.cc
src/service_inspectors/dns/dns.cc
src/service_inspectors/ftp_telnet/ftp_cmd_lookup.cc
src/service_inspectors/ftp_telnet/pp_telnet.cc
src/service_inspectors/sip/sip_config.cc
src/service_inspectors/sip/sip_parser.h
src/service_inspectors/sip/sip_roptions.h
src/service_inspectors/sip/sip_utils.cc
src/service_inspectors/smtp/smtp.cc
src/sfip/sf_ip.cc
src/sfip/sf_ipvar.cc
src/sfrt/sfrt.cc
src/sfrt/sfrt_dir.cc
src/sfrt/sfrt_flat.cc
src/sfrt/sfrt_flat_dir.cc
src/stream/stream.cc
src/stream/stream.h
src/stream/tcp/segment_overlap_editor.cc
src/stream/tcp/test/tcp_normalizer_test.cc
src/utils/util_cstring.cc

index 211f30e066c4d02c7627228fc2931c88e1ad7f6e..70ce93b7e40c83e1fc61a6ea77427e80dd7a18e0 100644 (file)
@@ -111,7 +111,7 @@ bool EspCodec::decode(const RawData& raw, CodecData& codec, DecodeData& snort)
 
     /* The Authentication Data at the end of the packet is variable-length.
        RFC 2406 says that Encryption and Authentication algorithms MUST NOT
-       both be NULL, so we assume NULL Encryption and some other Authentication.
+       both be null, so we assume null Encryption and some other Authentication.
 
        The mandatory algorithms for Authentication are HMAC-MD5-96 and
        HMAC-SHA-1-96, so we assume a 12-byte authentication data at the end. */
index 9f31bb111db6e917ea4dacfaabe2a5ea06914699..69fa6637063be5d3e71fb0b2107d77b9c21105c9 100644 (file)
@@ -337,7 +337,7 @@ void Icmp4Codec::log(TextLog* const log, const uint8_t* raw_pkt,
 {
     const icmp::ICMPHdr* const icmph = reinterpret_cast<const ICMPHdr*>(raw_pkt);
 
-    /* 32 digits plus 7 colons and a NULL byte */
+    /* 32 digits plus 7 colons and a null byte */
     char buf[8*4 + 7 + 1];
     TextLog_Print(log, "Type:%d  Code:%d  ", icmph->type, icmph->code);
     TextLog_Puts(log, "\n\t");
index ebd677658b3e112e4e23c2229f2e4562d21969ea..38dae7b6f4619e451e12589ecec62667c094456a 100644 (file)
@@ -569,7 +569,7 @@ void TcpCodec::log(TextLog* const text_log, const uint8_t* raw_pkt,
 
     /* print TCP flags */
     CreateTCPFlagString(tcph, tcpFlags);
-    TextLog_Puts(text_log, tcpFlags); /* We don't care about the NULL */
+    TextLog_Puts(text_log, tcpFlags); /* We don't care about the null */
 
     /* print other TCP info */
     TextLog_Print(text_log, "  SrcPort:%u  DstPort:%u\n\tSeq: 0x%lX  Ack: 0x%lX  "
index 9c49d4b0397343201e1d994458c36edacbca75b5..7e60bf08d85101c3cca0f194bad0cb3316f9ceda 100644 (file)
@@ -315,7 +315,7 @@ static inline fd_status_t Pop_State(fd_PDF_Parse_t* p)
     return File_Decomp_OK;
 }
 
-/* If there's a previous state on the stack, return a pointer to it, else return NULL */
+/* If there's a previous state on the stack, return a pointer to it, else return null */
 static inline fd_PDF_Parse_Stack_t* Get_Previous_State(fd_PDF_Parse_t* p)
 {
     if ( p->Parse_Stack_Index == 0 )
index 059a14f1cb9128556faadd0b8d10da0a17bbc129..5519a5d6111ce8a1b157f87a2b70b062d1351665 100644 (file)
@@ -404,7 +404,7 @@ static int pmx_create_tree(SnortConfig* sc, void* id, void** existing_tree, Mpse
         if ( !*existing_tree )
             return -1;
 
-        /* NULL input id (PMX *), last call for this pattern state */
+        /* null input id (PMX *), last call for this pattern state */
         return finalize_detection_option_tree(sc, (detection_option_tree_root_t*)*existing_tree);
     }
 
index bc46e2c00590959e99beecbe3ddd27e3d52b9de4..61b5bea1bb49210c110168700b16b180ae18eda8 100644 (file)
@@ -205,7 +205,7 @@ static inline unsigned int memory_per_node(XHash* hash)
  * @param hash - pointer to XHash that should point to either ssn_tag_cache_ptr
  * or host_tag_cache_ptr.
  *
- * @returns a pointer to new TagNode or NULL if memory couldn't * be allocated
+ * @returns a pointer to new TagNode or null if memory couldn't * be allocated
  */
 static TagNode* TagAlloc(
     XHash* hash
index 55d2cd5601efdd3846a61bf631f6d0cb2be16135..a2a26648c90d04a96065964639a53159e67d032a 100644 (file)
@@ -40,7 +40,7 @@
 **       sfeventq_event_alloc() allocates the memory for storing the event.
 **       sfeventq_add() adds the event and prioritizes the event in the queue.
 **       You should only allocate and add one event at a time.  Otherwise,
-**       event_alloc() will return NULL on memory exhaustion.
+**       event_alloc() will return null on memory exhaustion.
 **
 **  3. Event actions
 **       sfeventq_action() will call the provided function on the initialized
@@ -88,13 +88,13 @@ SF_EVENTQ* sfeventq_new(int max_nodes, int log_nodes, int event_size)
 **  Allocate the memory for an event to add to the event queue.  This
 **  function is meant to be called first, the event structure filled in,
 **  and then added to the queue.  While you can allocate several times before
-**  adding to the queue, this is not recommended as you may get a NULL ptr
+**  adding to the queue, this is not recommended as you may get a null ptr
 **  if you allocate more than the max node number.
 **
 **  @return  void *
 **
-**  @retval  NULL unable to allocate memory.
-**  @retval !NULL ptr to memory.
+**  @retval  null - unable to allocate memory.
+**  @retval !null - ptr to memory.
 */
 void* sfeventq_event_alloc(SF_EVENTQ* eq)
 {
@@ -167,8 +167,8 @@ void sfeventq_free(SF_EVENTQ* eq)
 **
 **  @return SF_EVENTQ_NODE *
 **
-**  @retval NULL resource exhaustion and event is lower priority than last node
-**  @retval !NULL ptr to node memory.
+**  @retval null - resource exhaustion and event is lower priority than last node
+**  @retval !null - ptr to node memory.
 */
 static SF_EVENTQ_NODE* get_eventq_node(SF_EVENTQ* eq, void*)
 {
@@ -195,7 +195,7 @@ int sfeventq_add(SF_EVENTQ* eq, void* event)
     assert(event);
 
     /*
-    **  If get_eventq_node() returns NULL, this means that
+    **  If get_eventq_node() returns null, this means that
     **  we have exhausted the eventq and the incoming event
     **  is lower in priority then the last ranked event.
     **  So we just drop it.
index d250661c2dbef4e52fd5a5b8f6d7eb667881979e..ccc8c27b9f5cf50422fb8bd3df03dca479bd1b39 100644 (file)
@@ -862,7 +862,7 @@ static EventData evData[] =
 static void PrintTests()
 {
     unsigned i;
-    EventData* prev = NULL;
+    EventData* prev = nullptr;
 
     for ( i = 0; i < NUM_EVENTS; i++ )
     {
index 3d1c06eed1695141fccca557493676032738f818..6e0ab02e33d9db2dc6c2282b69c3c77c61689efa 100644 (file)
@@ -83,7 +83,7 @@ XHash* sfthd_local_new(unsigned bytes)
         sizeof(THD_IP_NODE));
 
 #ifdef THD_DEBUG
-    if (local_hash == NULL)
+    if ( !local_hash )
         printf("Could not allocate the sfxhash table\n");
 #endif
 
@@ -98,7 +98,7 @@ XHash* sfthd_global_new(unsigned bytes)
         sizeof(THD_IP_NODE));
 
 #ifdef THD_DEBUG
-    if (global_hash == NULL)
+    if ( !global_hash )
         printf("Could not allocate the sfxhash table\n");
 #endif
 
index d85e6a990fbedca18c922c00c6c89f7b3aa073b9..0384d1d3e0db6f71897a0072b07bb5bab8f38d76 100644 (file)
@@ -91,8 +91,8 @@ static void asn1_init_node_index()
 **
 **  @return ASN1_TYPE *
 **
-**  @retval NULL memory allocation failed
-**  @retval !NULL function successful
+**  @retval null -  memory allocation failed
+**  @retval !null - function successful
 */
 static ASN1_TYPE* asn1_node_alloc()
 {
@@ -159,7 +159,7 @@ void asn1_free_mem()
 **  @retval ASN1_OK function successful
 **  @retval ASN1_ERR_OVERLONG_LEN tag number too large
 **  @retval ASN1_ERR_OOB encoding goes out of bounds
-**  @retval ASN1_ERR_NULL_MEM function arguments are NULL
+**  @retval ASN1_ERR_NULL_MEM function arguments are null
 */
 static int asn1_decode_tag_num_ext(ASN1_DATA* asn1_data, unsigned* tag_num)
 {
@@ -210,7 +210,7 @@ static int asn1_decode_tag_num_ext(ASN1_DATA* asn1_data, unsigned* tag_num)
 **
 **  @return integer
 **
-**  @retval ASN1_ERR_NULL_MEM function arguments are NULL
+**  @retval ASN1_ERR_NULL_MEM function arguments are null
 **  @retval ASN1_ERR_OOB buffer out of bounds
 **  @retval ASN1_ERR_INVALID_BER_TAG_LEN tag num too large or bad encoding
 **  @retval ASN1_OK function ok
@@ -299,7 +299,7 @@ static int asn1_decode_len_type(const uint8_t* data)
 **
 **  @return integer
 **
-**  @retval ASN1_ERR_NULL_MEM function arguments NULL
+**  @retval ASN1_ERR_NULL_MEM function arguments null
 **  @retval ASN1_ERR_OVERLONG_LEN length to long for us to decode
 **  @retval ASN1_ERR_OOB out of bounds condition
 **  @retval ASN1_OK function successful
@@ -364,7 +364,7 @@ static int asn1_decode_len_ext(ASN1_DATA* asn1_data, unsigned* size)
 **
 **  @return integer
 **
-**  @retval ASN1_ERR_NULL_MEM function arguments NULL
+**  @retval ASN1_ERR_NULL_MEM function arguments null
 **  @retval ASN1_ERR_FATAL should never get this
 **  @retval ASN1_ERR_OOB out of bounds condition
 **  @retval ASN1_OK function successful
@@ -498,7 +498,7 @@ static int asn1_decode_type(const uint8_t** data, unsigned* len, ASN1_TYPE** asn
     /*
     **  Check len first, because if it's 0, then we already decoded a valid
     **  construct.  We let the caller know this, by returning OK, but setting
-    **  the asn1_type ptr to NULL.
+    **  the asn1_type ptr to null.
     */
     if (*len == 0)
         return ASN1_OK;
index 41f7009de15ad04e3d68764b4eaaeff2482858e5..bbb9ab60571c8496e4f5a8ed4bbd47a7fa69b81e 100644 (file)
@@ -213,7 +213,7 @@ static int CvsDecode(const uint8_t* data, uint16_t data_len,
 **  NAME
 **    CvsCmdCompare
 **       Compares two pointers to char to see if they are equal.
-**       The first arg is NULL terminated.  The second is not and
+**       The first arg is null terminated.  The second is not and
 **       it's length is passed in.
 **
 */
@@ -245,7 +245,7 @@ static int CvsCmdCompare(const char* cmd, const uint8_t* pkt_cmd, int pkt_cmd_le
 **       the replacement '\0' is put into the structure's command
 **       argument member.  If there isn't a space, the entire line
 **       is put in the command and the command argument is set to
-**       NULL.
+**       null.
 **
 */
 /**
index e45b5741884639dc77caf5f93e0ffc2878bdb4dc..3c6d4d9ea2f1a10f836be2a6e308d231b6175521 100644 (file)
@@ -245,7 +245,7 @@ static void flags_parse_test(const char* rule, TcpFlagCheckData* idx)
         default:
             ParseError(
                 "bad TCP flag = '%c'"
-                "Valid options: 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;
index eb3abbb638a1174d9b9e10057736fedea93b40bc..db8c4a427994378c40cd4fbcce0e4e0c4676f1c2 100644 (file)
@@ -116,8 +116,8 @@ static void pcre_check_anchored(PcreData* pcre_data)
     switch (rc)
     {
     /* pcre_fullinfo fails for the following:
-     * PCRE_ERROR_NULL - the argument code was NULL
-     *                   the argument where was NULL
+     * PCRE_ERROR_NULL - the argument code was null
+     *                   the argument where was null
      * PCRE_ERROR_BADMAGIC - the "magic number" was not found
      * PCRE_ERROR_BADOPTION - the value of what was invalid
      * so a failure here means we passed in bad values and we should
@@ -128,7 +128,7 @@ static void pcre_check_anchored(PcreData* pcre_data)
         break;
 
     case PCRE_ERROR_NULL:
-        ParseError("pcre_fullinfo: code and/or where were NULL.");
+        ParseError("pcre_fullinfo: code and/or where were null.");
         return;
 
     case PCRE_ERROR_BADMAGIC:
index 2d67911f2e45c26a9b7a53d3f6522e58465ae752..fe556e1ac148b291eb6beeb898aeede7ce841e19 100644 (file)
@@ -40,7 +40,7 @@ using namespace snort;
 
 namespace snort
 {
-// Input is packet and an nine-byte (including NULL) character array.  Results
+// Input is packet and an nine-byte (including null) character array.  Results
 // are put into the character array.
 void CreateTCPFlagString(const tcp::TCPHdr* const tcph, char* flagBuffer)
 {
index abc64c50026b58228e8c7f5a04978e7ec0f3024f..29023d5048822cd6231d35e336b3089780b3fa84 100644 (file)
@@ -583,7 +583,7 @@ void LogTCPHeader(TextLog* log, Packet* p)
     }
     /* print TCP flags */
     CreateTCPFlagString(tcph, tcpFlags);
-    TextLog_Puts(log, tcpFlags); /* We don't care about the NULL */
+    TextLog_Puts(log, tcpFlags); /* We don't care about the null */
 
     /* print other TCP info */
     TextLog_Print(log, " Seq: 0x%lX  Ack: 0x%lX  Win: 0x%X  TcpLen: %d",
@@ -778,7 +778,7 @@ static void LogICMPEmbeddedIP(TextLog* log, Packet* p)
  */
 void LogICMPHeader(TextLog* log, Packet* p)
 {
-    /* 32 digits plus 7 colons and a NULL byte */
+    /* 32 digits plus 7 colons and a null byte */
     char buf[8*4 + 7 + 1];
 
     if (p->ptrs.icmph == nullptr)
index 5c7936cf409ecac564eca71224475e4c8f76f79c..bf0514a5a7d0ba27bc7dd999865c928720ec9436 100644 (file)
@@ -58,7 +58,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 valid 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 */
index 71fa28bdbc20a1a9b168f3a1475fd4177ca1f61a..679aa4ec735f574cbffdb4343e9263964cc99e2e 100644 (file)
@@ -279,9 +279,7 @@ bool Snort::drop_privileges()
             return false;
     }
 
-    initializing = false;
     privileges_dropped = true;
-
     return true;
 }
 
@@ -317,8 +315,6 @@ void Snort::term()
 
     const SnortConfig* sc = SnortConfig::get_conf();
 
-    initializing = false;  // just in case we cut out early
-
     memory::MemoryCap::print();
 
     IpsManager::global_term(sc);
@@ -380,13 +376,9 @@ void Snort::clean_exit(int)
 // public methods
 //-------------------------------------------------------------------------
 
-bool Snort::initializing = true;
 bool Snort::reloading = false;
 bool Snort::privileges_dropped = false;
 
-bool Snort::is_starting()
-{ return initializing; }
-
 bool Snort::is_reloading()
 { return reloading; }
 
index c6eee51fdb30221fe6b2ecd80475cb991f8a47b1..eb190a34c55e3f23802614e296f3ad5f184cdd6f 100644 (file)
@@ -47,7 +47,6 @@ public:
     static void do_pidfile();
     static void cleanup();
 
-    static bool is_starting();
     static bool has_dropped_privileges();
     SO_PUBLIC static bool is_reloading();
 
index e8691793b640c8a9beb92338e1a171b944ebfb1d..93d43419130ae08edd46be98390df7b823dbc97f 100644 (file)
@@ -101,7 +101,7 @@ struct DetectorHTTPPattern
     {
         if( !pat )
         {
-            snort::ErrorMessage("HTTP pattern string is NULL.");
+            snort::ErrorMessage("HTTP pattern string is null.");
             return false;
         }
 
index f9a5e251c72dda9954143144e52ff4446fa3c175..754fb46ff51a8144453a265eb4f46a34b4f478fb 100644 (file)
 #include <CppUTest/TestHarness.h>
 #include <CppUTestExt/MockSupport.h>
 
-ServiceRSYNCData* fake_rsync_data = NULL;
+ServiceRSYNCData* fake_rsync_data = nullptr;
 
 TEST_GROUP(service_rsync)
 {
     void setup()
     {
-        fake_rsync_data = NULL;
+        fake_rsync_data = nullptr;
     }
 
     void teardown()
index 7c96c4c999f529f430363393662a3cb1935d1801..b7abbaf01172b260c6d53a31a010b1a2799ddf03 100644 (file)
@@ -28,7 +28,7 @@ class AppIdConfig;
 class OdpContext;
 
 // This needs to be exported by any third party .so library.
-// Must return NULL if it fails to create the object.
+// Must return null if it fails to create the object.
 typedef ThirdPartyAppIdContext* (* TpAppIdCreateCtxt)(ThirdPartyConfig& );
 typedef ThirdPartyAppIdSession* (* TpAppIdCreateSession)(ThirdPartyAppIdContext& ctxt);
 typedef int (* TpAppIdPfini)();
index 6cbbec385f02fc7e289cf502acf03b9508dc7e66..3e74c3c19dc647abe02b03da416c42eae4a6c0c3 100644 (file)
@@ -42,7 +42,7 @@ struct NormalizerConfig
     uint8_t normalizer_options[32];
 
     // these must be in the same order PROTO_IDs are defined!
-    // if entry is NULL, proto doesn't have normalization or it is disabled
+    // if entry is null, proto doesn't have normalization or it is disabled
     NormalFunc normalizers[snort::PacketManager::max_protocols()];
 };
 
index 44a3e4a3da6b5028f376c819ecc44da496c7ac8f..6da6c68712885925152c319b928ea4821044f7ab 100644 (file)
@@ -153,7 +153,7 @@ bool ReputationModule::set(const char*, Value& v, SnortConfig*)
 ReputationConfig* ReputationModule::get_data()
 {
 
-    // FIXIT-M: this needs to be set to NULL prior to returning here.
+    // FIXIT-M: this needs to be set to null prior to returning here.
     // If we do that, though, reload module will error out, even when
     // reputation has been properly configured (on startup) in lua.
     return conf;
index 50d424cab7a239203d0d753ac761372847298ae0..32770d392a3f69a87f105d9925b74aaa57ef5e56 100644 (file)
@@ -515,7 +515,7 @@ void PortObjectPrintPortsRaw(PortObject* po)
      * 30 bytes.  For the entire list, need room for spaces and brackets and
      * potential negations. Or:
      *      list_size * (30 + 1space_for_each_element, +
-     *       1potential_negation) + surrounding_whitespace + brackets + NULL */
+     *       1potential_negation) + surrounding_whitespace + brackets + null */
 
     bufsize = po->item_list->count * (30 + 1 + 1) + 5;
     buf = (char*)snort_calloc(bufsize);
index 7fd5fd503a8674320137db36ccd66ca1595b7e83..7c6628fd6202669d77aea123f98381b89fb064d8 100644 (file)
@@ -69,7 +69,6 @@ const std::array<const char*, PacketManager::stat_offset> PacketManager::stat_na
 };
 
 // Encoder Foo
-static THREAD_LOCAL PegCount total_rebuilt_pkts = 0;
 static THREAD_LOCAL std::array<uint8_t, Codec::PKT_MAX>* s_pkt;
 
 void PacketManager::thread_init()
@@ -720,7 +719,6 @@ int PacketManager::format_tcp(
     c->context->pkth->pktlen = 0;
     c->context->pkth->ts = p->pkth->ts;
 
-    total_rebuilt_pkts++;
     return 0;
 }
 
@@ -816,7 +814,6 @@ int PacketManager::encode_format(
     c->context->pkth->ts = p->pkth->ts;
 
     layer::set_packet_pointer(c);  // ensure we are looking at the new packet
-    total_rebuilt_pkts++;
     return 0;
 }
 
@@ -888,9 +885,6 @@ void PacketManager::encode_update(Packet* p)
 // codec support and statistics
 //-------------------------------------------------------------------------
 
-PegCount PacketManager::get_rebuilt_packet_count()
-{ return total_rebuilt_pkts; }
-
 uint16_t PacketManager::encode_get_max_payload(const Packet* p)
 {
     if ( !p->num_layers )
index 27e85c552a5bc3d52539ec92c8d7b03978238135..0c0f5813f05a1b0a4076a7c67afa1dde07410906 100644 (file)
@@ -100,9 +100,6 @@ public:
 
     /* codec support and statistics */
 
-    // get the number of packets which have been rebuilt by this thread
-    static PegCount get_rebuilt_packet_count();
-
     // get the max payload for the current packet
     static uint16_t encode_get_max_payload(const Packet*);
 
index 9b6e0c9faef7f73e6900b29e72cb51525e027b45..7ccd822c71e75dabffdfbb3d6b2d4723078cf901 100644 (file)
@@ -19,7 +19,7 @@
 // cip_parsing.cc author RA/Cisco
 
 /* Description: Data parsing for EtherNet/IP and CIP formats.
-   Note: No pointer parameters to these functions can be passed as NULL. */
+   Note: No pointer parameters to these functions can be passed as null. */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
index 0e8ebf5b417c57ba7ba0e7a05c4ce9dc59f31cf9..f40f5da886db2498e531ef95df6545979807ab7a 100644 (file)
@@ -184,7 +184,7 @@ struct DCE2_Roptions
     int opnum;    /* Set to sentinel if not applicable */
 
     /* dce_stub_data */
-    const uint8_t* stub_data;  /* Set to NULL if not applicable */
+    const uint8_t* stub_data;  /* Set to null if not applicable */
 };
 
 enum DCE2_SsnFlag
index b2efb9e265a284500063ae840cdf6f715c49f333..53b900d78333c5fdf7d06b58c379cfa09680ff7b 100644 (file)
@@ -53,11 +53,11 @@ static void DCE2_ListInsertBefore(DCE2_List*, DCE2_ListNode*, DCE2_ListNode*);
  *      for inserting, finding, etc.
  *  DCE2_ListDataFree
  *      An optional function to call to free data in the list.
- *      If NULL is passed in, the user will have to manually free
+ *      If null is passed in, the user will have to manually free
  *      the data.
  *  DCE2_ListKeyFree
  *      An optional function to call to free keys used in the list.
- *      If NULL is passed in, the user will have to manually free
+ *      If null is passed in, the user will have to manually free
  *      the keys.
  *  int
  *      Flags that affect processing of the list.
@@ -66,7 +66,7 @@ static void DCE2_ListInsertBefore(DCE2_List*, DCE2_ListNode*, DCE2_ListNode*);
  * Returns:
  *  DCE2_List *
  *      Pointer to a valid list object.
- *      NULL if an error occurs.
+ *      Null if an error occurs.
  *
  ********************************************************************/
 DCE2_List* DCE2_ListNew(DCE2_ListType type, DCE2_ListKeyCompare kc,
@@ -221,7 +221,7 @@ static void DCE2_ListInsertBefore(DCE2_List* list, DCE2_ListNode* insert, DCE2_L
  *          in the list and no duplicates are allowed.
  *      DCE2_RET__SUCCESS if a new node with key and data is
  *          successfully inserted into the list.
- *      DCE2_RET__ERROR if a NULL list object was passed in.
+ *      DCE2_RET__ERROR if a null list object was passed in.
  *
  ********************************************************************/
 DCE2_Ret DCE2_ListInsert(DCE2_List* list, void* key, void* data)
@@ -309,7 +309,7 @@ DCE2_Ret DCE2_ListInsert(DCE2_List* list, void* key, void* data)
  * Returns:
  *  void *
  *      The data in the first node in the list.
- *      NULL if the list object passed in is NULL, or there are
+ *      Null if the list object passed in is null, or there are
  *          no items in the list.
  *
  ********************************************************************/
@@ -342,7 +342,7 @@ void* DCE2_ListFirst(DCE2_List* list)
  * Returns:
  *  void *
  *      The data in the next node in the list.
- *      NULL if the list object passed in is NULL, or we are at
+ *      Null if the list object passed in is null, or we are at
  *          the end of the list and there are no next nodes.
  *
  ********************************************************************/
@@ -372,7 +372,7 @@ void* DCE2_ListNext(DCE2_List* list)
  *
  * Removes all of the nodes in a list.  Does not delete the list
  * object itself.  Calls data free and key free functions for
- * data and key if they are not NULL.
+ * data and key if they are not null.
  *
  * Arguments:
  *  DCE2_List *
@@ -446,7 +446,7 @@ void DCE2_ListDestroy(DCE2_List* list)
  *  void *
  *      If the key is found, the data associated with the node
  *          is returned.
- *      NULL is returned if the item cannot be found given the key.
+ *      Null is returned if the item cannot be found given the key.
  *
  ********************************************************************/
 void* DCE2_ListFind(DCE2_List* list, void* key)
@@ -579,7 +579,7 @@ DCE2_Ret DCE2_ListFindKey(DCE2_List* list, void* key)
  * Returns:
  *  DCE2_Ret
  *      DCE2_RET__ERROR if a node in the list with the specified
- *          key cannot be found or the list object passed in is NULL.
+ *          key cannot be found or the list object passed in is null.
  *      DCE2_RET__SUCCESS if the node is successfully removed from
  *          the list.
  *
@@ -688,7 +688,7 @@ void DCE2_ListRemoveCurrent(DCE2_List* list)
  * Arguments:
  *  DCE2_QueueDataFree
  *      An optional free function for the data inserted into
- *      the queue.  If NULL is passed in, the user will be
+ *      the queue.  If null is passed in, the user will be
  *      responsible for freeing data left in the queue.
  *
  * Returns:
@@ -719,7 +719,7 @@ DCE2_Queue* DCE2_QueueNew(DCE2_QueueDataFree df)
  *
  * Returns:
  *  DCE2_Ret
- *      DCE2_RET__ERROR if the queue object passed in is NULL.
+ *      DCE2_RET__ERROR if the queue object passed in is null.
  *      DCE2_RET__SUCCESS if the data is successfully added to
  *          the queue.
  *
@@ -766,8 +766,8 @@ DCE2_Ret DCE2_QueueEnqueue(DCE2_Queue* queue, void* data)
  * Returns:
  *  void *
  *      The data in the first node in the queue.
- *      NULL if there are no items in the queue or the queue object
- *          passed in is NULL.
+ *      Null if there are no items in the queue or the queue object
+ *          passed in is null.
  *
  ********************************************************************/
 void* DCE2_QueueDequeue(DCE2_Queue* queue)
@@ -808,7 +808,7 @@ void* DCE2_QueueDequeue(DCE2_Queue* queue)
  *
  * Removes all of the nodes in a queue.  Does not delete the queue
  * object itself.  Calls data free function for data if it is
- * not NULL.
+ * not null.
  *
  * Arguments:
  *  DCE2_Queue *
@@ -876,7 +876,7 @@ void DCE2_QueueDestroy(DCE2_Queue* queue)
  * Returns:
  *  void *
  *      The data in the first node in the queue.
- *      NULL if the queue object passed in is NULL, or there are
+ *      Null if the queue object passed in is null, or there are
  *          no items in the queue.
  *
  ********************************************************************/
@@ -909,7 +909,7 @@ void* DCE2_QueueFirst(DCE2_Queue* queue)
  * Returns:
  *  void *
  *      The data in the next node in the queue.
- *      NULL if the queue object passed in is NULL, or we are at
+ *      Null if the queue object passed in is null, or we are at
  *          the end of the queue and there are no next nodes.
  *
  ********************************************************************/
@@ -994,7 +994,7 @@ void DCE2_QueueRemoveCurrent(DCE2_Queue* queue)
  * Returns:
  *  void *
  *      The data in the last node in the queue.
- *      NULL if the queue object passed in is NULL, or there are
+ *      Null if the queue object passed in is null, or there are
  *          no items in the queue.
  *
  ********************************************************************/
index da3e4546f0f69014c7265120a7a68a4415f9db44..1ae594003de29223c13f7aab06a17bf5fca127d4 100644 (file)
@@ -142,7 +142,7 @@ void* DCE2_QueueLast(DCE2_Queue*);
  * Returns:
  *  bool
  *      true if the list has zero nodes in it or the list object
- *          passed in is NULL.
+ *          passed in is null.
  *      false if the list has one or more nodes in it.
  *
  ********************************************************************/
index 94537a48f2bb163f94fe6d363a1c0c7ed17ae112..d5272c07574abbc3dcf7259c4f45980c3c33e392 100644 (file)
@@ -1276,7 +1276,7 @@ DCE2_Ret DCE2_SmbSessionSetupAndX(DCE2_SmbSsnData* ssd, const SmbNtHdr* smb_hdr,
                         return DCE2_RET__SUCCESS;
                     }
 
-                    // Move past NULL string terminator
+                    // Move past null string terminator
                     dce2_move(nb_ptr, nb_len, increment);
                 }
             }
@@ -1592,7 +1592,7 @@ DCE2_Ret DCE2_SmbNegotiate(DCE2_SmbSsnData* ssd, const SmbNtHdr*,
             if (nb_len == 0)
                 break;
 
-            // Just a NULL byte - acceptable by Samba and Windows
+            // Just a null byte - acceptable by Samba and Windows
             if (term_ptr == nb_ptr)
                 continue;
 
@@ -1600,7 +1600,7 @@ DCE2_Ret DCE2_SmbNegotiate(DCE2_SmbSsnData* ssd, const SmbNtHdr*,
                 && (strncmp((const char*)nb_ptr, SMB_DIALECT_NT_LM_012, term_ptr - nb_ptr) == 0))
                 break;
 
-            // Move past string and NULL byte
+            // Move past string and null byte
             dce2_move(nb_ptr, nb_len, (term_ptr - nb_ptr) + 1);
 
             ntlm_index++;
@@ -1674,7 +1674,7 @@ DCE2_Ret DCE2_SmbTreeConnectAndX(DCE2_SmbSsnData* ssd, const SmbNtHdr* smb_hdr,
             while ((bs = (const uint8_t*)memchr(nb_ptr, '\\', nb_len)) != nullptr)
                 dce2_move(nb_ptr, nb_len, (bs - nb_ptr) + 1);
 
-            // Move past NULL byte if unicode
+            // Move past null byte if unicode
             if (SmbUnicode(smb_hdr) && (nb_len != 0))
                 dce2_move(nb_ptr, nb_len, 1);
 
index 842f49de9cb92ce9696f5baec8863fc7a42ab9a8..53a6d99c5a0640b28e6b9609b91e0a9157654710 100644 (file)
@@ -519,7 +519,7 @@ bool Dce2SmbModule::set(const char*, Value& v, SnortConfig*)
 
 void Dce2SmbModule::get_data(dce2SmbProtoConf& dce2_smb_config)
 {
-    dce2_smb_config = config; // includes pointer copy so set to NULL
+    dce2_smb_config = config; // includes pointer copy so set to null
     config.smb_invalid_shares = nullptr;
 }
 
index 427da039e8161fbbb5aa246c4b6c3a1123d28fe0..8f739782f17aed2d19e18544cd56f5acaf519998 100644 (file)
@@ -553,7 +553,7 @@ static DCE2_Ret DCE2_SmbUpdateTransRequest(DCE2_SmbSsnData* ssd,
         // Not implemented according to MS-CIFS
         case TRANS_RAW_READ_NMPIPE:
 
-        // Can only write 2 NULL bytes and subsequent writes return pipe disconnected
+        // Can only write 2 null bytes and subsequent writes return pipe disconnected
         case TRANS_RAW_WRITE_NMPIPE:
 
         // Can at most do a DCE/RPC bind
index a5fab9775779309b0f94a6b26c2a362400fed369..a0fa0cd2d9caf70426c16a789fb2bb6db8c757aa 100644 (file)
@@ -663,7 +663,7 @@ void DCE2_SmbRemoveFileTrackerFromRequestTrackers(DCE2_SmbSsnData* ssd,
     if (ftracker == nullptr)
         return;
 
-    // NULL out file trackers of any outstanding requests
+    // null out file trackers of any outstanding requests
     // that reference this file tracker
     if (ssd->rtracker.ftracker == ftracker)
         ssd->rtracker.ftracker = nullptr;
@@ -1168,7 +1168,7 @@ Packet* DCE2_SmbGetRpkt(DCE2_SmbSsnData* ssd,
  *
  * Arguments:
  *  DCE2_SmbBuffer **
- *      Pointer to pointer of buffer to add data to.  If NULL
+ *      Pointer to pointer of buffer to add data to.  If null
  *      a new buffer will be allocated.
  *  uint8_t *
  *      Pointer to the current data cursor in packet.
index 2379297daf3e9e38a570d692751d002f3ca7756f..de61687378de403ce45cbd0220e668f0b73e3be2 100644 (file)
@@ -193,7 +193,7 @@ inline bool DCE2_IsConfigEndChar(const char c)
  *
  * Arguments:
  *  char *
- *      NULL terminated string to prune.
+ *      null terminated string to prune.
  *  int
  *      length of string
  *
@@ -202,7 +202,7 @@ inline bool DCE2_IsConfigEndChar(const char c)
  *           still points within the original string.
  *
  * Side effects: Spaces at the end of the string passed in as an
- *               argument are replaced by NULL bytes.
+ *               argument are replaced by null bytes.
  *
  ********************************************************************/
 inline char* DCE2_PruneWhiteSpace(char* str)
@@ -212,7 +212,7 @@ inline char* DCE2_PruneWhiteSpace(char* str)
     if (str == nullptr)
         return nullptr;
 
-    /* Put end a char before NULL byte */
+    /* Put end a char before null byte */
     end = str + (strlen(str) - 1);
 
     while (isspace((int)*str))
@@ -230,14 +230,14 @@ inline char* DCE2_PruneWhiteSpace(char* str)
 /********************************************************************
  * Function: DCE2_IsEmptyStr()
  *
- * Checks if string is NULL, empty or just spaces.
+ * Checks if string is null, empty or just spaces.
  * String must be 0 terminated.
  *
  * Arguments: None
  *  char * - string to check
  *
  * Returns:
- *  true  if string is NULL, empty or just spaces
+ *  true  if string is null, empty or just spaces
  *  false  otherwise
  *
  ********************************************************************/
index 7fb9941e1dda20527600b1d85601c3856e9fd3c2..199eca98b4e780faf11212ae073c4565b7851ece 100644 (file)
@@ -298,7 +298,7 @@ static DCE2_Ret DCE2_OpnumParse(char* args, DCE2_Opnum* opnum)
     uint16_t num_opnums = 0;
     unsigned int i;
 
-    /* Include NULL byte for parsing */
+    /* Include null byte for parsing */
     args_end = args + (strlen(args) + 1);
     memset(opnum_mask, 0, sizeof(opnum_mask));
 
index 934ba9d79fadafced2e8f136ca8a0be935c3220b..aa615caf7f4553c58fae82c0a6bd08a8db72feea 100644 (file)
@@ -443,8 +443,8 @@ inline uint16_t SmbAndXOff2(const SmbAndXCommon* andx)
 }
 
 /* SMB formats (smb_fmt) Dialect, Pathname and ASCII are all
- * NULL terminated ASCII strings unless Unicode is specified
- * in the NT LM 1.0 SMB header in which case they are NULL
+ * null terminated ASCII strings unless Unicode is specified
+ * in the NT LM 1.0 SMB header in which case they are null
  * terminated unicode strings
  */
 #define SMB_FMT__DATA_BLOCK  1
index 31246362edf30b852845316c779ae6dcffd2dccd..0fbfda8666d7b058f481c6d1750015813fe0e323 100644 (file)
@@ -732,7 +732,7 @@ static void DCE2_SmbCheckCommand(DCE2_SmbSsnData* ssd,
         && (DCE2_SsnGetPolicy(&ssd->sd) == DCE2_POLICY__SAMBA))
     {
         // Current Samba errors on a zero byte count Transaction because it
-        // uses it to get the Name string and if zero Name will be NULL and
+        // uses it to get the Name string and if zero Name will be null and
         // it won't process it.
         com_info.cmd_error |= DCE2_SMB_COM_ERROR__BAD_LENGTH;
     }
index 7f26dce55dfcb68f776768148eac50e79de795e3..5e43a8f669e734a9d22fb503fd37980b1ce841b4 100644 (file)
@@ -596,7 +596,7 @@ static uint16_t CheckRRTypeTXTVuln(
             dnsSessionData->curr_txt.txt_len = (uint8_t)*data;
             dnsSessionData->curr_txt.txt_count++;
 
-            /* include the NULL */
+            /* include the null */
             dnsSessionData->curr_txt.total_txt_len += dnsSessionData->curr_txt.txt_len + 1;
 
             if (!dnsSessionData->curr_txt.alerted)
index 1c419936394cba9ced285a553734ff1386c883d7..eaa939a96a3b2ad4852ce826b3ff84f30968cdc0 100644 (file)
@@ -111,7 +111,7 @@ int ftp_cmd_lookup_add(CMD_LOOKUP* CmdLookup, const char* cmd, int len,
  * Returns: int => return code indicating error or success
  *
  * Returns: FTP_CMD_CONF* => Pointer to cmd configuration structure
- *                            matching IP if found, NULL otherwise.
+ *                            matching IP if found, null otherwise.
  *
  */
 FTP_CMD_CONF* ftp_cmd_lookup_find(CMD_LOOKUP* CmdLookup,
index 791959793c897f4dcfd36d503ae37fa92cf7e241..3ae2dc3df46f0621189f6801659041ba697ea415 100644 (file)
@@ -227,7 +227,7 @@ int normalize_telnet(
                 /* wind it back a line? */
                 if (ignoreEraseCmds == FTPP_APPLY_TNC_ERASE_CMDS)
                 {
-                    /* Go back to previous CR NULL or CR LF? */
+                    /* Go back to previous CR null or CR LF? */
                     while (write_ptr > start)
                     {
                         /* Go to previous char */
@@ -333,7 +333,7 @@ int normalize_telnet(
                 {
                     read_ptr++;
                     if (*read_ptr != 0x00)
-                    /* Encryption type is not NULL */
+                    /* Encryption type is not null */
                     {
                         /* printf("Encryption being negotiated by
                          * telnet client\n"); */
index 1620b6de17924f812d524ce4b70ee18c276d2433..e49afab4b355faa24209374f8fe4a10bd8d28697 100644 (file)
@@ -106,7 +106,7 @@ void SIP_SetDefaultMethods(SIP_PROTO_CONF* config)
  *      after parsing the methods list.
  *  SIPMethods*
  *      Flag for the methods.
- *      NULL flag if not a valid method type
+ *      Null flag if not a valid method type
  * Returns:
  *
  ********************************************************************/
index 49ffa3a8c19f64d7f8dd9b95e9ee83c545414419..5b341bec4939a131ae74cd68c263bd42f89893ff 100644 (file)
@@ -56,7 +56,7 @@ struct SIPMsg
     SIP_MediaSession* mediaSession;
     const char* authorization;
     const uint8_t* header;
-    const uint8_t* body_data; // Set to NULL if not applicable
+    const uint8_t* body_data; // Set to null if not applicable
     uint64_t cseqnum;
 
     uint16_t userNameLen;
index f8d7463acd238d6bd216b6e46226cf8506f2e7f4..3d4ca681e0ce0d496f4874fb21d1cdf92243dd68 100644 (file)
@@ -35,10 +35,10 @@ struct SIP_Roptions
 
     uint16_t status_code;       // sip_stat_code data
 
-    const uint8_t* header_data; // Set to NULL if not applicable
+    const uint8_t* header_data; // Set to null if not applicable
     uint16_t header_len;
 
-    const uint8_t* body_data;   // Set to NULL if not applicable
+    const uint8_t* body_data;   // Set to null if not applicable
     uint16_t body_len;
 };
 
index cf058ee4ee74d07b53d042b5ebf5c9cf904e8554..0ea2481087e7fee15c79a2da140206a05ce16284 100644 (file)
@@ -84,7 +84,7 @@ int SIP_TrimSP(const char* start, const char* end, const char** new_start, const
  *  int           - length of the method name
  *
  * Returns:
- *  SIPMethodNode*- the founded method node, or NULL if not founded
+ *  SIPMethodNode*- the founded method node, or null if not founded
  *
  ********************************************************************/
 
@@ -113,7 +113,7 @@ SIPMethodNode* SIP_FindMethod(SIPMethodlist methods, const char* methodName, uns
  *  int: length of the string
  *
  * Returns:
- *  1  if string is NULL, empty or just spaces
+ *  1  if string is null, empty or just spaces
  *  0  otherwise
  *
  ********************************************************************/
index 80f421b02cf85ba50bd9f9e89dde1863c63e384c..8f1053ff5340dbbf04c9e60f0f70868769e2b705 100644 (file)
@@ -333,7 +333,7 @@ static int AddCmd(SmtpProtoConf* config, const char* name, SMTPCmdTypeEnum type)
 
     config->num_cmds++;
 
-    /* allocate enough memory for new command - 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));
index 97997805ee54ee82e67b5727c5bcf60a9d589c0f..43ce58c4287fc6a981077cdb5f4e5620c318b35b 100644 (file)
@@ -226,7 +226,7 @@ SfIpRet SfIp::set(const char* src, uint16_t* srcBits)
     /* check for and extract a mask in CIDR form */
     if ( (mask = strchr(ip, (int)'/')) != nullptr )
     {
-        /* NULL out this character so inet_pton will see the
+        /* Null out this character so inet_pton will see the
          * correct ending to the IP string */
         char* end = mask++;
         while ( (end > ip) && isspace((int)end[-1]) )
index c52b7fbb9bb6806767ebeaa3cf248d84c0994f83..6e3794d7af08dd09d90d2cd222b098ff417e33a1 100644 (file)
@@ -309,7 +309,7 @@ static sfip_node_t* merge_lists(sfip_node_t* list1, sfip_node_t* list2, uint16_t
         return list1;
     }
 
-    /*Both lists are sorted and not NULL. If list1 or list2 contains "any", free the other list*/
+    /*Both lists are sorted and not null. If list1 or list2 contains "any", free the other list*/
     if (list1->flags & SFIP_ANY)
     {
         merge_len = list1_len;
@@ -324,7 +324,7 @@ static sfip_node_t* merge_lists(sfip_node_t* list1, sfip_node_t* list2, uint16_t
         return list2;
     }
 
-    /*Iterate till one of the list is NULL. Append each node to merge_list*/
+    /*Iterate till one of the list is null. Append each node to merge_list*/
     while (list1 && list2)
     {
         if ( num_nodes )
@@ -388,7 +388,7 @@ static sfip_node_t* merge_lists(sfip_node_t* list1, sfip_node_t* list2, uint16_t
         num_nodes++;
     }
 
-    /*list2 is NULL. Append list1*/
+    /*list2 is null. Append list1*/
     while ( list1 )
     {
         tmp = list1->next;
@@ -401,7 +401,7 @@ static sfip_node_t* merge_lists(sfip_node_t* list1, sfip_node_t* list2, uint16_t
         list1 = tmp;
     }
 
-    /*list1 is NULL. Append list2*/
+    /*list1 is null. Append list2*/
     while ( list2 )
     {
         tmp = list2->next;
@@ -600,11 +600,11 @@ static SfIpRet sfvar_list_compare(sfip_node_t* list1, sfip_node_t* list2)
 /* Check's if two variables have the same nodes */
 SfIpRet sfvar_compare(const sfip_var_t* one, const sfip_var_t* two)
 {
-    /* If both NULL, consider equal */
+    /* If both null, consider equal */
     if (!one && !two)
         return SFIP_EQUAL;
 
-    /* If one NULL and not the other, consider unequal */
+    /* If one null and not the other, consider unequal */
     if ((one && !two) || (!one && two))
         return SFIP_FAILURE;
 
index 7345ab2b4d5b088f0f43257c0768ac4ace079807..a419f80acc757c7c85d37cf121f7a39f003078ef 100644 (file)
@@ -324,7 +324,7 @@ void sfrt_cleanup(table_t* table, sfrt_iterator_callback cleanup_func)
             cleanup_func(table->data[index]);
 
             /* cleanup_func is supposed to free memory associated with this
-             * table->data[index].  Set that to NULL.
+             * table->data[index].  Set that to null.
              */
             table->data[index] = nullptr;
 
index 8cdf72110b70f71d7a33a8f36f883f5bf37964de..5da789d772849d633e2fa94fea4de246dd5a1de8 100644 (file)
@@ -415,7 +415,7 @@ static int _dir_sub_insert(IPLOOKUP* ip, int length, int cur_len, GENERIC ptr,
             (dir_sub_table_t*)sub_table->entries[index];
 
         /* Check if we need to alloc a new sub table.
-         * If next_sub was 0/NULL, there's no entry at this index
+         * If next_sub was 0/null, there's no entry at this index
          * If the length is non-zero, there is an entry */
         if (!next_sub || sub_table->lengths[index])
         {
index 2894cfb9392243c1f3fe5a9c619b880705e16ef8..3fcb7253495a4303bd2a95182c2ff2681ba027e9 100644 (file)
@@ -49,7 +49,7 @@ table_flat_t* sfrt_flat_new(char table_flat_type, char ip_type,  long data_size,
     /*The first allocation always return 0*/
     if (!table_ptr)
     {
-        //  return NULL;
+        //  return nullptr;
     }
 #endif
 
index 3fcc652893a376c3c7b9910c98d0a09ccd503da2..9d72125e793fccafaaa217f86f23e1e2b05af265 100644 (file)
@@ -434,7 +434,7 @@ static int _dir_sub_insert(IPLOOKUP* ip, int length, int cur_len, INFO ptr,
         DIR_Entry* entry = (DIR_Entry*)(&base[sub_table->entries]);
 
         /* Check if we need to alloc a new sub table.
-         * If next_sub was 0/NULL, there's no entry at this index
+         * If next_sub was 0/null, there's no entry at this index
          * If the length is non-zero, there is an entry */
         if (!entry[index].value || entry[index].length)
         {
index 72891fa875359026f07054cd74d9161755381f36..e632a1fbf3e0fb57d782f7f91b2573494073658d 100644 (file)
@@ -245,24 +245,6 @@ int Stream::ignore_flow(
         ctrlPkt, type, ip_proto, srcIP, srcPort, dstIP, dstPort, direction, fd);
 }
 
-void Stream::proxy_started(Flow* flow, unsigned dir)
-{
-    if (!flow)
-        return;
-
-    TcpSession* tcpssn = (TcpSession*)flow->session;
-    tcpssn->flush();
-
-    if ( dir & SSN_DIR_FROM_SERVER )
-        set_splitter(flow, true, new LogSplitter(true));
-
-    if ( dir & SSN_DIR_FROM_CLIENT )
-        set_splitter(flow, false, new LogSplitter(false));
-
-    tcpssn->start_proxy();
-    flow->set_proxied();
-}
-
 void Stream::stop_inspection(
     Flow* flow, Packet* p, char dir,
     int32_t /*bytes*/, int /*response*/)
@@ -298,24 +280,6 @@ void Stream::stop_inspection(
     flow->set_state(Flow::FlowState::ALLOW);
 }
 
-void Stream::resume_inspection(Flow* flow, char dir)
-{
-    if (!flow)
-        return;
-
-    switch (dir)
-    {
-    case SSN_DIR_BOTH:
-    case SSN_DIR_FROM_CLIENT:
-    case SSN_DIR_FROM_SERVER:
-        if (flow->ssn_state.ignore_direction & dir)
-        {
-            flow->ssn_state.ignore_direction &= ~dir;
-        }
-        break;
-    }
-}
-
 uint32_t Stream::get_packet_direction(Packet* p)
 {
     if (!p || !(p->flow))
index 021cfa11b8a148f4a1f5d568816bf74435f36099..ab4bfbfa597f2d4b6a5171466c2e19bc5d879670 100644 (file)
@@ -101,9 +101,6 @@ public:
     // packet_flags field of the Packet struct to indicate the direction determined.
     static uint32_t get_packet_direction(Packet*);
 
-    // Sets the stream session into proxy mode.
-    static void proxy_started(Flow*, unsigned dir);  // FIXIT-L method name is misleading
-
     // Stop inspection on a flow for up to count bytes (-1 to ignore for life or until resume).
     // If response flag is set, automatically resume inspection up to count bytes when a data
     // packet in the other direction is seen.  Also marks the packet to be ignored
@@ -117,10 +114,6 @@ public:
         const Packet* ctrlPkt, PktType, IpProtocol, const snort::SfIp* srcIP, uint16_t srcPort,
         const snort::SfIp* dstIP, uint16_t dstPort, char direction, FlowData* fd);
 
-    // Resume inspection for flow.
-    // FIXIT-L does resume work only for a flow that has been stopped by call to stop_inspection?
-    static void resume_inspection(Flow*, char dir);
-
     // Set Active status to force drop the current packet and set flow state to drop
     // subsequent packets arriving from the direction specified.
     static void drop_traffic(const Packet*, char dir);
index c97f5de7fbe2c5366913f44a27d6188793bd67f9..c6a61ee5682ca5ae7eb3e8596e551a43766a74d2 100644 (file)
@@ -377,7 +377,7 @@ void SegmentOverlapEditor::full_right_overlap_truncate_new(TcpReassemblerState&
 
         // Set seq to end of right since overlap was greater than or equal to right->size and
         // inserted seq has been truncated to beginning of right and reset trunc length to 0
-        // since we may fall out of loop if next right is NULL
+        // since we may fall out of loop if next right is null
         trs.sos.seq = trs.sos.right->i_seq + trs.sos.right->i_len;
         trs.sos.left = trs.sos.right;
         trs.sos.right = trs.sos.right->next;
index 0f5c76dd467f5ca02c5f5da7675fa1c7498e964a..7747d6c283df242cde9a6b9aad5d8cfb2d091ccb 100644 (file)
@@ -107,7 +107,7 @@ TEST_GROUP(tcp_normalizers)
 TEST(tcp_normalizers, os_policy)
 {
     StreamPolicy os_policy;
-    Flow* flow = new FlowMock;
+    Flow* flow = new Flow;
     TcpSession* session = new TcpSessionMock( flow );
     TcpNormalizerState tns;
 
@@ -126,7 +126,7 @@ TEST(tcp_normalizers, os_policy)
 TEST(tcp_normalizers, paws_fudge_config)
 {
     StreamPolicy os_policy;
-    Flow* flow = new FlowMock;
+    Flow* flow = new Flow;
     TcpSession* session = new TcpSessionMock( flow );
     TcpNormalizerState tns;
 
@@ -154,7 +154,7 @@ TEST(tcp_normalizers, paws_fudge_config)
 TEST(tcp_normalizers, paws_drop_zero_ts_config)
 {
     StreamPolicy os_policy;
-    Flow* flow = new FlowMock;
+    Flow* flow = new Flow;
     TcpSession* session = new TcpSessionMock( flow );
     TcpNormalizerState tns;
 
@@ -186,7 +186,7 @@ TEST(tcp_normalizers, paws_drop_zero_ts_config)
 TEST(tcp_normalizers, norm_options_enabled)
 {
     StreamPolicy os_policy;
-    Flow* flow = new FlowMock;
+    Flow* flow = new Flow;
     TcpSession* session = new TcpSessionMock( flow );
 
     norm_enabled = true;
index fc44b770c43aa433ff2c57e0d0a54604936cb434..74853d0af9e24a6dedc31d2f066209e541561083 100644 (file)
@@ -187,7 +187,7 @@ int SnortStrnlen(const char* buf, int buf_size)
 /*
  * Find first occurrence of char of accept in s, limited by slen.
  * A 'safe' version of strpbrk that won't read past end of buffer s
- * in cases that s is not NULL terminated.
+ * in cases that s is not null terminated.
  *
  * This code assumes 'accept' is a static string.
  */
@@ -212,7 +212,7 @@ const char* SnortStrnPbrk(const char* s, int slen, const char* accept)
 /*
  * Find first occurrence of searchstr in s, limited by slen.
  * A 'safe' version of strstr that won't read past end of buffer s
- * in cases that s is not NULL terminated.
+ * in cases that s is not null terminated.
  */
 const char* SnortStrnStr(const char* s, int slen, const char* searchstr)
 {