Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YANG operational-data fragmentation #6371

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bfdd/bfdd_nb_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ bfdd_bfd_sessions_single_hop_lookup_entry(struct nb_cb_lookup_entry_args *args)
struct sockaddr_any psa, lsa;
struct bfd_key bk;

/* TODO: take args->exact_match into account. */

strtosa(dest_addr, &psa);
memset(&lsa, 0, sizeof(lsa));
gen_bfd_key(&bk, &psa, &lsa, false, ifname, vrf);
Expand Down Expand Up @@ -368,6 +370,8 @@ bfdd_bfd_sessions_multi_hop_lookup_entry(struct nb_cb_lookup_entry_args *args)
struct sockaddr_any psa, lsa;
struct bfd_key bk;

/* TODO: take args->exact_match into account. */

strtosa(dest_addr, &psa);
strtosa(source_addr, &lsa);
gen_bfd_key(&bk, &psa, &lsa, true, ifname, vrf);
Expand Down
19 changes: 17 additions & 2 deletions grpc/frr-northbound.proto
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,18 @@ message GetRequest {
// Include implicit default nodes.
bool with_defaults = 3;

// Paths requested by the client.
repeated string path = 4;
// YANG data path.
string path = 4;

// Base iteration offset (optional).
//
// This parameter is valid only for the STATE request type.
string offset = 5;

// Maximum number of elements to fetch (optional).
//
// This parameter is valid only for the STATE request type.
uint32 chunk_size = 6;
}

message GetResponse {
Expand All @@ -143,6 +153,11 @@ message GetResponse {

// The requested data.
DataTree data = 2;

// When the requested data can't be delivered in a single response,
// an offset is returned indicating where the next Get() call should
// start to retrieve the remaining data.
string offset = 3;
}

//
Expand Down
10 changes: 9 additions & 1 deletion lib/if.c
Original file line number Diff line number Diff line change
Expand Up @@ -1644,8 +1644,16 @@ lib_interface_lookup_entry(struct nb_cb_lookup_entry_args *args)
const char *ifname = args->keys->key[0];
const char *vrfname = args->keys->key[1];
struct vrf *vrf = vrf_lookup_by_name(vrfname);
struct interface interface;

return vrf ? if_lookup_by_name(ifname, vrf->vrf_id) : NULL;
if (!vrf)
return NULL;

strlcpy(interface.name, ifname, sizeof(interface.name));
return args->exact_match
? RB_FIND(if_name_head, &vrf->ifaces_by_name, &interface)
: RB_NFIND(if_name_head, &vrf->ifaces_by_name,
&interface);
}

/*
Expand Down
8 changes: 4 additions & 4 deletions lib/nexthop.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ static int _nexthop_source_cmp(const struct nexthop *nh1,
return nexthop_g_addr_cmp(nh1->type, &nh1->src, &nh2->src);
}

static int _nexthop_cmp_no_labels(const struct nexthop *next1,
const struct nexthop *next2)
int nexthop_cmp_no_labels(const struct nexthop *next1,
const struct nexthop *next2)
{
int ret = 0;

Expand Down Expand Up @@ -193,7 +193,7 @@ int nexthop_cmp(const struct nexthop *next1, const struct nexthop *next2)
{
int ret = 0;

ret = _nexthop_cmp_no_labels(next1, next2);
ret = nexthop_cmp_no_labels(next1, next2);
if (ret != 0)
return ret;

Expand Down Expand Up @@ -335,7 +335,7 @@ bool nexthop_same_no_labels(const struct nexthop *nh1,
if (nh1 == nh2)
return true;

if (_nexthop_cmp_no_labels(nh1, nh2) != 0)
if (nexthop_cmp_no_labels(nh1, nh2) != 0)
return false;

return true;
Expand Down
2 changes: 2 additions & 0 deletions lib/nexthop.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ extern bool nexthop_same(const struct nexthop *nh1, const struct nexthop *nh2);
extern bool nexthop_same_no_labels(const struct nexthop *nh1,
const struct nexthop *nh2);
extern int nexthop_cmp(const struct nexthop *nh1, const struct nexthop *nh2);
extern int nexthop_cmp_no_labels(const struct nexthop *next1,
const struct nexthop *next2);
extern int nexthop_g_addr_cmp(enum nexthop_types_t type,
const union g_addr *addr1,
const union g_addr *addr2);
Expand Down
Loading