bool AuthCodec::decode(const RawData& raw, CodecData& codec, DecodeData& snort)
{
- const AuthHdr* const ah = reinterpret_cast<const AuthHdr* const>(raw.data);
+ const AuthHdr* const ah = reinterpret_cast<const AuthHdr*>(raw.data);
if (raw.len < MIN_AUTH_LEN)
{
}
const PgmHeader* const header =
- reinterpret_cast<const PgmHeader* const>(raw.data);
+ reinterpret_cast<const PgmHeader*>(raw.data);
if (8 != header->type)
return PGM_NAK_ERR;
const int expected_len)
{
// case for pointer arithmetic
- const uint8_t* const opt_ptr = reinterpret_cast<const uint8_t* const>(opt);
+ const uint8_t* const opt_ptr = reinterpret_cast<const uint8_t*>(opt);
if (expected_len > 1)
{
* Otherwise they assume we are reading garbage values
*/
const PsuedoheaderUnion* const ph4_u = reinterpret_cast
- <const PsuedoheaderUnion* const>(ph4);
+ <const PsuedoheaderUnion*>(ph4);
const uint16_t* const h = ph4_u->ph4_arr;
/* ipv4 pseudo header must have 12 bytes */
* Otherwise they assume we are reading garbage values
*/
const Psuedoheader6Union* const ph6_u = reinterpret_cast
- <const Psuedoheader6Union* const>(ph6);
+ <const Psuedoheader6Union*>(ph6);
const uint16_t* const h = ph6_u->ph6_arr;
/* PseudoHeader must have 36 bytes */
bool decode(const RawData&, CodecData&, DecodeData&) override;
};
-const static uint16_t PPP_IP = 0x0021; /* Internet Protocol */
-const static uint16_t PPP_IPV6 = 0x0057; /* Internet Protocol v6 */
-const static uint16_t PPP_VJ_COMP = 0x002d; /* VJ compressed TCP/IP */
-const static uint16_t PPP_VJ_UCOMP = 0x002f; /* VJ uncompressed TCP/IP */
-const static uint16_t PPP_IPX = 0x002b; /* Novell IPX Protocol */
+static const uint16_t PPP_IP = 0x0021; /* Internet Protocol */
+static const uint16_t PPP_IPV6 = 0x0057; /* Internet Protocol v6 */
+static const uint16_t PPP_VJ_COMP = 0x002d; /* VJ compressed TCP/IP */
+static const uint16_t PPP_VJ_UCOMP = 0x002f; /* VJ uncompressed TCP/IP */
+static const uint16_t PPP_IPX = 0x002b; /* Novell IPX Protocol */
} // namespace
void PppEncap::get_protocol_ids(std::vector<uint16_t>& v)
static void detection_option_node_update_otn_stats(detection_option_tree_node_t* node,
node_profile_stats* stats, uint64_t checks, uint64_t timeouts, uint64_t suspends)
{
- int i;
node_profile_stats local_stats; /* cumulative stats for this node */
node_profile_stats node_stats; /* sum of all instances */
if ( node->num_children )
{
- for ( i=0; i < node->num_children; ++i )
+ for ( int i=0; i < node->num_children; ++i )
detection_option_node_update_otn_stats(node->children[i], &local_stats, checks,
timeouts, suspends);
}
void FastPatternConfig::set_max_pattern_len(unsigned int max_len)
{
if (max_pattern_len != 0)
- ParseWarning(WARN_CONF, "maximum pattern length redefined from %d to %d.\n",
+ ParseWarning(WARN_CONF, "maximum pattern length redefined from %d to %u.\n",
max_pattern_len, max_len);
max_pattern_len = max_len;
if ( best.pmd and otn->proto == SNORT_PROTO_FILE and best.cat != CAT_SET_FILE )
{
- ParseWarning(WARN_RULES, "file rule %d:%d does not have file_data fast pattern",
+ ParseWarning(WARN_RULES, "file rule %u:%u does not have file_data fast pattern",
otn->sigInfo.generator, otn->sigInfo.id);
best.pmd->fp = 0;
return true;
if ( content )
- ParseWarning(WARN_RULES, "content based rule %d:%d has no fast pattern",
+ ParseWarning(WARN_RULES, "content based rule %u:%u has no fast pattern",
otn->sigInfo.generator, otn->sigInfo.id);
return false;
{
if ((parent) && (parent->content.size() + parent->offset > current->offset))
{
- ParseError("magic content at offset %d overlaps with offset %d.",
+ ParseError("magic content at offset %u overlaps with offset %u.",
parent->offset, current->offset);
return;
}
if (append->type_id)
{
if (start->type_id)
- ParseWarning(WARN_RULES, "Duplicated type definition '%d -> %d at offset %d",
+ ParseWarning(WARN_RULES, "Duplicated type definition '%u -> %u at offset %u",
start->type_id, append->type_id, append->offset);
start->type_id = append->type_id;
}
if (rule.id > FILE_ID_MAX)
{
- ParseError("file type: rule id %d larger than %d", rule.id, FILE_ID_MAX);
+ ParseError("file type: rule id %u larger than %d", rule.id, FILE_ID_MAX);
return;
}
if (file_magic_rules[rule.id].id > 0)
{
- ParseError("file type: duplicated rule id %d defined", rule.id);
+ ParseError("file type: duplicated rule id %u defined", rule.id);
return;
}
if (unused > 0)
{
- used = snprintf(cur, unused, "\nFile type: %s(%d)",
+ used = snprintf(cur, unused, "\nFile type: %s(%u)",
file_config->file_type_name(file_type_id).c_str(), file_type_id);
unused -= used;
cur += used;
SFGHASH* genHash;
tSFRFSidNode* pSidnode;
tSFRFConfigNode* cfgNode;
- int gid;
+ unsigned int gid;
SFGHASH_NODE* sidHashNode;
for ( gid=0; gid < SFRF_MAX_GENID; gid++ )
printf(" ");
printf("IDENT - asn1_class: %.2x | flag: %.2x | tag_type: %.2x | "
- "tag_num: %d\n", asn1_type->ident.asn1_class, asn1_type->ident.flag,
+ "tag_num: %u\n", asn1_type->ident.asn1_class, asn1_type->ident.flag,
asn1_type->ident.tag_type, asn1_type->ident.tag);
for (iCtr = 0; iCtr < iTabs; iCtr++)
for (iCtr = 0; iCtr < iTabs; iCtr++)
printf(" ");
- printf("DATA | data_len: %d | ", asn1_type->data_len);
+ printf("DATA | data_len: %u | ", asn1_type->data_len);
if (asn1_type->data)
{
for (iCtr = 0; iCtr < asn1_type->data_len; iCtr++)
{
MetadataModule* m = (MetadataModule*)p;
- for ( auto p : m->services )
- add_service_to_otn(m->snort_config, otn, p.c_str());
+ for ( auto service : m->services )
+ add_service_to_otn(m->snort_config, otn, service.c_str());
return nullptr;
}
#include "log/messages.h"
-int AddPiiPiece(SdTreeNode *node, char *new_pattern, SdOptionData *data);
-SdTreeNode* AddChild(SdTreeNode *node, SdOptionData *data, char *pattern);
+static SdTreeNode* AddChild(SdTreeNode *node, SdOptionData *data, char *pattern);
SdOptionData::SdOptionData(std::string pattern, uint8_t threshold)
}
// Create a new tree node, and add it as a child to the current node.
-SdTreeNode * AddChild(SdTreeNode *node, SdOptionData *data, char *pattern)
+static SdTreeNode * AddChild(SdTreeNode *node, SdOptionData *data, char *pattern)
{
SdTreeNode * new_node = NULL;
// static variables
// -----------------------------------------------------------------------------
-static struct SnortConfigWrapper : ConfigWrapper
+static struct SnortConfigWrapper : public ConfigWrapper
{
const PacketLatencyConfig* operator->() const override
{ return &snort_conf->latency->packet_latency; }
} config;
-static struct SnortEventHandler : EventHandler
+static struct SnortEventHandler : public EventHandler
{
void handle(const Event&) override
{ SnortEventqAdd(GID_LATENCY, LATENCY_EVENT_PACKET_FASTPATHED); }
} event_handler;
-static struct SnortLogHandler : EventHandler
+static struct SnortLogHandler : public EventHandler
{
void handle(const Event& e) override
{
// static variables
// -----------------------------------------------------------------------------
-static struct SnortConfigWrapper : ConfigWrapper
+static struct SnortConfigWrapper : public ConfigWrapper
{
const RuleLatencyConfig* operator->() const override
{ return &snort_conf->latency->rule_latency; }
} config;
-static struct SnortEventHandler : EventHandler
+static struct SnortEventHandler : public EventHandler
{
void handle(const Event& e) override
{
}
} event_handler;
-static struct SnortLogHandler : EventHandler
+static struct SnortLogHandler : public EventHandler
{
void handle(const Event& e) override
{
// FIXIT-L Refer to ParseMessage above.
if (file_name != NULL)
- FatalError("%s(%d) %s\n", file_name, file_line, buf);
+ FatalError("%s(%u) %s\n", file_name, file_line, buf);
else
FatalError("%s\n", buf);
}
if (event->sig_info->priority != 0)
{
SnortSnprintfAppend(event_string, sizeof(event_string),
- "[Priority: %d] ", event->sig_info->priority);
+ "[Priority: %u] ", event->sig_info->priority);
}
}
fprintf(stdout, "%s", "\n");
fprintf(stdout,
- "Reading network traffic from \"%s\" with snaplen = %d\n",
+ "Reading network traffic from \"%s\" with snaplen = %u\n",
pcap, DAQ_GetSnapLen());
}
NORETURN static void x2c(unsigned x)
{
- printf("0x%2.2X (%d) = '%c'\n", x, x, x);
+ printf("0x%2.2X (%u) = '%c'\n", x, x, static_cast<char>(x));
exit(0);
}
// `__thread` is a gnu extension that at present is slightly faster than
// `thread_local` (possibly due to the lack of dynamic initialization)
-#if USE_THREAD_LOCAL
+#ifdef USE_THREAD_LOCAL
# define THREAD_LOCAL thread_local
#else
# define THREAD_LOCAL __thread
struct CpuSet
{
- CpuSet(hwloc_cpuset_t cpuset) : cpuset(cpuset) { }
+ CpuSet(hwloc_cpuset_t set) : cpuset(set) { }
~CpuSet()
{
if (cpuset)
hwloc_bitmap_list_asprintf(&s, desired_cpuset);
if (hwloc_set_cpubind(topology, desired_cpuset, HWLOC_CPUBIND_THREAD))
{
- FatalError("Unable to pin thread %u (type %u) to %s: %s (%d)\n",
+ FatalError("Failed to pin thread %u (type %u) to %s: %s (%d)\n",
id, type, s, get_error(errno), errno);
}
#ifndef REG_TEST
if ( v.get_type() == Value::VT_STR )
printf("%s: %s = '%s'\n", s, fqn, v.get_string());
else
- printf("%s: %s = %lu\n", s, fqn, v.get_long());
+ printf("%s: %s = %ld\n", s, fqn, v.get_long());
}
static ModHook* get_hook(const char* s)
if ( strcmp(m->get_name(), s) )
{
- std::string fqn = s;
- p = get_params(fqn, m->get_parameters(), idx);
+ std::string sfqn = s;
+ p = get_params(sfqn, m->get_parameters(), idx);
if ( !p )
{
cout << endl << "Type: " << mod_type(p->api) << endl;
- if ( const Parameter* p = m->get_parameters() )
+ if ( const Parameter* params = m->get_parameters() )
{
- if ( p->type < Parameter::PT_MAX )
+ if ( params->type < Parameter::PT_MAX )
{
cout << endl << "Configuration: " << endl << endl;
show_configs(name, true);
if ( api->size != sym->size )
{
- ParseWarning(WARN_PLUGINS, "%s: size mismatch; expected %d, got %d",
+ ParseWarning(WARN_PLUGINS, "%s: size mismatch; expected %u, got %u",
api->name, sym->size, api->size);
return false;
}
if ( api->api_version != sym->version )
{
- ParseWarning(WARN_PLUGINS, "%s: version mismatch; expected %d, got %d",
+ ParseWarning(WARN_PLUGINS, "%s: version mismatch; expected %u, got %u",
api->name, sym->version, api->version);
return false;
}
if (!fh)
return;
- fprintf(fh, "%ld,%u,", (unsigned long)cur_time, sfxhash_count(ipMap));
+ fprintf(fh, "%lu,%u,", (unsigned long)cur_time, sfxhash_count(ipMap));
for (node = sfxhash_findfirst(ipMap); node; node = sfxhash_findnext(ipMap))
{
char ipA[41], ipB[41];
if (chmod(file_name, mode) != 0)
{
WarningMessage("perfmonitor: Unable to change mode of "
- "stats file '%s' to mode:%d: %s.",
+ "stats file '%s' to mode:%u: %s.",
file_name, mode, get_error(errno));
}
pr != 0;
pr=(PORTRANGE*)sflist_next(&cur_port) )
{
- printf(" %d", pr->port_lo);
+ printf(" %u", pr->port_lo);
if ( pr->port_hi != pr->port_lo )
- printf("-%d", pr->port_hi);
+ printf("-%u", pr->port_hi);
}
printf("\n");
}
{
if ( pr->port_lo != 0)
{
- SnortSnprintfAppend(output_str, sizeof(output_str), "%d", pr->port_lo);
+ SnortSnprintfAppend(output_str, sizeof(output_str), "%u", pr->port_lo);
if ( pr->port_hi != pr->port_lo )
{
- SnortSnprintfAppend(output_str, sizeof(output_str), "-%d", pr->port_hi);
+ SnortSnprintfAppend(output_str, sizeof(output_str), "-%u", pr->port_hi);
}
SnortSnprintfAppend(output_str, sizeof(output_str), " ");
}
case WHITELISTED_TRUST:
return white_info;
default:
- return nullptr;
+ break;
}
return nullptr;
}
long Trough::pcap_loop_count = 0;
unsigned Trough::file_count = 0;
-/*****************************************************************
- * Function: GetPcaps()
- *
- * This function takes a list of pcap types and arguments from
- * the command line, parses them depending on type and puts them
- * in a user supplied queue. The pcap object list will contain
- * PcapReadObject structures. The returned queue contains
- * strings representing paths to pcaps.
- *
- * returns -1 on error and 0 on success
- *
- ****************************************************************/
-int Trough::get_pcaps(std::vector<struct PcapReadObject> &pol, std::vector<std::string> &pcap_queue)
+int Trough::get_pcaps(std::vector<struct PcapReadObject> &pol)
{
for (const PcapReadObject &pro : pol)
{
{
if (!pcap_object_list.empty())
{
- if (get_pcaps(pcap_object_list, pcap_queue) == -1)
+ if (get_pcaps(pcap_object_list) == -1)
FatalError("Error getting pcaps.\n");
if (pcap_queue.empty())
std::string filter;
};
- static int get_pcaps(std::vector<struct PcapReadObject> &pol, std::vector<std::string> &pcap_queue);
+ static int get_pcaps(std::vector<struct PcapReadObject> &pol);
static std::vector<struct PcapReadObject> pcap_object_list;
static std::vector<std::string> pcap_queue;
static std::vector<std::string>::const_iterator pcap_queue_iter;
if (otn_cur->proto != otn_new->proto)
{
- ParseError("GID %d SID %d in rule duplicates previous rule, with "
+ ParseError("GID %u SID %u in rule duplicates previous rule, with "
"different protocol.",
otn_new->sigInfo.generator, otn_new->sigInfo.id);
return 0;
if ((rtn_cur != NULL) && (rtn_cur->type != rtn_new->type))
{
- ParseError("GID %d SID %d in rule duplicates previous rule, with "
+ ParseError("GID %u SID %u in rule duplicates previous rule, with "
"different type.",
otn_new->sigInfo.generator, otn_new->sigInfo.id);
return 0;
deleteRtnFromOtn(otn_new);
ParseWarning(WARN_RULES,
- "%d:%d duplicates previous rule. Using revision %d.",
+ "%u:%u duplicates previous rule. Using revision %u.",
otn_cur->sigInfo.generator, otn_cur->sigInfo.id, otn_cur->sigInfo.rev);
/* Now free the OTN itself -- this function is also used
if (SnortConfig::conf_error_out())
{
ParseError(
- "%d:%d:%d duplicates previous rule.",
+ "%u:%u:%u duplicates previous rule.",
otn_new->sigInfo.generator, otn_new->sigInfo.id, otn_new->sigInfo.rev);
return 0;
}
else
{
ParseWarning(WARN_RULES,
- "%d:%d duplicates previous rule. Using revision %d.",
+ "%u:%u duplicates previous rule. Using revision %u.",
otn_new->sigInfo.generator, otn_new->sigInfo.id, otn_new->sigInfo.rev);
}
}
ParseError("gid must set in builtin rules");
if ( otn->num_detection_opts )
- ParseError("%d:%d builtin rules do not support detection options",
+ ParseError("%u:%u builtin rules do not support detection options",
otn->sigInfo.generator, otn->sigInfo.id);
otn->sigInfo.text_rule = false;
else if ( c == '\\' )
state = (esc > 0) ? 4 : 16;
else if ( c == '\n' )
- ParseWarning(WARN_RULES, "line break in string on line %d\n", lines-1);
+ ParseWarning(WARN_RULES, "line break in string on line %u\n", lines-1);
else
s += c;
break;
break;
case 5: // unquoted escape
if ( c != '\n' && c != '\r' )
- ParseWarning(WARN_RULES, "invalid escape on line %d\n", lines);
+ ParseWarning(WARN_RULES, "invalid escape on line %u\n", lines);
state = 0;
break;
case 6: // token
state = 11;
else if ( c == '\n' )
{
- ParseWarning(WARN_RULES, "line break in commented string on line %d\n", lines-1);
+ ParseWarning(WARN_RULES, "line break in commented string on line %u\n", lines-1);
state = 11;
}
break;
}
else
{
- ParseWarning(WARN_RULES, "\\x used with no following hex digits on line %d\n",
+ ParseWarning(WARN_RULES, "\\x used with no following hex digits on line %u\n",
lines-1);
s += c;
state = 3;
}
}
if ( !ok )
- ParseError("invalid byte code at %d", idx);
+ ParseError("invalid byte code at %u", idx);
return ok;
}
if (otn == NULL)
{
- ParseError("Rule state specified for invalid SID: %d GID: %d",
+ ParseError("Rule state specified for invalid SID: %u GID: %u",
rule_state->sid, rule_state->gid);
return;
}
SnortSnprintfAppend(dstbuf, bufsize, "any");
else if ( poi->one() )
- SnortSnprintfAppend(dstbuf, bufsize, "%u", poi->lport);
+ SnortSnprintfAppend(dstbuf, bufsize, "%hu", poi->lport);
else
- SnortSnprintfAppend(dstbuf, bufsize, "%u:%u",poi->lport,poi->hport);
+ SnortSnprintfAppend(dstbuf, bufsize, "%hu:%hu",poi->lport,poi->hport);
}
}
SnortSnprintfAppend(po_print_buf, bufsize,
- " Id:%d Ports:%d Rules:%d\n {\n",
+ " Id:%d Ports:%u Rules:%u\n {\n",
po->id, po->item_list->count,po->rule_list->count);
SnortSnprintfAppend(po_print_buf, bufsize, " Ports [\n ");
}
SnortSnprintfAppend(po_print_buf, bufsize,
- " Id:%d Ports:%d Rules:%d\n {\n Ports [",
+ " Id:%d Ports:%u Rules:%u\n {\n Ports [",
po->id, po->item_list->count, po->rule_hash->count);
if ( PortObjectHasAny( (PortObject*)po) )
if ( po->name )
SnortSnprintfAppend(po_print_buf, bufsize, "%s ",po->name);
- SnortSnprintfAppend(po_print_buf, bufsize, " Id:%d Ports:%d Rules:%d PortUsageCnt=%d\n {\n",
+ SnortSnprintfAppend(po_print_buf, bufsize, " Id:%d Ports:%u Rules:%u PortUsageCnt=%d\n {\n",
po->id, po->item_list->count, po->rule_hash->count, po->port_cnt);
SnortSnprintfAppend(po_print_buf, bufsize, " Ports [\n ");
const std::string name;
};
-struct GetProfileFromModule : GetProfileFunctor
+struct GetProfileFromModule : public GetProfileFunctor
{
GetProfileFromModule(std::string name, Module* m) :
GetProfileFunctor(name), m(m) { }
Module* m;
};
-struct GetProfileFromFunction : GetProfileFunctor
+struct GetProfileFromFunction : public GetProfileFunctor
{
GetProfileFromFunction(std::string name, get_profile_stats_fn fn) :
GetProfileFunctor(name), fn(fn) { }
return reinterpret_cast<const ip::IP6Frag*>(lyr->start);
// Only check until current ip6h header
- if (lyr->start == (const uint8_t* const)ip6h)
+ if (lyr->start == (const uint8_t*)ip6h)
return nullptr;
lyr--;
TcpOptIterator::TcpOptIterator(const TCPHdr* const tcp_header, const Packet* const p)
{
- const uint8_t* const hdr = (const uint8_t* const)tcp_header;
+ const uint8_t* const hdr = (const uint8_t*)tcp_header;
start_ptr = hdr + TCP_MIN_HEADER_LEN;
end_ptr = start_ptr; // == begin()
TcpOptIterator::TcpOptIterator(const TCPHdr* const tcp_header, const uint32_t valid_hdr_len)
{
- const uint8_t* const hdr = (const uint8_t* const)tcp_header;
+ const uint8_t* const hdr = (const uint8_t*)tcp_header;
start_ptr = hdr + TCP_MIN_HEADER_LEN;
if (valid_hdr_len < TCP_MIN_HEADER_LEN)
if (((FTPBounce->ip.family == AF_INET) && (bits != 32)) ||
((FTPBounce->ip.family == AF_INET6) && (bits != 128)))
{
- snprintf(bits_str, sizeof(bits_str), "/%u", bits);
+ snprintf(bits_str, sizeof(bits_str), "/%hhu", bits);
}
if (FTPBounce->porthi)
{
while (FTPCmd != NULL)
{
memset(buf, 0, BUF_SIZE+1);
- snprintf(buf, BUF_SIZE, " %s { %d ",
+ snprintf(buf, BUF_SIZE, " %s { %u ",
FTPCmd->cmd_name, FTPCmd->max_param_len);
#ifdef PRINT_DEFAULT_CONFIGS
if (FTPCmd->data_chan_cmd)
return HI_SUCCESS;
}
}
- else
- {
- return HI_SUCCESS;
- }
return HI_SUCCESS;
}
for (index=0; index < sub->num_entries; index++)
{
if (sub->lengths[index] || sub->entries[index])
- printf("%sIndex: %d, Length: %d, dataIndex: %d\n", label, index, sub->lengths[index],
+ printf("%sIndex: %d, Length: %d, dataIndex: %u\n", label, index, sub->lengths[index],
(uint32_t)sub->entries[index]);
if ( !sub->lengths[index] && sub->entries[index] )
if ((lyr.prot_id == ETHERTYPE_IPV6) || (lyr.prot_id == IPPROTO_ID_IPV6))
{
ip::IP6Hdr* const rawHdr =
- const_cast<ip::IP6Hdr* const>(dpkt->ptrs.ip_api.get_ip6h());
+ const_cast<ip::IP6Hdr*>(dpkt->ptrs.ip_api.get_ip6h());
rawHdr->ip6_next = ft->protocol;
}
else
else if (SEQ_GT(sx, tsn->seq))
fprintf(stdout, " -%u", sx - tsn->seq);
- fprintf(stdout, " %u", tsn->payload_size);
+ fprintf(stdout, " %hu", tsn->payload_size);
segs++;
bytes += tsn->payload_size;
{
ParseWarning(WARN_HOSTS,
"AttributeTable insertion failed: %d Insufficient "
- "space in attribute table, only configured to store %d hosts\n",
+ "space in attribute table, only configured to store %u hosts\n",
ret, SnortConfig::get_max_attribute_hosts());
sfat_insufficient_space_logged = true;
}
inline BitOp::~BitOp()
{ delete[] bit_buf; }
+inline uint8_t BitOp::mask(size_t bit) const
+{ return (uint8_t)(0x80 >> (bit & 7)); }
+
// FIXIT-L J ops that don't need to be inlined can probably be but into a .cc file
// Reset the bit buffer so that it can be reused
inline void BitOp::reset()
inline size_t BitOp::size() const
{ return buf_size << 3; }
-inline uint8_t BitOp::mask(size_t bit) const
-{ return (uint8_t)(0x80 >> (bit & 7)); }
-
inline size_t BitOp::get_buf_size() const
{ return buf_size; }
#pragma clang diagnostic ignored "-Wflexible-array-extensions"
#endif
-#if defined(__GNUC__)
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
#endif
#pragma clang diagnostic pop
#endif
-#if defined(__GNUC__)
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
#pragma GCC diagnostic pop
#endif
{ Z6+ 0, ANY, Z0+ 0, Z0+ 0, ACT_NOP }
};
-void UnescapeDecode(char*, uint16_t, char**, char**, uint16_t*, JSState*, uint8_t*);
+static void UnescapeDecode(char*, uint16_t, char**, char**, uint16_t*, JSState*, uint8_t*);
void InitJSNormLookupTable(void)
{
return(Unescape_exec(s, (ActionUnsc)m->action, c, js));
}
-void UnescapeDecode(char* src, uint16_t srclen, char** ptr, char** dst, uint16_t* bytes_copied,
+static void UnescapeDecode(char* src, uint16_t srclen, char** ptr, char** dst, uint16_t* bytes_copied,
JSState* js, uint8_t* iis_unicode_map)
{
int iRet;
length(command_default_len) { }
};
- const static int command_default_len = -1;
+ static const int command_default_len = -1;
static int ftpsever_binding_id;
std::vector<Command> commands;
length(command_default_len) { }
};
- const static int command_default_len = -1;
+ static const int command_default_len = -1;
std::vector<Command> commands;
bool parse_alt_max_cmd(std::istringstream& data_stream);
items_read = fread(rec->data, sizeof(uint8_t), rec->length, input);
if (items_read != rec->length)
{
- fprintf(stderr, "Error: incomplete record. %d of %u bytes read.\n",
+ fprintf(stderr, "Error: incomplete record. %u of %u bytes read.\n",
items_read, rec->length);
return FAILURE;
}
"\tsensor id: %u\tevent id: %u\tevent second: %u\tevent microsecond: %u\n"
"\tsig id: %u\tgen id: %u\trevision: %u\t classification: %u\n"
"\tpriority: %u\tip source: %u.%u.%u.%u\tip destination: %u.%u.%u.%u\n"
- "\tsrc port: %u\tdest port: %u\tprotocol: %u\timpact_flag: %u\tblocked: %u\n",
+ "\tsrc port: %hu\tdest port: %hu\tprotocol: %hhu\timpact_flag: %hhu\tblocked: %hhu\n",
event.sensor_id, event.event_id,
event.event_second, event.event_microsecond,
event.signature_id, event.generator_id,
inet_ntop(AF_INET6, &event.ip_destination, ip6buf, INET6_ADDRSTRLEN);
printf("ip destination: %s\n"
- "\tsrc port: %u\tdest port: %u\tprotocol: %u\timpact_flag: %u\tblocked: %u\n",
+ "\tsrc port: %hu\tdest port: %hu\tprotocol: %hhu\timpact_flag: %hhu\tblocked: %hhu\n",
ip6buf, event.sport_itype,
event.dport_icode, event.protocol,
event.impact_flag, event.blocked);
"\tsensor id: %u\tevent id: %u\tevent second: %u\tevent microsecond: %u\n"
"\tsig id: %u\tgen id: %u\trevision: %u\t classification: %u\n"
"\tpriority: %u\tip source: %u.%u.%u.%u\tip destination: %u.%u.%u.%u\n"
- "\tsrc port: %u\tdest port: %u\tprotocol: %u\timpact_flag: %u\tblocked: %u\n"
- "\tmpls label: %u\tvland id: %u\tpolicy id: %u\n",
+ "\tsrc port: %hu\tdest port: %hu\tprotocol: %hhu\timpact_flag: %hhu\tblocked: %hhu\n"
+ "\tmpls label: %u\tvland id: %hu\tpolicy id: %hu\n",
event.sensor_id, event.event_id,
event.event_second, event.event_microsecond,
event.signature_id, event.generator_id,
inet_ntop(AF_INET6, &event.ip_destination, ip6buf, INET6_ADDRSTRLEN);
printf("ip destination: %s\n"
- "\tsrc port: %u\tdest port: %u\tprotocol: %u\timpact_flag: %u\tblocked: %u\n"
- "\tmpls label: %u\tvland id: %u\tpolicy id: %u\n",
+ "\tsrc port: %hu\tdest port: %hu\tprotocol: %hhu\timpact_flag: %hhu\tblocked: %hhu\n"
+ "\tmpls label: %u\tvland id: %hu\tpolicy id: %hu\n",
ip6buf, event.sport_itype,
event.dport_icode, event.protocol,
event.impact_flag, event.blocked,