/* 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,