MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cli_ipv4_lookup

Function cli_ipv4_lookup

dpdk/app/graph/ip4_route.c:146–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146static void
147cli_ipv4_lookup(void *parsed_result, __rte_unused struct cmdline *cl, void *data __rte_unused)
148{
149 struct ip4_lookup_cmd_tokens *res = parsed_result;
150 struct route_ipv4_config config;
151 int rc = -EINVAL;
152
153 if (parser_ip4_read(&config.ip, res->ip)) {
154 printf(MSG_ARG_INVALID, "ipv4");
155 return;
156 }
157
158 if (parser_ip4_read(&config.netmask, res->mask)) {
159 printf(MSG_ARG_INVALID, "netmask");
160 return;
161 }
162
163 if (parser_ip4_read(&config.via, res->via_ip)) {
164 printf(MSG_ARG_INVALID, "via ip");
165 return;
166 }
167
168 rc = route_ip4_add(&config);
169 if (rc < 0)
170 printf(MSG_CMD_FAIL, res->cmd);
171}
172
173cmdline_parse_token_string_t ip4_lookup_cmd =
174 TOKEN_STRING_INITIALIZER(struct ip4_lookup_cmd_tokens, cmd, "ipv4_lookup");

Callers

nothing calls this directly

Calls 3

parser_ip4_readFunction · 0.85
route_ip4_addFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected