]> git.proxmox.com Git - mirror_frr.git/blob - pathd/path_debug.c
doc: Add `show ipv6 rpf X:X::X:X` command to docs
[mirror_frr.git] / pathd / path_debug.c
1 /*
2 * Copyright (C) 2020 NetDEF, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation; either version 2 of the License, or (at your option)
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; see the file COPYING; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 #include <zebra.h>
20
21 #include <string.h>
22 #include <stdbool.h>
23 #include <time.h>
24 #include <libyang/libyang.h>
25
26 #include "printfrr.h"
27 #include "ipaddr.h"
28
29 #include "pathd/path_debug.h"
30
31 THREAD_DATA char _debug_buff[DEBUG_BUFF_SIZE];
32
33 /**
34 * Gives the string representation of an srte_protocol_origin enum value.
35 *
36 * @param origin The enum value to convert to string
37 * @return a constant string representation of the enum value
38 */
39 const char *srte_protocol_origin_name(enum srte_protocol_origin origin)
40 {
41 switch (origin) {
42 case SRTE_ORIGIN_UNDEFINED:
43 return "UNDEFINED";
44 case SRTE_ORIGIN_PCEP:
45 return "PCEP";
46 case SRTE_ORIGIN_BGP:
47 return "BGP";
48 case SRTE_ORIGIN_LOCAL:
49 return "LOCAL";
50 default:
51 return "UNKNOWN";
52 }
53 }
54
55 /**
56 * Gives the string representation of an srte_candidate_type enum value.
57 *
58 * @param origin The enum value to convert to string
59 * @return a constant string representation of the enum value
60 */
61 const char *srte_candidate_type_name(enum srte_candidate_type type)
62 {
63 switch (type) {
64 case SRTE_CANDIDATE_TYPE_EXPLICIT:
65 return "EXPLICIT";
66 case SRTE_CANDIDATE_TYPE_DYNAMIC:
67 return "DYNAMIC";
68 case SRTE_CANDIDATE_TYPE_UNDEFINED:
69 return "UNDEFINED";
70 default:
71 return "UNKNOWN";
72 }
73 }
74
75 /**
76 * Gives the string representation of an objfun_type enum value.
77 *
78 * @param origin The enum value to convert to string
79 * @return a constant string representation of the enum value
80 */
81 const char *objfun_type_name(enum objfun_type type)
82 {
83 switch (type) {
84 case OBJFUN_UNDEFINED:
85 return "UNDEFINED";
86 case OBJFUN_MCP:
87 return "MCP";
88 case OBJFUN_MLP:
89 return "MLP";
90 case OBJFUN_MBP:
91 return "MBP";
92 case OBJFUN_MBC:
93 return "MBC";
94 case OBJFUN_MLL:
95 return "MLL";
96 case OBJFUN_MCC:
97 return "MCC";
98 case OBJFUN_SPT:
99 return "SPT";
100 case OBJFUN_MCT:
101 return "MCT";
102 case OBJFUN_MPLP:
103 return "MPLP";
104 case OBJFUN_MUP:
105 return "MUP";
106 case OBJFUN_MRUP:
107 return "MRUP";
108 case OBJFUN_MTD:
109 return "MTD";
110 case OBJFUN_MBN:
111 return "MBN";
112 case OBJFUN_MCTD:
113 return "MCTD";
114 case OBJFUN_MSL:
115 return "MSL";
116 case OBJFUN_MSS:
117 return "MSS";
118 case OBJFUN_MSN:
119 return "MSN";
120 default:
121 return "UNKNOWN";
122 }
123 }