/openbsd-current/regress/usr.sbin/bgpd/unittests/ |
H A D | rde_decide_test.c | 66 struct aspath a; 81 { .aspath = &asdata[0].a, .med = 100, .lpref = 100, .origin = ORIGIN_IGP, .weight = 1000 }, 83 { .aspath = &asdata[0].a, .med = 100, .lpref = 100, .origin = ORIGIN_IGP, .flags=F_ATTR_PARSE_ERR }, 84 { .aspath = &asdata[0].a, .med = 100, .lpref = 100, .origin = ORIGIN_IGP, .flags=F_ATTR_LOOP }, 86 { .aspath = &asdata[0].a, .med = 100, .lpref = 50, .origin = ORIGIN_IGP }, 87 /* 4: aspath count */ 88 { .aspath = &asdata[1].a, .med = 100, .lpref = 100, .origin = ORIGIN_IGP }, 90 { .aspath = &asdata[0].a, .med = 100, .lpref = 100, .origin = ORIGIN_EGP }, 91 { .aspath = &asdata[0].a, .med = 100, .lpref = 100, .origin = ORIGIN_INCOMPLETE }, 93 { .aspath [all...] |
H A D | rde_aspa_test.c | 25 static struct aspath *build_aspath(const uint32_t *, uint32_t, int); 44 const uint32_t *aspath; member in struct:aspath_test 50 const uint32_t *aspath; member in struct:aspa_test 440 struct aspath *a; 443 a = build_aspath(aspath_testset[i].aspath, 447 "aspath %s got -1\n", i, 448 print_aspath(aspath_testset[i].aspath, 454 printf("failed: aspath_testset[%zu]: aspath %s " 456 print_aspath(aspath_testset[i].aspath, 465 a = build_aspath(aspath_testset[i].aspath, 556 struct aspath *aspath; local [all...] |
/openbsd-current/usr.sbin/bgpd/ |
H A D | rde_attr.c | 320 /* aspath specific functions */ 324 static uint16_t aspath_countlength(struct aspath *, uint16_t, int); 325 static void aspath_countcopy(struct aspath *, uint16_t, uint8_t *, 329 aspath_compare(struct aspath *a1, struct aspath *a2) 345 struct aspath * 348 struct aspath *aspath; local 350 aspath = malloc(ASPATH_HEADER_SIZE + len); 351 if (aspath 368 struct aspath *aspath; local 383 aspath_put(struct aspath *aspath) argument 484 aspath_neighbor(struct aspath *aspath) argument 558 aspath_countlength(struct aspath *aspath, uint16_t cnt, int headcnt) argument 594 aspath_countcopy(struct aspath *aspath, uint16_t cnt, uint8_t *buf, uint16_t size, int headcnt) argument 637 aspath_loopfree(struct aspath *aspath, uint32_t myAS) argument 698 aspath_match(struct aspath *aspath, struct filter_as *f, uint32_t neighas) argument [all...] |
H A D | rde_filter.c | 47 state->aspath.lpref = set->action.metric; 51 if (state->aspath.lpref > 53 state->aspath.lpref = UINT_MAX; 55 state->aspath.lpref += 58 if (state->aspath.lpref < 60 state->aspath.lpref = 0; 62 state->aspath.lpref += 67 state->aspath.flags |= F_ATTR_MED | F_ATTR_MED_ANNOUNCE; 68 state->aspath.med = set->action.metric; 71 state->aspath [all...] |
H A D | rde.h | 120 #define ASPATH_HEADER_SIZE (offsetof(struct aspath, data)) 122 struct aspath { struct 124 uint16_t len; /* total length of aspath in octets */ 211 struct aspath *aspath; member in struct:rde_aspath 277 struct rde_aspath *aspath; member in struct:prefix 315 struct rde_aspath aspath; member in struct:filterstate 395 struct aspath *aspath_get(void *, uint16_t); 396 struct aspath *aspath_copy(struct aspath *); 410 aspath_dump(struct aspath *aspath) argument 416 aspath_length(struct aspath *aspath) argument 422 aspath_origin(struct aspath *aspath) argument [all...] |
H A D | rde_update.c | 120 if (state->aspath.flags & F_ATTR_OTC) 129 if ((state->aspath.flags & F_ATTR_OTC) == 0) { 133 if (attr_optadd(&state->aspath, 138 state->aspath.flags |= F_ATTR_OTC; 412 asp = &state.aspath; 413 asp->aspath = aspath_get(NULL, 0); 551 np = aspath_prepend(state->aspath.aspath, prep_as, 1, &nl); 552 aspath_put(state->aspath.aspath); [all...] |
H A D | rde_decide.c | 165 /* 3. aspath count, the shorter the better */ 166 if (asp1->aspath->ascnt < asp2->aspath->ascnt) 168 if (asp1->aspath->ascnt > asp2->aspath->ascnt) 185 aspath_neighbor(asp1->aspath) == aspath_neighbor(asp2->aspath)) { 489 /* The aspath needs to be loop and error free */
|
H A D | rde_aspa.c | 156 * Calculate the various indexes of an aspath. 158 * in the aspath. The down-ramp starts at index 1. 160 * nup_p: smallest index after which all aspath hops are provider valid 161 * nup_u: The biggest index of an unknown aspath hop. 162 * nup_np: The biggest index of a not-provider aspath hop. 163 * ndown_p: biggest index before which all aspath hops are provider valid 164 * ndown_u: The smallest index of an unknown aspath hop. 165 * ndown_np: The smallest index of a not-provider aspath hop. 169 aspa_check_aspath(struct rde_aspa *ra, struct aspath *a, struct aspa_state *s) 180 * Walk aspath an [all...] |
H A D | mrt.c | 246 /* aspath */ 247 plen = aspath_length(a->aspath); 248 pdata = aspath_dump(a->aspath); 350 pdata = aspath_prepend(a->aspath, rde_local_as(), 0, &plen);
|
/openbsd-current/usr.sbin/bgpctl/ |
H A D | mrtparser.h | 40 void *aspath; member in struct:mrt_rib_entry
|
H A D | output.c | 77 "aspath origin"); 760 char *aspath; local 813 if (aspath_asprint(&aspath, &asbuf) == -1) 815 printf("%s", aspath); 816 free(aspath); 978 char *p, *aspath; local 988 if (aspath_asprint(&aspath, asbuf) == -1) 990 if (strlen(aspath) > 0) 991 printf("%s ", aspath); 992 free(aspath); 1001 char *aspath, *s; local 1034 show_rib(struct ctl_show_rib *r, struct ibuf *aspath, struct parse_result *res) argument [all...] |
H A D | mrtparser.c | 673 if ((re->aspath = malloc(alen)) == NULL) 675 if (ibuf_get(&abuf, re->aspath, alen) == -1) 678 re->aspath = mrt_aspath_inflate(&abuf, 680 if (re->aspath == NULL) 754 free(re->aspath); 756 if ((re->aspath = malloc(alen)) == NULL) 758 if (ibuf_get(&abuf, re->aspath, alen) == -1) 803 free(r->entries[i].aspath);
|
H A D | output_json.c | 575 char *aspath; local 637 if (aspath_asprint(&aspath, &asbuf) == -1) 639 json_do_string("aspath", aspath); 640 free(aspath); 808 char *aspath; local 816 if (aspath_asprint(&aspath, asbuf) == -1) 818 json_do_string("aspath", aspath); 819 free(aspath); [all...] |
H A D | bgpctl.c | 1289 !match_aspath(mre->aspath, mre->aspath_len, &req->as)) 1292 ibuf_from_buffer(&ibuf, mre->aspath, mre->aspath_len); 1360 !match_aspath(mre->aspath, mre->aspath_len, &req->as)) 1375 imsg_add(msg, mre->aspath, mre->aspath_len) == -1)
|