Lines Matching refs:actstr

477     def parse(self, actstr):
478 totallen = len(actstr)
479 while len(actstr) != 0:
482 if actstr.startswith("drop"):
486 if actstr.startswith("drop("):
489 actstr, reason = parse_extract_field(
490 actstr,
502 actstr = actstr[len("drop"): ]
503 return (totallen - len(actstr))
505 elif parse_starts_block(actstr, "^(\d+)", False, True):
506 actstr, output = parse_extract_field(
507 actstr, None, "(\d+)", lambda x: int(x), False, "0"
511 elif parse_starts_block(actstr, "recirc(", False):
512 actstr, recircid = parse_extract_field(
513 actstr,
532 if parse_starts_block(actstr, flat_act[0], False):
533 actstr = actstr[len(flat_act[0]):]
535 actstr = actstr[strspn(actstr, ", ") :]
538 if parse_starts_block(actstr, "clone(", False):
541 actstr = actstr[len("clone("):]
542 parsedLen = subacts.parse(actstr)
545 actstr = actstr[parsedLen:]
547 elif parse_starts_block(actstr, "ct(", False):
549 actstr = actstr[len("ct(") :]
560 if actstr.startswith(scan[0]):
561 actstr = actstr[len(scan[0]) :]
563 if actstr[0] != "=":
565 actstr = actstr[1:]
566 pos = strcspn(actstr, ",)")
567 datum = scan[2](actstr[:pos], 0)
569 actstr = actstr[pos:]
572 actstr = actstr[strspn(actstr, ", ") :]
575 if actstr.startswith("nat"):
576 actstr = actstr[3:]
579 if actstr.startswith("("):
582 actstr = actstr[1:]
583 if actstr.startswith("src"):
585 actstr = actstr[3:]
586 elif actstr.startswith("dst"):
588 actstr = actstr[3:]
590 actstr, ip_block_min = parse_extract_field(
591 actstr, "=", "([0-9a-fA-F\.]+)", str, False
593 actstr, ip_block_max = parse_extract_field(
594 actstr, "-", "([0-9a-fA-F\.]+)", str, False
597 actstr, proto_min = parse_extract_field(
598 actstr, ":", "(\d+)", int, False
600 actstr, proto_max = parse_extract_field(
601 actstr, "-", "(\d+)", int, False
629 if actstr.startswith(natscan[0]):
630 actstr = actstr[len(natscan[0]) :]
632 actstr = actstr[strspn(actstr, ", ") :]
635 actstr = actstr[strspn(actstr, ", ") :]
640 actstr = actstr[strspn(actstr, ", ") :]
643 actstr = actstr[strspn(actstr, " "):]
644 if len(actstr) and actstr[0] != ")":
645 raise ValueError("Action str: '%s' unbalanced" % actstr)
646 actstr = actstr[1:]
648 if len(actstr) and actstr[0] == ")":
649 return (totallen - len(actstr))
651 actstr = actstr[strspn(actstr, ", ") :]
654 raise ValueError("Action str: '%s' not supported" % actstr)
656 return (totallen - len(actstr))
1864 def parse(self, flowstr, actstr, dpidx=0):
1915 a.parse(actstr)