ethdev: add private generic device iterator
[dpdk.git] / lib / librte_ethdev / ethdev_private.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 GaĆ«tan Rivet
3  */
4
5 #ifndef _RTE_ETH_PRIVATE_H_
6 #define _RTE_ETH_PRIVATE_H_
7
8 #include "rte_ethdev.h"
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 /* Generic rte_eth_dev comparison function. */
15 typedef int (*rte_eth_cmp_t)(const struct rte_eth_dev *, const void *);
16
17 /* Generic rte_eth_dev iterator. */
18 struct rte_eth_dev *
19 eth_find_device(const struct rte_eth_dev *_start, rte_eth_cmp_t cmp,
20                 const void *data);
21
22 #ifdef __cplusplus
23 }
24 #endif
25
26 #endif /* _RTE_ETH_PRIVATE_H_ */