From anarcat@anarcat.dyndns.org  Wed Apr  3 22:12:36 2002
Return-Path: <anarcat@anarcat.dyndns.org>
Received: from tomts14-srv.bellnexxia.net (tomts14.bellnexxia.net [209.226.175.35])
	by hub.freebsd.org (Postfix) with ESMTP id 9FE4F37B405
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  3 Apr 2002 22:12:35 -0800 (PST)
Received: from khan.anarcat.dyndns.org ([65.94.191.9])
          by tomts14-srv.bellnexxia.net
          (InterMail vM.4.01.03.23 201-229-121-123-20010418) with ESMTP
          id <20020404061234.EUFR21410.tomts14-srv.bellnexxia.net@khan.anarcat.dyndns.org>
          for <FreeBSD-gnats-submit@freebsd.org>;
          Thu, 4 Apr 2002 01:12:34 -0500
Received: from lenny.anarcat.dyndns.org (lenny.anarcat.dyndns.org [192.168.0.4])
	by khan.anarcat.dyndns.org (Postfix) with SMTP
	id 9F7C718B9; Thu,  4 Apr 2002 01:12:32 -0500 (EST)
Received: by lenny.anarcat.dyndns.org (sSMTP sendmail emulation); Thu, 4 Apr 2002 01:11:31 -0500
Message-Id: <20020404061232.9F7C718B9@khan.anarcat.dyndns.org>
Date: Thu, 4 Apr 2002 01:11:31 -0500
From: The Anarcat <anarcat@anarcat.dyndns.org>
Reply-To: The Anarcat <anarcat@anarcat.dyndns.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: ipnat(5) manpage grammar is incomplete and inconsistent
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         36724
>Category:       docs
>Synopsis:       ipnat(5) manpage grammar is incomplete and inconsistent
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 03 22:20:01 PST 2002
>Closed-Date:    
>Last-Modified:  Wed Jul 03 01:03:05 UTC 2013
>Originator:     The Anarcat
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
Nada, Inc
>Environment:
System: FreeBSD lenny.anarcat.dyndns.org 4.5-STABLE FreeBSD 4.5-STABLE #1: Wed Mar 27 12:55:29 EST 2002 anarcat@lenny.anarcat.dyndns.org:/usr/src/sys/compile/LENNY i386

>Description:

The ipnat(5) manpage features, on -stable, a section wrt the grammar
recognized by the ipnat parser.

This grammar is incomplete and does not represent properly ipnat
behavior.

1- Undefined non-terminals:

a- Major:

these actually prevent one from clearly knowing what the syntax is

- portnum (which I guess is portnumbers)
- numports (idem)
- nummask

b- Minor (we can easily guess what these are):

bits, mask, ip, host-name, ipaddr, hexnumber, numbers

Note that ip and ipaddr seem to be redundant here.

2- inconsistence in the syntax

In the same grammar, curly brackets and brackest are used to represent
repetition, at least I guess.

For example, I guessed that:

ip [ "," ip ]

meant that ip could be repeated, seperated by commas.

But, on the other hand, we havge:

fname ::= 'A' - 'Z' { 'A' - 'Z' } numbers .

which I guessed means that "'A' - 'Z'" can be repeated any number of
times.

I think this section of the manpage needs a complete rewrite.

>How-To-Repeat:

Follow the grammar given in the grammar.

Also see:

docs/33371 guido    ipnat(5) requires mapped-to port in rdr rules
docs/36127 darrenr  ipnat(5) man page glitches

for other glitches.

>Fix:

Unknown. I will inspect the parser if I find the time, but since it's a
flat .c file (natparse.c) and not a .y, it's harder. ;)

Any idea why ipnat doesn't use something like yacc or bison?

I'm not sure what format the grammar is following right now, but it
would gain at following a standard notation such as the BNF.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-doc->darrenr 
Responsible-Changed-By: brueffer 
Responsible-Changed-When: Fri Mar 21 16:42:27 CET 2003 
Responsible-Changed-Why:  
darrenr is out ipfilter/ipnat guy 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36724 
State-Changed-From-To: open->open 
State-Changed-By: linimon 
State-Changed-When: Wed Jul 3 00:50:32 UTC 2013 
State-Changed-Why:  
commit bit has been taken in for safekeeping. 


Responsible-Changed-From-To: darrenr->freebsd-doc 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Jul 3 00:50:32 UTC 2013 
Responsible-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=36724 
>Unformatted:
