+/* neigh add parse */
+struct cfg_neigh_add_item {
+ cmdline_fixed_string_t neigh;
+ cmdline_fixed_string_t pstr;
+ uint16_t port;
+ cmdline_fixed_string_t mac;
+};
+
+static void
+cfg_parse_neigh(void *parsed_result, __rte_unused struct cmdline *cl,
+ void *data)
+{
+ int32_t rc;
+ struct cfg_neigh_add_item *res;
+ struct parse_status *st;
+ struct rte_ether_addr mac;
+
+ st = data;
+ res = parsed_result;
+ rc = parse_mac(res->mac, &mac);
+ APP_CHECK(rc == 0, st, "invalid ether addr:%s", res->mac);
+ rc = add_dst_ethaddr(res->port, &mac);
+ APP_CHECK(rc == 0, st, "invalid port numer:%hu", res->port);
+ if (st->status < 0)
+ return;
+}
+
+cmdline_parse_token_string_t cfg_add_neigh_start =
+ TOKEN_STRING_INITIALIZER(struct cfg_neigh_add_item, neigh, "neigh");
+cmdline_parse_token_string_t cfg_add_neigh_pstr =
+ TOKEN_STRING_INITIALIZER(struct cfg_neigh_add_item, pstr, "port");
+cmdline_parse_token_num_t cfg_add_neigh_port =
+ TOKEN_NUM_INITIALIZER(struct cfg_neigh_add_item, port, UINT16);
+cmdline_parse_token_string_t cfg_add_neigh_mac =
+ TOKEN_STRING_INITIALIZER(struct cfg_neigh_add_item, mac, NULL);
+
+cmdline_parse_inst_t cfg_neigh_add_rule = {
+ .f = cfg_parse_neigh,
+ .data = NULL,
+ .help_str = "",
+ .tokens = {
+ (void *)&cfg_add_neigh_start,
+ (void *)&cfg_add_neigh_pstr,
+ (void *)&cfg_add_neigh_port,
+ (void *)&cfg_add_neigh_mac,
+ NULL,
+ },
+};
+