int (*fp)(struct zebra_dplane_provider *),
int (*fini_fp)(struct zebra_dplane_provider *,
bool early),
- void *data)
+ void *data,
+ struct zebra_dplane_provider **prov_p)
{
int ret = 0;
struct zebra_dplane_provider *p, *last;
p->dp_name, p->dp_id, p->dp_priority);
done:
+ if (prov_p)
+ *prov_p = p;
+
return ret;
}
DPLANE_PROV_FLAGS_DEFAULT,
kernel_dplane_process_func,
NULL,
- NULL);
+ NULL, NULL);
if (ret != AOK)
zlog_err("Unable to register kernel dplane provider: %d",
DPLANE_PROV_FLAGS_DEFAULT,
test_dplane_process_func,
test_dplane_shutdown_func,
- NULL /* data */);
+ NULL /* data */, NULL);
if (ret != AOK)
zlog_err("Unable to register test dplane provider: %d",
/* Provider registration: ordering or priority value, callbacks, and optional
- * opaque data value.
+ * opaque data value. If 'prov_p', return the newly-allocated provider object
+ * on success.
*/
/* Providers offer an entry-point for incoming work, called in the context of
int (*fp)(struct zebra_dplane_provider *),
int (*fini_fp)(struct zebra_dplane_provider *,
bool early),
- void *data);
+ void *data,
+ struct zebra_dplane_provider **prov_p);
/* Accessors for provider attributes */
const char *dplane_provider_get_name(const struct zebra_dplane_provider *prov);