else if (pp->ipproto == IPPROTO_UDP)
printf("IPProto: UDP\n");
else
- printf("IPProto: %"PRIu16"\n", pp->ipproto);
+ printf("IPProto: %"PRIu8"\n", pp->ipproto);
pp_port = pp->port;
for ( ; pp_port != NULL; pp_port = pp_port->next) {
while (curr_pe != NULL) {
if (curr_pe->alproto == alproto) {
SCLogError(SC_ERR_ALPARSER, "Duplicate pp registered - "
- "ipproto - %"PRIu16" Port - %"PRIu16" "
+ "ipproto - %"PRIu8" Port - %"PRIu16" "
"App Protocol - NULL, App Protocol(ID) - "
"%"PRIu16" min_depth - %"PRIu16" "
"max_dept - %"PRIu16".",
#define TCP_OPTS_CNT tcpvars.tcp_opt_cnt
#define TCP_GET_RAW_OFFSET(tcph) (((tcph)->th_offx2 & 0xf0) >> 4)
-#define TCP_GET_RAW_X2(tcph) ((tcph)->th_offx2 & 0x0f)
+#define TCP_GET_RAW_X2(tcph) (unsigned char)((tcph)->th_offx2 & 0x0f)
#define TCP_GET_RAW_SRC_PORT(tcph) ntohs((tcph)->th_sport)
#define TCP_GET_RAW_DST_PORT(tcph) ntohs((tcph)->th_dport)
for (; i < 8; i++) {
if (bitarray & 0x01)
- printf(", %"PRIu16"", u * 8 + i);
+ printf(", %"PRIu32"", u * 8 + i);
else
printf(", ");
for (u = 0; u < (sgh->init->sig_size * 8); u++) {
if (sgh->init->sig_array[u / 8] & (1 << (u % 8))) {
SCLogDebug("%" PRIu32, u);
- printf("s->num %"PRIu16" ", u);
+ printf("s->num %"PRIu32" ", u);
}
}
break;
case IPPROTO_ICMP:
if (PKT_IS_ICMPV4(p)) {
- fprintf(dlt->file_ctx->fp, " TYPE=%"PRIu16" CODE=%"PRIu16""
+ fprintf(dlt->file_ctx->fp, " TYPE=%"PRIu8" CODE=%"PRIu8""
" ID=%"PRIu16" SEQ=%"PRIu16"", ICMPV4_GET_TYPE(p),
ICMPV4_GET_CODE(p), ICMPV4_GET_ID(p), ICMPV4_GET_SEQ(p));
} else if(PKT_IS_ICMPV6(p)) {
- fprintf(dlt->file_ctx->fp, " TYPE=%"PRIu16" CODE=%"PRIu16""
+ fprintf(dlt->file_ctx->fp, " TYPE=%"PRIu8" CODE=%"PRIu8""
" ID=%"PRIu16" SEQ=%"PRIu16"", ICMPV6_GET_TYPE(p),
ICMPV6_GET_CODE(p), ICMPV6_GET_ID(p), ICMPV6_GET_SEQ(p));
}
}
for (thread = 0; thread < thread_max; thread++) {
- snprintf(tname, sizeof(tname), "Detect%"PRIu16, thread+1);
- snprintf(qname, sizeof(qname), "pickup%"PRIu16, thread+1);
+ snprintf(tname, sizeof(tname), "Detect%d", thread+1);
+ snprintf(qname, sizeof(qname), "pickup%d", thread+1);
SCLogDebug("tname %s, qname %s", tname, qname);
}
for (thread = 0; thread < thread_max; thread++) {
- snprintf(tname, sizeof(tname), "Detect%"PRIu16, thread+1);
- snprintf(qname, sizeof(qname), "pickup%"PRIu16, thread+1);
+ snprintf(tname, sizeof(tname), "Detect%d", thread+1);
+ snprintf(qname, sizeof(qname), "pickup%d", thread+1);
SCLogDebug("tname %s, qname %s", tname, qname);
tv->thread_priority = taf->prio;
}
SCLogInfo("Setting prio %d for \"%s\" Module to cpu/core "
- "%"PRIu16", thread id %lu", tv->thread_priority,
+ "%d, thread id %lu", tv->thread_priority,
tv->name, cpu, SCGetThreadIdLong());
} else {
SetCPUAffinitySet(&taf->cpu_set);
if ((uint64_t)(*res) != i64) {
SCLogError(SC_ERR_NUMERIC_VALUE_ERANGE, "Numeric value out of range "
- "(%" PRIu64 " > %" PRIu32 ")", i64, UINT_MAX);
+ "(%" PRIu64 " > %" PRIuMAX ")", i64, (uintmax_t)UINT_MAX);
return -1;
}
if ((uint64_t)(*res) != i64) {
SCLogError(SC_ERR_NUMERIC_VALUE_ERANGE, "Numeric value out of range "
- "(%" PRIu64 " > %" PRIu16 ")", i64, USHRT_MAX);
+ "(%" PRIu64 " > %" PRIuMAX ")", i64, (uintmax_t)USHRT_MAX);
return -1;
}
if ((uint64_t)(*res) != i64) {
SCLogError(SC_ERR_NUMERIC_VALUE_ERANGE, "Numeric value out of range "
- "(%" PRIu64 " > %" PRIu8 ")", i64, UCHAR_MAX);
+ "(%" PRIu64 " > %" PRIuMAX ")", i64, (uintmax_t)UCHAR_MAX);
return -1;
}
if ((int64_t)(*res) != i64) {
SCLogError(SC_ERR_NUMERIC_VALUE_ERANGE, "Numeric value out of range "
- "(%" PRIi64 " > %" PRIi32 ")\n", i64, INT_MAX);
+ "(%" PRIi64 " > %" PRIiMAX ")\n", i64, (intmax_t)INT_MAX);
return -1;
}
if ((int64_t)(*res) != i64) {
SCLogError(SC_ERR_NUMERIC_VALUE_ERANGE, "Numeric value out of range "
- "(%" PRIi64 " > %" PRIi16 ")\n", i64, SHRT_MAX);
+ "(%" PRIi64 " > %" PRIiMAX ")\n", i64, (intmax_t)SHRT_MAX);
return -1;
}
if ((int64_t)(*res) != i64) {
SCLogError(SC_ERR_NUMERIC_VALUE_ERANGE, "Numeric value out of range "
- "(%" PRIi64 " > %" PRIi8 ")\n", i64, CHAR_MAX);
+ "(%" PRIi64 " > %" PRIiMAX ")\n", i64, (intmax_t)CHAR_MAX);
return -1;
}
{
uint8_t i = 0;
for (i = 8; i > 0; i--) {
- printf("%"PRIu8, ((byte >> (i - 1)) & 0x01));
+ printf("%"PRIu8, (uint8_t)((byte >> (i - 1)) & 0x01));
if (i == 5)
printf(" ");
}
if (strlen(queues) > 0)
strlcat(queues, ",", queues_size);
- snprintf(qname, sizeof(qname), "pickup%"PRIu16, thread+1);
+ snprintf(qname, sizeof(qname), "pickup%d", thread+1);
strlcat(queues, qname, queues_size);
}
/* create the threads */
for (thread = 0; thread < threads_count; thread++) {
- snprintf(tname, sizeof(tname), "%s%"PRIu16, thread_name, thread+1);
+ snprintf(tname, sizeof(tname), "%s%d", thread_name, thread+1);
char *thread_name = SCStrdup(tname);
if (unlikely(thread_name == NULL)) {
SCLogError(SC_ERR_MEM_ALLOC, "Can't allocate thread name");
threads_count = ModThreadsCount(aconf);
for (thread = 0; thread < threads_count; thread++) {
- snprintf(tname, sizeof(tname), "%s%s%"PRIu16, thread_name,
+ snprintf(tname, sizeof(tname), "%s%s%d", thread_name,
live_dev, thread+1);
char *thread_name = SCStrdup(tname);
if (unlikely(thread_name == NULL)) {
}
for (thread = 0; thread < thread_max; thread++) {
- snprintf(tname, sizeof(tname), "Detect%"PRIu16, thread+1);
- snprintf(qname, sizeof(qname), "pickup%"PRIu16, thread+1);
+ snprintf(tname, sizeof(tname), "Detect%d", thread+1);
+ snprintf(qname, sizeof(qname), "pickup%d", thread+1);
SCLogDebug("tname %s, qname %s", tname, qname);
if (single_mode) {
snprintf(tname, sizeof(tname), "%s", thread_name);
} else {
- snprintf(tname, sizeof(tname), "%s%s%"PRIu16,
+ snprintf(tname, sizeof(tname), "%s%s%d",
thread_name, live_dev, thread+1);
}
n_thread_name = SCStrdup(tname);
}
for (thread = 0; thread < thread_max; thread++) {
- snprintf(tname, sizeof(tname), "Detect%"PRIu16, thread+1);
- snprintf(qname, sizeof(qname), "pickup%"PRIu16, thread+1);
+ snprintf(tname, sizeof(tname), "Detect%d", thread+1);
+ snprintf(qname, sizeof(qname), "pickup%d", thread+1);
SCLogDebug("tname %s, qname %s", tname, qname);
/* create the threads */
for (int i = 0; i < nqueue; i++) {
memset(tname, 0, sizeof(tname));
- snprintf(tname, sizeof(tname), "Verdict%"PRIu16, i);
+ snprintf(tname, sizeof(tname), "Verdict%d", i);
char *thread_name = SCStrdup(tname);
if (unlikely(thread_name == NULL)) {