DPO_PROTO_IP4 = 0,
#endif
DPO_PROTO_IP6,
+ DPO_PROTO_ETHERNET,
DPO_PROTO_MPLS,
} __attribute__((packed)) dpo_proto_t;
#define DPO_PROTOS { \
[DPO_PROTO_IP4] = "ip4", \
[DPO_PROTO_IP6] = "ip6", \
+ [DPO_PROTO_ETHERNET] = "ethernet", \
[DPO_PROTO_MPLS] = "mpls", \
}
+#define FOR_EACH_DPO_PROTO(_proto) \
+ for (_proto = DPO_PROTO_IP4; \
+ _proto <= DPO_PROTO_MPLS; \
+ _proto++)
+
/**
* @brief Common types of data-path objects
* New types can be dynamically added using dpo_register_new_type()
*/
typedef void (*dpo_unlock_fn_t)(dpo_id_t *dpo);
+/**
+ * @brief An memory usage show command
+ */
+typedef void (*dpo_mem_show_t)(void);
+
/**
* @brief A virtual function table regisitered for a DPO type
*/
* A format function
*/
format_function_t *dv_format;
+ /**
+ * A show memory usage function
+ */
+ dpo_mem_show_t dv_mem_show;
} dpo_vft_t;
* @param nodes
* The string description of the per-protocol VLIB graph nodes.
*/
-void dpo_register(dpo_type_t type,
- const dpo_vft_t *vft,
- const char * const * const * nodes);
+extern void dpo_register(dpo_type_t type,
+ const dpo_vft_t *vft,
+ const char * const * const * nodes);
/**
* @brief Create and register a new DPO type.
*
* @return The new dpo_type_t
*/
-dpo_type_t dpo_register_new_type(const dpo_vft_t *vft,
- const char * const * const * nodes);
+extern dpo_type_t dpo_register_new_type(const dpo_vft_t *vft,
+ const char * const * const * nodes);
#endif