| 1123 | } |
| 1124 | |
| 1125 | static void |
| 1126 | get_ipv6_opt(const char *opt, const char *name) |
| 1127 | { |
| 1128 | uint32_t i; |
| 1129 | |
| 1130 | static const struct { |
| 1131 | const char *name; |
| 1132 | uint32_t val; |
| 1133 | } ipv6_opt[] = { |
| 1134 | { |
| 1135 | .name = "4B", |
| 1136 | .val = IPV6_FRMT_U32, |
| 1137 | }, |
| 1138 | { |
| 1139 | .name = "8B", |
| 1140 | .val = IPV6_FRMT_U64, |
| 1141 | }, |
| 1142 | }; |
| 1143 | |
| 1144 | for (i = 0; i != RTE_DIM(ipv6_opt); i++) { |
| 1145 | if (strcmp(opt, ipv6_opt[i].name) == 0) { |
| 1146 | config.ipv6 = ipv6_opt[i].val; |
| 1147 | return; |
| 1148 | } |
| 1149 | } |
| 1150 | |
| 1151 | rte_exit(-EINVAL, "invalid value: \"%s\" for option: %s\n", |
| 1152 | opt, name); |
| 1153 | } |
| 1154 | |
| 1155 | |
| 1156 | static void |
no test coverage detected