/openbsd/usr.sbin/rpki-client/ |
H A D | roa.c | 182 roa->ips = recallocarray(roa->ips, roa->ipsz, in roa_parse_econtent() 219 res = &roa->ips[roa->ipsz++]; in roa_parse_econtent() 237 struct roa * 241 struct roa *roa; in roa_parse() local 252 if ((roa = calloc(1, sizeof(struct roa))) == NULL) in roa_parse() 264 if (roa->aia == NULL || roa->aki == NULL || roa->sia == NULL || in roa_parse() 296 roa->valid = valid_roa(fn, cert, roa); in roa_parse() 302 roa = NULL; in roa_parse() 308 return roa; in roa_parse() 354 struct roa * [all …]
|
H A D | parser.c | 160 static struct roa * 164 struct roa *roa; in proc_parser_roa() local 179 roa_free(roa); in proc_parser_roa() 186 roa->expires = x509_find_expires(roa->notafter, a, &crlt); in proc_parser_roa() 188 return roa; in proc_parser_roa() 807 struct roa *roa; in parse_entity() local 911 if (roa != NULL) in parse_entity() 914 c = (roa != NULL); in parse_entity() 916 if (roa != NULL) in parse_entity() 917 roa_buffer(b, roa); in parse_entity() [all …]
|
H A D | validate.c | 132 valid_roa(const char *fn, struct cert *cert, struct roa *roa) in valid_roa() argument 137 for (i = 0; i < roa->ipsz; i++) { in valid_roa() 138 if (ip_addr_check_covered(roa->ips[i].afi, roa->ips[i].min, in valid_roa() 139 roa->ips[i].max, cert->ips, cert->ipsz) > 0) in valid_roa() 142 ip_addr_print(&roa->ips[i].addr, roa->ips[i].afi, buf, in valid_roa()
|
H A D | filemode.c | 343 struct roa *roa = NULL; in proc_parser_file() 450 roa = roa_parse(&x509, file, -1, buf, len); in proc_parser_file() 451 if (roa == NULL) in proc_parser_file() 453 aia = roa->aia; in proc_parser_file() 454 expires = &roa->expires; in proc_parser_file() 455 notafter = &roa->notafter; in proc_parser_file() 507 status = roa->valid; in proc_parser_file() 573 roa_print(x509, roa); in proc_parser_file() 643 roa_free(roa); in proc_parser_file() 342 struct roa *roa = NULL; proc_parser_file() local [all...] |
H A D | extern.h | 241 struct roa { argument 694 void roa_buffer(struct ibuf *, const struct roa *); 695 void roa_free(struct roa *); 696 struct roa *roa_parse(X509 **, const char *, int, const unsigned char *, 698 struct roa *roa_read(struct ibuf *); 699 void roa_insert_vrps(struct vrp_tree *, struct roa *, 744 int valid_roa(const char *, struct cert *, struct roa *); 935 void roa_print(const X509 *, const struct roa *); 239 struct roa { global() struct 242 ipszroa global() argument 243 talidroa global() argument 244 validroa global() argument 245 aiaroa global() argument 246 akiroa global() argument 247 siaroa global() argument 248 skiroa global() argument 249 signtimeroa global() argument 250 notbeforeroa global() argument 251 notafterroa global() argument 252 expiresroa global() argument
|
H A D | Makefile | 7 output-ometric.c parser.c print.c repo.c rfc3779.c roa.c \
|
H A D | main.c | 572 struct roa *roa; in entity_process() local 655 roa = roa_read(b); in entity_process() 656 if (roa->valid) in entity_process() 657 roa_insert_vrps(tree, roa, rp); in entity_process() 660 roa_free(roa); in entity_process()
|
/openbsd/usr.sbin/bgpd/ |
H A D | rtr.c | 84 struct roa *roa, *nr; in rtr_expire_roas() local 87 RB_FOREACH_SAFE(roa, roa_tree, &conf->roa, nr) { in rtr_expire_roas() 90 RB_REMOVE(roa_tree, &conf->roa, roa); in rtr_expire_roas() 120 struct roa *roa; in rtr_roa_insert() local 122 if ((roa = malloc(sizeof(*roa))) == NULL) in rtr_roa_insert() 124 memcpy(roa, in, sizeof(*roa)); in rtr_roa_insert() 311 struct roa roa; in rtr_dispatch_imsg_parent() local 366 rtr_roa_insert(&nconf->roa, &roa); in rtr_dispatch_imsg_parent() 498 struct roa *roa, *nr; in rtr_recalc() local 508 RB_FOREACH(roa, roa_tree, &conf->roa) in rtr_recalc() [all …]
|
H A D | rtr_proto.c | 611 struct roa *roa; in rtr_parse_ipv4_prefix() local 632 if ((roa = calloc(1, sizeof(*roa))) == NULL) { in rtr_parse_ipv4_prefix() 646 free(roa); in rtr_parse_ipv4_prefix() 656 free(roa); in rtr_parse_ipv4_prefix() 661 free(roa); in rtr_parse_ipv4_prefix() 676 struct roa *roa; in rtr_parse_ipv6_prefix() local 697 if ((roa = calloc(1, sizeof(*roa))) == NULL) { in rtr_parse_ipv6_prefix() 711 free(roa); in rtr_parse_ipv6_prefix() 721 free(roa); in rtr_parse_ipv6_prefix() 726 free(roa); in rtr_parse_ipv6_prefix() [all …]
|
H A D | rde_trie.c | 387 trie_roa_add(struct trie_head *th, struct roa *roa) in trie_roa_add() argument 396 switch (roa->aid) { in trie_roa_add() 398 if (roa->prefixlen > 32) in trie_roa_add() 401 n4 = trie_add_v4(th, &roa->prefix.inet, roa->prefixlen); in trie_roa_add() 407 if (roa->prefixlen > 128) in trie_roa_add() 410 n6 = trie_add_v6(th, &roa->prefix.inet6, roa->prefixlen); in trie_roa_add() 425 if ((rsp = set_match(*stp, roa->asnum)) != NULL) { in trie_roa_add() 426 if (rsp->maxlen < roa->maxlen) in trie_roa_add() 427 rsp->maxlen = roa->maxlen; in trie_roa_add() 429 rs.as = roa->asnum; in trie_roa_add() [all …]
|
H A D | config.c | 64 RB_INIT(&conf->roa); in new_config() 213 struct roa *roa, *nroa; in free_roatree() local 215 RB_FOREACH_SAFE(roa, roa_tree, r, nroa) { in free_roatree() 216 RB_REMOVE(roa_tree, r, roa); in free_roatree() 217 free(roa); in free_roatree() 269 free_roatree(&conf->roa); in free_config() 336 free_roatree(&xconf->roa); in merge_config() 338 RB_ROOT(&xconf->roa) = RB_ROOT(&conf->roa); in merge_config() 339 RB_ROOT(&conf->roa) = NULL; in merge_config() 684 roa_cmp(struct roa *a, struct roa *b) in roa_cmp() [all …]
|
H A D | util.c | 196 log_roa(struct roa *roa) in log_roa() argument 201 struct bgpd_addr addr = { .aid = roa->aid }; in log_roa() 202 addr.v6 = roa->prefix.inet6; in log_roa() 204 struct bgpd_addr addr = { .aid = roa->aid, .v6 = roa->prefix.inet6 }; in log_roa() 208 if (roa->prefixlen != roa->maxlen) in log_roa() 209 snprintf(maxbuf, sizeof(maxbuf), " maxlen %u", roa->maxlen); in log_roa() 211 roa->prefixlen, maxbuf, roa->asnum, log_expires(roa->expires)); in log_roa()
|
H A D | printconf.c | 668 struct roa *roa; in print_originsets() local 673 RB_FOREACH(roa, roa_tree, &ps->roaitems) { in print_originsets() 675 addr.aid = roa->aid; in print_originsets() 676 addr.v6 = roa->prefix.inet6; in print_originsets() 678 if (roa->prefixlen != roa->maxlen) in print_originsets() 679 printf(" maxlen %u", roa->maxlen); in print_originsets() 680 printf(" source-as %u", roa->asnum); in print_originsets() 689 struct roa *roa; in print_roa() local 695 RB_FOREACH(roa, roa_tree, r) { in print_roa() 696 printf("\n\t%s", log_roa(roa)); in print_roa() [all …]
|
H A D | bgpd.c | 600 struct roa *roa; in send_config() local 704 RB_FOREACH(roa, roa_tree, &ps->roaitems) { in send_config() 706 -1, roa, sizeof(*roa)) == -1) in send_config() 714 RB_FOREACH(roa, roa_tree, &conf->roa) { in send_config() 716 -1, roa, sizeof(*roa)) == -1) in send_config() 719 free_roatree(&conf->roa); in send_config()
|
H A D | bgpd.h | 261 struct roa { struct 262 RB_ENTRY(roa) entry; 275 RB_HEAD(roa_tree, roa); argument 299 struct roa_tree roa; member 1433 RB_PROTOTYPE(roa_tree, roa, entry, roa_cmp); 1534 int trie_roa_add(struct trie_head *, struct roa *); 1555 const char *log_roa(struct roa *);
|
H A D | rde.c | 815 struct roa roa; in rde_dispatch_imsg_parent() local 1097 if (imsg_get_data(&imsg, &roa, sizeof(roa)) == -1) in rde_dispatch_imsg_parent() 1099 rv = trie_roa_add(&last_prefixset->th, &roa); in rde_dispatch_imsg_parent() 1224 struct roa roa; in rde_dispatch_imsg_rtr() local 1240 if (imsg_get_data(&imsg, &roa, sizeof(roa)) == -1) in rde_dispatch_imsg_rtr() 1242 if (trie_roa_add(&roa_new.th, &roa) != 0) { in rde_dispatch_imsg_rtr() 1245 .aid = roa.aid in rde_dispatch_imsg_rtr() 1247 p.v6 = roa.prefix.inet6; in rde_dispatch_imsg_rtr() 1250 .aid = roa.aid, in rde_dispatch_imsg_rtr() 1251 .v6 = roa.prefix.inet6 in rde_dispatch_imsg_rtr() [all …]
|
/openbsd/regress/usr.sbin/bgpd/unittests/ |
H A D | rde_trie_test.c | 36 int roa; variable 175 struct roa roa; in parse_roa_file() local 221 roa.aid = prefix.aid; in parse_roa_file() 222 roa.prefix.inet6 = prefix.v6; in parse_roa_file() 223 roa.prefixlen = plen; in parse_roa_file() 224 roa.maxlen = max; in parse_roa_file() 225 roa.asnum = as; in parse_roa_file() 226 if (trie_roa_add(th, &roa) != 0) in parse_roa_file() 322 roa = 1; in main() 342 if (roa) in main() [all …]
|
/openbsd/regress/usr.sbin/bgpd/config/ |
H A D | bgpd.conf.9.in | 2 # test roa-set blocks 6 roa-set { } 7 roa-set { 1.2.3/24 source-as 0 } 8 roa-set {
|
H A D | bgpd.conf.14.in | 2 # test roa-set blocks 6 roa-set {
|
H A D | bgpd.conf.14.ok | 7 roa-set {
|
H A D | bgpd.conf.9.ok | 7 roa-set {
|
/openbsd/regress/usr.sbin/rpki-client/ |
H A D | Makefile.inc | 10 PROGS += test-roa 51 SRCS_test-roa+= test-roa.c roa.c cms.c x509.c ip.c as.c io.c json.c \ 54 run-regress-test-roa: test-roa 55 ./test-roa -v ${.CURDIR}/../roa/*.roa
|
H A D | test-roa.c | 43 struct roa *p; in main()
|
/openbsd/regress/usr.sbin/rpki-client/rrdp/ |
H A D | rrdp-r3.out | 2 …mple.com/repository/DEFAULT/95/d58727-d970-44d9-abdc-93b3ad12d2f3/1/gSk6an-JyWyxV5LYX0AB2BOJb7I.roa 14 …mple.com/repository/DEFAULT/95/d58727-d970-44d9-abdc-93b3ad12d2f3/1/x7OkhL6fs-x6CQ4Kqd5jOkkB4pY.roa
|
/openbsd/regress/usr.sbin/bgpd/integrationtests/ |
H A D | bgpd.ovs.rdomain1.conf | 5 roa-set {
|