1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-25 04:37:22 +01:00

see #2403 added ability to import clause en0:network; stubbed import of en0:broadcast

This commit is contained in:
Vadim Kurland 2011-05-26 21:29:12 -07:00
parent 68bc1ec263
commit e89cc24466
11 changed files with 834 additions and 632 deletions

View File

@ -36,6 +36,7 @@
#include "fwbuilder/Address.h"
#include "fwbuilder/AddressRange.h"
#include "fwbuilder/AddressTable.h"
#include "fwbuilder/AttachedNetworks.h"
#include "fwbuilder/FWObjectDatabase.h"
#include "fwbuilder/ICMPService.h"
#include "fwbuilder/IPService.h"
@ -381,6 +382,35 @@ FWObject* PFImporter::makeAddressObj(AddressSpec &as)
return intf;
}
if (as.at == AddressSpec::INTERFACE_NETWORK)
{
Interface *intf = getInterfaceByName(as.address);
if (intf == NULL)
{
// this interface was never used in "on <intf>" clause before
newInterface(as.address);
intf = getInterfaceByName(as.address);
}
string name = intf->getName() + "-net";
ObjectMaker maker(Library::cast(library), error_tracker);
AttachedNetworks *an =
AttachedNetworks::cast(
maker.createObject(intf, AttachedNetworks::TYPENAME, name));
an->setRunTime(true);
an->setSourceName(intf->getName());
address_table_registry[name.c_str()] = an;
return an;
}
if (as.at == AddressSpec::INTERFACE_BROADCAST)
{
addMessageToLog(
QObject::tr("Error: import of '%1:broadcast' is not supported")
.arg(as.address.c_str()));
return NULL;
}
if (as.at == AddressSpec::HOST_ADDRESS)
{
return Importer::makeAddressObj(as.address, "");

View File

@ -75,6 +75,8 @@ public:
NETWORK_ADDRESS,
SPECIAL_ADDRESS,
INTERFACE_NAME,
INTERFACE_NETWORK,
INTERFACE_BROADCAST,
TABLE } address_type;
address_type at;

View File

