-/* $OpenBSD: rde_community_test.c,v 1.2 2019/07/04 10:20:59 claudio Exp $ */
+/* $OpenBSD: rde_community_test.c,v 1.3 2022/02/07 09:31:21 claudio Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
}
int
-attr_write(void *p, u_int16_t p_len, u_int8_t flags, u_int8_t type,
- void *data, u_int16_t data_len)
+attr_write(void *p, uint16_t p_len, uint8_t flags, uint8_t type,
+ void *data, uint16_t data_len)
{
u_char *b = p;
- u_int16_t tmp, tot_len = 2; /* attribute header (without len) */
+ uint16_t tmp, tot_len = 2; /* attribute header (without len) */
flags &= ~ATTR_DEFMASK;
if (data_len > 255) {
}
int
-attr_writebuf(struct ibuf *buf, u_int8_t flags, u_int8_t type, void *data,
- u_int16_t data_len)
+attr_writebuf(struct ibuf *buf, uint8_t flags, uint8_t type, void *data,
+ uint16_t data_len)
{
return (-1);
}
-/* $OpenBSD: rde_decide_test.c,v 1.6 2021/08/31 10:54:40 claudio Exp $ */
+/* $OpenBSD: rde_decide_test.c,v 1.7 2022/02/07 09:31:21 claudio Exp $ */
/*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
struct aspath a;
struct {
LIST_ENTRY(aspath) entry;
- u_int32_t source_as;
+ uint32_t source_as;
int refcnt;
uint16_t len;
uint16_t ascnt;
- uint8_t d[6];
+ uint8_t d[6];
} x;
} asdata[] = {
{ .x = { .len = 6, .ascnt = 2, .d = { 2, 1, 0, 0, 0, 1 } } },
/*
* Helper functions need to link and run the tests.
*/
-u_int32_t
+uint32_t
rde_local_as(void)
{
return 65000;
}
int
-as_set_match(const struct as_set *aset, u_int32_t asnum)
+as_set_match(const struct as_set *aset, uint32_t asnum)
{
errx(1, __func__);
}
struct rib *
-rib_byid(u_int16_t id)
+rib_byid(uint16_t id)
{
return &dummy_rib;
}
-/* $OpenBSD: rde_sets_test.c,v 1.7 2019/12/17 11:57:16 claudio Exp $ */
+/* $OpenBSD: rde_sets_test.c,v 1.8 2022/02/07 09:31:21 claudio Exp $ */
/*
* Copyright (c) 2018 Claudio Jeker <claudio@openbsd.org>
struct rde_memstats rdemem;
-u_int32_t va[] = { 19, 14, 32, 76, 125 };
-u_int32_t vaa[] = { 125, 14, 76, 32, 19 };
-u_int32_t vb[] = { 256, 1024, 512, 4096, 2048, 512 };
-u_int32_t vc[] = { 42 };
+uint32_t va[] = { 19, 14, 32, 76, 125 };
+uint32_t vaa[] = { 125, 14, 76, 32, 19 };
+uint32_t vb[] = { 256, 1024, 512, 4096, 2048, 512 };
+uint32_t vc[] = { 42 };
struct as_set_head as_sets;
static struct as_set *
-build_set(const char *name, u_int32_t *mem, size_t nmemb, size_t initial)
+build_set(const char *name, uint32_t *mem, size_t nmemb, size_t initial)
{
struct as_set *a;
-/* $OpenBSD: rde_trie_test.c,v 1.12 2020/12/29 15:35:57 claudio Exp $ */
+/* $OpenBSD: rde_trie_test.c,v 1.13 2022/02/07 09:31:21 claudio Exp $ */
/*
* Copyright (c) 2018 Claudio Jeker <claudio@openbsd.org>
int orlonger;
int
-host_ip(const char *s, struct bgpd_addr *h, u_int8_t *len)
+host_ip(const char *s, struct bgpd_addr *h, uint8_t *len)
{
struct addrinfo hints, *res;
int bits;
}
int
-host(const char *s, struct bgpd_addr *h, u_int8_t *len)
+host(const char *s, struct bgpd_addr *h, uint8_t *len)
{
int mask = 128;
char *p, *ps;
const char *errstr;
char *line, *s;
struct bgpd_addr prefix;
- u_int8_t plen;
+ uint8_t plen;
while ((line = fparseln(in, NULL, NULL, NULL, FPARSELN_UNESCALL))) {
int state = 0;
- u_int8_t min = 255, max = 255, maskmax = 0;
+ uint8_t min = 255, max = 255, maskmax = 0;
while ((s = strsep(&line, " \t\n"))) {
if (*s == '\0')
struct set_table *set = NULL;
struct roa roa;
struct bgpd_addr prefix;
- u_int8_t plen;
+ uint8_t plen;
while ((line = fparseln(in, NULL, NULL, NULL, FPARSELN_UNESCALL))) {
int state = 0;
- u_int32_t as;
- u_int8_t max = 0;
+ uint32_t as;
+ uint8_t max = 0;
while ((s = strsep(&line, " \t\n"))) {
if (*s == '\0')
{
char *line;
struct bgpd_addr prefix;
- u_int8_t plen;
+ uint8_t plen;
while ((line = fparseln(in, NULL, NULL, NULL, FPARSELN_UNESCALL))) {
if (!host(line, &prefix, &plen))
const char *errstr;
char *line, *s;
struct bgpd_addr prefix;
- u_int8_t plen;
- u_int32_t as;
+ uint8_t plen;
+ uint32_t as;
int r;
while ((line = fparseln(in, NULL, NULL, NULL, FPARSELN_UNESCALL))) {