Permalink
Browse files

- Support new syntax.

  • Loading branch information...
1 parent fe84a49 commit de4be1ad9254d9fcb02b04ada5b57716918f2253 fujisawa committed Sep 2, 2001
Showing with 84 additions and 95 deletions.
  1. +84 −95 kame/kame/natptconfig/natptconfig.bnf
@@ -1,5 +1,7 @@
+/* $KAME: natptconfig.bnf,v 1.6 2001/09/02 20:49:10 fujisawa Exp $ */
+
/*
- * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 and 2001 WIDE Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,147 +27,134 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id: natptconfig.bnf,v 1.5 2001/05/05 11:50:07 fujisawa Exp $
*/
-/* Top level definitions */
-
- <statement> ::= <comment>
- | <question>
- | <break>
- | <interface>
- | <prefix>
- | <rule>
- | <switch>
- | <set>
- | <show>
- | <test>
- | <error>
-
-
-/* Comment definition */
-
- <comment> ::= SCOMMENT
+/* Top level definitions */
+ <statement> ::= <question>
+ | <break>
+ | <prefix>
+ | <rules>
+ | <switch>
+ | <set>
+ | <show>
+ | <log>
+ | <test>
+ | <error>
-/* ??? */
- <question> ::= "?"
+/* question mark */
+ <question> ::= SQUESTION
-/* Stop at breakpoiont (for debug only) */
- <break> ::= SBREAK
+/* stop at breakpoint (for debug) */
+ <break> ::= SBREAK
-/* Interface definitions */
- <interface> ::= "interface" "?"
- | "interface" <netdevice> <in_ex>
+/* set NAT-PT prefix */
- <in_ex> ::= "internal"
- | "external"
+ <prefix> ::= SPREFIX SQUESTION
+ | SPREFIX <ipv6addr>
-/* Set NATPT prefix to the kernel */
+/* Translation rule */
- <prefix> ::= "prefix" "?"
- | "natpt" IPV6ADDR
- | "natpt" IPV6ADDR "/" DECIMAL
+ <rules> ::= SMAP SQUESTION
+ /* IPv6 -> IPv4 */
+ | SMAP SFROM SANY6 STO <ipv4addr> <opt_ports> <opt_proto>
+ | SMAP SFROM <ipv6addrs> STO <ipv4addrs> <opt_ports> <opt_proto>
-/* Tranlation rule definitions */
+ /* IPv4 -> IPv6 */
+ | SMAP SFROM <ipv4addrs> STO <ipv6addrs> <opt_proto>
+ | SMAP SFROM <ipv4addr> <dport> STO <ipv6addr> <dport> <opt_proto>
- <rule> ::= "map" "?"
- | "map" <dir> "from" <ipaddrport> "to" <ipaddrport>
- | "map" <dir> "from" "any4" "to" <ipaddrport>
- | "map" <dir> "from" "any6" "to" <ipaddrport>
- | "map" "flush" <opt_type>
+ /* IPv4 -> IPv4 (outbound) */
+ | SMAP SFROM <ipv4addrs> STO <ipv4addrs> <opt_ports> <opt_proto> <opt_bidir>
+ /* IPv4 -> IPv4 (inbound) */
+ | SMAP SFROM <ipv4addr> <dport> STO <ipv4addr> <dport> <opt_proto>
- <dir> ::= "inbound"
- | "incoming"
- | "outbound"
- | "outgoing"
+ | SMAP SFLUSH <opt_all>
-/* Translation on/off switch definition */
+/* Translation of/off */
- <swich> ::= "map" "enable"
- | "map" "disable"
+ <switch> ::= SMAP SENABLE
+ | SMAP SDISABLE
-/* Set definition */
+/* Set variable(s) */
- <set> ::= "set" "?"
- | "set" <name> "=" <decimail>
- | "set" <name> "=" <hexdecimal>
+ <set> ::= SSET SQUESTION
+ | SSET name SEQUAL SDECIMAL
+ | SSET name SEQUAL SHEXADECIMAL
-/* Show definitions */
+/* Show rule/variables/... */
- <show> ::= "show" "?"
- | "show" "interface" <opt_netdevice>
- | "show" "prefix"
- | "show" "static"
- | "show" "dynamic"
- | "show" "xlate" <opt_long> <opt_decimal>
- | "show" "variables"
- | "show" "mapping"
+ <show> ::= SSHOW SQUESTION
+ | SSHOW SPREFIX
+ | SSHOW SRULES <opt_all>
+ | SSHOW SXLATE <opt_long> <opt_decimal>
+ | SSHOW SVARIABLES
+ | SSHOW SMAPPING
-/* Test something */
+/* Log */
- <test> ::= "test" "?"
- | "test" "log"
- | "test" "log" <name>
- | "test" "log" <string>
+ <log> ::= SLOG SSTRING
+ | SLOG SSYSLOG
-/* Miscellaneous definitions */
+/* Test log system */
+ <test> ::= STEST SQUESTION
+ | STEST SLOG
+ | STEST SLOG SNAME
+ | STEST SLOG SSTRING
- <opt_netdevice> ::= eps
- | <netdevice>
- <netdevice> ::= STRING
- | NAME
+/* conventional */
- ipaddrport> ::= <ipv4addrs>
- | <ipv4addrs> <port>
- | <ipv6addrs>
- | <ipv6addrs> <port>
+ <opt_ports> ::= <eps>
+ | SPORT SDECIMAL SMINUS SDECIMAL
+ | SPORT SDECIMAL SCOLON SDECIMAL
- <ipv4addrs> ::= <ipv4addr>
- | <ipv4addr> "/" <decimal>
- | <ipv4addr> "-" <ipv4addr>
+ <opt_proto> ::= <eps>
+ | <protos>
- <ipv6addrs> ::= <ipv6addr>
- | <ipv6addr> "/" <decimal>
+ <opt_all> ::= <eps>
+ | SALL
- <ipv4addr> ::= IPV4ADDR
+ <opt_bidir> ::= <eps>
+ | SBIDIR
- <ipv6addr> ::= IPV6ADDR
+ <opt_long> ::= <eps>
+ | SLONG
- <name> ::= SNAME
+<opt_decimal> ::= <eps>
+ | SDECIMAL
- <decimal> ::= SDECIMAL
+ <dport> ::= SDPORT SDECIMAL
- <hexdecimal> ::= SHEXDECIMAL
+ <protos> ::= <proto>
+ | <protos> SSLASH <proto>
- <port> ::= "port" SDECIMAL
- | "port" SDECIMAL ":" SDECIMAL
- | "port" SDECIMAL "-" SDECIMAL
+ <proto> ::= SICMP
+ | STCP
+ | SUDP
+ <ipv4addrs> ::= <ipv4addr>
+ | <ipv4addr> SSLASH <SDECIMAL>
+ | <ipv4addr> SMINUS <ipv4addr>
-/* Optional termila definitions */
+ <ipv4addr> ::= SIPV4ADDR
- <opt_type> ::= eps
- | "static"
- | "dynamic"
+ <ipv6addrs> ::= <ipv6addr>
+ | <ipv6addr> SSLASH SDECIMAL
- <opt_long> ::= eps
- | "long"
+ <ipv6addr> ::= SIPV6ADDR
- <opt_decimal> ::= eps
- | DECIMAL
+ <name> ::= SNAME

0 comments on commit de4be1a

Please sign in to comment.