Lines Matching +defs:c +defs:cpp

160 	char	*cps[20], **cpp, c, ipopts[68];
175 cpp = cps;
176 if (!*cpp)
179 c = **cpp;
180 if (!ISALPHA(c) || (TOLOWER(c) != 'o' && TOLOWER(c) != 'i')) {
181 fprintf(stderr, "bad direction \"%s\"\n", *cpp);
186 if (!strcasecmp(*cpp, "out6") || !strcasecmp(*cpp, "in6")) {
187 return (parseipv6(cpp, (ip6_t *)ip, ifn, out));
191 *out = (TOLOWER(c) == 'o') ? 1 : 0;
192 cpp++;
193 if (!*cpp)
196 if (!strcasecmp(*cpp, "on")) {
197 cpp++;
198 if (!*cpp)
200 *ifn = strdup(*cpp++);
201 if (!*cpp)
205 c = **cpp;
207 if (!strcasecmp(*cpp, "tcp") || !strcasecmp(*cpp, "udp") ||
208 !strcasecmp(*cpp, "icmp")) {
209 if (c == 't') {
213 } else if (c == 'u') {
222 cpp++;
223 } else if (ISDIGIT(**cpp) && !index(*cpp, '.')) {
224 ip->ip_p = atoi(*cpp);
225 cpp++;
229 if (!*cpp)
234 last = strchr(*cpp, ',');
246 ip->ip_src.s_addr = tx_hostnum(*cpp, &r);
247 cpp++;
248 if (!*cpp)
254 last = strchr(*cpp, ',');
262 ip->ip_dst.s_addr = tx_hostnum(*cpp, &r);
263 cpp++;
265 if (*cpp != NULL) {
269 for (s = *cpp; *s; s++)
274 cpp++;
280 if (*cpp && !strncasecmp(*cpp, "seq=", 4)) {
281 tcp->th_seq = htonl(atoi(*cpp + 4));
282 cpp++;
285 if (*cpp && !strncasecmp(*cpp, "ack=", 4)) {
286 tcp->th_ack = htonl(atoi(*cpp + 4));
287 cpp++;
289 } else if (*cpp && ip->ip_p == IPPROTO_ICMP) {
292 t = strchr(*cpp, ',');
296 ic->icmp_type = geticmptype(AF_INET, *cpp);
299 cpp++;
308 if (*cpp && !strcasecmp(*cpp, "opt")) {
311 cpp++;
312 olen = buildopts(*cpp, ipopts, (IP_HL(ip) - 5) << 2);
332 parseipv6(char **cpp, ip6_t *ip6, char **ifn, int *out)
342 *out = (**cpp == 'o') ? 1 : 0;
343 cpp++;
344 if (!*cpp)
347 if (!strcasecmp(*cpp, "on")) {
348 cpp++;
349 if (!*cpp)
351 *ifn = strdup(*cpp++);
352 if (!*cpp)
356 if (!strcasecmp(*cpp, "tcp")) {
359 cpp++;
360 } else if (!strcasecmp(*cpp, "udp")) {
363 cpp++;
364 } else if (!strcasecmp(*cpp, "icmpv6")) {
367 cpp++;
368 } else if (ISDIGIT(**cpp) && !index(*cpp, ':')) {
369 ip6->ip6_nxt = atoi(*cpp);
370 cpp++;
374 if (!*cpp)
395 last = strchr(*cpp, ',');
408 if (inet_pton(AF_INET6, *cpp, &ip6->ip6_src) != 1) {
409 fprintf(stderr, "cannot parse source address '%s'\n", *cpp);
413 cpp++;
414 if (!*cpp)
420 last = strchr(*cpp, ',');
429 if (inet_pton(AF_INET6, *cpp, &ip6->ip6_dst) != 1) {
431 *cpp);
435 cpp++;
437 if (*cpp != NULL) {
441 for (s = *cpp; *s; s++)
446 cpp++;
452 if (*cpp && !strncasecmp(*cpp, "seq=", 4)) {
453 tcp->th_seq = htonl(atoi(*cpp + 4));
454 cpp++;
457 if (*cpp && !strncasecmp(*cpp, "ack=", 4)) {
458 tcp->th_ack = htonl(atoi(*cpp + 4));
459 cpp++;
461 } else if (*cpp && ip6->ip6_nxt == IPPROTO_ICMPV6) {
464 t = strchr(*cpp, ',');
468 ic6->icmp6_type = geticmptype(AF_INET6, *cpp);