Permalink
Browse files

rename to natptconfig.*

  • Loading branch information...
itojun
itojun committed Dec 25, 1999
1 parent 1ccb490 commit fcd083c0e0190157edd468504300868d38155593
Showing with 0 additions and 527 deletions.
  1. +0 −112 kame/kame/natptconfig/ptrconfig.bnf
  2. +0 −129 kame/kame/natptconfig/ptrconfig.l
  3. +0 −286 kame/kame/natptconfig/ptrconfig.y
@@ -1,112 +0,0 @@
-/*
-//##
-//#------------------------------------------------------------------------
-//# Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
-//# All rights reserved.
-//#
-//# Redistribution and use in source and binary forms, with or without
-//# modification, are permitted provided that the following conditions
-//# are met:
-//# 1. Redistributions of source code must retain the above copyright
-//# notice, this list of conditions and the following disclaimer.
-//# 2. Redistributions in binary form must reproduce the above copyright
-//# notice, this list of conditions and the following disclaimer in the
-//# documentation and/or other materials provided with the distribution.
-//# 3. Neither the name of the project nor the names of its contributors
-//# may be used to endorse or promote products derived from this software
-//# without specific prior written permission.
-//#
-//# THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
-//# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-//# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-//# ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
-//# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-//# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-//# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-//# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//# 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: ptrconfig.bnf,v 1.1 1999/08/08 23:31:16 itojun Exp $
-//#
-//#------------------------------------------------------------------------
-*/
-
-/* Top level definitions */
-
- <statement> ::= <comment>
- | <interface>
- | <rule>
- | <show>
- | <switch>
- | <break>
-
-
-/* Comment definition */
-
- <comment> ::= SCOMMENT
-
-
-/* Interface definitions */
-
- <interface> ::= "interface" <netdevice> <in_ex>
-
- <in_ex> ::= "internal"
- | "external"
-
-
-/* Set faith/NATPT prefix to the kernel */
-
- <prefix> ::= "prefix" IPV6ADDR
- | "prefix" IPV6ADDR "/" DECIMAL
-
-
-/* Tranlation rule definitions */
-
- <rule> ::= "map" "from" <ipaddr> <opt_port> "to" <ipaddr> <opt_port>
- | "map" "to" <ipaddr> <opt_port> "from" <ipaddr> <opt_port>
- | "map" "flush" <opt_type>
-
-
-/* Show definitions */
-
- <show> ::= "show" "interface" <opt_netdevice>
- | "show" "static"
- | "show" "dynamic"
- | "show" "xlate" <opt_decimal>
-
-
-/* Translation on/off switch definition */
-
- <swich> ::= "map" "enable"
- | "map" "disable"
-
-
-/* Stop at breakpoint if possible */
- <break> ::= "break"
-
-
-/* Miscellaneous definitions */
-
- <opt_netdevice> ::= eps
- | <netdevice>
-
- <netdevice> ::= STRING
- | NAME
-
- <ipaddr> ::= <ipv4addr>
- | <ipv6addr>
-
- <ipv4addr> ::= IPV4ADDR
-
- <ipv6addr> ::= IPV6ADDR
-
- <opt_port> ::= eps
-
- <opt_type> ::= eps
- | "static"
- | "dynamic"
-
- <opt_decimal> ::= eps
- | DECIMAL
@@ -1,129 +0,0 @@
-/*
-//##
-//#------------------------------------------------------------------------
-//# Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
-//# All rights reserved.
-//#
-//# Redistribution and use in source and binary forms, with or without
-//# modification, are permitted provided that the following conditions
-//# are met:
-//# 1. Redistributions of source code must retain the above copyright
-//# notice, this list of conditions and the following disclaimer.
-//# 2. Redistributions in binary form must reproduce the above copyright
-//# notice, this list of conditions and the following disclaimer in the
-//# documentation and/or other materials provided with the distribution.
-//# 3. Neither the name of the project nor the names of its contributors
-//# may be used to endorse or promote products derived from this software
-//# without specific prior written permission.
-//#
-//# THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
-//# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-//# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-//# ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
-//# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-//# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-//# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-//# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//# 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: ptrconfig.l,v 1.1 1999/08/08 23:31:16 itojun Exp $
-//#
-//#------------------------------------------------------------------------
-*/
-
-%{
-#include "ptrconfig.y.h"
-
-#define YY_DECL int _yylex(void)
-#define YY_NO_UNPUT
-
-int getDecimal __P((char *));
-int getDQuoteString __P((char *));
-int SNAMEorKeyword __P((char *));
-
-%}
-
-letter [a-zA-Z_]
-digit [0-9]
-hexdigit [0-9A-Fa-f]
-letter_or_digit [a-zA-Z_0-9]
-dot "."
-colon ":"
-ipv4addr {digit}{1,3}({dot}{digit}{1,3}){0,3}
-ipv6addr {hexdigit}{0,4}({colon}{hexdigit}{0,4}){2,7}
-
-%%
-
-#[^\n]*\n { return SCOMMENT; }
-[ \t\n]+ /* eat up whitespace */
-{letter}{letter_or_digit}* return (SNAMEorKeyword(yytext));
-{digit}+ return (getDecimal(yytext));
-{ipv4addr} return (IPV4ADDR);
-{ipv6addr} return (IPV6ADDR);
-
-"-" return (SMINUS);
-"." return (SPERIOD);
-"/" return (SSLASH);
-"~" return (STILDA);
-
-\" return (getDQuoteString(yytext));
-. return (SOTHER);
-
-
-%%
-
-void
-switchToBuffer(char *Wow)
-{
- YY_BUFFER_STATE yyb;
-
- yyb = yy_scan_string(Wow);
- yy_switch_to_buffer(yyb);
-}
-
-
-void
-reassembleCommandLine(int argc, char *argv[], char *Wow)
-{
- YY_BUFFER_STATE yyb;
- char *s, *d;
-
- for (d = Wow; argc; argc--, argv++)
- {
- s = *(argv);
- while (*s) *d++ = *s++;
- *d++ = ' ';
- }
-
- yyb = yy_scan_string(Wow);
- yy_switch_to_buffer(yyb);
-}
-
-
-int
-getDecimal(char *yytext)
-{
- yylval.Int = strtol(yytext, NULL, 0);
- return (SDECIMAL);
-}
-
-
-int
-getDQuoteString(char *yytext)
-{
- register int ch;
- register char *p = yytext;
-
- for (;;)
- {
- switch (ch = input())
- {
- case 0: return (SDQUOTE);
- case '\"': *p = 0; return (SSTRING);
- default: *p++ = ch;
- }
- }
- return (SSTRING);
-}
Oops, something went wrong.

0 comments on commit fcd083c

Please sign in to comment.