/* Boolean functions - general information about this packet */
inline bool is_eth() const
- { return proto_bits & PROTO_BIT__ETH; }
+ { return ((proto_bits & PROTO_BIT__ETH) != 0); }
inline bool has_ip() const
{ return ptrs.ip_api.is_ip(); }
{ return (ptrs.get_pkt_type() == PktType::PDU) or (ptrs.get_pkt_type() == PktType::FILE); }
inline bool is_cooked() const
- { return packet_flags & PKT_PSEUDO; }
+ { return ((packet_flags & PKT_PSEUDO) != 0); }
inline bool is_fragment() const
{ return ptrs.decode_flags & DECODE_FRAG; }
{ return (th_flags & flags) == flags; }
inline bool is_syn() const
- { return (th_flags & TH_SYN); }
+ { return ((th_flags & TH_SYN) != 0); }
inline bool is_syn_only() const
{ return (th_flags & (TH_SYN | TH_ACK)) == TH_SYN; }
{ return are_flags_set(TH_SYN | TH_ACK); }
inline bool is_ack() const
- { return (th_flags & TH_ACK); }
+ { return ((th_flags & TH_ACK) != 0); }
inline bool is_psh() const
- { return (th_flags & TH_PUSH); }
+ { return ((th_flags & TH_PUSH) != 0); }
inline bool is_rst() const
- { return (th_flags & TH_RST); }
+ { return ((th_flags & TH_RST) != 0); }
inline bool is_fin() const
- { return (th_flags & TH_FIN); }
+ { return ((th_flags & TH_FIN) != 0); }
/* raw data access */
inline uint16_t raw_src_port() const
inline bool SmbNtCreateAndXReqSequentialOnly(const SmbNtCreateAndXReq* req)
{
- return (snort::alignedNtohl(&req->smb_create_opts) & SMB_CREATE_OPTIONS__FILE_SEQUENTIAL_ONLY);
+ return ((snort::alignedNtohl(&req->smb_create_opts) & SMB_CREATE_OPTIONS__FILE_SEQUENTIAL_ONLY) != 0);
}
inline uint32_t SmbNtCreateAndXReqFileAttrs(const SmbNtCreateAndXReq* req)
inline bool SmbNtTransactCreateReqSequentialOnly(const SmbNtTransactCreateReqParams* req)
{
- return (snort::alignedNtohl(&req->create_options) & SMB_CREATE_OPTIONS__FILE_SEQUENTIAL_ONLY);
+ return ((snort::alignedNtohl(&req->create_options) & SMB_CREATE_OPTIONS__FILE_SEQUENTIAL_ONLY) != 0);
}
struct SmbNtTransactCreateReq