Lines Matching refs:cpp

172 	char	*cps[20], **cpp, c, ipopts[68];
187 cpp = cps;
188 if (!*cpp)
191 c = **cpp;
193 fprintf(stderr, "bad direction \"%s\"\n", *cpp);
198 if (!strcasecmp(*cpp, "out6") || !strcasecmp(*cpp, "in6")) {
199 return parseipv6(cpp, (ip6_t *)ip, ifn, out);
204 cpp++;
205 if (!*cpp)
208 if (!strcasecmp(*cpp, "on")) {
209 cpp++;
210 if (!*cpp)
212 *ifn = strdup(*cpp++);
213 if (!*cpp)
217 c = **cpp;
219 if (!strcasecmp(*cpp, "tcp") || !strcasecmp(*cpp, "udp") ||
220 !strcasecmp(*cpp, "icmp")) {
234 cpp++;
235 } else if (ISDIGIT(**cpp) && !index(*cpp, '.')) {
236 ip->ip_p = atoi(*cpp);
237 cpp++;
241 if (!*cpp)
246 last = strchr(*cpp, ',');
258 ip->ip_src.s_addr = tx_hostnum(*cpp, &r);
259 cpp++;
260 if (!*cpp)
266 last = strchr(*cpp, ',');
274 ip->ip_dst.s_addr = tx_hostnum(*cpp, &r);
275 cpp++;
277 if (*cpp != NULL) {
281 for (s = *cpp; *s; s++)
285 cpp++;
291 if (*cpp && !strncasecmp(*cpp, "seq=", 4)) {
292 tcp->th_seq = htonl(atoi(*cpp + 4));
293 cpp++;
296 if (*cpp && !strncasecmp(*cpp, "ack=", 4)) {
297 tcp->th_ack = htonl(atoi(*cpp + 4));
298 cpp++;
300 } else if (*cpp && ip->ip_p == IPPROTO_ICMP) {
303 t = strchr(*cpp, ',');
307 ic->icmp_type = geticmptype(AF_INET, *cpp);
310 cpp++;
319 if (*cpp && !strcasecmp(*cpp, "opt")) {
322 cpp++;
323 olen = buildopts(*cpp, ipopts, (IP_HL(ip) - 5) << 2);
342 int parseipv6(cpp, ip6, ifn, out)
343 char **cpp;
356 *out = (**cpp == 'o') ? 1 : 0;
357 cpp++;
358 if (!*cpp)
361 if (!strcasecmp(*cpp, "on")) {
362 cpp++;
363 if (!*cpp)
365 *ifn = strdup(*cpp++);
366 if (!*cpp)
370 if (!strcasecmp(*cpp, "tcp")) {
373 cpp++;
374 } else if (!strcasecmp(*cpp, "udp")) {
377 cpp++;
378 } else if (!strcasecmp(*cpp, "icmpv6")) {
381 cpp++;
382 } else if (ISDIGIT(**cpp) && !index(*cpp, ':')) {
383 ip6->ip6_nxt = atoi(*cpp);
384 cpp++;
388 if (!*cpp)
409 last = strchr(*cpp, ',');
422 if (inet_pton(AF_INET6, *cpp, &ip6->ip6_src) != 1) {
423 fprintf(stderr, "cannot parse source address '%s'\n", *cpp);
427 cpp++;
428 if (!*cpp)
434 last = strchr(*cpp, ',');
443 if (inet_pton(AF_INET6, *cpp, &ip6->ip6_dst) != 1) {
445 *cpp);
449 cpp++;
451 if (*cpp != NULL) {
455 for (s = *cpp; *s; s++)
459 cpp++;
465 if (*cpp && !strncasecmp(*cpp, "seq=", 4)) {
466 tcp->th_seq = htonl(atoi(*cpp + 4));
467 cpp++;
470 if (*cpp && !strncasecmp(*cpp, "ack=", 4)) {
471 tcp->th_ack = htonl(atoi(*cpp + 4));
472 cpp++;
474 } else if (*cpp && ip6->ip6_nxt == IPPROTO_ICMPV6) {
477 t = strchr(*cpp, ',');
481 ic6->icmp6_type = geticmptype(AF_INET6, *cpp);