Lines Matching refs:arg
32 int get_integer(int *val, const char *arg, int base) in get_integer() argument
37 if (!arg || !*arg) in get_integer()
39 res = strtol(arg, &ptr, base); in get_integer()
40 if (!ptr || ptr == arg || *ptr || res > INT_MAX || res < INT_MIN) in get_integer()
61 static int get_netmask(unsigned *val, const char *arg, int base) in get_netmask() argument
65 if (!get_unsigned(val, arg, base)) in get_netmask()
69 if (!get_addr_1(&addr, arg, AF_INET) && addr.family == AF_INET) { in get_netmask()
81 int get_unsigned(unsigned *val, const char *arg, int base) in get_unsigned() argument
86 if (!arg || !*arg) in get_unsigned()
88 res = strtoul(arg, &ptr, base); in get_unsigned()
89 if (!ptr || ptr == arg || *ptr || res > UINT_MAX) in get_unsigned()
103 int get_jiffies(unsigned *jiffies, const char *arg, int base, int *raw) in get_jiffies() argument
109 if (strchr(arg,'.') != NULL) { in get_jiffies()
110 t = strtod(arg,&p); in get_jiffies()
115 res = strtoul(arg,&p,base); in get_jiffies()
120 if (p == arg) in get_jiffies()
159 int get_u64(__u64 *val, const char *arg, int base) in get_u64() argument
164 if (!arg || !*arg) in get_u64()
166 res = strtoull(arg, &ptr, base); in get_u64()
167 if (!ptr || ptr == arg || *ptr || res == 0xFFFFFFFFULL) in get_u64()
173 int get_u32(__u32 *val, const char *arg, int base) in get_u32() argument
178 if (!arg || !*arg) in get_u32()
180 res = strtoul(arg, &ptr, base); in get_u32()
181 if (!ptr || ptr == arg || *ptr || res > 0xFFFFFFFFUL) in get_u32()
187 int get_u16(__u16 *val, const char *arg, int base) in get_u16() argument
192 if (!arg || !*arg) in get_u16()
194 res = strtoul(arg, &ptr, base); in get_u16()
195 if (!ptr || ptr == arg || *ptr || res > 0xFFFF) in get_u16()
201 int get_u8(__u8 *val, const char *arg, int base) in get_u8() argument
206 if (!arg || !*arg) in get_u8()
208 res = strtoul(arg, &ptr, base); in get_u8()
209 if (!ptr || ptr == arg || *ptr || res > 0xFF) in get_u8()
215 int get_s16(__s16 *val, const char *arg, int base) in get_s16() argument
220 if (!arg || !*arg) in get_s16()
222 res = strtol(arg, &ptr, base); in get_s16()
223 if (!ptr || ptr == arg || *ptr || res > 0x7FFF || res < -0x8000) in get_s16()
229 int get_s8(__s8 *val, const char *arg, int base) in get_s8() argument
234 if (!arg || !*arg) in get_s8()
236 res = strtol(arg, &ptr, base); in get_s8()
237 if (!ptr || ptr == arg || *ptr || res > 0x7F || res < -0x80) in get_s8()
325 int get_prefix_1(inet_prefix *dst, char *arg, int family) in get_prefix_1() argument
333 if (strcmp(arg, "default") == 0 || in get_prefix_1()
334 strcmp(arg, "any") == 0 || in get_prefix_1()
335 strcmp(arg, "all") == 0) { in get_prefix_1()
344 slash = strchr(arg, '/'); in get_prefix_1()
348 err = get_addr_1(dst, arg, family); in get_prefix_1()
377 int get_addr(inet_prefix *dst, const char *arg, int family) in get_addr() argument
380 …printf(stderr, "Error: \"%s\" may be inet address, but it is not allowed in this context.\n", arg); in get_addr()
383 if (get_addr_1(dst, arg, family)) { in get_addr()
384 fprintf(stderr, "Error: an inet address is expected rather than \"%s\".\n", arg); in get_addr()
390 int get_prefix(inet_prefix *dst, char *arg, int family) in get_prefix() argument
393 …fprintf(stderr, "Error: \"%s\" may be inet prefix, but it is not allowed in this context.\n", arg); in get_prefix()
396 if (get_prefix_1(dst, arg, family)) { in get_prefix()
397 fprintf(stderr, "Error: an inet prefix is expected rather than \"%s\".\n", arg); in get_prefix()
425 void invarg(const char *msg, const char *arg) in invarg() argument
427 fprintf(stderr, "Error: argument \"%s\" is wrong: %s\n", arg, msg); in invarg()
431 void duparg(const char *key, const char *arg) in duparg() argument
433 fprintf(stderr, "Error: duplicate \"%s\": \"%s\" is the second value.\n", key, arg); in duparg()
437 void duparg2(const char *key, const char *arg) in duparg2() argument
439 fprintf(stderr, "Error: either \"%s\" is duplicate, or \"%s\" is a garbage.\n", key, arg); in duparg2()