accept: Don't rely on rejection flag encoding
Instead of enumerating all eight combinations of the three flags in a table, simply print each flag on its own, and drop the table. The old table depends on the flag encoding, the new code doesn't. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
2fcc325dd5
commit
c3f6dfda9d
1 changed files with 6 additions and 12 deletions
|
@ -79,17 +79,11 @@ acce(void)
|
||||||
static void
|
static void
|
||||||
pr_accept(struct natstr *to, natid from)
|
pr_accept(struct natstr *to, natid from)
|
||||||
{
|
{
|
||||||
static char *rejects[] = {
|
static char *yes_no[] = { "YES", "NO " };
|
||||||
/* must follow reject flags defined in nat.h */
|
int rej = getrejects(from, to);
|
||||||
" YES YES YES",
|
|
||||||
" NO YES YES",
|
|
||||||
" YES NO YES",
|
|
||||||
" NO NO YES",
|
|
||||||
" YES YES NO ",
|
|
||||||
" NO YES NO ",
|
|
||||||
" YES NO NO ",
|
|
||||||
" NO NO NO ",
|
|
||||||
};
|
|
||||||
|
|
||||||
pr(" %s", rejects[getrejects(from, to)]);
|
pr(" %s %s %s",
|
||||||
|
yes_no[(rej & REJ_TELE) != 0],
|
||||||
|
yes_no[(rej & REJ_ANNO) != 0],
|
||||||
|
yes_no[(rej & REJ_LOAN) != 0]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue