return;
}
-static void SRepCIDRAddNetblock(SRepCIDRTree *cidr_ctx, char *ip, int cat, int value)
+static void SRepCIDRAddNetblock(SRepCIDRTree *cidr_ctx, char *ip, int cat, uint8_t value)
{
SReputation *user_data = NULL;
if ((user_data = SCMalloc(sizeof(SReputation))) == NULL) {
if (strcmp(ptrs[0], "ip") == 0)
return 1;
- int c, v;
- if (StringParseI32RangeCheck(&c, 10, 0, (const char *)ptrs[1], 0, SREP_MAX_CATS - 1) < 0)
+ uint8_t c, v;
+ if (StringParseU8RangeCheck(&c, 10, 0, (const char *)ptrs[1], 0, SREP_MAX_CATS - 1) < 0)
return -1;
- if (StringParseI32RangeCheck(&v, 10, 0, (const char *)ptrs[2], 0, SREP_MAX_VAL) < 0)
+ if (StringParseU8RangeCheck(&v, 10, 0, (const char *)ptrs[2], 0, SREP_MAX_VAL) < 0)
return -1;
if (strchr(ptrs[0], '/') != NULL) {
struct libnet_in6_addr src6, dst6;
uint32_t src4, dst4;
uint16_t sp, dp;
- size_t len;
+ uint16_t len;
uint8_t *smac, *dmac;
} Libnet11Packet;
lpacket.id = 0;
lpacket.flow = 0;
lpacket.class = 0;
- const int iplen = IPV4_GET_IPLEN(p);
+ const uint16_t iplen = IPV4_GET_IPLEN(p);
if (g_reject_dev_mtu >= ETHERNET_HEADER_LEN + LIBNET_IPV4_H + 8) {
lpacket.len = MIN(g_reject_dev_mtu - ETHERNET_HEADER_LEN, (LIBNET_IPV4_H + iplen));
} else {
lpacket.id = 0;
lpacket.flow = 0;
lpacket.class = 0;
- const int iplen = IPV6_GET_PLEN(p);
+ const uint16_t iplen = IPV6_GET_PLEN(p);
if (g_reject_dev_mtu >= ETHERNET_HEADER_LEN + IPV6_HEADER_LEN + 8) {
lpacket.len = IPV6_HEADER_LEN + MIN(g_reject_dev_mtu - ETHERNET_HEADER_LEN, iplen);
} else {
TmSlotSetFuncAppend(tv_detect_ncpu, tm_module, NULL);
if (threading_set_cpu_affinity) {
- TmThreadSetCPUAffinity(tv_detect_ncpu, (int)cpu);
+ TmThreadSetCPUAffinity(tv_detect_ncpu, cpu);
/* If we have more than one core/cpu, the first Detect thread
* (at cpu 0) will have less priority (higher 'nice' value)
* In this case we will set the thread priority to +10 (default is 0)
}
SCLogInfo("VLAN handler: id %u maps to tenant %u", (uint32_t)traffic_id, tenant_id);
- r = DetectEngineTentantRegisterVlanId(tenant_id, (uint32_t)traffic_id);
+ r = DetectEngineTentantRegisterVlanId(tenant_id, (uint16_t)traffic_id);
}
if (r != 0) {
json_object_set_new(answer, "message", json_string("handler setup failure"));
}
SCLogInfo("VLAN handler: removing mapping of %u to tenant %u", (uint32_t)traffic_id, tenant_id);
- r = DetectEngineTentantUnregisterVlanId(tenant_id, (uint32_t)traffic_id);
+ r = DetectEngineTentantUnregisterVlanId(tenant_id, (uint16_t)traffic_id);
}
if (r != 0) {
json_object_set_new(answer, "message", json_string("handler unregister failure"));
}
/* register the logger bits to the app-layer */
- int a;
+ AppProto a;
for (a = 0; a < ALPROTO_MAX; a++) {
if (logger_bits[a] == 0)
continue;