-/* $OpenBSD: rde_community_test.c,v 1.6 2023/01/30 17:02:48 claudio Exp $ */
+/* $OpenBSD: rde_community_test.c,v 1.7 2023/06/17 08:01:22 claudio Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
if (f->next != 0) {
if (community_count(&comm, COMMUNITY_TYPE_EXT) !=
f->next - 1) {
- printf("Test %zu: community_count unexpected "
+ printf("Test %zu: ext community_count unexpected "
"return %d != %d\n", num, r, f->next - 1);
return -1;
}
if (f->nlarge != 0) {
if (community_count(&comm, COMMUNITY_TYPE_LARGE) !=
f->nlarge - 1) {
- printf("Test %zu: community_count unexpected "
+ printf("Test %zu: large community_count unexpected "
"return %d != %d\n", num, r, f->nlarge - 1);
return -1;
}
.data2 = 196618,
.data3 = EXT_COMMUNITY_TRANS_TWO_AS << 8 | 0x02,
},
+ { /* 42 */
+ .flags = COMMUNITY_TYPE_EXT | (COMMUNITY_ANY << 24),
+ },
+ { /* 43 */
+ .flags = COMMUNITY_TYPE_EXT | (COMMUNITY_ANY << 8),
+ .data3 = (-1 << 8) | 0x02,
+ },
+ { /* 44 */
+ .flags = COMMUNITY_TYPE_EXT | (COMMUNITY_ANY << 8),
+ .data3 = EXT_COMMUNITY_TRANS_FOUR_AS << 8 | 0x02,
+ },
+ { /* 45 */
+ .flags = COMMUNITY_TYPE_EXT | (COMMUNITY_ANY << 16),
+ .data3 = EXT_COMMUNITY_TRANS_FOUR_AS << 8 | 0x02,
+ .data1 = 196618,
+ },
};
struct testfilter {
int nlarge;
struct rde_peer *peer;
} testfilters[] = {
- {
- .in = { 38, -1 },
- .match = 30,
- .mout = 1,
- .peer = &peer,
- },
{
.in = { 1, 2, -1 },
.match = 1,
.mout = 1,
.peer = &peer_r4,
},
+ {
+ .in = { 38, -1 },
+ .match = 30,
+ .mout = 1,
+ .peer = &peer,
+ },
+ { /* 70 */
+ .in = { 38, 39, 40, -1 },
+ .match = 42,
+ .mout = 1,
+ .delete = 42,
+ .next = 0 + 1,
+ .peer = &peer,
+ },
+ {
+ .in = { 38, 39, 40, -1 },
+ .match = 43,
+ .mout = 1,
+ .delete = 43,
+ .next = 0 + 1,
+ .peer = &peer,
+ },
+ {
+ .in = { 39, 40, -1 },
+ .match = 44,
+ .mout = 1,
+ .delete = 44,
+ .next = 0 + 1,
+ .peer = &peer,
+ },
+ {
+ .in = { 38, -1 },
+ .match = 44,
+ .mout = 0,
+ .peer = &peer,
+ },
+ {
+ .in = { 40, -1 },
+ .match = 45,
+ .mout = 1,
+ .delete = 45,
+ .next = 0 + 1,
+ .peer = &peer,
+ },
+ { /* 75 */
+ .in = { 38, 39, 41, -1 },
+ .match = 45,
+ .mout = 0,
+ .peer = &peer,
+ },
};
-