| 149 | } |
| 150 | |
| 151 | static void |
| 152 | cli_ipv6_lookup(void *parsed_result, __rte_unused struct cmdline *cl, void *data __rte_unused) |
| 153 | { |
| 154 | struct ip6_lookup_cmd_tokens *res = parsed_result; |
| 155 | struct route_ipv6_config config; |
| 156 | int rc = -EINVAL; |
| 157 | |
| 158 | if (parser_ip6_read(config.ip, res->ip)) { |
| 159 | printf(MSG_ARG_INVALID, "ipv6"); |
| 160 | return; |
| 161 | } |
| 162 | |
| 163 | if (parser_ip6_read(config.mask, res->mask)) { |
| 164 | printf(MSG_ARG_INVALID, "netmask"); |
| 165 | return; |
| 166 | } |
| 167 | |
| 168 | if (parser_ip6_read(config.gateway, res->via_ip)) { |
| 169 | printf(MSG_ARG_INVALID, "gateway ip"); |
| 170 | return; |
| 171 | } |
| 172 | |
| 173 | rc = route_ip6_add(&config); |
| 174 | if (rc) |
| 175 | printf(MSG_CMD_FAIL, res->cmd); |
| 176 | } |
| 177 | |
| 178 | cmdline_parse_token_string_t ip6_lookup_cmd = |
| 179 | TOKEN_STRING_INITIALIZER(struct ip6_lookup_cmd_tokens, cmd, "ipv6_lookup"); |
nothing calls this directly
no test coverage detected