| 136 | } |
| 137 | |
| 138 | static int |
| 139 | command_help(const char *cmd __rte_unused, const char *params, |
| 140 | struct rte_tel_data *d) |
| 141 | { |
| 142 | int i; |
| 143 | /* if no parameters return our own help text */ |
| 144 | const char *to_lookup = (params == NULL ? cmd : params); |
| 145 | |
| 146 | rte_tel_data_start_dict(d); |
| 147 | rte_spinlock_lock(&callback_sl); |
| 148 | for (i = 0; i < num_callbacks; i++) |
| 149 | if (strcmp(to_lookup, callbacks[i].cmd) == 0) { |
| 150 | if (params == NULL) |
| 151 | rte_tel_data_string(d, callbacks[i].help); |
| 152 | else |
| 153 | rte_tel_data_add_dict_string(d, params, callbacks[i].help); |
| 154 | break; |
| 155 | } |
| 156 | rte_spinlock_unlock(&callback_sl); |
| 157 | if (i == num_callbacks) |
| 158 | return -1; |
| 159 | return 0; |
| 160 | } |
| 161 | |
| 162 | static int |
| 163 | container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len) |
nothing calls this directly
no test coverage detected