int i;
int i, dotitle = opts & PF_OPT_SHOWALL;
pfctl_show_nat(int dev, int opts, char *anchorname, char *rulesetname){	struct pfioc_rule pr;	u_int32_t mnr, nr;	static int nattype[3] = { PF_NAT, PF_RDR, PF_BINAT };	int i;	if (*anchorname && !*rulesetname) {		struct pfioc_ruleset pr;		int r;		memset(&pr, 0, sizeof(pr));		memcpy(pr.anchor, anchorname, sizeof(pr.anchor));		if (ioctl(dev, DIOCGETRULESETS, &pr)) {			if (errno == EINVAL)				fprintf(stderr, "No rulesets in anchor '%s'.\n",				    anchorname);			else				err(1, "DIOCGETRULESETS");			return (-1);		}		mnr = pr.nr;		for (nr = 0; nr < mnr; ++nr) {			pr.nr = nr;			if (ioctl(dev, DIOCGETRULESET, &pr))				err(1, "DIOCGETRULESET");			r = pfctl_show_nat(dev, opts, anchorname, pr.name);			if (r)				return (r);		}		return (0);	}	memset(&pr, 0, sizeof(pr));	memcpy(pr.anchor, anchorname, sizeof(pr.anchor));	memcpy(pr.ruleset, rulesetname, sizeof(pr.ruleset));	if (opts & PF_OPT_SHOWALL) {		for (i = 0; i < 3; i++) {			pr.rule.action = nattype[i];			if (ioctl(dev, DIOCGETRULES, &pr)) {				warn("DIOCGETRULES");				return (-1);			}			if (pr.nr > 0) {				pfctl_print_title("TRANSLATION RULES:");				break;			}		}	}	for (i = 0; i < 3; i++) {		pr.rule.action = nattype[i];		if (ioctl(dev, DIOCGETRULES, &pr)) {			warn("DIOCGETRULES");			return (-1);		}		mnr = pr.nr;		for (nr = 0; nr < mnr; ++nr) {			pr.nr = nr;			if (ioctl(dev, DIOCGETRULE, &pr)) {				warn("DIOCGETRULE");				return (-1);			}			if (pfctl_get_pool(dev, &pr.rule.rpool, nr,			    pr.ticket, nattype[i], anchorname,			    rulesetname) != 0)				return (-1);			print_rule(&pr.rule, opts & PF_OPT_VERBOSE2);			pfctl_print_rule_counters(&pr.rule, opts);			pfctl_clear_pool(&pr.rule.rpool);		}	}	return (0);}