Home | History | Annotate | Download | only in ip

Lines Matching full:argv

64 static int gre_parse_opt(struct link_util *lu, int argc, char **argv,
183 if (!matches(*argv, "key")) {
189 if (strchr(*argv, '.'))
190 uval = get_addr32(*argv);
192 if (get_unsigned(&uval, *argv, 0) < 0) {
194 "Invalid value for \"key\": \"%s\"; it should be an unsigned integer\n", *argv);
201 } else if (!matches(*argv, "ikey")) {
206 if (strchr(*argv, '.'))
207 uval = get_addr32(*argv);
209 if (get_unsigned(&uval, *argv, 0) < 0) {
210 fprintf(stderr, "invalid value for \"ikey\": \"%s\"; it should be an unsigned integer\n", *argv);
216 } else if (!matches(*argv, "okey")) {
221 if (strchr(*argv, '.'))
222 uval = get_addr32(*argv);
224 if (get_unsigned(&uval, *argv, 0) < 0) {
225 fprintf(stderr, "invalid value for \"okey\": \"%s\"; it should be an unsigned integer\n", *argv);
231 } else if (!matches(*argv, "seq")) {
234 } else if (!matches(*argv, "iseq")) {
236 } else if (!matches(*argv, "oseq")) {
238 } else if (!matches(*argv, "csum")) {
241 } else if (!matches(*argv, "icsum")) {
243 } else if (!matches(*argv, "ocsum")) {
245 } else if (!matches(*argv, "nopmtudisc")) {
247 } else if (!matches(*argv, "pmtudisc")) {
249 } else if (!matches(*argv, "remote")) {
251 if (strcmp(*argv, "any"))
252 daddr = get_addr32(*argv);
253 } else if (!matches(*argv, "local")) {
255 if (strcmp(*argv, "any"))
256 saddr = get_addr32(*argv);
257 } else if (!matches(*argv, "dev")) {
259 link = if_nametoindex(*argv);
262 *argv);
265 } else if (!matches(*argv, "ttl") ||
266 !matches(*argv, "hoplimit")) {
270 if (strcmp(*argv, "inherit") != 0) {
271 if (get_unsigned(&uval, *argv, 0))
272 invarg("invalid TTL\n", *argv);
274 invarg("TTL must be <= 255\n", *argv);
277 } else if (!matches(*argv, "tos") ||
278 !matches(*argv, "tclass") ||
279 !matches(*argv, "dsfield")) {
283 if (strcmp(*argv, "inherit") != 0) {
284 if (rtnl_dsfield_a2n(&uval, *argv))
285 invarg("bad TOS value", *argv);
289 } else if (strcmp(*argv, "noencap") == 0) {
291 } else if (strcmp(*argv, "encap") == 0) {
293 if (strcmp(*argv, "fou") == 0)
295 else if (strcmp(*argv, "gue") == 0)
297 else if (strcmp(*argv, "none") == 0)
300 invarg("Invalid encap type.", *argv);
301 } else if (strcmp(*argv, "encap-sport") == 0) {
303 if (strcmp(*argv, "auto") == 0)
305 else if (get_u16(&encapsport, *argv, 0))
306 invarg("Invalid source port.", *argv);
307 } else if (strcmp(*argv, "encap-dport") == 0) {
309 if (get_u16(&encapdport, *argv, 0))
310 invarg("Invalid destination port.", *argv);
311 } else if (strcmp(*argv, "encap-csum") == 0) {
313 } else if (strcmp(*argv, "noencap-csum") == 0) {
315 } else if (strcmp(*argv, "encap-udp6-csum") == 0) {
317 } else if (strcmp(*argv, "noencap-udp6-csum") == 0) {
319 } else if (strcmp(*argv, "encap-remcsum") == 0) {
321 } else if (strcmp(*argv, "noencap-remcsum") == 0) {
323 } else if (strcmp(*argv, "external") == 0) {
325 } else if (strcmp(*argv, "ignore-df") == 0) {
327 } else if (strcmp(*argv, "noignore-df") == 0) {
332 } else if (strcmp(*argv, "fwmark") == 0) {
334 if (get_u32(&fwmark, *argv, 0))
335 invarg("invalid fwmark\n", *argv);
336 } else if (strcmp(*argv, "erspan") == 0) {
338 if (get_u32(&erspan_idx, *argv, 0))
339 invarg("invalid erspan index\n", *argv);
341 invarg("erspan index must be > 0 and <= 20-bit\n", *argv);
344 argc--; argv++;
588 static void gre_print_help(struct link_util *lu, int argc, char **argv,