2 * Copyright (c) 2016 Intel Corporation.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
19 #define PARSE_LIST_DELIM "-"
27 struct in6_addr addr6;
30 struct ether_addr mac;
35 parse_uint_val(__rte_unused const char *key, const char *val, void *prm)
43 v = strtoul(val, &end, 0);
44 if (errno != 0 || end[0] != 0 || v > UINT32_MAX)
52 format_addr(const struct sockaddr_storage *sp, char buf[], size_t len)
54 const struct sockaddr_in *i4;
55 const struct sockaddr_in6 *i6;
58 if (sp->ss_family == AF_INET) {
59 i4 = (const struct sockaddr_in *)sp;
61 } else if (sp->ss_family == AF_INET6) {
62 i6 = (const struct sockaddr_in6 *)sp;
63 addr = &i6->sin6_addr;
68 return inet_ntop(sp->ss_family, addr, buf, len);
71 int parse_netbe_arg(struct netbe_port *prt, const char *arg);
73 int netbe_parse_dest(const char *fname, struct netbe_dest_prm *prm);
75 int netfe_parse_cfg(const char *fname, struct netfe_lcore_prm *lp);
77 #endif /* __PARSE_H__ */