Line data Source code
1 : /* SPDX-License-Identifier: GPL-2.0-only */
2 : /*
3 : * Copyright (c) 2023 Meta Platforms, Inc. and affiliates.
4 : */
5 :
6 : #include "core/front.h"
7 :
8 : #include "core/helper.h"
9 :
10 5 : const char *bf_front_to_str(enum bf_front front)
11 : {
12 5 : bf_assert(front >= 0 && front < _BF_FRONT_MAX);
13 :
14 : static const char * const names[] = {
15 : [BF_FRONT_IPT] = "BF_FRONT_IPT",
16 : [BF_FRONT_NFT] = "BF_FRONT_NFT",
17 : [BF_FRONT_CLI] = "BF_FRONT_CLI",
18 : };
19 :
20 : static_assert(ARRAY_SIZE(names) == _BF_FRONT_MAX,
21 : "missing fronts in bf_front_to_str()");
22 :
23 3 : return names[front];
24 : }
|