70 if (node->
val && strcmp(node->
val,
"eve-log") == 0) {
99 SCLogError(
"Unable to allocate MacSet memory");
119 static inline void MacUpdateEntry(
122 switch (ms->
state[side]) {
131 if (ms->
buf[side] == NULL) {
145 memcpy(ms->
buf[side] + 1, addr,
sizeof(
MacAddr));
159 if (ms->
last[side] > 0) {
164 for (
int i = ms->
last[side] - 1; i >= 0; i--) {
165 uint8_t *addr2 = (uint8_t*) ((ms->
buf[side]) + i);
182 uint16_t ctr_src, uint16_t ctr_dst)
199 switch (ms->
state[side]) {
203 ret = IterFunc((uint8_t*) ms->
singles[side], side, data);
209 for (
int i = 0; i < ms->
last[side]; i++) {
210 ret = IterFunc((uint8_t*) ms->
buf[side][i], side, data);
226 ret = MacSetIterateSide(ms, IterFunc,
MAC_SET_SRC, data);
230 return MacSetIterateSide(ms, IterFunc,
MAC_SET_DST, data);
266 size_t total_free = 0;
278 total_free +=
sizeof(*ms);
284 static int CheckTest1Membership(uint8_t *addr,
MacSetSide side,
void *data)
286 int *i = (
int*) data;
289 if (addr[5] != 1)
return 1;
292 if (addr[5] != 2)
return 1;
295 if (addr[5] != 3)
return 1;
302 static int MacSetTest01(
void)
306 MacAddr addr1 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x1},
307 addr2 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x2},
308 addr3 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x3};
335 static int MacSetTest02(
void)
345 for (i = 1; i < 100; i++) {
346 MacAddr addr1 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x1},
347 addr2 = {0x1, 0x0, 0x0, 0x0, 0x0, 0x2};
359 static int MacSetTest03(
void)
368 for (uint8_t i = 1; i < 100; i++) {
369 MacAddr addr1 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x1},
370 addr2 = {0x1, 0x0, 0x0, 0x0, 0x0, 0x1};
381 static int MacSetTest04(
void)
392 static int MacSetTest05(
void)
402 for (uint8_t i = 1; i < 100; i++) {
403 MacAddr addr1 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x1},
404 addr2 = {0x1, 0x0, 0x0, 0x0, 0x0, 0x1};