メインコンテンツまでスキップ

2.1. Pseudo-Code (疑似コード)

2.1. Pseudo-Code (疑似コード)

以下の疑似コードは上記の手順を示しています。曖昧な場合は, 疑似コードではなく上記の手順を権威あるものとして扱うべきです。

result = BGP_PFXV_STATE_NOT_FOUND;

//Iterate through all the Covering entries in the local VRP
//database, pfx_validate_table.
entry = next_lookup_result(pfx_validate_table, route_prefix);

while (entry != NULL) {
prefix_exists = TRUE;

if (route_prefix_length <= entry->max_length) {
if (route_origin_as != NONE
&& entry->origin_as != 0
&& route_origin_as == entry->origin_as) {
result = BGP_PFXV_STATE_VALID;
return (result);
}
}
entry = next_lookup_result(pfx_validate_table, input.prefix);
}

//If one or more VRP entries Covered the route prefix, but
//none Matched, return "Invalid" validation state.
if (prefix_exists == TRUE) {
result = BGP_PFXV_STATE_INVALID;
}

return (result);