@ -25,6 +25,7 @@
#include "fwbuilder/AddressRange.h"
#include "fwbuilder/AddressTable.h"
#include "fwbuilder/AttachedNetworks.h"
#include "fwbuilder/CustomService.h"
#include "fwbuilder/DNSName.h"
#include "fwbuilder/FWObject.h"
@ -121,6 +122,7 @@ ObjectSignature::ObjectSignature(const ObjectSignature &other)
address_range_end = other.address_range_end;
dns_name = other.dns_name;
address_table_name = other.address_table_name;
parent_interface_name = other.parent_interface_name;
protocol = other.protocol;
fragments = other.fragments;
short_fragments = other.short_fragments;
@ -616,6 +618,9 @@ QString ObjectSignature::toString() const
if (type_name == AddressRange::TYPENAME)
sig << address_range_start << address_range_end;
if (type_name == AttachedNetworks::TYPENAME)
sig << parent_interface_name;
if (type_name == DNSName::TYPENAME)
sig << dns_name;
@ -830,6 +835,14 @@ void* ObjectSignature::dispatch(DNSName *obj, void*)
return this;
}
void* ObjectSignature::dispatch(AttachedNetworks *obj, void*)
{
object_name = QString::fromUtf8(obj->getName().c_str());
type_name = obj->getTypeName().c_str();
parent_interface_name = obj->getSourceName().c_str();
return this;
}
void* ObjectSignature::dispatch(ServiceGroup *obj, void*)
{
object_name = QString::fromUtf8(obj->getName().c_str());

View File

@ -37,6 +37,7 @@
namespace libfwbuilder
{
class AddressRange;
class AttachedNetworks;
class Cluster;
class CustomService;
class Firewall;
@ -109,7 +110,8 @@ public:
QString address_range_end;
QString dns_name;
QString address_table_name;
QString parent_interface_name;
// for IP service
int protocol;
bool fragments;
@ -204,7 +206,8 @@ public:
virtual void* dispatch(libfwbuilder::DNSName*, void*);
virtual void* dispatch(libfwbuilder::ObjectGroup*, void*);
virtual void* dispatch(libfwbuilder::ServiceGroup*, void*);
virtual void* dispatch(libfwbuilder::AttachedNetworks*, void*);
};
class ObjectMaker

View File

@ -1,4 +1,4 @@
/* $ANTLR 2.7.7 (20100319): "pf.g" -> "PFCfgLexer.cpp"$ */
/* $ANTLR 2.7.7 (20090306): "pf.g" -> "PFCfgLexer.cpp"$ */
#line 42 "pf.g"
// gets inserted before the antlr generated includes in the cpp
@ -44,93 +44,96 @@ PFCfgLexer::PFCfgLexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& st
void PFCfgLexer::initLiterals()
{
literals["vrrp"] = 61;
literals["critical"] = 100;
literals["ospf"] = 59;
literals["rdp"] = 53;
literals["disable"] = 107;
literals["vrrp"] = 64;
literals["critical"] = 103;
literals["ospf"] = 62;
literals["rdp"] = 56;
literals["disable"] = 110;
literals["scrub"] = 12;
literals["ipsec"] = 90;
literals["inet"] = 45;
literals["pcp"] = 92;
literals["emergencies"] = 102;
literals["debugging"] = 101;
literals["ipsec"] = 92;
literals["inet"] = 48;
literals["pcp"] = 94;
literals["emergencies"] = 105;
literals["debugging"] = 104;
literals["persist"] = 16;
literals["snp"] = 96;
literals["timeout"] = 32;
literals["to"] = 42;
literals["flags"] = 71;
literals["isis"] = 63;
literals["icmp6-type"] = 74;
literals["snp"] = 98;
literals["timeout"] = 35;
literals["to"] = 45;
literals["flags"] = 74;
literals["isis"] = 66;
literals["icmp6-type"] = 77;
literals["const"] = 17;
literals["pptp"] = 94;
literals["pass"] = 33;
literals["no"] = 77;
literals["from"] = 64;
literals["igrp"] = 89;
literals["pim"] = 93;
literals["tagged"] = 75;
literals["rsvp"] = 54;
literals["route-to"] = 69;
literals["nos"] = 91;
literals["quit"] = 86;
literals["->"] = 109;
literals["icmp-type"] = 72;
literals["exit"] = 85;
literals["modulate"] = 79;
literals["nat"] = 29;
literals["range"] = 98;
literals["urpf-failed"] = 65;
literals["out"] = 36;
literals["pptp"] = 96;
literals["pass"] = 36;
literals["no"] = 80;
literals["from"] = 67;
literals["igrp"] = 91;
literals["pim"] = 95;
literals["tagged"] = 78;
literals["rsvp"] = 57;
literals["route-to"] = 72;
literals["nos"] = 93;
literals["quit"] = 88;
literals["->"] = 112;
literals["peer"] = 100;
literals["icmp-type"] = 75;
literals["exit"] = 87;
literals["modulate"] = 82;
literals["nat"] = 32;
literals["range"] = 101;
literals["urpf-failed"] = 68;
literals["out"] = 39;
literals["queue"] = 10;
literals["gre"] = 55;
literals["gre"] = 58;
literals["set"] = 11;
literals["warnings"] = 106;
literals["ah"] = 57;
literals["host"] = 97;
literals["interface"] = 87;
literals["rip"] = 95;
literals["icmp6"] = 88;
literals["notifications"] = 105;
literals["warnings"] = 109;
literals["ah"] = 60;
literals["host"] = 99;
literals["interface"] = 89;
literals["rip"] = 97;
literals["icmp6"] = 90;
literals["broadcast"] = 27;
literals["notifications"] = 108;
literals["file"] = 19;
literals["synproxy"] = 80;
literals["network"] = 26;
literals["synproxy"] = 83;
literals["altq"] = 9;
literals["any"] = 66;
literals["esp"] = 56;
literals["alerts"] = 99;
literals["all"] = 40;
literals["inet6"] = 46;
literals["inactive"] = 108;
literals["label"] = 82;
literals["no-route"] = 67;
literals["udp"] = 52;
literals["reply-to"] = 70;
literals["tag"] = 76;
literals["port"] = 83;
literals["code"] = 73;
literals["ip"] = 48;
literals["any"] = 69;
literals["esp"] = 59;
literals["alerts"] = 102;
literals["all"] = 43;
literals["inet6"] = 49;
literals["inactive"] = 111;
literals["label"] = 85;
literals["no-route"] = 70;
literals["udp"] = 55;
literals["reply-to"] = 73;
literals["tag"] = 79;
literals["port"] = 86;
literals["code"] = 76;
literals["ip"] = 51;
literals["table"] = 13;
literals["eigrp"] = 58;
literals["errors"] = 103;
literals["ipip"] = 60;
literals["eigrp"] = 61;
literals["errors"] = 106;
literals["ipip"] = 63;
literals["antispoof"] = 8;
literals["binat"] = 30;
literals["igmp"] = 50;
literals["on"] = 44;
literals["state"] = 81;
literals["proto"] = 47;
literals["log"] = 37;
literals["rdr"] = 31;
literals["informational"] = 104;
literals["self"] = 25;
literals["in"] = 35;
literals["keep"] = 78;
literals["block"] = 34;
literals["l2tp"] = 62;
literals["quick"] = 43;
literals["user"] = 41;
literals["icmp"] = 49;
literals["tcp"] = 51;
literals["binat"] = 33;
literals["igmp"] = 53;
literals["on"] = 47;
literals["state"] = 84;
literals["log"] = 40;
literals["proto"] = 50;
literals["rdr"] = 34;
literals["informational"] = 107;
literals["self"] = 28;
literals["in"] = 38;
literals["keep"] = 81;
literals["block"] = 37;
literals["l2tp"] = 65;
literals["quick"] = 46;
literals["user"] = 44;
literals["icmp"] = 52;
literals["tcp"] = 54;
}
ANTLR_USE_NAMESPACE(antlr)RefToken PFCfgLexer::nextToken()
@ -438,11 +441,11 @@ void PFCfgLexer::mLINE_COMMENT(bool _createToken) {
}
}
else {
goto _loop152;
goto _loop156;
}
}
_loop152:;
_loop156:;
} // ( ... )*
mNEWLINE(false);
if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
@ -474,9 +477,9 @@ void PFCfgLexer::mNEWLINE(bool _createToken) {
}
if ( inputState->guessing==0 ) {
#line 1030 "pf.g"
#line 1061 "pf.g"
newline();
#line 480 "PFCfgLexer.cpp"
#line 483 "PFCfgLexer.cpp"
}
if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
_token = makeToken(_ttype);
@ -555,9 +558,9 @@ void PFCfgLexer::mWhitespace(bool _createToken) {
}
}
if ( inputState->guessing==0 ) {
#line 1025 "pf.g"
#line 1056 "pf.g"
_ttype = ANTLR_USE_NAMESPACE(antlr)Token::SKIP;
#line 561 "PFCfgLexer.cpp"
#line 564 "PFCfgLexer.cpp"
}
if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
_token = makeToken(_ttype);
@ -742,10 +745,10 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
_ttype = NUMBER_ADDRESS_OR_WORD;
ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
bool synPredMatched177 = false;
bool synPredMatched181 = false;
if ((((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ )) && (_tokenSet_2.member(LA(2))) && (_tokenSet_2.member(LA(3))))) {
int _m177 = mark();
synPredMatched177 = true;
int _m181 = mark();
synPredMatched181 = true;
inputState->guessing++;
try {
{
@ -756,12 +759,12 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
}
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
synPredMatched177 = false;
synPredMatched181 = false;
}
rewind(_m177);
rewind(_m181);
inputState->guessing--;
}
if ( synPredMatched177 ) {
if ( synPredMatched181 ) {
{
mNUM_3DIGIT(false);
match('.' /* charlit */ );
@ -772,99 +775,99 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
mNUM_3DIGIT(false);
}
if ( inputState->guessing==0 ) {
#line 1067 "pf.g"
#line 1098 "pf.g"
_ttype = IPV4;
#line 778 "PFCfgLexer.cpp"
#line 781 "PFCfgLexer.cpp"
}
}
else {
bool synPredMatched184 = false;
bool synPredMatched188 = false;
if ((((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ )) && (_tokenSet_2.member(LA(2))) && (_tokenSet_2.member(LA(3))))) {
int _m184 = mark();
synPredMatched184 = true;
int _m188 = mark();
synPredMatched188 = true;
inputState->guessing++;
try {
{
{ // ( ... )+
int _cnt181=0;
int _cnt185=0;
for (;;) {
if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
mDIGIT(false);
}
else {
if ( _cnt181>=1 ) { goto _loop181; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt185>=1 ) { goto _loop185; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt181++;
_cnt185++;
}
_loop181:;
_loop185:;
} // ( ... )+
match('.' /* charlit */ );
{ // ( ... )+
int _cnt183=0;
int _cnt187=0;
for (;;) {
if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
mDIGIT(false);
}
else {
if ( _cnt183>=1 ) { goto _loop183; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt187>=1 ) { goto _loop187; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt183++;
_cnt187++;
}
_loop183:;
_loop187:;
} // ( ... )+
}
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
synPredMatched184 = false;
synPredMatched188 = false;
}
rewind(_m184);
rewind(_m188);
inputState->guessing--;
}
if ( synPredMatched184 ) {
if ( synPredMatched188 ) {
{
{ // ( ... )+
int _cnt187=0;
int _cnt191=0;
for (;;) {
if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
mDIGIT(false);
}
else {
if ( _cnt187>=1 ) { goto _loop187; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt191>=1 ) { goto _loop191; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt187++;
_cnt191++;
}
_loop187:;
_loop191:;
} // ( ... )+
match('.' /* charlit */ );
{ // ( ... )+
int _cnt189=0;
int _cnt193=0;
for (;;) {
if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
mDIGIT(false);
}
else {
if ( _cnt189>=1 ) { goto _loop189; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt193>=1 ) { goto _loop193; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt189++;
_cnt193++;
}
_loop189:;
_loop193:;
} // ( ... )+
}
if ( inputState->guessing==0 ) {
#line 1070 "pf.g"
#line 1101 "pf.g"
_ttype = NUMBER;
#line 861 "PFCfgLexer.cpp"
#line 864 "PFCfgLexer.cpp"
}
}
else {
bool synPredMatched208 = false;
bool synPredMatched212 = false;
if (((LA(1) == 0x3a /* ':' */ ) && (LA(2) == 0x3a /* ':' */ ) && ((LA(3) >= 0x30 /* '0' */ && LA(3) <= 0x39 /* '9' */ )))) {
int _m208 = mark();
synPredMatched208 = true;
int _m212 = mark();
synPredMatched212 = true;
inputState->guessing++;
try {
{
@ -874,12 +877,12 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
}
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
synPredMatched208 = false;
synPredMatched212 = false;
}
rewind(_m208);
rewind(_m212);
inputState->guessing--;
}
if ( synPredMatched208 ) {
if ( synPredMatched212 ) {
match(':' /* charlit */ );
match(':' /* charlit */ );
mNUM_HEX_4DIGIT(false);
@ -890,23 +893,23 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
mNUM_HEX_4DIGIT(false);
}
else {
goto _loop210;
goto _loop214;
}
}
_loop210:;
_loop214:;
} // ( ... )*
if ( inputState->guessing==0 ) {
#line 1093 "pf.g"
#line 1124 "pf.g"
_ttype = IPV6;
#line 903 "PFCfgLexer.cpp"
#line 906 "PFCfgLexer.cpp"
}
}
else {
bool synPredMatched193 = false;
bool synPredMatched197 = false;
if ((((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ )) && ((LA(2) >= 0x61 /* 'a' */ && LA(2) <= 0x66 /* 'f' */ )))) {
int _m193 = mark();
synPredMatched193 = true;
int _m197 = mark();
synPredMatched197 = true;
inputState->guessing++;
try {
{
@ -915,60 +918,60 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
}
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
synPredMatched193 = false;
synPredMatched197 = false;
}
rewind(_m193);
rewind(_m197);
inputState->guessing--;
}
if ( synPredMatched193 ) {
if ( synPredMatched197 ) {
{
bool synPredMatched198 = false;
bool synPredMatched202 = false;
if ((((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ )) && ((LA(2) >= 0x61 /* 'a' */ && LA(2) <= 0x66 /* 'f' */ )) && ((LA(3) >= 0x30 /* '0' */ && LA(3) <= 0x3a /* ':' */ )))) {
int _m198 = mark();
synPredMatched198 = true;
int _m202 = mark();
synPredMatched202 = true;
inputState->guessing++;
try {
{
{ // ( ... )+
int _cnt197=0;
int _cnt201=0;
for (;;) {
if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
mNUM_HEX_4DIGIT(false);
match(':' /* charlit */ );
}
else {
if ( _cnt197>=1 ) { goto _loop197; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt201>=1 ) { goto _loop201; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt197++;
_cnt201++;
}
_loop197:;
_loop201:;
} // ( ... )+
match(':' /* charlit */ );
}
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
synPredMatched198 = false;
synPredMatched202 = false;
}
rewind(_m198);
rewind(_m202);
inputState->guessing--;
}
if ( synPredMatched198 ) {
if ( synPredMatched202 ) {
{
{ // ( ... )+
int _cnt201=0;
int _cnt205=0;
for (;;) {
if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
mNUM_HEX_4DIGIT(false);
match(':' /* charlit */ );
}
else {
if ( _cnt201>=1 ) { goto _loop201; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt205>=1 ) { goto _loop205; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt201++;
_cnt205++;
}
_loop201:;
_loop205:;
} // ( ... )+
match(':' /* charlit */ );
{
@ -981,11 +984,11 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
mNUM_HEX_4DIGIT(false);
}
else {
goto _loop204;
goto _loop208;
}
}
_loop204:;
_loop208:;
} // ( ... )*
}
else {
@ -994,32 +997,32 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
}
}
if ( inputState->guessing==0 ) {
#line 1084 "pf.g"
#line 1115 "pf.g"
_ttype = IPV6;
#line 1000 "PFCfgLexer.cpp"
#line 1003 "PFCfgLexer.cpp"
}
}
else if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ )) && ((LA(2) >= 0x61 /* 'a' */ && LA(2) <= 0x66 /* 'f' */ )) && ((LA(3) >= 0x30 /* '0' */ && LA(3) <= 0x3a /* ':' */ ))) {
mNUM_HEX_4DIGIT(false);
{ // ( ... )+
int _cnt206=0;
int _cnt210=0;
for (;;) {
if ((LA(1) == 0x3a /* ':' */ )) {
match(':' /* charlit */ );
mNUM_HEX_4DIGIT(false);
}
else {
if ( _cnt206>=1 ) { goto _loop206; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt210>=1 ) { goto _loop210; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt206++;
_cnt210++;
}
_loop206:;
_loop210:;
} // ( ... )+
if ( inputState->guessing==0 ) {
#line 1087 "pf.g"
#line 1118 "pf.g"
_ttype = IPV6;
#line 1023 "PFCfgLexer.cpp"
#line 1026 "PFCfgLexer.cpp"
}
}
else {
@ -1028,47 +1031,47 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
}
if ( inputState->guessing==0 ) {
#line 1089 "pf.g"
#line 1120 "pf.g"
_ttype = IPV6;
#line 1034 "PFCfgLexer.cpp"
#line 1037 "PFCfgLexer.cpp"
}
}
else if ((LA(1) == 0x3a /* ':' */ ) && (LA(2) == 0x3a /* ':' */ ) && (true)) {
match(':' /* charlit */ );
match(':' /* charlit */ );
if ( inputState->guessing==0 ) {
#line 1096 "pf.g"
#line 1127 "pf.g"
_ttype = IPV6;
#line 1043 "PFCfgLexer.cpp"
#line 1046 "PFCfgLexer.cpp"
}
}
else if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ )) && (true) && (true)) {
{ // ( ... )+
int _cnt191=0;
int _cnt195=0;
for (;;) {
if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
mDIGIT(false);
}
else {
if ( _cnt191>=1 ) { goto _loop191; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt195>=1 ) { goto _loop195; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt191++;
_cnt195++;
}
_loop191:;
_loop195:;
} // ( ... )+
if ( inputState->guessing==0 ) {
#line 1075 "pf.g"
#line 1106 "pf.g"
_ttype = INT_CONST;
#line 1064 "PFCfgLexer.cpp"
#line 1067 "PFCfgLexer.cpp"
}
}
else if ((LA(1) == 0x3a /* ':' */ ) && (true)) {
match(':' /* charlit */ );
if ( inputState->guessing==0 ) {
#line 1099 "pf.g"
#line 1130 "pf.g"
_ttype = COLON;
#line 1072 "PFCfgLexer.cpp"
#line 1075 "PFCfgLexer.cpp"
}
}
else if ((_tokenSet_3.member(LA(1)))) {
@ -1279,16 +1282,16 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
}
default:
{
goto _loop213;
goto _loop217;
}
}
}
_loop213:;
_loop217:;
} // ( ... )*
if ( inputState->guessing==0 ) {
#line 1111 "pf.g"
#line 1142 "pf.g"
_ttype = WORD;
#line 1292 "PFCfgLexer.cpp"
#line 1295 "PFCfgLexer.cpp"
}
}
else {
@ -1316,11 +1319,11 @@ void PFCfgLexer::mSTRING(bool _createToken) {
matchNot('\"' /* charlit */ );
}
else {
goto _loop216;
goto _loop220;
}
}
_loop216:;
_loop220:;
} // ( ... )*
match('\"' /* charlit */ );
if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
@ -1727,7 +1730,7 @@ void PFCfgLexer::mDOUBLE_QUOTE(bool _createToken) {
const unsigned long PFCfgLexer::_tokenSet_0_data_[] = { 4294958072UL, 1UL, 0UL, 2147483648UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xe 0xf 0x10 0x11 0x12 0x13 0x14
// 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x7f 0x80 0x81
// 0x82 0x83 0x84 0x85 0x86 0x87 0x88
// 0x82 0x83 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgLexer::_tokenSet_0(_tokenSet_0_data_,16);
const unsigned long PFCfgLexer::_tokenSet_1_data_[] = { 4294958072UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xe 0xf 0x10 0x11 0x12 0x13 0x14
@ -1735,7 +1738,7 @@ const unsigned long PFCfgLexer::_tokenSet_1_data_[] = { 4294958072UL, 4294967295
// & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G
// H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c d e f g h
// i j k l m n o p q r s t u v w x y z { | } ~ 0x7f 0x80 0x81 0x82 0x83
// 0x84 0x85 0x86 0x87 0x88
// 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgLexer::_tokenSet_1(_tokenSet_1_data_,16);
const unsigned long PFCfgLexer::_tokenSet_2_data_[] = { 0UL, 67059712UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// . 0 1 2 3 4 5 6 7 8 9
@ -1750,6 +1753,6 @@ const unsigned long PFCfgLexer::_tokenSet_4_data_[] = { 4294967288UL, 4294967291
// % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F
// G H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c d e f g
// h i j k l m n o p q r s t u v w x y z { | } ~ 0x7f 0x80 0x81 0x82 0x83
// 0x84 0x85 0x86 0x87 0x88
// 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgLexer::_tokenSet_4(_tokenSet_4_data_,16);

View File

@ -9,7 +9,7 @@
#line 11 "PFCfgLexer.hpp"
#include <antlr/config.hpp>
/* $ANTLR 2.7.7 (20100319): "pf.g" -> "PFCfgLexer.hpp"$ */
/* $ANTLR 2.7.7 (20090306): "pf.g" -> "PFCfgLexer.hpp"$ */
#include <antlr/CommonToken.hpp>
#include <antlr/InputBuffer.hpp>
#include <antlr/BitSet.hpp>

View File

@ -1,4 +1,4 @@
/* $ANTLR 2.7.7 (20100319): "pf.g" -> "PFCfgParser.cpp"$ */
/* $ANTLR 2.7.7 (20090306): "pf.g" -> "PFCfgParser.cpp"$ */
#line 42 "pf.g"
// gets inserted before the antlr generated includes in the cpp
@ -431,7 +431,7 @@ void PFCfgParser::nat_command() {
try { // for error handling
match(NAT);
#line 287 "pf.g"
#line 301 "pf.g"
importer->clear();
importer->setCurrentLineNumber(LT(0)->getLine());
@ -452,7 +452,7 @@ void PFCfgParser::rdr_command() {
try { // for error handling
match(RDR);
#line 309 "pf.g"
#line 323 "pf.g"
importer->clear();
importer->setCurrentLineNumber(LT(0)->getLine());
@ -473,7 +473,7 @@ void PFCfgParser::binat_command() {
try { // for error handling
match(BINAT);
#line 298 "pf.g"
#line 312 "pf.g"
importer->clear();
importer->setCurrentLineNumber(LT(0)->getLine());
@ -494,7 +494,7 @@ void PFCfgParser::pass_command() {
try { // for error handling
match(PASS);
#line 343 "pf.g"
#line 357 "pf.g"
importer->clear();
importer->setCurrentLineNumber(LT(0)->getLine());
@ -505,7 +505,7 @@ void PFCfgParser::pass_command() {
#line 506 "PFCfgParser.cpp"
rule_extended();
match(NEWLINE);
#line 351 "pf.g"
#line 365 "pf.g"
importer->pushRule();
@ -522,7 +522,7 @@ void PFCfgParser::block_command() {
try { // for error handling
match(BLOCK);
#line 357 "pf.g"
#line 371 "pf.g"
importer->clear();
importer->setCurrentLineNumber(LT(0)->getLine());
@ -533,7 +533,7 @@ void PFCfgParser::block_command() {
#line 534 "PFCfgParser.cpp"
rule_extended();
match(NEWLINE);
#line 365 "pf.g"
#line 379 "pf.g"
importer->pushRule();
@ -550,7 +550,7 @@ void PFCfgParser::timeout_command() {
try { // for error handling
match(TIMEOUT);
#line 320 "pf.g"
#line 334 "pf.g"
importer->clear();
importer->setCurrentLineNumber(LT(0)->getLine());
@ -571,7 +571,7 @@ void PFCfgParser::unknown_command() {
try { // for error handling
match(WORD);
#line 332 "pf.g"
#line 346 "pf.g"
importer->clear();
importer->setCurrentLineNumber(LT(0)->getLine());
@ -625,38 +625,88 @@ void PFCfgParser::tableaddr_spec() {
as.address = LT(0)->getText();
#line 628 "PFCfgParser.cpp"
{
switch ( LA(1)) {
case COLON:
{
match(COLON);
{
switch ( LA(1)) {
case NETWORK:
{
match(NETWORK);
#line 261 "pf.g"
as.at = AddressSpec::INTERFACE_NETWORK;
#line 643 "PFCfgParser.cpp"
break;
}
case BROADCAST:
{
match(BROADCAST);
#line 266 "pf.g"
as.at = AddressSpec::INTERFACE_BROADCAST;
#line 653 "PFCfgParser.cpp"
break;
}
default:
{
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
}
}
}
break;
}
case WORD:
case COMMA:
case CLOSING_BRACE:
case EXLAMATION:
case SELF:
case IPV4:
{
break;
}
default:
{
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
}
}
}
break;
}
case SELF:
{
match(SELF);
#line 259 "pf.g"
#line 273 "pf.g"
as.at = AddressSpec::SPECIAL_ADDRESS;
as.address = "self";
#line 639 "PFCfgParser.cpp"
#line 689 "PFCfgParser.cpp"
break;
}
case IPV4:
{
match(IPV4);
#line 265 "pf.g"
#line 279 "pf.g"
as.at = AddressSpec::HOST_ADDRESS;
as.address = LT(0)->getText();
#line 650 "PFCfgParser.cpp"
#line 700 "PFCfgParser.cpp"
{
switch ( LA(1)) {
case SLASH:
{
match(SLASH);
#line 271 "pf.g"
#line 285 "pf.g"
as.at = AddressSpec::NETWORK_ADDRESS;
#line 660 "PFCfgParser.cpp"
#line 710 "PFCfgParser.cpp"
{
switch ( LA(1)) {
case IPV4:
@ -675,11 +725,11 @@ void PFCfgParser::tableaddr_spec() {
}
}
}
#line 275 "pf.g"
#line 289 "pf.g"
as.netmask = LT(0)->getText();
#line 683 "PFCfgParser.cpp"
#line 733 "PFCfgParser.cpp"
break;
}
case WORD:
@ -705,11 +755,11 @@ void PFCfgParser::tableaddr_spec() {
}
}
}
#line 280 "pf.g"
#line 294 "pf.g"
importer->tmp_group.push_back(as);
#line 713 "PFCfgParser.cpp"
#line 763 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -1046,11 +1096,11 @@ void PFCfgParser::direction() {
}
}
}
#line 383 "pf.g"
#line 397 "pf.g"
importer->direction = LT(0)->getText();
#line 1054 "PFCfgParser.cpp"
#line 1104 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -1102,11 +1152,11 @@ void PFCfgParser::logging() {
}
}
}
#line 390 "pf.g"
#line 404 "pf.g"
importer->logging = true;
#line 1110 "PFCfgParser.cpp"
#line 1160 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -1119,11 +1169,11 @@ void PFCfgParser::quick() {
try { // for error handling
match(QUICK);
#line 412 "pf.g"
#line 426 "pf.g"
importer->quick = true;
#line 1127 "PFCfgParser.cpp"
#line 1177 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -1202,11 +1252,11 @@ void PFCfgParser::address_family() {
case INET6:
{
match(INET6);
#line 442 "pf.g"
#line 456 "pf.g"
importer->address_family = LT(0)->getText();
#line 1210 "PFCfgParser.cpp"
#line 1260 "PFCfgParser.cpp"
break;
}
default:
@ -1242,14 +1292,14 @@ void PFCfgParser::hosts() {
case ALL:
{
match(ALL);
#line 485 "pf.g"
#line 499 "pf.g"
importer->src_group.push_back(
AddressSpec(AddressSpec::ANY, false, "0.0.0.0", "0.0.0.0"));
importer->dst_group.push_back(
AddressSpec(AddressSpec::ANY, false, "0.0.0.0", "0.0.0.0"));
#line 1253 "PFCfgParser.cpp"
#line 1303 "PFCfgParser.cpp"
break;
}
case NEWLINE:
@ -1380,11 +1430,11 @@ void PFCfgParser::filteropts() {
filteropt();
}
else {
goto _loop106;
goto _loop110;
}
}
_loop106:;
_loop110:;
} // ( ... )*
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@ -1403,17 +1453,17 @@ void PFCfgParser::logopts() {
for (;;) {
if ((LA(1) == COMMA)) {
match(COMMA);
#line 399 "pf.g"
#line 413 "pf.g"
importer->logopts += ",";
#line 1409 "PFCfgParser.cpp"
#line 1459 "PFCfgParser.cpp"
logopt();
}
else {
goto _loop47;
goto _loop49;
}
}
_loop47:;
_loop49:;
} // ( ... )*
match(CLOSING_PAREN);
}
@ -1442,11 +1492,11 @@ void PFCfgParser::logopt() {
{
match(TO);
match(WORD);
#line 406 "pf.g"
#line 420 "pf.g"
importer->logopts += LT(0)->getText();
#line 1450 "PFCfgParser.cpp"
#line 1500 "PFCfgParser.cpp"
break;
}
default:
@ -1463,9 +1513,9 @@ void PFCfgParser::logopt() {
void PFCfgParser::ifspec() {
Tracer traceInOut(this, "ifspec");
#line 420 "pf.g"
#line 434 "pf.g"
InterfaceSpec is;
#line 1469 "PFCfgParser.cpp"
#line 1519 "PFCfgParser.cpp"
try { // for error handling
{
@ -1473,9 +1523,9 @@ void PFCfgParser::ifspec() {
case EXLAMATION:
{
match(EXLAMATION);
#line 421 "pf.g"
#line 435 "pf.g"
is.neg = true;
#line 1479 "PFCfgParser.cpp"
#line 1529 "PFCfgParser.cpp"
break;
}
case WORD:
@ -1489,13 +1539,13 @@ void PFCfgParser::ifspec() {
}
}
match(WORD);
#line 423 "pf.g"
#line 437 "pf.g"
is.name = LT(0)->getText();
importer->iface_group.push_back(is);
importer->newInterface(is.name);
#line 1499 "PFCfgParser.cpp"
#line 1549 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -1533,11 +1583,11 @@ void PFCfgParser::interface_list() {
ifspec();
}
else {
goto _loop57;
goto _loop59;
}
}
_loop57:;
_loop59:;
} // ( ... )*
match(CLOSING_BRACE);
}
@ -1688,11 +1738,11 @@ void PFCfgParser::proto_name() {
}
}
}
#line 462 "pf.g"
#line 476 "pf.g"
importer->proto_list.push_back(LT(0)->getText());
#line 1696 "PFCfgParser.cpp"
#line 1746 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -1705,11 +1755,11 @@ void PFCfgParser::proto_number() {
try { // for error handling
match(INT_CONST);
#line 468 "pf.g"
#line 482 "pf.g"
importer->proto_list.push_back(LT(0)->getText());
#line 1713 "PFCfgParser.cpp"
#line 1763 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -1763,11 +1813,11 @@ void PFCfgParser::proto_list() {
proto_def();
}
else {
goto _loop68;
goto _loop70;
}
}
_loop68:;
_loop70:;
} // ( ... )*
match(CLOSING_BRACE);
}
@ -1904,13 +1954,13 @@ void PFCfgParser::src_hosts_part() {
case URPF_FAILED:
{
match(URPF_FAILED);
#line 508 "pf.g"
#line 522 "pf.g"
importer->tmp_group.push_back(
AddressSpec(AddressSpec::SPECIAL_ADDRESS, false,
"urpf-failed", ""));
#line 1914 "PFCfgParser.cpp"
#line 1964 "PFCfgParser.cpp"
break;
}
default:
@ -1919,13 +1969,13 @@ void PFCfgParser::src_hosts_part() {
}
}
}
#line 514 "pf.g"
#line 528 "pf.g"
importer->src_neg = importer->tmp_neg;
importer->src_group.splice(importer->src_group.begin(),
importer->tmp_group);
#line 1929 "PFCfgParser.cpp"
#line 1979 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -1961,12 +2011,12 @@ void PFCfgParser::src_port_part() {
}
}
}
#line 809 "pf.g"
#line 837 "pf.g"
importer->src_port_group.splice(importer->src_port_group.begin(),
importer->tmp_port_group);
#line 1970 "PFCfgParser.cpp"
#line 2020 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -1979,13 +2029,13 @@ void PFCfgParser::dst_hosts_part() {
try { // for error handling
common_hosts_part();
#line 523 "pf.g"
#line 537 "pf.g"
importer->dst_neg = importer->tmp_neg;
importer->dst_group.splice(importer->dst_group.begin(),
importer->tmp_group);
#line 1989 "PFCfgParser.cpp"
#line 2039 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -2021,12 +2071,12 @@ void PFCfgParser::dst_port_part() {
}
}
}
#line 817 "pf.g"
#line 845 "pf.g"
importer->dst_port_group.splice(importer->dst_port_group.begin(),
importer->tmp_port_group);
#line 2030 "PFCfgParser.cpp"
#line 2080 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -2042,23 +2092,23 @@ void PFCfgParser::common_hosts_part() {
case ANY:
{
match(ANY);
#line 532 "pf.g"
#line 546 "pf.g"
importer->tmp_group.push_back(
AddressSpec(AddressSpec::ANY, false, "0.0.0.0", "0.0.0.0"));
#line 2051 "PFCfgParser.cpp"
#line 2101 "PFCfgParser.cpp"
break;
}
case NO_ROUTE:
{
match(NO_ROUTE);
#line 538 "pf.g"
#line 552 "pf.g"
importer->tmp_group.push_back(
AddressSpec(AddressSpec::SPECIAL_ADDRESS, false, "no-route", ""));
#line 2062 "PFCfgParser.cpp"
#line 2112 "PFCfgParser.cpp"
break;
}
case WORD:
@ -2091,9 +2141,9 @@ void PFCfgParser::common_hosts_part() {
void PFCfgParser::host() {
Tracer traceInOut(this, "host");
ANTLR_USE_NAMESPACE(antlr)RefToken tn = ANTLR_USE_NAMESPACE(antlr)nullToken;
#line 548 "pf.g"
#line 562 "pf.g"
AddressSpec as;
#line 2097 "PFCfgParser.cpp"
#line 2147 "PFCfgParser.cpp"
try { // for error handling
{
@ -2101,9 +2151,9 @@ void PFCfgParser::host() {
case EXLAMATION:
{
match(EXLAMATION);
#line 549 "pf.g"
#line 563 "pf.g"
as.neg = true;
#line 2107 "PFCfgParser.cpp"
#line 2157 "PFCfgParser.cpp"
break;
}
case WORD:
@ -2125,57 +2175,118 @@ void PFCfgParser::host() {
case WORD:
{
match(WORD);
#line 552 "pf.g"
#line 566 "pf.g"
// interface name or domain/host name
as.at = AddressSpec::INTERFACE_NAME;
as.address = LT(0)->getText();
#line 2135 "PFCfgParser.cpp"
#line 2185 "PFCfgParser.cpp"
{
switch ( LA(1)) {
case COLON:
{
match(COLON);
{
switch ( LA(1)) {
case NETWORK:
{
match(NETWORK);
#line 575 "pf.g"
as.at = AddressSpec::INTERFACE_NETWORK;
#line 2200 "PFCfgParser.cpp"
break;
}
case BROADCAST:
{
match(BROADCAST);
#line 580 "pf.g"
as.at = AddressSpec::INTERFACE_BROADCAST;
#line 2210 "PFCfgParser.cpp"
break;
}
default:
{
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
}
}
}
break;
}
case NEWLINE:
case QUEUE:
case COMMA:
case CLOSING_BRACE:
case EXLAMATION:
case TO:
case FLAGS:
case ICMP_TYPE:
case ICMP6_TYPE:
case TAGGED:
case TAG:
case NO:
case KEEP:
case MODULATE:
case SYNPROXY:
case LABEL:
case PORT:
{
break;
}
default:
{
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
}
}
}
break;
}
case SELF:
{
match(SELF);
#line 559 "pf.g"
#line 587 "pf.g"
as.at = AddressSpec::SPECIAL_ADDRESS;
as.address = "self";
#line 2146 "PFCfgParser.cpp"
#line 2257 "PFCfgParser.cpp"
break;
}
case IPV6:
{
match(IPV6);
#line 565 "pf.g"
#line 593 "pf.g"
importer->addMessageToLog(
QString("Error: IPv6 import is not supported. "));
consumeUntil(NEWLINE);
#line 2158 "PFCfgParser.cpp"
#line 2269 "PFCfgParser.cpp"
break;
}
case IPV4:
{
match(IPV4);
#line 572 "pf.g"
#line 600 "pf.g"
as.at = AddressSpec::HOST_ADDRESS;
as.address = LT(0)->getText();
#line 2169 "PFCfgParser.cpp"
#line 2280 "PFCfgParser.cpp"
{
switch ( LA(1)) {
case SLASH:
{
match(SLASH);
#line 578 "pf.g"
#line 606 "pf.g"
as.at = AddressSpec::NETWORK_ADDRESS;
#line 2179 "PFCfgParser.cpp"
#line 2290 "PFCfgParser.cpp"
{
switch ( LA(1)) {
case IPV4:
@ -2194,11 +2305,11 @@ void PFCfgParser::host() {
}
}
}
#line 582 "pf.g"
#line 610 "pf.g"
as.netmask = LT(0)->getText();
#line 2202 "PFCfgParser.cpp"
#line 2313 "PFCfgParser.cpp"
break;
}
case NEWLINE:
@ -2235,12 +2346,12 @@ void PFCfgParser::host() {
tn = LT(1);
match(WORD);
match(GREATER_THAN);
#line 588 "pf.g"
#line 616 "pf.g"
as.at = AddressSpec::TABLE;
as.address = tn->getText();
#line 2244 "PFCfgParser.cpp"
#line 2355 "PFCfgParser.cpp"
break;
}
default:
@ -2249,11 +2360,11 @@ void PFCfgParser::host() {
}
}
}
#line 593 "pf.g"
#line 621 "pf.g"
importer->tmp_group.push_back(as);
#line 2257 "PFCfgParser.cpp"
#line 2368 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -2274,11 +2385,11 @@ void PFCfgParser::host_list() {
host();
}
else {
goto _loop89;
goto _loop93;
}
}
_loop89:;
_loop93:;
} // ( ... )*
match(CLOSING_BRACE);
}
@ -2311,11 +2422,11 @@ void PFCfgParser::route_to() {
}
}
}
#line 615 "pf.g"
#line 643 "pf.g"
importer->route_type = PFImporter::ROUTE_TO;
#line 2319 "PFCfgParser.cpp"
#line 2430 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -2346,11 +2457,11 @@ void PFCfgParser::reply_to() {
}
}
}
#line 622 "pf.g"
#line 650 "pf.g"
importer->route_type = PFImporter::REPLY_TO;
#line 2354 "PFCfgParser.cpp"
#line 2465 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -2364,16 +2475,16 @@ void PFCfgParser::routehost() {
ANTLR_USE_NAMESPACE(antlr)RefToken v6 = ANTLR_USE_NAMESPACE(antlr)nullToken;
ANTLR_USE_NAMESPACE(antlr)RefToken nm = ANTLR_USE_NAMESPACE(antlr)nullToken;
ANTLR_USE_NAMESPACE(antlr)RefToken nm6 = ANTLR_USE_NAMESPACE(antlr)nullToken;
#line 627 "pf.g"
#line 655 "pf.g"
RouteSpec rs;
#line 2370 "PFCfgParser.cpp"
#line 2481 "PFCfgParser.cpp"
try { // for error handling
match(OPENING_PAREN);
match(WORD);
#line 629 "pf.g"
#line 657 "pf.g"
rs.iface = LT(0)->getText();
#line 2377 "PFCfgParser.cpp"
#line 2488 "PFCfgParser.cpp"
{
switch ( LA(1)) {
case IPV4:
@ -2431,7 +2542,7 @@ void PFCfgParser::routehost() {
}
}
}
#line 631 "pf.g"
#line 659 "pf.g"
if (v6)
{
@ -2445,7 +2556,7 @@ void PFCfgParser::routehost() {
importer->route_group.push_back(rs);
}
#line 2449 "PFCfgParser.cpp"
#line 2560 "PFCfgParser.cpp"
match(CLOSING_PAREN);
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@ -2483,11 +2594,11 @@ void PFCfgParser::routehost_list() {
routehost();
}
else {
goto _loop102;
goto _loop106;
}
}
_loop102:;
_loop106:;
} // ( ... )*
match(CLOSING_BRACE);
}
@ -2570,12 +2681,12 @@ void PFCfgParser::tcp_flags() {
case ANY:
{
match(ANY);
#line 688 "pf.g"
#line 716 "pf.g"
importer->flags_check = "any";
importer->flags_mask = "all";
#line 2579 "PFCfgParser.cpp"
#line 2690 "PFCfgParser.cpp"
break;
}
case WORD:
@ -2631,7 +2742,7 @@ void PFCfgParser::tcp_flags() {
}
}
}
#line 694 "pf.g"
#line 722 "pf.g"
if (check)
importer->flags_check = check->getText();
@ -2642,7 +2753,7 @@ void PFCfgParser::tcp_flags() {
else
importer->flags_mask = "all";
#line 2646 "PFCfgParser.cpp"
#line 2757 "PFCfgParser.cpp"
break;
}
default:
@ -2694,13 +2805,13 @@ void PFCfgParser::icmp6_type() {
try { // for error handling
match(ICMP6_TYPE);
#line 748 "pf.g"
#line 776 "pf.g"
importer->addMessageToLog(
QString("Error: ICMP6 import is not supported. "));
consumeUntil(NEWLINE);
#line 2704 "PFCfgParser.cpp"
#line 2815 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -2717,9 +2828,9 @@ void PFCfgParser::tagged() {
case EXLAMATION:
{
match(EXLAMATION);
#line 756 "pf.g"
#line 784 "pf.g"
importer->tagged_neg = true;
#line 2723 "PFCfgParser.cpp"
#line 2834 "PFCfgParser.cpp"
break;
}
case TAGGED:
@ -2734,11 +2845,11 @@ void PFCfgParser::tagged() {
}
match(TAGGED);
match(WORD);
#line 758 "pf.g"
#line 786 "pf.g"
importer->tagged = LT(0)->getText();
#line 2742 "PFCfgParser.cpp"
#line 2853 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -2752,11 +2863,11 @@ void PFCfgParser::tag_clause() {
try { // for error handling
match(TAG);
match(WORD);
#line 765 "pf.g"
#line 793 "pf.g"
importer->tag = LT(0)->getText();
#line 2760 "PFCfgParser.cpp"
#line 2871 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -2796,11 +2907,11 @@ void PFCfgParser::state() {
}
}
}
#line 780 "pf.g"
#line 808 "pf.g"
importer->state_op = LT(0)->getText();
#line 2804 "PFCfgParser.cpp"
#line 2915 "PFCfgParser.cpp"
match(STATE);
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@ -2819,36 +2930,36 @@ void PFCfgParser::queue() {
case WORD:
{
match(WORD);
#line 789 "pf.g"
#line 817 "pf.g"
importer->queue += LT(0)->getText();
#line 2825 "PFCfgParser.cpp"
#line 2936 "PFCfgParser.cpp"
break;
}
case OPENING_PAREN:
{
match(OPENING_PAREN);
match(WORD);
#line 792 "pf.g"
#line 820 "pf.g"
importer->queue += LT(0)->getText();
#line 2834 "PFCfgParser.cpp"
#line 2945 "PFCfgParser.cpp"
{ // ( ... )*
for (;;) {
if ((LA(1) == COMMA)) {
match(COMMA);
#line 794 "pf.g"
#line 822 "pf.g"
importer->queue += ",";
#line 2841 "PFCfgParser.cpp"
#line 2952 "PFCfgParser.cpp"
match(WORD);
#line 795 "pf.g"
#line 823 "pf.g"
importer->queue += LT(0)->getText();
#line 2845 "PFCfgParser.cpp"
#line 2956 "PFCfgParser.cpp"
}
else {
goto _loop131;
goto _loop135;
}
}
_loop131:;
_loop135:;
} // ( ... )*
match(CLOSING_PAREN);
break;
@ -2881,9 +2992,9 @@ void PFCfgParser::label() {
void PFCfgParser::icmp_type_code() {
Tracer traceInOut(this, "icmp_type_code");
#line 716 "pf.g"
#line 744 "pf.g"
IcmpSpec is;
#line 2887 "PFCfgParser.cpp"
#line 2998 "PFCfgParser.cpp"
try { // for error handling
{
@ -2891,17 +3002,17 @@ void PFCfgParser::icmp_type_code() {
case WORD:
{
match(WORD);
#line 718 "pf.g"
#line 746 "pf.g"
is.icmp_type_name = LT(0)->getText();
#line 2897 "PFCfgParser.cpp"
#line 3008 "PFCfgParser.cpp"
break;
}
case INT_CONST:
{
match(INT_CONST);
#line 720 "pf.g"
#line 748 "pf.g"
is.icmp_type_int = LT(0)->getText();
#line 2905 "PFCfgParser.cpp"
#line 3016 "PFCfgParser.cpp"
break;
}
default:
@ -2920,17 +3031,17 @@ void PFCfgParser::icmp_type_code() {
case WORD:
{
match(WORD);
#line 725 "pf.g"
#line 753 "pf.g"
is.icmp_code_name = LT(0)->getText();
#line 2926 "PFCfgParser.cpp"
#line 3037 "PFCfgParser.cpp"
break;
}
case INT_CONST:
{
match(INT_CONST);
#line 727 "pf.g"
#line 755 "pf.g"
is.icmp_code_int = LT(0)->getText();
#line 2934 "PFCfgParser.cpp"
#line 3045 "PFCfgParser.cpp"
break;
}
default:
@ -2967,11 +3078,11 @@ void PFCfgParser::icmp_type_code() {
}
}
}
#line 730 "pf.g"
#line 758 "pf.g"
importer->icmp_type_code_group.push_back(is);
#line 2975 "PFCfgParser.cpp"
#line 3086 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -3009,11 +3120,11 @@ void PFCfgParser::icmp_list() {
icmp_type_code();
}
else {
goto _loop121;
goto _loop125;
}
}
_loop121:;
_loop125:;
} // ( ... )*
match(CLOSING_BRACE);
}
@ -3025,9 +3136,9 @@ void PFCfgParser::icmp_list() {
void PFCfgParser::port_op() {
Tracer traceInOut(this, "port_op");
#line 849 "pf.g"
#line 877 "pf.g"
PortSpec ps;
#line 3031 "PFCfgParser.cpp"
#line 3142 "PFCfgParser.cpp"
try { // for error handling
{
@ -3038,39 +3149,39 @@ void PFCfgParser::port_op() {
case EXLAMATION:
{
unary_port_op();
#line 851 "pf.g"
#line 879 "pf.g"
ps.port_op = importer->tmp_port_op;
#line 3044 "PFCfgParser.cpp"
#line 3155 "PFCfgParser.cpp"
port_def();
#line 853 "pf.g"
#line 881 "pf.g"
ps.port1 = importer->tmp_port_def;
ps.port2 = importer->tmp_port_def;
#line 3051 "PFCfgParser.cpp"
#line 3162 "PFCfgParser.cpp"
break;
}
case WORD:
case INT_CONST:
{
port_def();
#line 859 "pf.g"
#line 887 "pf.g"
ps.port1 = importer->tmp_port_def;
ps.port2 = ps.port1;
ps.port_op = "=";
#line 3064 "PFCfgParser.cpp"
#line 3175 "PFCfgParser.cpp"
{
if ((LA(1) == LESS_THAN || LA(1) == GREATER_THAN || LA(1) == COLON) && (_tokenSet_33.member(LA(2)))) {
binary_port_op();
#line 865 "pf.g"
#line 893 "pf.g"
ps.port_op = importer->tmp_port_op;
#line 3070 "PFCfgParser.cpp"
#line 3181 "PFCfgParser.cpp"
port_def();
#line 866 "pf.g"
#line 894 "pf.g"
ps.port2 = LT(0)->getText();
#line 3074 "PFCfgParser.cpp"
#line 3185 "PFCfgParser.cpp"
}
else if ((_tokenSet_34.member(LA(1))) && (_tokenSet_35.member(LA(2)))) {
}
@ -3087,11 +3198,11 @@ void PFCfgParser::port_op() {
}
}
}
#line 869 "pf.g"
#line 897 "pf.g"
importer->tmp_port_group.push_back(ps);
#line 3095 "PFCfgParser.cpp"
#line 3206 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@ -3133,11 +3244,11 @@ void PFCfgParser::port_op_list() {
port_op();
}
else {
goto _loop148;
goto _loop152;
}
}
_loop148:;
_loop152:;
} // ( ... )*
match(CLOSING_BRACE);
}
@ -3156,46 +3267,46 @@ void PFCfgParser::unary_port_op() {
case EQUAL:
{
match(EQUAL);
#line 825 "pf.g"
#line 853 "pf.g"
importer->tmp_port_op = "=";
#line 3162 "PFCfgParser.cpp"
#line 3273 "PFCfgParser.cpp"
break;
}
case EXLAMATION:
{
match(EXLAMATION);
match(EQUAL);
#line 827 "pf.g"
#line 855 "pf.g"
importer->tmp_port_op = "!=";
#line 3171 "PFCfgParser.cpp"
#line 3282 "PFCfgParser.cpp"
break;
}
default:
if ((LA(1) == LESS_THAN) && (LA(2) == WORD || LA(2) == INT_CONST)) {
match(LESS_THAN);
#line 829 "pf.g"
#line 857 "pf.g"
importer->tmp_port_op = "<";
#line 3179 "PFCfgParser.cpp"
#line 3290 "PFCfgParser.cpp"
}
else if ((LA(1) == LESS_THAN) && (LA(2) == EQUAL)) {
match(LESS_THAN);
match(EQUAL);
#line 831 "pf.g"
#line 859 "pf.g"
importer->tmp_port_op = "<=";
#line 3186 "PFCfgParser.cpp"
#line 3297 "PFCfgParser.cpp"
}
else if ((LA(1) == GREATER_THAN) && (LA(2) == WORD || LA(2) == INT_CONST)) {
match(GREATER_THAN);
#line 833 "pf.g"
#line 861 "pf.g"
importer->tmp_port_op = ">";
#line 3192 "PFCfgParser.cpp"
#line 3303 "PFCfgParser.cpp"
}
else if ((LA(1) == GREATER_THAN) && (LA(2) == EQUAL)) {
match(GREATER_THAN);
match(EQUAL);
#line 835 "pf.g"
#line 863 "pf.g"
importer->tmp_port_op = ">=";
#line 3199 "PFCfgParser.cpp"
#line 3310 "PFCfgParser.cpp"
}
else {
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
@ -3219,26 +3330,26 @@ void PFCfgParser::binary_port_op() {
{
match(LESS_THAN);
match(GREATER_THAN);
#line 841 "pf.g"
#line 869 "pf.g"
importer->tmp_port_op = "<>";
#line 3225 "PFCfgParser.cpp"
#line 3336 "PFCfgParser.cpp"
break;
}
case GREATER_THAN:
{
match(GREATER_THAN);
match(LESS_THAN);
#line 843 "pf.g"
#line 871 "pf.g"
importer->tmp_port_op = "><";
#line 3234 "PFCfgParser.cpp"
#line 3345 "PFCfgParser.cpp"
break;
}
case COLON:
{
match(COLON);
#line 845 "pf.g"
#line 873 "pf.g"
importer->tmp_port_op = ":";
#line 3242 "PFCfgParser.cpp"
#line 3353 "PFCfgParser.cpp"
break;
}
default:
@ -3267,11 +3378,11 @@ void PFCfgParser::port_def() {
case INT_CONST:
{
match(INT_CONST);
#line 876 "pf.g"
#line 904 "pf.g"
importer->tmp_port_def = LT(0)->getText();
#line 3275 "PFCfgParser.cpp"
#line 3386 "PFCfgParser.cpp"
break;
}
default:
@ -3315,6 +3426,9 @@ const char* PFCfgParser::tokenNames[] = {
"COMMA",
"CLOSING_BRACE",
"EXLAMATION",
"COLON",
"\"network\"",
"\"broadcast\"",
"\"self\"",
"IPV4",
"SLASH",
@ -3374,7 +3488,6 @@ const char* PFCfgParser::tokenNames[] = {
"\"state\"",
"\"label\"",
"\"port\"",
"COLON",
"\"exit\"",
"\"quit\"",
"\"interface\"",
@ -3388,6 +3501,7 @@ const char* PFCfgParser::tokenNames[] = {
"\"rip\"",
"\"snp\"",
"\"host\"",
"\"peer\"",
"\"range\"",
"\"alerts\"",
"\"critical\"",
@ -3430,35 +3544,35 @@ const char* PFCfgParser::tokenNames[] = {
0
};
const unsigned long PFCfgParser::_tokenSet_0_data_[] = { 3758112626UL, 7UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_0_data_[] = { 16242UL, 63UL, 0UL, 0UL, 0UL, 0UL };
// EOF NEWLINE LINE_COMMENT WORD "antispoof" "altq" "queue" "set" "scrub"
// "table" "nat" "binat" "rdr" "timeout" "pass" "block"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_0(_tokenSet_0_data_,6);
const unsigned long PFCfgParser::_tokenSet_1_data_[] = { 2UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// EOF
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_1(_tokenSet_1_data_,6);
const unsigned long PFCfgParser::_tokenSet_2_data_[] = { 121634880UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_2_data_[] = { 826277952UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// WORD COMMA EXLAMATION "self" IPV4
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_2(_tokenSet_2_data_,6);
const unsigned long PFCfgParser::_tokenSet_3_data_[] = { 130023488UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_3_data_[] = { 834666560UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// WORD COMMA CLOSING_BRACE EXLAMATION "self" IPV4
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_3(_tokenSet_3_data_,6);
const unsigned long PFCfgParser::_tokenSet_4_data_[] = { 16778256UL, 1280UL, 392577UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_4_data_[] = { 16778256UL, 10240UL, 3140616UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "all" "to" "from" "flags" "icmp-type" "icmp6-type"
// "tagged" "tag" "no" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_4(_tokenSet_4_data_,8);
const unsigned long PFCfgParser::_tokenSet_5_data_[] = { 4285562738UL, 1095UL, 1047966UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_5_data_[] = { 4050681714UL, 8767UL, 8383728UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// EOF NEWLINE LINE_COMMENT WORD "antispoof" "altq" "queue" "set" "scrub"
// "table" LESS_THAN STRING OPENING_BRACE COMMA EXLAMATION "self" IPV4
// SLASH INT_CONST "nat" "binat" "rdr" "timeout" "pass" "block" OPENING_PAREN
// "to" "urpf-failed" "any" "no-route" IPV6 "flags" "icmp-type" "icmp6-type"
// "tagged" "tag" "no" "keep" "modulate" "synproxy" "state" "label" "port"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_5(_tokenSet_5_data_,8);
const unsigned long PFCfgParser::_tokenSet_6_data_[] = { 16778256UL, 0UL, 392576UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_6_data_[] = { 16778256UL, 0UL, 3140608UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "flags" "icmp-type" "icmp6-type" "tagged"
// "tag" "no" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_6(_tokenSet_6_data_,8);
const unsigned long PFCfgParser::_tokenSet_7_data_[] = { 4184883058UL, 71UL, 523652UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_7_data_[] = { 3245358962UL, 575UL, 4189216UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// EOF NEWLINE LINE_COMMENT WORD "antispoof" "altq" "queue" "set" "scrub"
// "table" STRING OPENING_BRACE COMMA EXLAMATION SLASH INT_CONST "nat"
// "binat" "rdr" "timeout" "pass" "block" OPENING_PAREN "any" "flags" "icmp-type"
@ -3468,146 +3582,146 @@ const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_7(_tokenSet_7_data
const unsigned long PFCfgParser::_tokenSet_8_data_[] = { 16UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_8(_tokenSet_8_data_,6);
const unsigned long PFCfgParser::_tokenSet_9_data_[] = { 16778256UL, 64800UL, 392673UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_9_data_[] = { 16778256UL, 518400UL, 3141384UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "log" "all" "to" "quick" "on" "inet" "inet6"
// "proto" "from" "route-to" "reply-to" "flags" "icmp-type" "icmp6-type"
// "tagged" "tag" "no" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_9(_tokenSet_9_data_,8);
const unsigned long PFCfgParser::_tokenSet_10_data_[] = { 16778256UL, 64768UL, 392673UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_10_data_[] = { 16778256UL, 518144UL, 3141384UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "all" "to" "quick" "on" "inet" "inet6" "proto"
// "from" "route-to" "reply-to" "flags" "icmp-type" "icmp6-type" "tagged"
// "tag" "no" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_10(_tokenSet_10_data_,8);
const unsigned long PFCfgParser::_tokenSet_11_data_[] = { 16778256UL, 62720UL, 392673UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_11_data_[] = { 16778256UL, 501760UL, 3141384UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "all" "to" "on" "inet" "inet6" "proto" "from"
// "route-to" "reply-to" "flags" "icmp-type" "icmp6-type" "tagged" "tag"
// "no" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_11(_tokenSet_11_data_,8);
const unsigned long PFCfgParser::_tokenSet_12_data_[] = { 16778256UL, 58624UL, 392673UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_12_data_[] = { 16778256UL, 468992UL, 3141384UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "all" "to" "inet" "inet6" "proto" "from"
// "route-to" "reply-to" "flags" "icmp-type" "icmp6-type" "tagged" "tag"
// "no" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_12(_tokenSet_12_data_,8);
const unsigned long PFCfgParser::_tokenSet_13_data_[] = { 16778256UL, 58624UL, 392577UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_13_data_[] = { 16778256UL, 468992UL, 3140616UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "all" "to" "inet" "inet6" "proto" "from"
// "flags" "icmp-type" "icmp6-type" "tagged" "tag" "no" "keep" "modulate"
// "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_13(_tokenSet_13_data_,8);
const unsigned long PFCfgParser::_tokenSet_14_data_[] = { 16778256UL, 34048UL, 392577UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_14_data_[] = { 16778256UL, 272384UL, 3140616UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "all" "to" "proto" "from" "flags" "icmp-type"
// "icmp6-type" "tagged" "tag" "no" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_14(_tokenSet_14_data_,8);
const unsigned long PFCfgParser::_tokenSet_15_data_[] = { 20972544UL, 0UL, 392576UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_15_data_[] = { 20972544UL, 0UL, 3140608UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// "queue" COMMA EXLAMATION "flags" "icmp-type" "icmp6-type" "tagged" "tag"
// "no" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_15(_tokenSet_15_data_,8);
const unsigned long PFCfgParser::_tokenSet_16_data_[] = { 4194304UL, 128UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_16_data_[] = { 4194304UL, 1024UL, 0UL, 0UL, 0UL, 0UL };
// COMMA CLOSING_PAREN
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_16(_tokenSet_16_data_,6);
const unsigned long PFCfgParser::_tokenSet_17_data_[] = { 29361232UL, 58624UL, 392673UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_17_data_[] = { 29361232UL, 468992UL, 3141384UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE WORD "queue" COMMA CLOSING_BRACE EXLAMATION "all" "to" "inet"
// "inet6" "proto" "from" "route-to" "reply-to" "flags" "icmp-type" "icmp6-type"
// "tagged" "tag" "no" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_17(_tokenSet_17_data_,8);
const unsigned long PFCfgParser::_tokenSet_18_data_[] = { 299893776UL, 4294903040UL, 392577UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_18_data_[] = { 2178941968UL, 4294453248UL, 3140623UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" OPENING_BRACE COMMA CLOSING_BRACE EXLAMATION INT_CONST
// "all" "to" "ip" "icmp" "igmp" "tcp" "udp" "rdp" "rsvp" "gre" "esp" "ah"
// "eigrp" "ospf" "ipip" "vrrp" "l2tp" "isis" "from" "flags" "icmp-type"
// "icmp6-type" "tagged" "tag" "no" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_18(_tokenSet_18_data_,8);
const unsigned long PFCfgParser::_tokenSet_19_data_[] = { 274726912UL, 4294901760UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_19_data_[] = { 2153775104UL, 4294443008UL, 7UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// OPENING_BRACE COMMA INT_CONST "ip" "icmp" "igmp" "tcp" "udp" "rdp" "rsvp"
// "gre" "esp" "ah" "eigrp" "ospf" "ipip" "vrrp" "l2tp" "isis"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_19(_tokenSet_19_data_,6);
const unsigned long PFCfgParser::_tokenSet_20_data_[] = { 119554112UL, 0UL, 30UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_19(_tokenSet_19_data_,8);
const unsigned long PFCfgParser::_tokenSet_20_data_[] = { 824197184UL, 0UL, 240UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// WORD LESS_THAN OPENING_BRACE EXLAMATION "self" IPV4 "urpf-failed" "any"
// "no-route" IPV6
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_20(_tokenSet_20_data_,8);
const unsigned long PFCfgParser::_tokenSet_21_data_[] = { 251675728UL, 1024UL, 916880UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE WORD "queue" LESS_THAN EXLAMATION "self" IPV4 SLASH "to" IPV6
// "flags" "icmp-type" "icmp6-type" "tagged" "tag" "no" "keep" "modulate"
const unsigned long PFCfgParser::_tokenSet_21_data_[] = { 1929397328UL, 8192UL, 7335040UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE WORD "queue" LESS_THAN EXLAMATION COLON "self" IPV4 SLASH "to"
// IPV6 "flags" "icmp-type" "icmp6-type" "tagged" "tag" "no" "keep" "modulate"
// "synproxy" "label" "port"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_21(_tokenSet_21_data_,8);
const unsigned long PFCfgParser::_tokenSet_22_data_[] = { 16778256UL, 1024UL, 916864UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_22_data_[] = { 16778256UL, 8192UL, 7334912UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "to" "flags" "icmp-type" "icmp6-type" "tagged"
// "tag" "no" "keep" "modulate" "synproxy" "label" "port"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_22(_tokenSet_22_data_,8);
const unsigned long PFCfgParser::_tokenSet_23_data_[] = { 4285595634UL, 71UL, 1047964UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_23_data_[] = { 4050714610UL, 575UL, 8383712UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// EOF NEWLINE LINE_COMMENT WORD EQUAL "antispoof" "altq" "queue" "set"
// "scrub" "table" LESS_THAN GREATER_THAN STRING OPENING_BRACE COMMA EXLAMATION
// "self" IPV4 SLASH INT_CONST "nat" "binat" "rdr" "timeout" "pass" "block"
// OPENING_PAREN "any" "no-route" IPV6 "flags" "icmp-type" "icmp6-type"
// "tagged" "tag" "no" "keep" "modulate" "synproxy" "state" "label" "port"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_23(_tokenSet_23_data_,8);
const unsigned long PFCfgParser::_tokenSet_24_data_[] = { 16778256UL, 1024UL, 392576UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_24_data_[] = { 16778256UL, 8192UL, 3140608UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "to" "flags" "icmp-type" "icmp6-type" "tagged"
// "tag" "no" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_24(_tokenSet_24_data_,8);
const unsigned long PFCfgParser::_tokenSet_25_data_[] = { 119554112UL, 0UL, 28UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_25_data_[] = { 824197184UL, 0UL, 224UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// WORD LESS_THAN OPENING_BRACE EXLAMATION "self" IPV4 "any" "no-route"
// IPV6
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_25(_tokenSet_25_data_,8);
const unsigned long PFCfgParser::_tokenSet_26_data_[] = { 251675728UL, 0UL, 916880UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE WORD "queue" LESS_THAN EXLAMATION "self" IPV4 SLASH IPV6 "flags"
// "icmp-type" "icmp6-type" "tagged" "tag" "no" "keep" "modulate" "synproxy"
// "label" "port"
const unsigned long PFCfgParser::_tokenSet_26_data_[] = { 1929397328UL, 0UL, 7335040UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE WORD "queue" LESS_THAN EXLAMATION COLON "self" IPV4 SLASH IPV6
// "flags" "icmp-type" "icmp6-type" "tagged" "tag" "no" "keep" "modulate"
// "synproxy" "label" "port"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_26(_tokenSet_26_data_,8);
const unsigned long PFCfgParser::_tokenSet_27_data_[] = { 16778256UL, 0UL, 916864UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_27_data_[] = { 16778256UL, 0UL, 7334912UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "flags" "icmp-type" "icmp6-type" "tagged"
// "tag" "no" "keep" "modulate" "synproxy" "label" "port"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_27(_tokenSet_27_data_,8);
const unsigned long PFCfgParser::_tokenSet_28_data_[] = { 4184932338UL, 71UL, 523652UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_28_data_[] = { 3245408242UL, 575UL, 4189216UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// EOF NEWLINE LINE_COMMENT WORD EQUAL "antispoof" "altq" "queue" "set"
// "scrub" "table" LESS_THAN GREATER_THAN STRING OPENING_BRACE COMMA EXLAMATION
// SLASH INT_CONST "nat" "binat" "rdr" "timeout" "pass" "block" OPENING_PAREN
// "any" "flags" "icmp-type" "icmp6-type" "tagged" "tag" "no" "keep" "modulate"
// "synproxy" "state" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_28(_tokenSet_28_data_,8);
const unsigned long PFCfgParser::_tokenSet_29_data_[] = { 29361168UL, 1024UL, 916864UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_29_data_[] = { 29361168UL, 8192UL, 7334912UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" COMMA CLOSING_BRACE EXLAMATION "to" "flags" "icmp-type"
// "icmp6-type" "tagged" "tag" "no" "keep" "modulate" "synproxy" "label"
// "port"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_29(_tokenSet_29_data_,8);
const unsigned long PFCfgParser::_tokenSet_30_data_[] = { 29361168UL, 58688UL, 392577UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_30_data_[] = { 29361168UL, 469504UL, 3140616UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" COMMA CLOSING_BRACE EXLAMATION OPENING_PAREN "all" "to"
// "inet" "inet6" "proto" "from" "flags" "icmp-type" "icmp6-type" "tagged"
// "tag" "no" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_30(_tokenSet_30_data_,8);
const unsigned long PFCfgParser::_tokenSet_31_data_[] = { 20972560UL, 0UL, 392576UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_31_data_[] = { 20972560UL, 0UL, 3140608UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" COMMA EXLAMATION "flags" "icmp-type" "icmp6-type" "tagged"
// "tag" "no" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_31(_tokenSet_31_data_,8);
const unsigned long PFCfgParser::_tokenSet_32_data_[] = { 297796688UL, 0UL, 392576UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_32_data_[] = { 2176844880UL, 0UL, 3140608UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE WORD "queue" COMMA CLOSING_BRACE EXLAMATION INT_CONST "flags"
// "icmp-type" "icmp6-type" "tagged" "tag" "no" "keep" "modulate" "synproxy"
// "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_32(_tokenSet_32_data_,8);
const unsigned long PFCfgParser::_tokenSet_33_data_[] = { 268484672UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_33_data_[] = { 2147532864UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// WORD LESS_THAN GREATER_THAN INT_CONST
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_33(_tokenSet_33_data_,6);
const unsigned long PFCfgParser::_tokenSet_34_data_[] = { 297845968UL, 1024UL, 392576UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_34_data_[] = { 2176894160UL, 8192UL, 3140608UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE WORD EQUAL "queue" LESS_THAN GREATER_THAN COMMA CLOSING_BRACE
// EXLAMATION INT_CONST "to" "flags" "icmp-type" "icmp6-type" "tagged"
// "tag" "no" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_34(_tokenSet_34_data_,8);
const unsigned long PFCfgParser::_tokenSet_35_data_[] = { 4293984242UL, 1095UL, 2096540UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_35_data_[] = { 4092657650UL, 8767UL, 8383712UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// EOF NEWLINE LINE_COMMENT WORD EQUAL "antispoof" "altq" "queue" "set"
// "scrub" "table" LESS_THAN GREATER_THAN STRING OPENING_BRACE COMMA CLOSING_BRACE
// EXLAMATION "self" IPV4 SLASH INT_CONST "nat" "binat" "rdr" "timeout"
// EXLAMATION COLON "self" IPV4 SLASH INT_CONST "nat" "binat" "rdr" "timeout"
// "pass" "block" OPENING_PAREN "to" "any" "no-route" IPV6 "flags" "icmp-type"
// "icmp6-type" "tagged" "tag" "no" "keep" "modulate" "synproxy" "state"
// "label" "port" COLON
// "label" "port"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_35(_tokenSet_35_data_,8);
const unsigned long PFCfgParser::_tokenSet_36_data_[] = { 289456320UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_36_data_[] = { 2168504512UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// WORD EQUAL LESS_THAN GREATER_THAN COMMA EXLAMATION INT_CONST
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_36(_tokenSet_36_data_,6);
const unsigned long PFCfgParser::_tokenSet_37_data_[] = { 268435520UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_37_data_[] = { 2147483712UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// WORD INT_CONST
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_37(_tokenSet_37_data_,6);
const unsigned long PFCfgParser::_tokenSet_38_data_[] = { 297845968UL, 1024UL, 1441152UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_38_data_[] = { 2210448592UL, 8192UL, 3140608UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE WORD EQUAL "queue" LESS_THAN GREATER_THAN COMMA CLOSING_BRACE
// EXLAMATION INT_CONST "to" "flags" "icmp-type" "icmp6-type" "tagged"
// "tag" "no" "keep" "modulate" "synproxy" "label" COLON
// EXLAMATION COLON INT_CONST "to" "flags" "icmp-type" "icmp6-type" "tagged"
// "tag" "no" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_38(_tokenSet_38_data_,8);

View File

@ -9,7 +9,7 @@
#line 11 "PFCfgParser.hpp"
#include <antlr/config.hpp>
/* $ANTLR 2.7.7 (20100319): "pf.g" -> "PFCfgParser.hpp"$ */
/* $ANTLR 2.7.7 (20090306): "pf.g" -> "PFCfgParser.hpp"$ */
#include <antlr/TokenStream.hpp>
#include <antlr/TokenBuffer.hpp>
#include "PFCfgParserTokenTypes.hpp"
@ -163,10 +163,10 @@ protected:
private:
static const char* tokenNames[];
#ifndef NO_STATIC_CONSTS
static const int NUM_TOKENS = 137;
static const int NUM_TOKENS = 140;
#else
enum {
NUM_TOKENS = 137
NUM_TOKENS = 140
};
#endif

View File

@ -1,7 +1,7 @@
#ifndef INC_PFCfgParserTokenTypes_hpp_
#define INC_PFCfgParserTokenTypes_hpp_
/* $ANTLR 2.7.7 (20100319): "pf.g" -> "PFCfgParserTokenTypes.hpp"$ */
/* $ANTLR 2.7.7 (20090306): "pf.g" -> "PFCfgParserTokenTypes.hpp"$ */
#ifndef CUSTOM_API
# define CUSTOM_API
@ -33,118 +33,121 @@ struct CUSTOM_API PFCfgParserTokenTypes {
COMMA = 22,
CLOSING_BRACE = 23,
EXLAMATION = 24,
SELF = 25,
IPV4 = 26,
SLASH = 27,
INT_CONST = 28,
NAT = 29,
BINAT = 30,
RDR = 31,
TIMEOUT = 32,
PASS = 33,
BLOCK = 34,
IN = 35,
OUT = 36,
LOG = 37,
OPENING_PAREN = 38,
CLOSING_PAREN = 39,
ALL = 40,
USER = 41,
TO = 42,
QUICK = 43,
ON = 44,
INET = 45,
INET6 = 46,
PROTO = 47,
IP = 48,
ICMP = 49,
IGMP = 50,
TCP = 51,
UDP = 52,
RDP = 53,
RSVP = 54,
GRE = 55,
ESP = 56,
AH = 57,
EIGRP = 58,
OSPF = 59,
IPIP = 60,
VRRP = 61,
L2TP = 62,
ISIS = 63,
FROM = 64,
URPF_FAILED = 65,
ANY = 66,
NO_ROUTE = 67,
IPV6 = 68,
ROUTE_TO = 69,
REPLY_TO = 70,
FLAGS = 71,
ICMP_TYPE = 72,
ICMP_CODE = 73,
ICMP6_TYPE = 74,
TAGGED = 75,
TAG = 76,
NO = 77,
KEEP = 78,
MODULATE = 79,
SYNPROXY = 80,
STATE = 81,
LABEL = 82,
PORT = 83,
COLON = 84,
EXIT = 85,
QUIT = 86,
INTRFACE = 87,
ICMP6 = 88,
IGRP = 89,
IPSEC = 90,
NOS = 91,
PCP = 92,
PIM = 93,
PPTP = 94,
RIP = 95,
SNP = 96,
HOST = 97,
RANGE = 98,
LOG_LEVEL_ALERTS = 99,
LOG_LEVEL_CRITICAL = 100,
LOG_LEVEL_DEBUGGING = 101,
LOG_LEVEL_EMERGENCIES = 102,
LOG_LEVEL_ERRORS = 103,
LOG_LEVEL_INFORMATIONAL = 104,
LOG_LEVEL_NOTIFICATIONS = 105,
LOG_LEVEL_WARNINGS = 106,
LOG_LEVEL_DISABLE = 107,
LOG_LEVEL_INACTIVE = 108,
TRANSLATE_TO = 109,
Whitespace = 110,
HEX_CONST = 111,
NUMBER = 112,
NEG_INT_CONST = 113,
HEX_DIGIT = 114,
DIGIT = 115,
NUM_3DIGIT = 116,
NUM_HEX_4DIGIT = 117,
NUMBER_ADDRESS_OR_WORD = 118,
PIPE_CHAR = 119,
NUMBER_SIGN = 120,
PERCENT = 121,
AMPERSAND = 122,
APOSTROPHE = 123,
STAR = 124,
PLUS = 125,
MINUS = 126,
DOT = 127,
SEMICOLON = 128,
QUESTION = 129,
COMMERCIAL_AT = 130,
OPENING_SQUARE = 131,
CLOSING_SQUARE = 132,
CARET = 133,
UNDERLINE = 134,
TILDE = 135,
DOUBLE_QUOTE = 136,
COLON = 25,
NETWORK = 26,
BROADCAST = 27,
SELF = 28,
IPV4 = 29,
SLASH = 30,
INT_CONST = 31,
NAT = 32,
BINAT = 33,
RDR = 34,
TIMEOUT = 35,
PASS = 36,
BLOCK = 37,
IN = 38,
OUT = 39,
LOG = 40,
OPENING_PAREN = 41,
CLOSING_PAREN = 42,
ALL = 43,
USER = 44,
TO = 45,
QUICK = 46,
ON = 47,
INET = 48,
INET6 = 49,
PROTO = 50,
IP = 51,
ICMP = 52,
IGMP = 53,
TCP = 54,
UDP = 55,
RDP = 56,
RSVP = 57,
GRE = 58,
ESP = 59,
AH = 60,
EIGRP = 61,
OSPF = 62,
IPIP = 63,
VRRP = 64,
L2TP = 65,
ISIS = 66,
FROM = 67,
URPF_FAILED = 68,
ANY = 69,
NO_ROUTE = 70,
IPV6 = 71,
ROUTE_TO = 72,
REPLY_TO = 73,
FLAGS = 74,
ICMP_TYPE = 75,
ICMP_CODE = 76,
ICMP6_TYPE = 77,
TAGGED = 78,
TAG = 79,
NO = 80,
KEEP = 81,
MODULATE = 82,
SYNPROXY = 83,
STATE = 84,
LABEL = 85,
PORT = 86,
EXIT = 87,
QUIT = 88,
INTRFACE = 89,
ICMP6 = 90,
IGRP = 91,
IPSEC = 92,
NOS = 93,
PCP = 94,
PIM = 95,
PPTP = 96,
RIP = 97,
SNP = 98,
HOST = 99,
PEER = 100,
RANGE = 101,
LOG_LEVEL_ALERTS = 102,
LOG_LEVEL_CRITICAL = 103,
LOG_LEVEL_DEBUGGING = 104,
LOG_LEVEL_EMERGENCIES = 105,
LOG_LEVEL_ERRORS = 106,
LOG_LEVEL_INFORMATIONAL = 107,
LOG_LEVEL_NOTIFICATIONS = 108,
LOG_LEVEL_WARNINGS = 109,
LOG_LEVEL_DISABLE = 110,
LOG_LEVEL_INACTIVE = 111,
TRANSLATE_TO = 112,
Whitespace = 113,
HEX_CONST = 114,
NUMBER = 115,
NEG_INT_CONST = 116,
HEX_DIGIT = 117,
DIGIT = 118,
NUM_3DIGIT = 119,
NUM_HEX_4DIGIT = 120,
NUMBER_ADDRESS_OR_WORD = 121,
PIPE_CHAR = 122,
NUMBER_SIGN = 123,
PERCENT = 124,
AMPERSAND = 125,
APOSTROPHE = 126,
STAR = 127,
PLUS = 128,
MINUS = 129,
DOT = 130,
SEMICOLON = 131,
QUESTION = 132,
COMMERCIAL_AT = 133,
OPENING_SQUARE = 134,
CLOSING_SQUARE = 135,
CARET = 136,
UNDERLINE = 137,
TILDE = 138,
DOUBLE_QUOTE = 139,
NULL_TREE_LOOKAHEAD = 3
};
#ifdef __cplusplus

View File

@ -1,4 +1,4 @@
// $ANTLR 2.7.7 (20100319): pf.g -> PFCfgParserTokenTypes.txt$
// $ANTLR 2.7.7 (20090306): pf.g -> PFCfgParserTokenTypes.txt$
PFCfgParser // output token vocab name
NEWLINE=4
LINE_COMMENT=5
@ -21,115 +21,118 @@ OPENING_BRACE=21
COMMA=22
CLOSING_BRACE=23
EXLAMATION=24
SELF="self"=25
IPV4=26
SLASH=27
INT_CONST=28
NAT="nat"=29
BINAT="binat"=30
RDR="rdr"=31
TIMEOUT="timeout"=32
PASS="pass"=33
BLOCK="block"=34
IN="in"=35
OUT="out"=36
LOG="log"=37
OPENING_PAREN=38
CLOSING_PAREN=39
ALL="all"=40
USER="user"=41
TO="to"=42
QUICK="quick"=43
ON="on"=44
INET="inet"=45
INET6="inet6"=46
PROTO="proto"=47
IP="ip"=48
ICMP="icmp"=49
IGMP="igmp"=50
TCP="tcp"=51
UDP="udp"=52
RDP="rdp"=53
RSVP="rsvp"=54
GRE="gre"=55
ESP="esp"=56
AH="ah"=57
EIGRP="eigrp"=58
OSPF="ospf"=59
IPIP="ipip"=60
VRRP="vrrp"=61
L2TP="l2tp"=62
ISIS="isis"=63
FROM="from"=64
URPF_FAILED="urpf-failed"=65
ANY="any"=66
NO_ROUTE="no-route"=67
IPV6=68
ROUTE_TO="route-to"=69
REPLY_TO="reply-to"=70
FLAGS="flags"=71
ICMP_TYPE="icmp-type"=72
ICMP_CODE="code"=73
ICMP6_TYPE="icmp6-type"=74
TAGGED="tagged"=75
TAG="tag"=76
NO="no"=77
KEEP="keep"=78
MODULATE="modulate"=79
SYNPROXY="synproxy"=80
STATE="state"=81
LABEL="label"=82
PORT="port"=83
COLON=84
EXIT="exit"=85
QUIT="quit"=86
INTRFACE="interface"=87
ICMP6="icmp6"=88
IGRP="igrp"=89
IPSEC="ipsec"=90
NOS="nos"=91
PCP="pcp"=92
PIM="pim"=93
PPTP="pptp"=94
RIP="rip"=95
SNP="snp"=96
HOST="host"=97
RANGE="range"=98
LOG_LEVEL_ALERTS="alerts"=99
LOG_LEVEL_CRITICAL="critical"=100
LOG_LEVEL_DEBUGGING="debugging"=101
LOG_LEVEL_EMERGENCIES="emergencies"=102
LOG_LEVEL_ERRORS="errors"=103
LOG_LEVEL_INFORMATIONAL="informational"=104
LOG_LEVEL_NOTIFICATIONS="notifications"=105
LOG_LEVEL_WARNINGS="warnings"=106
LOG_LEVEL_DISABLE="disable"=107
LOG_LEVEL_INACTIVE="inactive"=108
TRANSLATE_TO="->"=109
Whitespace=110
HEX_CONST=111
NUMBER=112
NEG_INT_CONST=113
HEX_DIGIT=114
DIGIT=115
NUM_3DIGIT=116
NUM_HEX_4DIGIT=117
NUMBER_ADDRESS_OR_WORD=118
PIPE_CHAR=119
NUMBER_SIGN=120
PERCENT=121
AMPERSAND=122
APOSTROPHE=123
STAR=124
PLUS=125
MINUS=126
DOT=127
SEMICOLON=128
QUESTION=129
COMMERCIAL_AT=130
OPENING_SQUARE=131
CLOSING_SQUARE=132
CARET=133
UNDERLINE=134
TILDE=135
DOUBLE_QUOTE=136
COLON=25
NETWORK="network"=26
BROADCAST="broadcast"=27
SELF="self"=28
IPV4=29
SLASH=30
INT_CONST=31
NAT="nat"=32
BINAT="binat"=33
RDR="rdr"=34
TIMEOUT="timeout"=35
PASS="pass"=36
BLOCK="block"=37
IN="in"=38
OUT="out"=39
LOG="log"=40
OPENING_PAREN=41
CLOSING_PAREN=42
ALL="all"=43
USER="user"=44
TO="to"=45
QUICK="quick"=46
ON="on"=47
INET="inet"=48
INET6="inet6"=49
PROTO="proto"=50
IP="ip"=51
ICMP="icmp"=52
IGMP="igmp"=53
TCP="tcp"=54
UDP="udp"=55
RDP="rdp"=56
RSVP="rsvp"=57
GRE="gre"=58
ESP="esp"=59
AH="ah"=60
EIGRP="eigrp"=61
OSPF="ospf"=62
IPIP="ipip"=63
VRRP="vrrp"=64
L2TP="l2tp"=65
ISIS="isis"=66
FROM="from"=67
URPF_FAILED="urpf-failed"=68
ANY="any"=69
NO_ROUTE="no-route"=70
IPV6=71
ROUTE_TO="route-to"=72
REPLY_TO="reply-to"=73
FLAGS="flags"=74
ICMP_TYPE="icmp-type"=75
ICMP_CODE="code"=76
ICMP6_TYPE="icmp6-type"=77
TAGGED="tagged"=78
TAG="tag"=79
NO="no"=80
KEEP="keep"=81
MODULATE="modulate"=82
SYNPROXY="synproxy"=83
STATE="state"=84
LABEL="label"=85
PORT="port"=86
EXIT="exit"=87
QUIT="quit"=88
INTRFACE="interface"=89
ICMP6="icmp6"=90
IGRP="igrp"=91
IPSEC="ipsec"=92
NOS="nos"=93
PCP="pcp"=94
PIM="pim"=95
PPTP="pptp"=96
RIP="rip"=97
SNP="snp"=98
HOST="host"=99
PEER="peer"=100
RANGE="range"=101
LOG_LEVEL_ALERTS="alerts"=102
LOG_LEVEL_CRITICAL="critical"=103
LOG_LEVEL_DEBUGGING="debugging"=104
LOG_LEVEL_EMERGENCIES="emergencies"=105
LOG_LEVEL_ERRORS="errors"=106
LOG_LEVEL_INFORMATIONAL="informational"=107
LOG_LEVEL_NOTIFICATIONS="notifications"=108
LOG_LEVEL_WARNINGS="warnings"=109
LOG_LEVEL_DISABLE="disable"=110
LOG_LEVEL_INACTIVE="inactive"=111
TRANSLATE_TO="->"=112
Whitespace=113
HEX_CONST=114
NUMBER=115
NEG_INT_CONST=116
HEX_DIGIT=117
DIGIT=118
NUM_3DIGIT=119
NUM_HEX_4DIGIT=120
NUMBER_ADDRESS_OR_WORD=121
PIPE_CHAR=122
NUMBER_SIGN=123
PERCENT=124
AMPERSAND=125
APOSTROPHE=126
STAR=127
PLUS=128
MINUS=129
DOT=130
SEMICOLON=131
QUESTION=132
COMMERCIAL_AT=133
OPENING_SQUARE=134
CLOSING_SQUARE=135
CARET=136
UNDERLINE=137
TILDE=138
DOUBLE_QUOTE=139

View File

@ -254,6 +254,20 @@ tableaddr_spec { AddressSpec as; } :
as.at = AddressSpec::INTERFACE_NAME;
as.address = LT(0)->getText();
}
(
COLON
(
NETWORK
{
as.at = AddressSpec::INTERFACE_NETWORK;
}
|
BROADCAST
{
as.at = AddressSpec::INTERFACE_BROADCAST;
}
)
)?
|
SELF
{
@ -554,6 +568,20 @@ host { AddressSpec as; } :
as.at = AddressSpec::INTERFACE_NAME;
as.address = LT(0)->getText();
}
(
COLON
(
NETWORK
{
as.at = AddressSpec::INTERFACE_NETWORK;
}
|
BROADCAST
{
as.at = AddressSpec::INTERFACE_BROADCAST;
}
)
)?
|
SELF
{
@ -959,6 +987,9 @@ tokens
ANY = "any";
ALL = "all";
USER = "user";
NETWORK = "network";
BROADCAST = "broadcast";
PEER = "peer";
PORT = "port";