summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_dplane.h
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2018-07-11 17:08:47 +0200
committerMark Stapp <mjs@voltanet.io>2018-10-25 14:34:30 +0200
commit5709131cec0a3ebd9739b287b8cd2bb5c421357f (patch)
treef4d92521abb1737b386d88a12aa23965978c4d5e /zebra/zebra_dplane.h
parentzebra: start sketching dataplane provider api (diff)
downloadfrr-5709131cec0a3ebd9739b287b8cd2bb5c421357f.tar.xz
frr-5709131cec0a3ebd9739b287b8cd2bb5c421357f.zip
zebra: resolve style issues in dplane commit
Resolve (most) style issues in the initial zebra dataplane commit branch. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'zebra/zebra_dplane.h')
-rw-r--r--zebra/zebra_dplane.h26
1 files changed, 10 insertions, 16 deletions
diff --git a/zebra/zebra_dplane.h b/zebra/zebra_dplane.h
index fcc70e99b..4cd75961a 100644
--- a/zebra/zebra_dplane.h
+++ b/zebra/zebra_dplane.h
@@ -94,7 +94,7 @@ enum zebra_dplane_result {
/*
* Enqueue a route install or update for the dataplane.
*/
-typedef enum {
+enum dplane_op_e {
DPLANE_OP_NONE = 0,
/* Route update */
@@ -102,14 +102,14 @@ typedef enum {
DPLANE_OP_ROUTE_UPDATE,
DPLANE_OP_ROUTE_DELETE,
-} dplane_op_e;
+};
/*
* Opaque context block used to exchange info between the main zebra
* context and the dataplane module(s). If these are two independent pthreads,
* they cannot share existing global data structures safely.
*/
-typedef struct zebra_dplane_ctx_s * dplane_ctx_h;
+typedef struct zebra_dplane_ctx_s *dplane_ctx_h;
/* Define a tailq list type for context blocks. The list is exposed/public,
* but the internal linkage in the context struct is private, so there
@@ -117,11 +117,6 @@ typedef struct zebra_dplane_ctx_s * dplane_ctx_h;
*/
TAILQ_HEAD(dplane_ctx_q_s, zebra_dplane_ctx_s);
-/*
- * Allocate an opaque context block, currently for a route update.
- */
-dplane_ctx_h dplane_ctx_alloc(void);
-
/* Return a dataplane results context block after use; the caller's pointer will
* be cleared.
*/
@@ -140,13 +135,13 @@ void dplane_ctx_dequeue(struct dplane_ctx_q_s *q, dplane_ctx_h *ctxp);
*/
enum zebra_dplane_result dplane_ctx_get_status(const dplane_ctx_h ctx);
-dplane_op_e dplane_ctx_get_op(const dplane_ctx_h ctx);
-const char *dplane_op2str(dplane_op_e op);
+enum dplane_op_e dplane_ctx_get_op(const dplane_ctx_h ctx);
+const char *dplane_op2str(enum dplane_op_e op);
const struct prefix *dplane_ctx_get_dest(const dplane_ctx_h ctx);
-/* Source prefix is a little special - use convention like prefix-len of zero
- * and all-zeroes address means "no src prefix"? or ... return NULL in that case?
+/* Source prefix is a little special - use convention to return NULL
+ * to mean "no src prefix"
*/
const struct prefix *dplane_ctx_get_src(const dplane_ctx_h ctx);
@@ -186,7 +181,6 @@ enum zebra_dplane_result dplane_route_delete(struct route_node *rn,
struct route_entry *re);
/* Opaque handle to a dataplane provider plugin */
-typedef struct zebra_dplane_provider_s *dplane_provider_h;
#define DPLANE_PROVIDER_NAMELEN 64
@@ -195,21 +189,21 @@ typedef struct zebra_dplane_provider_s *dplane_provider_h;
* followed by the kernel, followed by some post-processing step (such as
* the fpm output stream.)
*/
-typedef enum {
+enum dplane_provider_prio_e {
DPLANE_PRIO_NONE = 0,
DPLANE_PRIO_PREPROCESS,
DPLANE_PRIO_PRE_KERNEL,
DPLANE_PRIO_KERNEL,
DPLANE_PRIO_POSTPROCESS,
DPLANE_PRIO_LAST
-} dplane_provider_prio_e;
+};
/* Provider's entry-point to process a context block */
typedef int (*dplane_provider_process_fp)(dplane_ctx_h ctx);
/* Provider registration */
int dplane_provider_register(const char *name,
- dplane_provider_prio_e prio,
+ enum dplane_provider_prio_e prio,
dplane_provider_process_fp fp);
/*