Packet(const Packet&) = delete;
Packet& operator=(const Packet&) = delete;
- Flow* flow; /* for session tracking */
+ Flow* flow = nullptr; /* for session tracking */
Endianness* endianness = nullptr;
Obfuscator* obfuscator = nullptr;
- uint64_t packet_flags; /* special flags for the packet */
- uint32_t xtradata_mask;
- uint32_t proto_bits; /* protocols contained within this packet */
+ uint64_t packet_flags = 0; /* special flags for the packet */
+ uint32_t xtradata_mask = 0;
+ uint32_t proto_bits = 0; /* protocols contained within this packet */
- uint16_t alt_dsize; /* size for detection (iff PKT_DETECT_LIMIT) */
+ uint16_t alt_dsize = 0; /* size for detection (iff PKT_DETECT_LIMIT) */
- uint8_t num_layers; /* index into layers for next encap */
+ uint8_t num_layers = 0; /* index into layers for next encap */
// FIXIT-M Consider moving ip_proto_next below `pkth`.
- IpProtocol ip_proto_next; /* the protocol ID after IP and all IP6 extension */
- bool disable_inspect;
+ IpProtocol ip_proto_next = IpProtocol::PROTO_NOT_SET; /* the protocol ID after IP and all IP6 extension */
+ bool disable_inspect = false;
mutable FilteringState filtering_state;
- PduSection sect;
+ PduSection sect = PS_NONE;
// nothing after this point is zeroed by reset() ...
IpsContext* context = nullptr;
Active* active = nullptr;
- Active* active_inst;
+ Active* active_inst = nullptr;
ActiveAction** action = nullptr;
ActiveAction* action_inst = nullptr;
SFDAQInstance* daq_instance = nullptr; // DAQ instance the message came from
// Everything beyond this point is set by PacketManager::decode()
- const DAQ_PktHdr_t* pkth; // packet meta data
- const uint8_t* pkt; // raw packet data
+ const DAQ_PktHdr_t* pkth = nullptr; // packet meta data
+ const uint8_t* pkt = nullptr; // raw packet data
uint32_t pktlen = 0; // raw packet data length
// These are both set before PacketManager::decode() returns
uint16_t dsize = 0; /* packet payload size */
DecodeData ptrs; // convenience pointers used throughout Snort++
- Layer* layers; /* decoded encapsulations */
+ Layer* layers = nullptr; /* decoded encapsulations */
PseudoPacketType pseudo_type = PSEUDO_PKT_MAX; // valid only when PKT_PSEUDO is set
- uint64_t user_inspection_policy_id;
- uint64_t user_ips_policy_id;
- uint64_t user_network_policy_id;
+ uint64_t user_inspection_policy_id = 0;
+ uint64_t user_ips_policy_id = 0;
+ uint64_t user_network_policy_id = 0;
- uint64_t inspection_started_timestamp;
+ uint64_t inspection_started_timestamp = 0;
- uint8_t vlan_idx;
- uint8_t ts_packet_flags; // FIXIT-M packet flags should always be thread safe
+ uint8_t vlan_idx = 0;
+ uint8_t ts_packet_flags = 0; // FIXIT-M packet flags should always be thread safe
// IP_MAXPACKET is the minimum allowable max_dsize
// there is no requirement that all data fit into an IP datagram
int inject();
private:
- bool allocated;
+ bool allocated = false;
};
#define BIT(i) (0x1 << ((i)-1))
}
}
#endif
-