]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge branch 'master' of /nfs/home/rucombs/Snort++ into codecs
authorJosh <jrosenba@cisco.com>
Thu, 28 Aug 2014 16:53:31 +0000 (12:53 -0400)
committerJosh <jrosenba@cisco.com>
Thu, 28 Aug 2014 16:53:31 +0000 (12:53 -0400)
Conflicts:
src/framework/module.cc
src/main/snort_debug.h
src/managers/packet_manager.cc
src/managers/packet_manager.h

1  2 
src/main/snort_debug.h
src/managers/packet_manager.cc
src/managers/packet_manager.h
src/parser/parser.cc
src/stream/stream_api.cc
src/stream/stream_api.h

index 3e3b70058f357999e8650ff276797b594270afe7,762ea4b39305c8992a4581118ad828d3b51d4c4c..b0bf52278282c71e1425fb82f861f63cec8c3946
@@@ -85,7 -85,9 +85,9 @@@
  #define DEBUG_SMTP            0x0001000000000000LL
  #define DEBUG_PP_EXP          0x8000000000000000LL
  
 -void DebugMessageFunc(uint64_t dbg, const char *fmt, ...);
+ #if 0
+ // FIXIT delete duplicate declarations
 +SO_PUBLIC void DebugMessageFunc(uint64_t dbg, const char *fmt, ...);
  #ifdef SF_WCHAR
  void DebugWideMessageFunc(uint64_t dbg, const wchar_t *fmt, ...);
  #endif
index 6c286d66098cf6a382f57a8b5037030c968a8e4c,6efc9af573a149ae1051fcea24b8bebea93da020..e9a05ffa7534535cfc65ddd5fba9c3a0edaee2c0
  
  #include "protocols/packet.h"
  #include "protocols/protocol_ids.h"
- #include "parser/parser.h"
  #include "time/profiler.h"
+ #include "parser/parser.h"
  
 -#include "protocols/ipv4.h"
 -#include "protocols/ipv6.h"
  #include "codecs/ip/ip_util.h"
- #include "codecs/decode_module.h"
  #include "codecs/codec_events.h"
+ #include "codecs/decode_module.h"
  
  // Encoder FOO
  #ifdef HAVE_DUMBNET_H
index fce9ea2aacedcf274e7262e9cfb2faa2b8c2d8fe,4e0504e9a22be2aa3e89b5c0f120a43619253b93..5437c16c8c9e4d62166ecc37cfcb5ab63cec9155
@@@ -48,42 -48,48 +48,48 @@@ public
      /* constructors, destructors, and statistics */
  
      // global plugin initializer. Called by LUA to add register codecs
 -    static void add_plugin(const struct CodecApi*);
 +    SO_PRIVATE static void add_plugin(const struct CodecApi*);
      // instantiate a specific codec with a codec specific Module
 -    static void instantiate(const CodecApi*, Module*, SnortConfig*);
 +    SO_PRIVATE static void instantiate(const CodecApi*, Module*, SnortConfig*);
      // instantiate any codec for which a module has not been provided.
 -    static void instantiate();
 +    SO_PRIVATE static void instantiate();
      // destroy all global codec related information
 -    static void release_plugins();
 +    SO_PRIVATE static void release_plugins();
      // initialize the current threads codecs
 -    static void thread_init();
 +    SO_PRIVATE static void thread_init();
      // destroy thread_local data
 -    static void thread_term();
 +    SO_PRIVATE static void thread_term();
-     // allocate a Packet for later formatting (cloning)
-     static Packet* encode_new(void);
-     // release the allocated Packet
-     static void encode_delete(Packet*);
  
  
      /* main encode and decode functions */
  
      // decode this packet and set all relevent packet fields.
      static void decode(Packet*, const struct _daq_pkthdr*, const uint8_t*);
+     // allocate a Packet for later formatting (cloning)
+     SO_PUBLIC static Packet* encode_new(void);
+     // release the allocated Packet
+     SO_PUBLIC static void encode_delete(Packet*);
      // update the packet's checksums and length variables. Call this function
      // after Snort has changed any data in this packet
 -    SO_PUBLIC static void encode_update(Packet*);
 +    static void encode_update(Packet*);
      // format packet for detection.  Original ttl is always used.
 -    SO_PUBLIC static int encode_format(
 +    static int encode_format(
          EncodeFlags f, const Packet* orig, Packet* clone, PseudoPacketType type);
      // encode the packet with pre-set daq info.
 -    SO_PUBLIC static int encode_format_with_daq_info (
 +    static int encode_format_with_daq_info (
          EncodeFlags f, const Packet* p, Packet* c, PseudoPacketType type,
          const DAQ_PktHdr_t*, uint32_t opaque);
      // orig is the wire pkt; clone was obtained with New()
 -    SO_PUBLIC static const uint8_t* encode_response(
 +    static const uint8_t* encode_response(
          EncodeType, EncodeFlags, const Packet* orig, uint32_t* len,
          const uint8_t* payLoad, uint32_t payLen);
+     // when encoding, rather than copy the destination MAC address from the
+     // inbound packet, manually set the MAC address.
+     SO_PUBLIC static void encode_set_dst_mac(uint8_t* );
+     // get the MAC address which has been set using encode_set_dst_mac().
+     // Useful for root decoders setting the MAC address
+     SO_PUBLIC static uint8_t *encode_get_dst_mac();
  
      // wrapper for encode response.  Ensure no payload is encoded.
      static inline const uint8_t* encode_reject( EncodeType type,
index cc2f093a371cbe10a8c63ffd074cc72c65c5534f,ed2959549610be0e5a4fda8aa2e5de1dc205b703..30d388380155581addec06ac52325fe5b3d68b5c
@@@ -1106,10 -1106,13 +1106,13 @@@ void ParseWarning(const char *format, .
      if (file_name != NULL)
          LogMessage("WARNING: %s(%d) %s\n", file_name, file_line, buf);
      else
-         LogMessage("%s\n", buf);
+         LogMessage("WARNING: %s\n", buf);
+     if ( ScConfErrorOut() )
+         parse_errors++;
  }
  
 -SO_PUBLIC void ParseMessage(const char *format, ...)
 +void ParseMessage(const char *format, ...)
  {
      char buf[STD_BUF+1];
      va_list ap;
Simple merge
Simple merge