see #2394 matching icmp types and codes by name explicitly to avoid conflicts where the same keyword (e.g. "skip") is used in different rules of the grammar; see #2464 added test case for "set timeout" commands

This commit is contained in:
Vadim Kurland
2011-06-02 16:13:23 -07:00
parent b86900cc54
commit 68a29785da
15 changed files with 1574 additions and 650 deletions
+8 -2
View File
@@ -888,8 +888,14 @@ void Importer::addMessageToLog(const std::string &msg)
void Importer::addMessageToLog(const QString &msg)
{
QString log_line("%1: %2\n");
*logger << log_line.arg(getCurrentLineNumber()).arg(msg).toUtf8().constData();
if (getCurrentLineNumber() >= 0)
{
QString log_line("%1: %2\n");
*logger << log_line.arg(getCurrentLineNumber()).arg(msg).toUtf8().constData();
} else
{
*logger << msg.toUtf8().constData();
}
}
void Importer::addStandardImportComment(FWObject *obj,
+20 -15
View File
@@ -1013,24 +1013,29 @@ Firewall* PFImporter::finalize()
timeout_activation_names["frag"] = "pf_do_timeout_frag";
timeout_activation_names["interval"] = "pf_do_timeout_interval";
if (timeouts.size() > 0)
{
setCurrentLineNumber(-1);
addMessageToLog(QObject::tr("Configuring timeouts:"));
list<str_tuple>::iterator it;
for (it=timeouts.begin(); it!=timeouts.end(); ++it)
{
string name = it->first;
bool ok = false;
int value = QString(it->second.c_str()).toInt(&ok);
list<str_tuple>::iterator it;
for (it=timeouts.begin(); it!=timeouts.end(); ++it)
{
string name = it->first;
bool ok = false;
int value = QString(it->second.c_str()).toInt(&ok);
qDebug() << "Timeout " << name.c_str() << "=" << value;
addMessageToLog(QString("%1=%2").arg(name.c_str()).arg(value));
if (timeout_activation_names.count(name) == 0)
{
error_tracker->registerError(
QObject::tr("Unknown timeout name %1").arg(name.c_str()));
} else
{
options->setBool(timeout_activation_names[name], true);
options->setInt(timeout_option_names[name], value);
if (timeout_activation_names.count(name) == 0)
{
addMessageToLog(
QObject::tr("Error: Unknown timeout name %1").arg(name.c_str()));
} else
{
options->setBool(timeout_activation_names[name], true);
options->setInt(timeout_option_names[name], value);
}
}
}
+325 -259
View File
@@ -1,4 +1,4 @@
/* $ANTLR 2.7.7 (20090306): "pf.g" -> "PFCfgLexer.cpp"$ */
/* $ANTLR 2.7.7 (20100319): "pf.g" -> "PFCfgLexer.cpp"$ */
#line 43 "pf.g"
// gets inserted before the antlr generated includes in the cpp
@@ -44,138 +44,192 @@ PFCfgLexer::PFCfgLexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& st
void PFCfgLexer::initLiterals()
{
literals["vrrp"] = 115;
literals["other.single"] = 37;
literals["critical"] = 150;
literals["ospf"] = 113;
literals["rdp"] = 107;
literals["disable"] = 157;
literals["return-rst"] = 87;
literals["scrub"] = 48;
literals["source-hash"] = 78;
literals["optimization"] = 14;
literals["bitmask"] = 76;
literals["ipsec"] = 140;
literals["inet"] = 99;
literals["pcp"] = 142;
literals["emergencies"] = 152;
literals["debugging"] = 151;
literals["limit"] = 15;
literals["hex-key"] = 79;
literals["persist"] = 52;
literals["snp"] = 146;
literals["reassemble"] = 24;
literals["block-policy"] = 17;
literals["other.first"] = 36;
literals["timeout"] = 12;
literals["tcp.closed"] = 30;
literals["badhead"] = 175;
literals["notifications"] = 209;
literals["state-policy"] = 18;
literals["to"] = 96;
literals["flags"] = 124;
literals["isis"] = 117;
literals["icmp6-type"] = 127;
literals["const"] = 53;
literals["return"] = 86;
literals["pptp"] = 144;
literals["interval"] = 40;
literals["udp.single"] = 32;
literals["pass"] = 67;
literals["no"] = 65;
literals["esp"] = 110;
literals["routersol"] = 134;
literals["reply-to"] = 123;
literals["icmp.first"] = 34;
literals["string-key"] = 80;
literals["gre"] = 109;
literals["pass"] = 67;
literals["scrub"] = 48;
literals["warnings"] = 210;
literals["skip"] = 22;
literals["timeout"] = 12;
literals["eigrp"] = 112;
literals["icmp-type"] = 125;
literals["transit"] = 173;
literals["inet"] = 99;
literals["network"] = 59;
literals["photuris"] = 150;
literals["igmp"] = 104;
literals["unreach"] = 128;
literals["range"] = 202;
literals["rsvp"] = 108;
literals["debugging"] = 205;
literals["host-tos"] = 163;
literals["paramprob"] = 136;
literals["user"] = 95;
literals["interface"] = 191;
literals["adaptive.end"] = 43;
literals["limit"] = 15;
literals["state-defaults"] = 19;
literals["hex-key"] = 79;
literals["net-unk"] = 157;
literals["antispoof"] = 8;
literals["udp.single"] = 32;
literals["inforeq"] = 139;
literals["ipv6-here"] = 147;
literals["redir"] = 130;
literals["static-port"] = 69;
literals["igrp"] = 139;
literals["common-adv"] = 172;
literals["loginterface"] = 16;
literals["ip"] = 102;
literals["mobregreq"] = 148;
literals["ospf"] = 113;
literals["proto-unr"] = 153;
literals["peer"] = 61;
literals["inforep"] = 140;
literals["errors"] = 207;
literals["any"] = 120;
literals["mobregrep"] = 149;
literals["label"] = 188;
literals["pptp"] = 198;
literals["synproxy"] = 186;
literals["debug"] = 23;
literals["alerts"] = 203;
literals["all"] = 94;
literals["state"] = 187;
literals["tag"] = 183;
literals["in"] = 91;
literals["file"] = 55;
literals["nos"] = 195;
literals["ipv6-where"] = 146;
literals["require-order"] = 20;
literals["udp"] = 106;
literals["sticky-address"] = 82;
literals["return-icmp"] = 89;
literals["redir-tos-net"] = 169;
literals["pim"] = 197;
literals["emergencies"] = 206;
literals["squench"] = 129;
literals["disable"] = 211;
literals["flags"] = 124;
literals["tcp"] = 105;
literals["net-tos"] = 162;
literals["reassemble"] = 24;
literals["adaptive.start"] = 42;
literals["frag"] = 39;
literals["port"] = 73;
literals["icmp"] = 103;
literals["to"] = 96;
literals["return-rst"] = 87;
literals["normal-adv"] = 171;
literals["optimization"] = 14;
literals["log"] = 93;
literals["snp"] = 200;
literals["broadcast"] = 60;
literals["icmp6-type"] = 181;
literals["code"] = 126;
literals["src.track"] = 41;
literals["routeradv"] = 133;
literals["other.single"] = 37;
literals["bitmask"] = 76;
literals["maskreq"] = 141;
literals["ipip"] = 114;
literals["tcp.closed"] = 30;
literals["block"] = 84;
literals["udp.first"] = 31;
literals["badlen"] = 177;
literals["tcp.first"] = 25;
literals["host-unr"] = 152;
literals["ah"] = 111;
literals["modulate"] = 185;
literals["interval"] = 40;
literals["maskrep"] = 142;
literals["ruleset-optimization"] = 13;
literals["trace"] = 143;
literals["rip"] = 199;
literals["urpf-failed"] = 119;
literals["set"] = 11;
literals["source-hash"] = 78;
literals["critical"] = 204;
literals["quit"] = 190;
literals["icmp.error"] = 35;
literals["const"] = 53;
literals["altq"] = 9;
literals["tcp.closing"] = 28;
literals["port-unr"] = 154;
literals["table"] = 49;
literals["redir-tos-host"] = 170;
literals["fingerprints"] = 21;
literals["return"] = 86;
literals["optmiss"] = 176;
literals["keep"] = 184;
literals["net-prohib"] = 160;
literals["inet6"] = 100;
literals["from"] = 118;
literals["tcp.finwait"] = 29;
literals["pim"] = 143;
literals["tagged"] = 128;
literals["tcp.opening"] = 26;
literals["rsvp"] = 108;
literals["route-to"] = 122;
literals["nos"] = 141;
literals["quit"] = 136;
literals["peer"] = 61;
literals["icmp-type"] = 125;
literals["exit"] = 135;
literals["icmp.error"] = 35;
literals["modulate"] = 131;
literals["nat"] = 66;
literals["loginterface"] = 16;
literals["range"] = 148;
literals["urpf-failed"] = 119;
literals["out"] = 92;
literals["queue"] = 10;
literals["gre"] = 109;
literals["set"] = 11;
literals["require-order"] = 20;
literals["tcp.first"] = 25;
literals["other.multiple"] = 38;
literals["warnings"] = 156;
literals["ah"] = 111;
literals["host"] = 147;
literals["src.track"] = 41;
literals["interface"] = 137;
literals["rip"] = 145;
literals["icmp6"] = 138;
literals["broadcast"] = 60;
literals["notifications"] = 155;
literals["file"] = 55;
literals["network"] = 59;
literals["synproxy"] = 132;
literals["round-robin"] = 81;
literals["altq"] = 9;
literals["any"] = 120;
literals["esp"] = 110;
literals["state-defaults"] = 19;
literals["alerts"] = 149;
literals["all"] = 94;
literals["proto"] = 101;
literals["vrrp"] = 115;
literals["drop"] = 85;
literals["return-icmp"] = 89;
literals["inet6"] = 100;
literals["ruleset-optimization"] = 13;
literals["inactive"] = 158;
literals["label"] = 134;
literals["no-route"] = 121;
literals["udp"] = 106;
literals["udp.multiple"] = 33;
literals["reply-to"] = 123;
literals["l2tp"] = 116;
literals["isolate"] = 159;
literals["timereq"] = 137;
literals["icmp6"] = 192;
literals["echoreq"] = 132;
literals["tcp.established"] = 27;
literals["tag"] = 129;
literals["port"] = 73;
literals["code"] = 126;
literals["ip"] = 102;
literals["adaptive.start"] = 42;
literals["debug"] = 23;
literals["table"] = 49;
literals["eigrp"] = 112;
literals["errors"] = 153;
literals["sticky-address"] = 82;
literals["ipip"] = 114;
literals["antispoof"] = 8;
literals["decrypt-fail"] = 180;
literals["mobredir"] = 145;
literals["other.first"] = 36;
literals["ipsec"] = 194;
literals["no-route"] = 121;
literals["random"] = 77;
literals["binat"] = 83;
literals["igmp"] = 104;
literals["on"] = 98;
literals["fingerprints"] = 21;
literals["state"] = 133;
literals["string-key"] = 80;
literals["udp.first"] = 31;
literals["log"] = 93;
literals["proto"] = 101;
literals["adaptive.end"] = 43;
literals["rdr"] = 70;
literals["informational"] = 154;
literals["srcfail"] = 156;
literals["self"] = 62;
literals["in"] = 91;
literals["frag"] = 39;
literals["keep"] = 130;
literals["block"] = 84;
literals["skip"] = 22;
literals["tcp.closing"] = 28;
literals["l2tp"] = 116;
literals["timerep"] = 138;
literals["host-preced"] = 165;
literals["host"] = 201;
literals["echorep"] = 127;
literals["other.multiple"] = 38;
literals["althost"] = 131;
literals["udp.multiple"] = 33;
literals["cutoff-preced"] = 166;
literals["redir-host"] = 168;
literals["rdr"] = 70;
literals["tagged"] = 182;
literals["on"] = 98;
literals["round-robin"] = 81;
literals["pcp"] = 196;
literals["block-policy"] = 17;
literals["unknown-ind"] = 178;
literals["persist"] = 52;
literals["redir-net"] = 167;
literals["filter-prohib"] = 164;
literals["nat"] = 66;
literals["informational"] = 208;
literals["needfrag"] = 155;
literals["tcp.opening"] = 26;
literals["igrp"] = 193;
literals["quick"] = 97;
literals["user"] = 95;
literals["icmp.first"] = 34;
literals["icmp"] = 103;
literals["tcp"] = 105;
literals["timex"] = 135;
literals["host-unk"] = 158;
literals["route-to"] = 122;
literals["dataconv"] = 144;
literals["rdp"] = 107;
literals["net-unr"] = 151;
literals["queue"] = 10;
literals["isis"] = 117;
literals["reassemb"] = 174;
literals["inactive"] = 212;
literals["out"] = 92;
literals["auth-fail"] = 179;
literals["exit"] = 189;
literals["host-prohib"] = 161;
}
ANTLR_USE_NAMESPACE(antlr)RefToken PFCfgLexer::nextToken()
@@ -483,11 +537,11 @@ void PFCfgLexer::mLINE_COMMENT(bool _createToken) {
}
}
else {
goto _loop222;
goto _loop226;
}
}
_loop222:;
_loop226:;
} // ( ... )*
mNEWLINE(false);
if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
@@ -519,9 +573,9 @@ void PFCfgLexer::mNEWLINE(bool _createToken) {
}
if ( inputState->guessing==0 ) {
#line 1612 "pf.g"
#line 1733 "pf.g"
newline();
#line 525 "PFCfgLexer.cpp"
#line 579 "PFCfgLexer.cpp"
}
if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
_token = makeToken(_ttype);
@@ -600,9 +654,9 @@ void PFCfgLexer::mWhitespace(bool _createToken) {
}
}
if ( inputState->guessing==0 ) {
#line 1607 "pf.g"
#line 1728 "pf.g"
_ttype = ANTLR_USE_NAMESPACE(antlr)Token::SKIP;
#line 606 "PFCfgLexer.cpp"
#line 660 "PFCfgLexer.cpp"
}
if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
_token = makeToken(_ttype);
@@ -827,10 +881,10 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
_ttype = NUMBER_ADDRESS_OR_WORD;
ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
bool synPredMatched260 = false;
bool synPredMatched264 = false;
if (((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2))) && (_tokenSet_3.member(LA(3))))) {
int _m260 = mark();
synPredMatched260 = true;
int _m264 = mark();
synPredMatched264 = true;
inputState->guessing++;
try {
{
@@ -839,60 +893,60 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
}
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
synPredMatched260 = false;
synPredMatched264 = false;
}
rewind(_m260);
rewind(_m264);
inputState->guessing--;
}
if ( synPredMatched260 ) {
if ( synPredMatched264 ) {
{
bool synPredMatched265 = false;
bool synPredMatched269 = false;
if (((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2))) && (_tokenSet_3.member(LA(3))))) {
int _m265 = mark();
synPredMatched265 = true;
int _m269 = mark();
synPredMatched269 = true;
inputState->guessing++;
try {
{
{ // ( ... )+
int _cnt264=0;
int _cnt268=0;
for (;;) {
if ((_tokenSet_2.member(LA(1)))) {
mNUM_HEX_4DIGIT(false);
match(':' /* charlit */ );
}
else {
if ( _cnt264>=1 ) { goto _loop264; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt268>=1 ) { goto _loop268; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt264++;
_cnt268++;
}
_loop264:;
_loop268:;
} // ( ... )+
match(':' /* charlit */ );
}
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
synPredMatched265 = false;
synPredMatched269 = false;
}
rewind(_m265);
rewind(_m269);
inputState->guessing--;
}
if ( synPredMatched265 ) {
if ( synPredMatched269 ) {
{
{ // ( ... )+
int _cnt268=0;
int _cnt272=0;
for (;;) {
if ((_tokenSet_2.member(LA(1)))) {
mNUM_HEX_4DIGIT(false);
match(':' /* charlit */ );
}
else {
if ( _cnt268>=1 ) { goto _loop268; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt272>=1 ) { goto _loop272; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt268++;
_cnt272++;
}
_loop268:;
_loop272:;
} // ( ... )+
match(':' /* charlit */ );
{
@@ -905,11 +959,11 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
mNUM_HEX_4DIGIT(false);
}
else {
goto _loop271;
goto _loop275;
}
}
_loop271:;
_loop275:;
} // ( ... )*
}
else {
@@ -918,34 +972,34 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
}
}
if ( inputState->guessing==0 ) {
#line 1660 "pf.g"
#line 1781 "pf.g"
_ttype = IPV6;
#line 924 "PFCfgLexer.cpp"
#line 978 "PFCfgLexer.cpp"
}
}
else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2))) && (_tokenSet_3.member(LA(3)))) {
{
mNUM_HEX_4DIGIT(false);
{ // ( ... )+
int _cnt274=0;
int _cnt278=0;
for (;;) {
if ((LA(1) == 0x3a /* ':' */ )) {
match(':' /* charlit */ );
mNUM_HEX_4DIGIT(false);
}
else {
if ( _cnt274>=1 ) { goto _loop274; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt278>=1 ) { goto _loop278; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt274++;
_cnt278++;
}
_loop274:;
_loop278:;
} // ( ... )+
}
if ( inputState->guessing==0 ) {
#line 1662 "pf.g"
#line 1783 "pf.g"
_ttype = IPV6;
#line 949 "PFCfgLexer.cpp"
#line 1003 "PFCfgLexer.cpp"
}
}
else {
@@ -955,10 +1009,10 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
}
}
else {
bool synPredMatched276 = false;
bool synPredMatched280 = false;
if (((LA(1) == 0x3a /* ':' */ ) && (LA(2) == 0x3a /* ':' */ ) && (_tokenSet_2.member(LA(3))))) {
int _m276 = mark();
synPredMatched276 = true;
int _m280 = mark();
synPredMatched280 = true;
inputState->guessing++;
try {
{
@@ -968,12 +1022,12 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
}
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
synPredMatched276 = false;
synPredMatched280 = false;
}
rewind(_m276);
rewind(_m280);
inputState->guessing--;
}
if ( synPredMatched276 ) {
if ( synPredMatched280 ) {
match(':' /* charlit */ );
match(':' /* charlit */ );
mNUM_HEX_4DIGIT(false);
@@ -984,23 +1038,23 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
mNUM_HEX_4DIGIT(false);
}
else {
goto _loop278;
goto _loop282;
}
}
_loop278:;
_loop282:;
} // ( ... )*
if ( inputState->guessing==0 ) {
#line 1666 "pf.g"
#line 1787 "pf.g"
_ttype = IPV6;
#line 997 "PFCfgLexer.cpp"
#line 1051 "PFCfgLexer.cpp"
}
}
else {
bool synPredMatched280 = false;
bool synPredMatched284 = false;
if ((((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ )) && (_tokenSet_4.member(LA(2))) && (_tokenSet_4.member(LA(3))))) {
int _m280 = mark();
synPredMatched280 = true;
int _m284 = mark();
synPredMatched284 = true;
inputState->guessing++;
try {
{
@@ -1011,12 +1065,12 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
}
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
synPredMatched280 = false;
synPredMatched284 = false;
}
rewind(_m280);
rewind(_m284);
inputState->guessing--;
}
if ( synPredMatched280 ) {
if ( synPredMatched284 ) {
{
mNUM_3DIGIT(false);
match('.' /* charlit */ );
@@ -1027,159 +1081,133 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
mNUM_3DIGIT(false);
}
if ( inputState->guessing==0 ) {
#line 1684 "pf.g"
#line 1805 "pf.g"
_ttype = IPV4;
#line 1033 "PFCfgLexer.cpp"
#line 1087 "PFCfgLexer.cpp"
}
}
else {
bool synPredMatched287 = false;
bool synPredMatched291 = false;
if ((((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ )) && (_tokenSet_4.member(LA(2))) && (_tokenSet_4.member(LA(3))))) {
int _m287 = mark();
synPredMatched287 = true;
int _m291 = mark();
synPredMatched291 = true;
inputState->guessing++;
try {
{
{ // ( ... )+
int _cnt284=0;
int _cnt288=0;
for (;;) {
if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
mDIGIT(false);
}
else {
if ( _cnt284>=1 ) { goto _loop284; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt288>=1 ) { goto _loop288; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt284++;
_cnt288++;
}
_loop284:;
_loop288:;
} // ( ... )+
match('.' /* charlit */ );
{ // ( ... )+
int _cnt286=0;
int _cnt290=0;
for (;;) {
if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
mDIGIT(false);
}
else {
if ( _cnt286>=1 ) { goto _loop286; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt290>=1 ) { goto _loop290; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt286++;
_cnt290++;
}
_loop286:;
_loop290:;
} // ( ... )+
}
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
synPredMatched287 = false;
synPredMatched291 = false;
}
rewind(_m287);
rewind(_m291);
inputState->guessing--;
}
if ( synPredMatched287 ) {
if ( synPredMatched291 ) {
{
{ // ( ... )+
int _cnt290=0;
int _cnt294=0;
for (;;) {
if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
mDIGIT(false);
}
else {
if ( _cnt290>=1 ) { goto _loop290; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt294>=1 ) { goto _loop294; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt290++;
_cnt294++;
}
_loop290:;
_loop294:;
} // ( ... )+
match('.' /* charlit */ );
{ // ( ... )+
int _cnt292=0;
int _cnt296=0;
for (;;) {
if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
mDIGIT(false);
}
else {
if ( _cnt292>=1 ) { goto _loop292; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt296>=1 ) { goto _loop296; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt292++;
_cnt296++;
}
_loop292:;
_loop296:;
} // ( ... )+
}
if ( inputState->guessing==0 ) {
#line 1687 "pf.g"
#line 1808 "pf.g"
_ttype = NUMBER;
#line 1116 "PFCfgLexer.cpp"
#line 1170 "PFCfgLexer.cpp"
}
}
else {
bool synPredMatched250 = false;
bool synPredMatched254 = false;
if (((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2))) && (true))) {
int _m250 = mark();
synPredMatched250 = true;
int _m254 = mark();
synPredMatched254 = true;
inputState->guessing++;
try {
{
{ // ( ... )+
int _cnt249=0;
int _cnt253=0;
for (;;) {
if ((_tokenSet_2.member(LA(1)))) {
mHEX_DIGIT(false);
}
else {
if ( _cnt249>=1 ) { goto _loop249; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt253>=1 ) { goto _loop253; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt249++;
_cnt253++;
}
_loop249:;
_loop253:;
} // ( ... )+
match(':' /* charlit */ );
}
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
synPredMatched250 = false;
synPredMatched254 = false;
}
rewind(_m250);
rewind(_m254);
inputState->guessing--;
}
if ( synPredMatched250 ) {
if ( synPredMatched254 ) {
{
{
{ // ( ... )+
int _cnt254=0;
for (;;) {
if ((_tokenSet_2.member(LA(1)))) {
mHEX_DIGIT(false);
}
else {
if ( _cnt254>=1 ) { goto _loop254; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt254++;
}
_loop254:;
} // ( ... )+
{ // ( ... )+
int _cnt258=0;
for (;;) {
if ((LA(1) == 0x3a /* ':' */ )) {
match(':' /* charlit */ );
{ // ( ... )*
for (;;) {
if ((_tokenSet_2.member(LA(1)))) {
mHEX_DIGIT(false);
}
else {
goto _loop257;
}
}
_loop257:;
} // ( ... )*
if ((_tokenSet_2.member(LA(1)))) {
mHEX_DIGIT(false);
}
else {
if ( _cnt258>=1 ) { goto _loop258; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
@@ -1189,11 +1217,37 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
}
_loop258:;
} // ( ... )+
{ // ( ... )+
int _cnt262=0;
for (;;) {
if ((LA(1) == 0x3a /* ':' */ )) {
match(':' /* charlit */ );
{ // ( ... )*
for (;;) {
if ((_tokenSet_2.member(LA(1)))) {
mHEX_DIGIT(false);
}
else {
goto _loop261;
}
}
_loop261:;
} // ( ... )*
}
else {
if ( _cnt262>=1 ) { goto _loop262; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt262++;
}
_loop262:;
} // ( ... )+
}
if ( inputState->guessing==0 ) {
#line 1651 "pf.g"
#line 1772 "pf.g"
_ttype = IPV6;
#line 1197 "PFCfgLexer.cpp"
#line 1251 "PFCfgLexer.cpp"
}
}
}
@@ -1201,38 +1255,38 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
match(':' /* charlit */ );
match(':' /* charlit */ );
if ( inputState->guessing==0 ) {
#line 1668 "pf.g"
#line 1789 "pf.g"
_ttype = IPV6;
#line 1207 "PFCfgLexer.cpp"
#line 1261 "PFCfgLexer.cpp"
}
}
else if ((LA(1) == 0x3a /* ':' */ ) && (true)) {
match(':' /* charlit */ );
if ( inputState->guessing==0 ) {
#line 1670 "pf.g"
#line 1791 "pf.g"
_ttype = COLON;
#line 1215 "PFCfgLexer.cpp"
#line 1269 "PFCfgLexer.cpp"
}
}
else if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ )) && (true) && (true)) {
{ // ( ... )+
int _cnt294=0;
int _cnt298=0;
for (;;) {
if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
mDIGIT(false);
}
else {
if ( _cnt294>=1 ) { goto _loop294; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
if ( _cnt298>=1 ) { goto _loop298; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
}
_cnt294++;
_cnt298++;
}
_loop294:;
_loop298:;
} // ( ... )+
if ( inputState->guessing==0 ) {
#line 1689 "pf.g"
#line 1810 "pf.g"
_ttype = INT_CONST;
#line 1236 "PFCfgLexer.cpp"
#line 1290 "PFCfgLexer.cpp"
}
}
else if ((_tokenSet_5.member(LA(1))) && (true) && (true)) {
@@ -1448,16 +1502,16 @@ void PFCfgLexer::mNUMBER_ADDRESS_OR_WORD(bool _createToken) {
}
default:
{
goto _loop297;
goto _loop301;
}
}
}
_loop297:;
_loop301:;
} // ( ... )*
if ( inputState->guessing==0 ) {
#line 1702 "pf.g"
#line 1823 "pf.g"
_ttype = WORD;
#line 1461 "PFCfgLexer.cpp"
#line 1515 "PFCfgLexer.cpp"
}
}
else {
@@ -1485,11 +1539,11 @@ void PFCfgLexer::mSTRING(bool _createToken) {
matchNot('\"' /* charlit */ );
}
else {
goto _loop300;
goto _loop304;
}
}
_loop300:;
_loop304:;
} // ( ... )*
match('\"' /* charlit */ );
if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
@@ -1899,7 +1953,11 @@ const unsigned long PFCfgLexer::_tokenSet_0_data_[] = { 4294958072UL, 1UL, 0UL,
// 0x82 0x83 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f
// 0x90 0x91 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c 0x9d
// 0x9e 0x9f 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa 0xab
// 0xac 0xad 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7
// 0xac 0xad 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9
// 0xba 0xbb 0xbc 0xbd 0xbe 0xbf 0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc6 0xc7
// 0xc8 0xc9 0xca 0xcb 0xcc 0xcd 0xce 0xcf 0xd0 0xd1 0xd2 0xd3 0xd4 0xd5
// 0xd6 0xd7 0xd8 0xd9 0xda 0xdb 0xdc 0xdd 0xde 0xdf 0xe0 0xe1 0xe2 0xe3
// 0xe4 0xe5 0xe6 0xe7 0xe8 0xe9 0xea 0xeb 0xec 0xed
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
@@ -1910,7 +1968,11 @@ const unsigned long PFCfgLexer::_tokenSet_1_data_[] = { 4294958072UL, 4294967295
// 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x91
// 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c 0x9d 0x9e 0x9f
// 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa 0xab 0xac 0xad
// 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7
// 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9 0xba 0xbb
// 0xbc 0xbd 0xbe 0xbf 0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc6 0xc7 0xc8 0xc9
// 0xca 0xcb 0xcc 0xcd 0xce 0xcf 0xd0 0xd1 0xd2 0xd3 0xd4 0xd5 0xd6 0xd7
// 0xd8 0xd9 0xda 0xdb 0xdc 0xdd 0xde 0xdf 0xe0 0xe1 0xe2 0xe3 0xe4 0xe5
// 0xe6 0xe7 0xe8 0xe9 0xea 0xeb 0xec 0xed
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgLexer::_tokenSet_1(_tokenSet_1_data_,16);
const unsigned long PFCfgLexer::_tokenSet_2_data_[] = { 0UL, 67043328UL, 126UL, 126UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f
@@ -1934,6 +1996,10 @@ const unsigned long PFCfgLexer::_tokenSet_6_data_[] = { 4294967288UL, 4294967291
// 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x91
// 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c 0x9d 0x9e 0x9f
// 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa 0xab 0xac 0xad
// 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7
// 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9 0xba 0xbb
// 0xbc 0xbd 0xbe 0xbf 0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc6 0xc7 0xc8 0xc9
// 0xca 0xcb 0xcc 0xcd 0xce 0xcf 0xd0 0xd1 0xd2 0xd3 0xd4 0xd5 0xd6 0xd7
// 0xd8 0xd9 0xda 0xdb 0xdc 0xdd 0xde 0xdf 0xe0 0xe1 0xe2 0xe3 0xe4 0xe5
// 0xe6 0xe7 0xe8 0xe9 0xea 0xeb 0xec 0xed
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgLexer::_tokenSet_6(_tokenSet_6_data_,16);
+1 -1
View File
@@ -9,7 +9,7 @@
#line 11 "PFCfgLexer.hpp"
#include <antlr/config.hpp>
/* $ANTLR 2.7.7 (20090306): "pf.g" -> "PFCfgLexer.hpp"$ */
/* $ANTLR 2.7.7 (20100319): "pf.g" -> "PFCfgLexer.hpp"$ */
#include <antlr/CommonToken.hpp>
#include <antlr/InputBuffer.hpp>
#include <antlr/BitSet.hpp>
+823 -237
View File
@@ -1,4 +1,4 @@
/* $ANTLR 2.7.7 (20090306): "pf.g" -> "PFCfgParser.cpp"$ */
/* $ANTLR 2.7.7 (20100319): "pf.g" -> "PFCfgParser.cpp"$ */
#line 43 "pf.g"
// gets inserted before the antlr generated includes in the cpp
@@ -2197,7 +2197,7 @@ void PFCfgParser::tagged() {
case EXLAMATION:
{
match(EXLAMATION);
#line 1295 "pf.g"
#line 1416 "pf.g"
importer->tagged_neg = true;
#line 2203 "PFCfgParser.cpp"
break;
@@ -2214,7 +2214,7 @@ void PFCfgParser::tagged() {
}
match(TAGGED);
match(WORD);
#line 1297 "pf.g"
#line 1418 "pf.g"
importer->tagged = LT(0)->getText();
@@ -2232,7 +2232,7 @@ void PFCfgParser::tag_clause() {
try { // for error handling
match(TAG);
match(WORD);
#line 1304 "pf.g"
#line 1425 "pf.g"
importer->tag = LT(0)->getText();
@@ -2614,7 +2614,7 @@ void PFCfgParser::port_def() {
}
}
}
#line 1443 "pf.g"
#line 1564 "pf.g"
importer->tmp_port_def = LT(0)->getText();
@@ -3025,9 +3025,38 @@ void PFCfgParser::block_return() {
match(OPENING_PAREN);
{
switch ( LA(1)) {
case WORD:
case 151:
case 152:
case 153:
case 154:
case LITERAL_needfrag:
case LITERAL_srcfail:
case 157:
case 158:
case LITERAL_isolate:
case 160:
case 161:
case 162:
case 163:
case 164:
case 165:
case 166:
case 167:
case 168:
case 169:
case 170:
case 171:
case 172:
case LITERAL_transit:
case LITERAL_reassemb:
case LITERAL_badhead:
case LITERAL_optmiss:
case LITERAL_badlen:
case 178:
case 179:
case 180:
{
match(WORD);
icmp_code_by_name();
break;
}
case INT_CONST:
@@ -3043,7 +3072,7 @@ void PFCfgParser::block_return() {
}
#line 855 "pf.g"
importer->block_action_params.push_back(LT(0)->getText());
#line 3047 "PFCfgParser.cpp"
#line 3076 "PFCfgParser.cpp"
{
switch ( LA(1)) {
case COMMA:
@@ -3051,9 +3080,38 @@ void PFCfgParser::block_return() {
match(COMMA);
{
switch ( LA(1)) {
case WORD:
case 151:
case 152:
case 153:
case 154:
case LITERAL_needfrag:
case LITERAL_srcfail:
case 157:
case 158:
case LITERAL_isolate:
case 160:
case 161:
case 162:
case 163:
case 164:
case 165:
case 166:
case 167:
case 168:
case 169:
case 170:
case 171:
case 172:
case LITERAL_transit:
case LITERAL_reassemb:
case LITERAL_badhead:
case LITERAL_optmiss:
case LITERAL_badlen:
case 178:
case 179:
case 180:
{
match(WORD);
icmp_code_by_name();
break;
}
case INT_CONST:
@@ -3072,7 +3130,7 @@ void PFCfgParser::block_return() {
importer->error_tracker->registerError(
QString("Import of \"block return-icmp (icmp_code, icmp6_code)\" is not supported"));
#line 3076 "PFCfgParser.cpp"
#line 3134 "PFCfgParser.cpp"
break;
}
case CLOSING_PAREN:
@@ -3134,7 +3192,7 @@ void PFCfgParser::block_return() {
QString("Import of \"block return-icmp6\" is not supported"));
importer->block_action_params.push_back("return-icmp");
#line 3138 "PFCfgParser.cpp"
#line 3196 "PFCfgParser.cpp"
break;
}
default:
@@ -3150,6 +3208,175 @@ void PFCfgParser::block_return() {
}
}
void PFCfgParser::icmp_code_by_name() {
Tracer traceInOut(this, "icmp_code_by_name");
try { // for error handling
{
switch ( LA(1)) {
case 151:
{
match(151);
break;
}
case 152:
{
match(152);
break;
}
case 153:
{
match(153);
break;
}
case 154:
{
match(154);
break;
}
case LITERAL_needfrag:
{
match(LITERAL_needfrag);
break;
}
case LITERAL_srcfail:
{
match(LITERAL_srcfail);
break;
}
case 157:
{
match(157);
break;
}
case 158:
{
match(158);
break;
}
case LITERAL_isolate:
{
match(LITERAL_isolate);
break;
}
case 160:
{
match(160);
break;
}
case 161:
{
match(161);
break;
}
case 162:
{
match(162);
break;
}
case 163:
{
match(163);
break;
}
case 164:
{
match(164);
break;
}
case 165:
{
match(165);
break;
}
case 166:
{
match(166);
break;
}
case 167:
{
match(167);
break;
}
case 168:
{
match(168);
break;
}
case 169:
{
match(169);
break;
}
case 170:
{
match(170);
break;
}
case 171:
{
match(171);
break;
}
case 172:
{
match(172);
break;
}
case LITERAL_transit:
{
match(LITERAL_transit);
break;
}
case LITERAL_reassemb:
{
match(LITERAL_reassemb);
break;
}
case LITERAL_badhead:
{
match(LITERAL_badhead);
break;
}
case LITERAL_optmiss:
{
match(LITERAL_optmiss);
break;
}
case LITERAL_badlen:
{
match(LITERAL_badlen);
break;
}
case 178:
{
match(178);
break;
}
case 179:
{
match(179);
break;
}
case 180:
{
match(180);
break;
}
default:
{
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
}
}
}
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_24);
}
}
void PFCfgParser::direction() {
Tracer traceInOut(this, "direction");
@@ -3176,11 +3403,11 @@ void PFCfgParser::direction() {
importer->direction = LT(0)->getText();
#line 3180 "PFCfgParser.cpp"
#line 3407 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_24);
recover(ex,_tokenSet_25);
}
}
@@ -3193,11 +3420,11 @@ void PFCfgParser::quick() {
importer->quick = true;
#line 3197 "PFCfgParser.cpp"
#line 3424 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_25);
recover(ex,_tokenSet_26);
}
}
@@ -3224,7 +3451,7 @@ void PFCfgParser::route() {
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_26);
recover(ex,_tokenSet_27);
}
}
@@ -3235,7 +3462,7 @@ void PFCfgParser::filteropts() {
filteropt();
{ // ( ... )*
for (;;) {
if ((_tokenSet_27.member(LA(1)))) {
if ((_tokenSet_28.member(LA(1)))) {
{
switch ( LA(1)) {
case COMMA:
@@ -3292,7 +3519,7 @@ void PFCfgParser::logopts() {
match(COMMA);
#line 905 "pf.g"
importer->logopts += ",";
#line 3296 "PFCfgParser.cpp"
#line 3523 "PFCfgParser.cpp"
logopt();
}
else {
@@ -3333,7 +3560,7 @@ void PFCfgParser::logopt() {
importer->logopts += LT(0)->getText();
#line 3337 "PFCfgParser.cpp"
#line 3564 "PFCfgParser.cpp"
break;
}
default:
@@ -3344,7 +3571,7 @@ void PFCfgParser::logopt() {
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_28);
recover(ex,_tokenSet_29);
}
}
@@ -3352,7 +3579,7 @@ void PFCfgParser::ifspec() {
Tracer traceInOut(this, "ifspec");
#line 926 "pf.g"
InterfaceSpec is;
#line 3356 "PFCfgParser.cpp"
#line 3583 "PFCfgParser.cpp"
try { // for error handling
{
@@ -3362,7 +3589,7 @@ void PFCfgParser::ifspec() {
match(EXLAMATION);
#line 927 "pf.g"
is.neg = true;
#line 3366 "PFCfgParser.cpp"
#line 3593 "PFCfgParser.cpp"
break;
}
case WORD:
@@ -3382,11 +3609,11 @@ void PFCfgParser::ifspec() {
importer->iface_group.push_back(is);
importer->newInterface(is.name);
#line 3386 "PFCfgParser.cpp"
#line 3613 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_29);
recover(ex,_tokenSet_30);
}
}
@@ -3479,7 +3706,7 @@ void PFCfgParser::proto_def() {
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_30);
recover(ex,_tokenSet_31);
}
}
@@ -3579,11 +3806,11 @@ void PFCfgParser::proto_name() {
importer->proto_list.push_back(LT(0)->getText());
#line 3583 "PFCfgParser.cpp"
#line 3810 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_30);
recover(ex,_tokenSet_31);
}
}
@@ -3596,11 +3823,11 @@ void PFCfgParser::proto_number() {
importer->proto_list.push_back(LT(0)->getText());
#line 3600 "PFCfgParser.cpp"
#line 3827 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_30);
recover(ex,_tokenSet_31);
}
}
@@ -3612,7 +3839,7 @@ void PFCfgParser::proto_list() {
proto_def();
{ // ( ... )*
for (;;) {
if ((_tokenSet_31.member(LA(1)))) {
if ((_tokenSet_32.member(LA(1)))) {
{
switch ( LA(1)) {
case COMMA:
@@ -3660,7 +3887,7 @@ void PFCfgParser::proto_list() {
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_30);
recover(ex,_tokenSet_31);
}
}
@@ -3704,7 +3931,7 @@ void PFCfgParser::hosts_from() {
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_32);
recover(ex,_tokenSet_33);
}
}
@@ -3780,7 +4007,7 @@ void PFCfgParser::src_hosts_part() {
AddressSpec(AddressSpec::SPECIAL_ADDRESS, false,
"urpf-failed", ""));
#line 3784 "PFCfgParser.cpp"
#line 4011 "PFCfgParser.cpp"
break;
}
default:
@@ -3795,11 +4022,11 @@ void PFCfgParser::src_hosts_part() {
importer->src_group.splice(importer->src_group.begin(),
importer->tmp_group);
#line 3799 "PFCfgParser.cpp"
#line 4026 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_33);
recover(ex,_tokenSet_34);
}
}
@@ -3828,13 +4055,13 @@ void PFCfgParser::src_port_part() {
case IPV6:
{
match(IPV6);
#line 1356 "pf.g"
#line 1477 "pf.g"
PortSpec ps;
ps.setFromPortRange(LT(0)->getText());
importer->tmp_port_group.push_back(ps);
#line 3838 "PFCfgParser.cpp"
#line 4065 "PFCfgParser.cpp"
break;
}
default:
@@ -3843,16 +4070,16 @@ void PFCfgParser::src_port_part() {
}
}
}
#line 1362 "pf.g"
#line 1483 "pf.g"
importer->src_port_group.splice(importer->src_port_group.begin(),
importer->tmp_port_group);
#line 3852 "PFCfgParser.cpp"
#line 4079 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_32);
recover(ex,_tokenSet_33);
}
}
@@ -3867,11 +4094,11 @@ void PFCfgParser::dst_hosts_part() {
importer->dst_group.splice(importer->dst_group.begin(),
importer->tmp_group);
#line 3871 "PFCfgParser.cpp"
#line 4098 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_34);
recover(ex,_tokenSet_35);
}
}
@@ -3900,13 +4127,13 @@ void PFCfgParser::dst_port_part() {
case IPV6:
{
match(IPV6);
#line 1378 "pf.g"
#line 1499 "pf.g"
PortSpec ps;
ps.setFromPortRange(LT(0)->getText());
importer->tmp_port_group.push_back(ps);
#line 3910 "PFCfgParser.cpp"
#line 4137 "PFCfgParser.cpp"
break;
}
default:
@@ -3915,12 +4142,12 @@ void PFCfgParser::dst_port_part() {
}
}
}
#line 1384 "pf.g"
#line 1505 "pf.g"
importer->dst_port_group.splice(importer->dst_port_group.begin(),
importer->tmp_port_group);
#line 3924 "PFCfgParser.cpp"
#line 4151 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
@@ -3941,7 +4168,7 @@ void PFCfgParser::common_hosts_part() {
importer->tmp_group.push_back(
AddressSpec(AddressSpec::ANY, false, "0.0.0.0", "0.0.0.0"));
#line 3945 "PFCfgParser.cpp"
#line 4172 "PFCfgParser.cpp"
break;
}
case NO_ROUTE:
@@ -3952,7 +4179,7 @@ void PFCfgParser::common_hosts_part() {
importer->tmp_group.push_back(
AddressSpec(AddressSpec::SPECIAL_ADDRESS, false, "no-route", ""));
#line 3956 "PFCfgParser.cpp"
#line 4183 "PFCfgParser.cpp"
break;
}
case WORD:
@@ -3979,7 +4206,7 @@ void PFCfgParser::common_hosts_part() {
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_33);
recover(ex,_tokenSet_34);
}
}
@@ -3989,7 +4216,7 @@ void PFCfgParser::host() {
ANTLR_USE_NAMESPACE(antlr)RefToken in = ANTLR_USE_NAMESPACE(antlr)nullToken;
#line 1054 "pf.g"
AddressSpec as;
#line 3993 "PFCfgParser.cpp"
#line 4220 "PFCfgParser.cpp"
try { // for error handling
{
@@ -3999,7 +4226,7 @@ void PFCfgParser::host() {
match(EXLAMATION);
#line 1055 "pf.g"
as.neg = true;
#line 4003 "PFCfgParser.cpp"
#line 4230 "PFCfgParser.cpp"
break;
}
case WORD:
@@ -4028,7 +4255,7 @@ void PFCfgParser::host() {
as.at = AddressSpec::INTERFACE_OR_HOST_NAME;
as.address = LT(0)->getText();
#line 4032 "PFCfgParser.cpp"
#line 4259 "PFCfgParser.cpp"
{
switch ( LA(1)) {
case COLON:
@@ -4043,7 +4270,7 @@ void PFCfgParser::host() {
as.at = AddressSpec::INTERFACE_NETWORK;
#line 4047 "PFCfgParser.cpp"
#line 4274 "PFCfgParser.cpp"
break;
}
case BROADCAST:
@@ -4053,7 +4280,7 @@ void PFCfgParser::host() {
as.at = AddressSpec::INTERFACE_BROADCAST;
#line 4057 "PFCfgParser.cpp"
#line 4284 "PFCfgParser.cpp"
break;
}
case PEER:
@@ -4064,7 +4291,7 @@ void PFCfgParser::host() {
importer->error_tracker->registerError(
QString("import of 'interface:peer' is not supported."));
#line 4068 "PFCfgParser.cpp"
#line 4295 "PFCfgParser.cpp"
break;
}
case INT_CONST:
@@ -4075,7 +4302,7 @@ void PFCfgParser::host() {
importer->error_tracker->registerError(
QString("import of 'interface:0' is not supported."));
#line 4079 "PFCfgParser.cpp"
#line 4306 "PFCfgParser.cpp"
break;
}
default:
@@ -4123,7 +4350,7 @@ void PFCfgParser::host() {
as.at = AddressSpec::SPECIAL_ADDRESS;
as.address = "self";
#line 4127 "PFCfgParser.cpp"
#line 4354 "PFCfgParser.cpp"
break;
}
case IPV6:
@@ -4135,7 +4362,7 @@ void PFCfgParser::host() {
QString("IPv6 import is not supported. "));
consumeUntil(NEWLINE);
#line 4139 "PFCfgParser.cpp"
#line 4366 "PFCfgParser.cpp"
break;
}
case IPV4:
@@ -4146,7 +4373,7 @@ void PFCfgParser::host() {
as.at = AddressSpec::HOST_ADDRESS;
as.address = LT(0)->getText();
#line 4150 "PFCfgParser.cpp"
#line 4377 "PFCfgParser.cpp"
{
switch ( LA(1)) {
case SLASH:
@@ -4156,7 +4383,7 @@ void PFCfgParser::host() {
as.at = AddressSpec::NETWORK_ADDRESS;
#line 4160 "PFCfgParser.cpp"
#line 4387 "PFCfgParser.cpp"
{
switch ( LA(1)) {
case IPV4:
@@ -4179,7 +4406,7 @@ void PFCfgParser::host() {
as.netmask = LT(0)->getText();
#line 4183 "PFCfgParser.cpp"
#line 4410 "PFCfgParser.cpp"
break;
}
case NEWLINE:
@@ -4222,7 +4449,7 @@ void PFCfgParser::host() {
as.at = AddressSpec::TABLE;
as.address = tn->getText();
#line 4226 "PFCfgParser.cpp"
#line 4453 "PFCfgParser.cpp"
break;
}
case OPENING_PAREN:
@@ -4237,7 +4464,7 @@ void PFCfgParser::host() {
as.at = AddressSpec::INTERFACE_OR_HOST_NAME;
as.address = in->getText();
#line 4241 "PFCfgParser.cpp"
#line 4468 "PFCfgParser.cpp"
break;
}
default:
@@ -4250,11 +4477,11 @@ void PFCfgParser::host() {
importer->tmp_group.push_back(as);
#line 4254 "PFCfgParser.cpp"
#line 4481 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_35);
recover(ex,_tokenSet_36);
}
}
@@ -4281,7 +4508,7 @@ void PFCfgParser::host_list() {
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_33);
recover(ex,_tokenSet_34);
}
}
@@ -4312,11 +4539,11 @@ void PFCfgParser::route_to() {
importer->route_type = PFImporter::ROUTE_TO;
#line 4316 "PFCfgParser.cpp"
#line 4543 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_26);
recover(ex,_tokenSet_27);
}
}
@@ -4347,11 +4574,11 @@ void PFCfgParser::reply_to() {
importer->route_type = PFImporter::REPLY_TO;
#line 4351 "PFCfgParser.cpp"
#line 4578 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_26);
recover(ex,_tokenSet_27);
}
}
@@ -4363,14 +4590,14 @@ void PFCfgParser::routehost() {
ANTLR_USE_NAMESPACE(antlr)RefToken nm6 = ANTLR_USE_NAMESPACE(antlr)nullToken;
#line 1166 "pf.g"
RouteSpec rs;
#line 4367 "PFCfgParser.cpp"
#line 4594 "PFCfgParser.cpp"
try { // for error handling
match(OPENING_PAREN);
match(WORD);
#line 1168 "pf.g"
rs.iface = LT(0)->getText();
#line 4374 "PFCfgParser.cpp"
#line 4601 "PFCfgParser.cpp"
{
switch ( LA(1)) {
case IPV4:
@@ -4442,12 +4669,12 @@ void PFCfgParser::routehost() {
importer->route_group.push_back(rs);
}
#line 4446 "PFCfgParser.cpp"
#line 4673 "PFCfgParser.cpp"
match(CLOSING_PAREN);
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_36);
recover(ex,_tokenSet_37);
}
}
@@ -4490,7 +4717,7 @@ void PFCfgParser::routehost_list() {
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_26);
recover(ex,_tokenSet_27);
}
}
@@ -4551,7 +4778,7 @@ void PFCfgParser::filteropt() {
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_37);
recover(ex,_tokenSet_38);
}
}
@@ -4572,7 +4799,7 @@ void PFCfgParser::tcp_flags() {
importer->flags_check = "none";
importer->flags_mask = "none";
#line 4576 "PFCfgParser.cpp"
#line 4803 "PFCfgParser.cpp"
break;
}
case WORD:
@@ -4639,7 +4866,7 @@ void PFCfgParser::tcp_flags() {
else
importer->flags_mask = "all";
#line 4643 "PFCfgParser.cpp"
#line 4870 "PFCfgParser.cpp"
break;
}
default:
@@ -4651,7 +4878,7 @@ void PFCfgParser::tcp_flags() {
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_37);
recover(ex,_tokenSet_38);
}
}
@@ -4662,8 +4889,32 @@ void PFCfgParser::icmp_type() {
match(ICMP_TYPE);
{
switch ( LA(1)) {
case WORD:
case LITERAL_skip:
case INT_CONST:
case LITERAL_echorep:
case LITERAL_unreach:
case LITERAL_squench:
case LITERAL_redir:
case LITERAL_althost:
case LITERAL_echoreq:
case LITERAL_routeradv:
case LITERAL_routersol:
case LITERAL_timex:
case LITERAL_paramprob:
case LITERAL_timereq:
case LITERAL_timerep:
case LITERAL_inforeq:
case LITERAL_inforep:
case LITERAL_maskreq:
case LITERAL_maskrep:
case LITERAL_trace:
case LITERAL_dataconv:
case LITERAL_mobredir:
case 146:
case 147:
case LITERAL_mobregreq:
case LITERAL_mobregrep:
case LITERAL_photuris:
{
icmp_type_code();
break;
@@ -4682,7 +4933,7 @@ void PFCfgParser::icmp_type() {
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_37);
recover(ex,_tokenSet_38);
}
}
@@ -4691,17 +4942,17 @@ void PFCfgParser::icmp6_type() {
try { // for error handling
match(ICMP6_TYPE);
#line 1287 "pf.g"
#line 1408 "pf.g"
importer->error_tracker->registerError(
QString("ICMP6 import is not supported. "));
consumeUntil(NEWLINE);
#line 4701 "PFCfgParser.cpp"
#line 4952 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_37);
recover(ex,_tokenSet_38);
}
}
@@ -4737,16 +4988,16 @@ void PFCfgParser::state() {
}
}
}
#line 1319 "pf.g"
#line 1440 "pf.g"
importer->state_op = LT(0)->getText();
#line 4745 "PFCfgParser.cpp"
#line 4996 "PFCfgParser.cpp"
match(STATE);
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_37);
recover(ex,_tokenSet_38);
}
}
@@ -4760,36 +5011,36 @@ void PFCfgParser::queue() {
case WORD:
{
match(WORD);
#line 1328 "pf.g"
#line 1449 "pf.g"
importer->queue += LT(0)->getText();
#line 4766 "PFCfgParser.cpp"
#line 5017 "PFCfgParser.cpp"
break;
}
case OPENING_PAREN:
{
match(OPENING_PAREN);
match(WORD);
#line 1331 "pf.g"
#line 1452 "pf.g"
importer->queue += LT(0)->getText();
#line 4775 "PFCfgParser.cpp"
#line 5026 "PFCfgParser.cpp"
{ // ( ... )*
for (;;) {
if ((LA(1) == COMMA)) {
match(COMMA);
#line 1333 "pf.g"
#line 1454 "pf.g"
importer->queue += ",";
#line 4782 "PFCfgParser.cpp"
#line 5033 "PFCfgParser.cpp"
match(WORD);
#line 1334 "pf.g"
#line 1455 "pf.g"
importer->queue += LT(0)->getText();
#line 4786 "PFCfgParser.cpp"
#line 5037 "PFCfgParser.cpp"
}
else {
goto _loop200;
goto _loop204;
}
}
_loop200:;
_loop204:;
} // ( ... )*
match(CLOSING_PAREN);
break;
@@ -4803,7 +5054,7 @@ void PFCfgParser::queue() {
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_37);
recover(ex,_tokenSet_38);
}
}
@@ -4816,7 +5067,7 @@ void PFCfgParser::label() {
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_37);
recover(ex,_tokenSet_38);
}
}
@@ -4824,17 +5075,41 @@ void PFCfgParser::icmp_type_code() {
Tracer traceInOut(this, "icmp_type_code");
#line 1255 "pf.g"
IcmpSpec is;
#line 4828 "PFCfgParser.cpp"
#line 5079 "PFCfgParser.cpp"
try { // for error handling
{
switch ( LA(1)) {
case WORD:
case LITERAL_skip:
case LITERAL_echorep:
case LITERAL_unreach:
case LITERAL_squench:
case LITERAL_redir:
case LITERAL_althost:
case LITERAL_echoreq:
case LITERAL_routeradv:
case LITERAL_routersol:
case LITERAL_timex:
case LITERAL_paramprob:
case LITERAL_timereq:
case LITERAL_timerep:
case LITERAL_inforeq:
case LITERAL_inforep:
case LITERAL_maskreq:
case LITERAL_maskrep:
case LITERAL_trace:
case LITERAL_dataconv:
case LITERAL_mobredir:
case 146:
case 147:
case LITERAL_mobregreq:
case LITERAL_mobregrep:
case LITERAL_photuris:
{
match(WORD);
icmp_type_by_name();
#line 1257 "pf.g"
is.icmp_type_name = LT(0)->getText();
#line 4838 "PFCfgParser.cpp"
#line 5113 "PFCfgParser.cpp"
break;
}
case INT_CONST:
@@ -4842,7 +5117,7 @@ void PFCfgParser::icmp_type_code() {
match(INT_CONST);
#line 1259 "pf.g"
is.icmp_type_int = LT(0)->getText();
#line 4846 "PFCfgParser.cpp"
#line 5121 "PFCfgParser.cpp"
break;
}
default:
@@ -4858,20 +5133,49 @@ void PFCfgParser::icmp_type_code() {
match(ICMP_CODE);
{
switch ( LA(1)) {
case WORD:
case 151:
case 152:
case 153:
case 154:
case LITERAL_needfrag:
case LITERAL_srcfail:
case 157:
case 158:
case LITERAL_isolate:
case 160:
case 161:
case 162:
case 163:
case 164:
case 165:
case 166:
case 167:
case 168:
case 169:
case 170:
case 171:
case 172:
case LITERAL_transit:
case LITERAL_reassemb:
case LITERAL_badhead:
case LITERAL_optmiss:
case LITERAL_badlen:
case 178:
case 179:
case 180:
{
match(WORD);
#line 1264 "pf.g"
icmp_code_by_name();
#line 1265 "pf.g"
is.icmp_code_name = LT(0)->getText();
#line 4867 "PFCfgParser.cpp"
#line 5171 "PFCfgParser.cpp"
break;
}
case INT_CONST:
{
match(INT_CONST);
#line 1266 "pf.g"
#line 1267 "pf.g"
is.icmp_code_int = LT(0)->getText();
#line 4875 "PFCfgParser.cpp"
#line 5179 "PFCfgParser.cpp"
break;
}
default:
@@ -4883,8 +5187,8 @@ void PFCfgParser::icmp_type_code() {
break;
}
case NEWLINE:
case WORD:
case QUEUE:
case LITERAL_skip:
case INT_CONST:
case COMMA:
case CLOSING_BRACE:
@@ -4892,6 +5196,30 @@ void PFCfgParser::icmp_type_code() {
case NO:
case FLAGS:
case ICMP_TYPE:
case LITERAL_echorep:
case LITERAL_unreach:
case LITERAL_squench:
case LITERAL_redir:
case LITERAL_althost:
case LITERAL_echoreq:
case LITERAL_routeradv:
case LITERAL_routersol:
case LITERAL_timex:
case LITERAL_paramprob:
case LITERAL_timereq:
case LITERAL_timerep:
case LITERAL_inforeq:
case LITERAL_inforep:
case LITERAL_maskreq:
case LITERAL_maskrep:
case LITERAL_trace:
case LITERAL_dataconv:
case LITERAL_mobredir:
case 146:
case 147:
case LITERAL_mobregreq:
case LITERAL_mobregrep:
case LITERAL_photuris:
case ICMP6_TYPE:
case TAGGED:
case TAG:
@@ -4908,15 +5236,15 @@ void PFCfgParser::icmp_type_code() {
}
}
}
#line 1269 "pf.g"
#line 1270 "pf.g"
importer->icmp_type_code_group.push_back(is);
#line 4916 "PFCfgParser.cpp"
#line 5244 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_38);
recover(ex,_tokenSet_39);
}
}
@@ -4928,7 +5256,7 @@ void PFCfgParser::icmp_list() {
icmp_type_code();
{ // ( ... )*
for (;;) {
if ((LA(1) == WORD || LA(1) == INT_CONST || LA(1) == COMMA)) {
if ((_tokenSet_40.member(LA(1)))) {
{
switch ( LA(1)) {
case COMMA:
@@ -4936,8 +5264,32 @@ void PFCfgParser::icmp_list() {
match(COMMA);
break;
}
case WORD:
case LITERAL_skip:
case INT_CONST:
case LITERAL_echorep:
case LITERAL_unreach:
case LITERAL_squench:
case LITERAL_redir:
case LITERAL_althost:
case LITERAL_echoreq:
case LITERAL_routeradv:
case LITERAL_routersol:
case LITERAL_timex:
case LITERAL_paramprob:
case LITERAL_timereq:
case LITERAL_timerep:
case LITERAL_inforeq:
case LITERAL_inforep:
case LITERAL_maskreq:
case LITERAL_maskrep:
case LITERAL_trace:
case LITERAL_dataconv:
case LITERAL_mobredir:
case 146:
case 147:
case LITERAL_mobregreq:
case LITERAL_mobregrep:
case LITERAL_photuris:
{
break;
}
@@ -4950,25 +5302,169 @@ void PFCfgParser::icmp_list() {
icmp_type_code();
}
else {
goto _loop190;
goto _loop194;
}
}
_loop190:;
_loop194:;
} // ( ... )*
match(CLOSING_BRACE);
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_37);
recover(ex,_tokenSet_38);
}
}
void PFCfgParser::icmp_type_by_name() {
Tracer traceInOut(this, "icmp_type_by_name");
try { // for error handling
{
switch ( LA(1)) {
case LITERAL_echorep:
{
match(LITERAL_echorep);
break;
}
case LITERAL_unreach:
{
match(LITERAL_unreach);
break;
}
case LITERAL_squench:
{
match(LITERAL_squench);
break;
}
case LITERAL_redir:
{
match(LITERAL_redir);
break;
}
case LITERAL_althost:
{
match(LITERAL_althost);
break;
}
case LITERAL_echoreq:
{
match(LITERAL_echoreq);
break;
}
case LITERAL_routeradv:
{
match(LITERAL_routeradv);
break;
}
case LITERAL_routersol:
{
match(LITERAL_routersol);
break;
}
case LITERAL_timex:
{
match(LITERAL_timex);
break;
}
case LITERAL_paramprob:
{
match(LITERAL_paramprob);
break;
}
case LITERAL_timereq:
{
match(LITERAL_timereq);
break;
}
case LITERAL_timerep:
{
match(LITERAL_timerep);
break;
}
case LITERAL_inforeq:
{
match(LITERAL_inforeq);
break;
}
case LITERAL_inforep:
{
match(LITERAL_inforep);
break;
}
case LITERAL_maskreq:
{
match(LITERAL_maskreq);
break;
}
case LITERAL_maskrep:
{
match(LITERAL_maskrep);
break;
}
case LITERAL_trace:
{
match(LITERAL_trace);
break;
}
case LITERAL_dataconv:
{
match(LITERAL_dataconv);
break;
}
case LITERAL_mobredir:
{
match(LITERAL_mobredir);
break;
}
case 146:
{
match(146);
break;
}
case 147:
{
match(147);
break;
}
case LITERAL_mobregreq:
{
match(LITERAL_mobregreq);
break;
}
case LITERAL_mobregrep:
{
match(LITERAL_mobregrep);
break;
}
case LITERAL_skip:
{
match(LITERAL_skip);
break;
}
case LITERAL_photuris:
{
match(LITERAL_photuris);
break;
}
default:
{
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
}
}
}
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_41);
}
}
void PFCfgParser::port_op() {
Tracer traceInOut(this, "port_op");
#line 1416 "pf.g"
#line 1537 "pf.g"
PortSpec ps;
#line 4972 "PFCfgParser.cpp"
#line 5468 "PFCfgParser.cpp"
try { // for error handling
{
@@ -4979,41 +5475,41 @@ void PFCfgParser::port_op() {
case EXLAMATION:
{
unary_port_op();
#line 1418 "pf.g"
#line 1539 "pf.g"
ps.port_op = importer->tmp_port_op;
#line 4985 "PFCfgParser.cpp"
#line 5481 "PFCfgParser.cpp"
port_def();
#line 1420 "pf.g"
#line 1541 "pf.g"
ps.port1 = importer->tmp_port_def;
ps.port2 = importer->tmp_port_def;
#line 4992 "PFCfgParser.cpp"
#line 5488 "PFCfgParser.cpp"
break;
}
case WORD:
case INT_CONST:
{
port_def();
#line 1426 "pf.g"
#line 1547 "pf.g"
ps.port1 = importer->tmp_port_def;
ps.port2 = ps.port1;
ps.port_op = "=";
#line 5005 "PFCfgParser.cpp"
#line 5501 "PFCfgParser.cpp"
{
if ((LA(1) == LESS_THAN || LA(1) == GREATER_THAN || LA(1) == COLON) && (_tokenSet_39.member(LA(2)))) {
if ((LA(1) == LESS_THAN || LA(1) == GREATER_THAN || LA(1) == COLON) && (_tokenSet_42.member(LA(2)))) {
binary_port_op();
#line 1432 "pf.g"
#line 1553 "pf.g"
ps.port_op = importer->tmp_port_op;
#line 5011 "PFCfgParser.cpp"
#line 5507 "PFCfgParser.cpp"
port_def();
#line 1433 "pf.g"
#line 1554 "pf.g"
ps.port2 = LT(0)->getText();
#line 5015 "PFCfgParser.cpp"
#line 5511 "PFCfgParser.cpp"
}
else if ((_tokenSet_40.member(LA(1))) && (_tokenSet_41.member(LA(2)))) {
else if ((_tokenSet_43.member(LA(1))) && (_tokenSet_44.member(LA(2)))) {
}
else {
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
@@ -5028,15 +5524,15 @@ void PFCfgParser::port_op() {
}
}
}
#line 1436 "pf.g"
#line 1557 "pf.g"
importer->tmp_port_group.push_back(ps);
#line 5036 "PFCfgParser.cpp"
#line 5532 "PFCfgParser.cpp"
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_40);
recover(ex,_tokenSet_43);
}
}
@@ -5048,7 +5544,7 @@ void PFCfgParser::port_op_list() {
port_op();
{ // ( ... )*
for (;;) {
if ((_tokenSet_42.member(LA(1)))) {
if ((_tokenSet_45.member(LA(1)))) {
{
switch ( LA(1)) {
case COMMA:
@@ -5074,17 +5570,17 @@ void PFCfgParser::port_op_list() {
port_op();
}
else {
goto _loop218;
goto _loop222;
}
}
_loop218:;
_loop222:;
} // ( ... )*
match(CLOSING_BRACE);
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_32);
recover(ex,_tokenSet_33);
}
}
@@ -5097,46 +5593,46 @@ void PFCfgParser::unary_port_op() {
case EQUAL:
{
match(EQUAL);
#line 1392 "pf.g"
#line 1513 "pf.g"
importer->tmp_port_op = "=";
#line 5103 "PFCfgParser.cpp"
#line 5599 "PFCfgParser.cpp"
break;
}
case EXLAMATION:
{
match(EXLAMATION);
match(EQUAL);
#line 1394 "pf.g"
#line 1515 "pf.g"
importer->tmp_port_op = "!=";
#line 5112 "PFCfgParser.cpp"
#line 5608 "PFCfgParser.cpp"
break;
}
default:
if ((LA(1) == LESS_THAN) && (LA(2) == WORD || LA(2) == INT_CONST)) {
match(LESS_THAN);
#line 1396 "pf.g"
#line 1517 "pf.g"
importer->tmp_port_op = "<";
#line 5120 "PFCfgParser.cpp"
#line 5616 "PFCfgParser.cpp"
}
else if ((LA(1) == LESS_THAN) && (LA(2) == EQUAL)) {
match(LESS_THAN);
match(EQUAL);
#line 1398 "pf.g"
#line 1519 "pf.g"
importer->tmp_port_op = "<=";
#line 5127 "PFCfgParser.cpp"
#line 5623 "PFCfgParser.cpp"
}
else if ((LA(1) == GREATER_THAN) && (LA(2) == WORD || LA(2) == INT_CONST)) {
match(GREATER_THAN);
#line 1400 "pf.g"
#line 1521 "pf.g"
importer->tmp_port_op = ">";
#line 5133 "PFCfgParser.cpp"
#line 5629 "PFCfgParser.cpp"
}
else if ((LA(1) == GREATER_THAN) && (LA(2) == EQUAL)) {
match(GREATER_THAN);
match(EQUAL);
#line 1402 "pf.g"
#line 1523 "pf.g"
importer->tmp_port_op = ">=";
#line 5140 "PFCfgParser.cpp"
#line 5636 "PFCfgParser.cpp"
}
else {
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
@@ -5146,7 +5642,7 @@ void PFCfgParser::unary_port_op() {
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_43);
recover(ex,_tokenSet_46);
}
}
@@ -5160,26 +5656,26 @@ void PFCfgParser::binary_port_op() {
{
match(LESS_THAN);
match(GREATER_THAN);
#line 1408 "pf.g"
#line 1529 "pf.g"
importer->tmp_port_op = "<>";
#line 5166 "PFCfgParser.cpp"
#line 5662 "PFCfgParser.cpp"
break;
}
case GREATER_THAN:
{
match(GREATER_THAN);
match(LESS_THAN);
#line 1410 "pf.g"
#line 1531 "pf.g"
importer->tmp_port_op = "><";
#line 5175 "PFCfgParser.cpp"
#line 5671 "PFCfgParser.cpp"
break;
}
case COLON:
{
match(COLON);
#line 1412 "pf.g"
#line 1533 "pf.g"
importer->tmp_port_op = ":";
#line 5183 "PFCfgParser.cpp"
#line 5679 "PFCfgParser.cpp"
break;
}
default:
@@ -5191,7 +5687,7 @@ void PFCfgParser::binary_port_op() {
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
reportError(ex);
recover(ex,_tokenSet_43);
recover(ex,_tokenSet_46);
}
}
@@ -5326,6 +5822,60 @@ const char* PFCfgParser::tokenNames[] = {
"\"flags\"",
"\"icmp-type\"",
"\"code\"",
"\"echorep\"",
"\"unreach\"",
"\"squench\"",
"\"redir\"",
"\"althost\"",
"\"echoreq\"",
"\"routeradv\"",
"\"routersol\"",
"\"timex\"",
"\"paramprob\"",
"\"timereq\"",
"\"timerep\"",
"\"inforeq\"",
"\"inforep\"",
"\"maskreq\"",
"\"maskrep\"",
"\"trace\"",
"\"dataconv\"",
"\"mobredir\"",
"\"ipv6-where\"",
"\"ipv6-here\"",
"\"mobregreq\"",
"\"mobregrep\"",
"\"photuris\"",
"\"net-unr\"",
"\"host-unr\"",
"\"proto-unr\"",
"\"port-unr\"",
"\"needfrag\"",
"\"srcfail\"",
"\"net-unk\"",
"\"host-unk\"",
"\"isolate\"",
"\"net-prohib\"",
"\"host-prohib\"",
"\"net-tos\"",
"\"host-tos\"",
"\"filter-prohib\"",
"\"host-preced\"",
"\"cutoff-preced\"",
"\"redir-net\"",
"\"redir-host\"",
"\"redir-tos-net\"",
"\"redir-tos-host\"",
"\"normal-adv\"",
"\"common-adv\"",
"\"transit\"",
"\"reassemb\"",
"\"badhead\"",
"\"optmiss\"",
"\"badlen\"",
"\"unknown-ind\"",
"\"auth-fail\"",
"\"decrypt-fail\"",
"\"icmp6-type\"",
"\"tagged\"",
"\"tag\"",
@@ -5386,16 +5936,16 @@ const char* PFCfgParser::tokenNames[] = {
0
};
const unsigned long PFCfgParser::_tokenSet_0_data_[] = { 2UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_0_data_[] = { 2UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// EOF
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_0(_tokenSet_0_data_,6);
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_0(_tokenSet_0_data_,8);
const unsigned long PFCfgParser::_tokenSet_1_data_[] = { 3954UL, 196608UL, 1572942UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// EOF NEWLINE LINE_COMMENT WORD "antispoof" "altq" "queue" "set" "scrub"
// "table" "no" "nat" "pass" "rdr" "binat" "block"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_1(_tokenSet_1_data_,8);
const unsigned long PFCfgParser::_tokenSet_2_data_[] = { 64UL, 3254796288UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_2_data_[] = { 64UL, 3254796288UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// WORD COMMA EXLAMATION "self" IPV4
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_2(_tokenSet_2_data_,6);
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_2(_tokenSet_2_data_,8);
const unsigned long PFCfgParser::_tokenSet_3_data_[] = { 4261416818UL, 249855UL, 1572942UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// EOF NEWLINE LINE_COMMENT WORD "antispoof" "altq" "queue" "set" "tcp.first"
// "tcp.opening" "tcp.established" "tcp.closing" "tcp.finwait" "tcp.closed"
@@ -5404,39 +5954,39 @@ const unsigned long PFCfgParser::_tokenSet_3_data_[] = { 4261416818UL, 249855UL,
// "adaptive.end" COMMA CLOSING_BRACE "scrub" "table" "no" "nat" "pass"
// "rdr" "binat" "block"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_3(_tokenSet_3_data_,8);
const unsigned long PFCfgParser::_tokenSet_4_data_[] = { 4261412864UL, 20479UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_4_data_[] = { 4261412864UL, 20479UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// "tcp.first" "tcp.opening" "tcp.established" "tcp.closing" "tcp.finwait"
// "tcp.closed" "udp.first" "udp.single" "udp.multiple" "icmp.first" "icmp.error"
// "other.first" "other.single" "other.multiple" "frag" "interval" "src.track"
// "adaptive.start" "adaptive.end" COMMA
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_4(_tokenSet_4_data_,6);
const unsigned long PFCfgParser::_tokenSet_5_data_[] = { 64UL, 3254829056UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_4(_tokenSet_4_data_,8);
const unsigned long PFCfgParser::_tokenSet_5_data_[] = { 64UL, 3254829056UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// WORD COMMA CLOSING_BRACE EXLAMATION "self" IPV4
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_5(_tokenSet_5_data_,6);
const unsigned long PFCfgParser::_tokenSet_6_data_[] = { 1040UL, 33554432UL, 1073741842UL, 3158310975UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_5(_tokenSet_5_data_,8);
const unsigned long PFCfgParser::_tokenSet_6_data_[] = { 1040UL, 33554432UL, 1073741842UL, 1010827327UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "no" MINUS "all" "to" "quick" "on" "inet"
// "inet6" "proto" "from" "route-to" "reply-to" "flags" "icmp-type" "icmp6-type"
// "tagged" "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_6(_tokenSet_6_data_,12);
const unsigned long PFCfgParser::_tokenSet_7_data_[] = { 1040UL, 33554432UL, 1073741842UL, 3158310969UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_7_data_[] = { 1040UL, 33554432UL, 1073741842UL, 1010827321UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "no" MINUS "all" "to" "inet" "inet6" "proto"
// "from" "route-to" "reply-to" "flags" "icmp-type" "icmp6-type" "tagged"
// "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_7(_tokenSet_7_data_,12);
const unsigned long PFCfgParser::_tokenSet_8_data_[] = { 1040UL, 33554432UL, 1073741842UL, 2956984353UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_8_data_[] = { 1040UL, 33554432UL, 1073741842UL, 809500705UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "no" MINUS "all" "to" "proto" "from" "flags"
// "icmp-type" "icmp6-type" "tagged" "tag" "keep" "modulate" "synproxy"
// "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_8(_tokenSet_8_data_,12);
const unsigned long PFCfgParser::_tokenSet_9_data_[] = { 1040UL, 33554432UL, 1073741842UL, 2956984321UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_9_data_[] = { 1040UL, 33554432UL, 1073741842UL, 809500673UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "no" MINUS "all" "to" "from" "flags" "icmp-type"
// "icmp6-type" "tagged" "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_9(_tokenSet_9_data_,12);
const unsigned long PFCfgParser::_tokenSet_10_data_[] = { 1040UL, 33554432UL, 18UL, 2952790016UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_10_data_[] = { 1040UL, 33554432UL, 18UL, 805306368UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "no" MINUS "flags" "icmp-type" "icmp6-type"
// "tagged" "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_10(_tokenSet_10_data_,12);
const unsigned long PFCfgParser::_tokenSet_11_data_[] = { 1040UL, 33570816UL, 18UL, 2952790016UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_11_data_[] = { 1040UL, 33570816UL, 18UL, 805306368UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" COMMA EXLAMATION "no" MINUS "flags" "icmp-type" "icmp6-type"
// "tagged" "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_11(_tokenSet_11_data_,12);
@@ -5456,131 +6006,167 @@ const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_15(_tokenSet_15_da
const unsigned long PFCfgParser::_tokenSet_16_data_[] = { 16UL, 0UL, 32UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "static-port"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_16(_tokenSet_16_data_,8);
const unsigned long PFCfgParser::_tokenSet_17_data_[] = { 1232UL, 101502976UL, 159794UL, 2952790017UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_17_data_[] = { 1232UL, 101502976UL, 159794UL, 805306369UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE WORD EQUAL "queue" INT_CONST COMMA CLOSING_BRACE LESS_THAN GREATER_THAN
// EXLAMATION COLON "no" MINUS "static-port" "bitmask" "random" "source-hash"
// "round-robin" "to" "flags" "icmp-type" "icmp6-type" "tagged" "tag" "keep"
// "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_17(_tokenSet_17_data_,12);
const unsigned long PFCfgParser::_tokenSet_18_data_[] = { 1040UL, 33554432UL, 1073741826UL, 2956984321UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_18_data_[] = { 1040UL, 33554432UL, 1073741826UL, 809500673UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "no" "all" "to" "from" "flags" "icmp-type"
// "icmp6-type" "tagged" "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_18(_tokenSet_18_data_,12);
const unsigned long PFCfgParser::_tokenSet_19_data_[] = { 3954UL, 3272044544UL, 1574095UL, 3011510272UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// EOF NEWLINE LINE_COMMENT WORD "antispoof" "altq" "queue" "set" INT_CONST
// OPENING_BRACE COMMA "scrub" "table" LESS_THAN STRING EXLAMATION "self"
// IPV4 SLASH "no" "nat" "pass" "rdr" OPENING_PAREN IPV6 "binat" "block"
// "urpf-failed" "any" "no-route" "flags" "icmp-type" "icmp6-type" "tagged"
// "tag" "keep" "modulate" "synproxy" "state" "label"
const unsigned long PFCfgParser::_tokenSet_19_data_[] = { 4198258UL, 3272044544UL, 1574095UL, 3011510272UL, 8388607UL, 534773760UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// EOF NEWLINE LINE_COMMENT WORD "antispoof" "altq" "queue" "set" "skip"
// INT_CONST OPENING_BRACE COMMA "scrub" "table" LESS_THAN STRING EXLAMATION
// "self" IPV4 SLASH "no" "nat" "pass" "rdr" OPENING_PAREN IPV6 "binat"
// "block" "urpf-failed" "any" "no-route" "flags" "icmp-type" "echorep"
// "unreach" "squench" "redir" "althost" "echoreq" "routeradv" "routersol"
// "timex" "paramprob" "timereq" "timerep" "inforeq" "inforep" "maskreq"
// "maskrep" "trace" "dataconv" "mobredir" "ipv6-where" "ipv6-here" "mobregreq"
// "mobregrep" "photuris" "icmp6-type" "tagged" "tag" "keep" "modulate"
// "synproxy" "state" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_19(_tokenSet_19_data_,12);
const unsigned long PFCfgParser::_tokenSet_20_data_[] = { 1040UL, 33554432UL, 2UL, 2952790016UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_20_data_[] = { 1040UL, 33554432UL, 2UL, 805306368UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "no" "flags" "icmp-type" "icmp6-type" "tagged"
// "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_20(_tokenSet_20_data_,12);
const unsigned long PFCfgParser::_tokenSet_21_data_[] = { 3954UL, 50556928UL, 1573071UL, 2969567232UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// EOF NEWLINE LINE_COMMENT WORD "antispoof" "altq" "queue" "set" INT_CONST
// OPENING_BRACE COMMA "scrub" "table" STRING EXLAMATION SLASH "no" "nat"
// "pass" "rdr" OPENING_PAREN "binat" "block" "any" "flags" "icmp-type"
// "icmp6-type" "tagged" "tag" "keep" "modulate" "synproxy" "state" "label"
const unsigned long PFCfgParser::_tokenSet_21_data_[] = { 4198258UL, 50556928UL, 1573071UL, 2969567232UL, 8388607UL, 534773760UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// EOF NEWLINE LINE_COMMENT WORD "antispoof" "altq" "queue" "set" "skip"
// INT_CONST OPENING_BRACE COMMA "scrub" "table" STRING EXLAMATION SLASH
// "no" "nat" "pass" "rdr" OPENING_PAREN "binat" "block" "any" "flags"
// "icmp-type" "echorep" "unreach" "squench" "redir" "althost" "echoreq"
// "routeradv" "routersol" "timex" "paramprob" "timereq" "timerep" "inforeq"
// "inforep" "maskreq" "maskrep" "trace" "dataconv" "mobredir" "ipv6-where"
// "ipv6-here" "mobregreq" "mobregrep" "photuris" "icmp6-type" "tagged"
// "tag" "keep" "modulate" "synproxy" "state" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_21(_tokenSet_21_data_,12);
const unsigned long PFCfgParser::_tokenSet_22_data_[] = { 16UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_22_data_[] = { 16UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_22(_tokenSet_22_data_,6);
const unsigned long PFCfgParser::_tokenSet_23_data_[] = { 1040UL, 33554432UL, 2013265922UL, 3158310975UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_22(_tokenSet_22_data_,8);
const unsigned long PFCfgParser::_tokenSet_23_data_[] = { 1040UL, 33554432UL, 2013265922UL, 1010827327UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "no" "in" "out" "log" "all" "to" "quick"
// "on" "inet" "inet6" "proto" "from" "route-to" "reply-to" "flags" "icmp-type"
// "icmp6-type" "tagged" "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_23(_tokenSet_23_data_,12);
const unsigned long PFCfgParser::_tokenSet_24_data_[] = { 1040UL, 33554432UL, 1610612738UL, 3158310975UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_24_data_[] = { 4195344UL, 33607680UL, 258UL, 2952790016UL, 8388607UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" "skip" INT_CONST COMMA CLOSING_BRACE EXLAMATION "no"
// CLOSING_PAREN "flags" "icmp-type" "echorep" "unreach" "squench" "redir"
// "althost" "echoreq" "routeradv" "routersol" "timex" "paramprob" "timereq"
// "timerep" "inforeq" "inforep" "maskreq" "maskrep" "trace" "dataconv"
// "mobredir" "ipv6-where" "ipv6-here" "mobregreq" "mobregrep" "photuris"
// "icmp6-type" "tagged" "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_24(_tokenSet_24_data_,12);
const unsigned long PFCfgParser::_tokenSet_25_data_[] = { 1040UL, 33554432UL, 1610612738UL, 1010827327UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "no" "log" "all" "to" "quick" "on" "inet"
// "inet6" "proto" "from" "route-to" "reply-to" "flags" "icmp-type" "icmp6-type"
// "tagged" "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_24(_tokenSet_24_data_,12);
const unsigned long PFCfgParser::_tokenSet_25_data_[] = { 1040UL, 33554432UL, 1073741826UL, 3158310973UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_25(_tokenSet_25_data_,12);
const unsigned long PFCfgParser::_tokenSet_26_data_[] = { 1040UL, 33554432UL, 1073741826UL, 1010827325UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "no" "all" "to" "on" "inet" "inet6" "proto"
// "from" "route-to" "reply-to" "flags" "icmp-type" "icmp6-type" "tagged"
// "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_25(_tokenSet_25_data_,12);
const unsigned long PFCfgParser::_tokenSet_26_data_[] = { 1040UL, 33554432UL, 1073741826UL, 2956984377UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_26(_tokenSet_26_data_,12);
const unsigned long PFCfgParser::_tokenSet_27_data_[] = { 1040UL, 33554432UL, 1073741826UL, 809500729UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "no" "all" "to" "inet" "inet6" "proto" "from"
// "flags" "icmp-type" "icmp6-type" "tagged" "tag" "keep" "modulate" "synproxy"
// "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_26(_tokenSet_26_data_,12);
const unsigned long PFCfgParser::_tokenSet_27_data_[] = { 1024UL, 33570816UL, 2UL, 2952790016UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_27(_tokenSet_27_data_,12);
const unsigned long PFCfgParser::_tokenSet_28_data_[] = { 1024UL, 33570816UL, 2UL, 805306368UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// "queue" COMMA EXLAMATION "no" "flags" "icmp-type" "icmp6-type" "tagged"
// "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_27(_tokenSet_27_data_,12);
const unsigned long PFCfgParser::_tokenSet_28_data_[] = { 0UL, 16384UL, 256UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_28(_tokenSet_28_data_,12);
const unsigned long PFCfgParser::_tokenSet_29_data_[] = { 0UL, 16384UL, 256UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// COMMA CLOSING_PAREN
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_28(_tokenSet_28_data_,8);
const unsigned long PFCfgParser::_tokenSet_29_data_[] = { 1104UL, 33603584UL, 1073741842UL, 3158310969UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_29(_tokenSet_29_data_,8);
const unsigned long PFCfgParser::_tokenSet_30_data_[] = { 1104UL, 33603584UL, 1073741842UL, 1010827321UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE WORD "queue" COMMA CLOSING_BRACE EXLAMATION "no" MINUS "all"
// "to" "inet" "inet6" "proto" "from" "route-to" "reply-to" "flags" "icmp-type"
// "icmp6-type" "tagged" "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_29(_tokenSet_29_data_,12);
const unsigned long PFCfgParser::_tokenSet_30_data_[] = { 1040UL, 33615872UL, 1073741842UL, 2961178561UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_30(_tokenSet_30_data_,12);
const unsigned long PFCfgParser::_tokenSet_31_data_[] = { 1040UL, 33615872UL, 1073741842UL, 813694913UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" INT_CONST OPENING_BRACE COMMA CLOSING_BRACE EXLAMATION
// "no" MINUS "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" "keep" "modulate" "synproxy"
// "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_30(_tokenSet_30_data_,12);
const unsigned long PFCfgParser::_tokenSet_31_data_[] = { 0UL, 28672UL, 0UL, 4194240UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_31(_tokenSet_31_data_,12);
const unsigned long PFCfgParser::_tokenSet_32_data_[] = { 0UL, 28672UL, 0UL, 4194240UL, 0UL, 0UL, 0UL, 0UL };
// INT_CONST OPENING_BRACE COMMA "ip" "icmp" "igmp" "tcp" "udp" "rdp" "rsvp"
// "gre" "esp" "ah" "eigrp" "ospf" "ipip" "vrrp" "l2tp" "isis"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_31(_tokenSet_31_data_,8);
const unsigned long PFCfgParser::_tokenSet_32_data_[] = { 1040UL, 33554432UL, 18UL, 2952790017UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_32(_tokenSet_32_data_,8);
const unsigned long PFCfgParser::_tokenSet_33_data_[] = { 1040UL, 33554432UL, 18UL, 805306369UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "no" MINUS "to" "flags" "icmp-type" "icmp6-type"
// "tagged" "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_32(_tokenSet_32_data_,12);
const unsigned long PFCfgParser::_tokenSet_33_data_[] = { 1040UL, 33554432UL, 530UL, 2952790017UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_33(_tokenSet_33_data_,12);
const unsigned long PFCfgParser::_tokenSet_34_data_[] = { 1040UL, 33554432UL, 530UL, 805306369UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "no" MINUS "port" "to" "flags" "icmp-type"
// "icmp6-type" "tagged" "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_33(_tokenSet_33_data_,12);
const unsigned long PFCfgParser::_tokenSet_34_data_[] = { 1040UL, 33554432UL, 530UL, 2952790016UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_34(_tokenSet_34_data_,12);
const unsigned long PFCfgParser::_tokenSet_35_data_[] = { 1040UL, 33554432UL, 530UL, 805306368UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" EXLAMATION "no" MINUS "port" "flags" "icmp-type" "icmp6-type"
// "tagged" "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_34(_tokenSet_34_data_,12);
const unsigned long PFCfgParser::_tokenSet_35_data_[] = { 1040UL, 33603584UL, 530UL, 2952790017UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_35(_tokenSet_35_data_,12);
const unsigned long PFCfgParser::_tokenSet_36_data_[] = { 1040UL, 33603584UL, 530UL, 805306369UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" COMMA CLOSING_BRACE EXLAMATION "no" MINUS "port" "to"
// "flags" "icmp-type" "icmp6-type" "tagged" "tag" "keep" "modulate" "synproxy"
// "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_35(_tokenSet_35_data_,12);
const unsigned long PFCfgParser::_tokenSet_36_data_[] = { 1040UL, 33603584UL, 1073741954UL, 2956984377UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_36(_tokenSet_36_data_,12);
const unsigned long PFCfgParser::_tokenSet_37_data_[] = { 1040UL, 33603584UL, 1073741954UL, 809500729UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" COMMA CLOSING_BRACE EXLAMATION "no" OPENING_PAREN "all"
// "to" "inet" "inet6" "proto" "from" "flags" "icmp-type" "icmp6-type"
// "tagged" "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_36(_tokenSet_36_data_,12);
const unsigned long PFCfgParser::_tokenSet_37_data_[] = { 1040UL, 33570816UL, 2UL, 2952790016UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_37(_tokenSet_37_data_,12);
const unsigned long PFCfgParser::_tokenSet_38_data_[] = { 1040UL, 33570816UL, 2UL, 805306368UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" COMMA EXLAMATION "no" "flags" "icmp-type" "icmp6-type"
// "tagged" "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_37(_tokenSet_37_data_,12);
const unsigned long PFCfgParser::_tokenSet_38_data_[] = { 1104UL, 33607680UL, 2UL, 2952790016UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE WORD "queue" INT_CONST COMMA CLOSING_BRACE EXLAMATION "no" "flags"
// "icmp-type" "icmp6-type" "tagged" "tag" "keep" "modulate" "synproxy"
// "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_38(_tokenSet_38_data_,12);
const unsigned long PFCfgParser::_tokenSet_39_data_[] = { 64UL, 790528UL, 0UL, 0UL, 0UL, 0UL };
const unsigned long PFCfgParser::_tokenSet_39_data_[] = { 4195344UL, 33607680UL, 2UL, 2952790016UL, 8388607UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" "skip" INT_CONST COMMA CLOSING_BRACE EXLAMATION "no"
// "flags" "icmp-type" "echorep" "unreach" "squench" "redir" "althost"
// "echoreq" "routeradv" "routersol" "timex" "paramprob" "timereq" "timerep"
// "inforeq" "inforep" "maskreq" "maskrep" "trace" "dataconv" "mobredir"
// "ipv6-where" "ipv6-here" "mobregreq" "mobregrep" "photuris" "icmp6-type"
// "tagged" "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_39(_tokenSet_39_data_,12);
const unsigned long PFCfgParser::_tokenSet_40_data_[] = { 4194304UL, 20480UL, 0UL, 2147483648UL, 8388607UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// "skip" INT_CONST COMMA "echorep" "unreach" "squench" "redir" "althost"
// "echoreq" "routeradv" "routersol" "timex" "paramprob" "timereq" "timerep"
// "inforeq" "inforep" "maskreq" "maskrep" "trace" "dataconv" "mobredir"
// "ipv6-where" "ipv6-here" "mobregreq" "mobregrep" "photuris"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_40(_tokenSet_40_data_,12);
const unsigned long PFCfgParser::_tokenSet_41_data_[] = { 4195344UL, 33607680UL, 2UL, 4026531840UL, 8388607UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE "queue" "skip" INT_CONST COMMA CLOSING_BRACE EXLAMATION "no"
// "flags" "icmp-type" "code" "echorep" "unreach" "squench" "redir" "althost"
// "echoreq" "routeradv" "routersol" "timex" "paramprob" "timereq" "timerep"
// "inforeq" "inforep" "maskreq" "maskrep" "trace" "dataconv" "mobredir"
// "ipv6-where" "ipv6-here" "mobregreq" "mobregrep" "photuris" "icmp6-type"
// "tagged" "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_41(_tokenSet_41_data_,12);
const unsigned long PFCfgParser::_tokenSet_42_data_[] = { 64UL, 790528UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// WORD INT_CONST LESS_THAN GREATER_THAN
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_39(_tokenSet_39_data_,6);
const unsigned long PFCfgParser::_tokenSet_40_data_[] = { 1232UL, 34394112UL, 18UL, 2952790017UL, 95UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_42(_tokenSet_42_data_,8);
const unsigned long PFCfgParser::_tokenSet_43_data_[] = { 1232UL, 34394112UL, 18UL, 805306369UL, 0UL, 400556032UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// NEWLINE WORD EQUAL "queue" INT_CONST COMMA CLOSING_BRACE LESS_THAN GREATER_THAN
// EXLAMATION "no" MINUS "to" "flags" "icmp-type" "icmp6-type" "tagged"
// "tag" "keep" "modulate" "synproxy" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_40(_tokenSet_40_data_,12);
const unsigned long PFCfgParser::_tokenSet_41_data_[] = { 4082UL, 3339710464UL, 1574111UL, 3003121665UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_43(_tokenSet_43_data_,12);
const unsigned long PFCfgParser::_tokenSet_44_data_[] = { 4198386UL, 3339710464UL, 1574111UL, 3003121665UL, 8388607UL, 534773760UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// EOF NEWLINE LINE_COMMENT WORD EQUAL "antispoof" "altq" "queue" "set"
// INT_CONST OPENING_BRACE COMMA CLOSING_BRACE "scrub" "table" LESS_THAN
// "skip" INT_CONST OPENING_BRACE COMMA CLOSING_BRACE "scrub" "table" LESS_THAN
// GREATER_THAN STRING EXLAMATION COLON "self" IPV4 SLASH "no" "nat" "pass"
// MINUS "rdr" OPENING_PAREN IPV6 "binat" "block" "to" "any" "no-route"
// "flags" "icmp-type" "icmp6-type" "tagged" "tag" "keep" "modulate" "synproxy"
// "state" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_41(_tokenSet_41_data_,12);
const unsigned long PFCfgParser::_tokenSet_42_data_[] = { 192UL, 34361344UL, 0UL, 0UL, 0UL, 0UL };
// "flags" "icmp-type" "echorep" "unreach" "squench" "redir" "althost"
// "echoreq" "routeradv" "routersol" "timex" "paramprob" "timereq" "timerep"
// "inforeq" "inforep" "maskreq" "maskrep" "trace" "dataconv" "mobredir"
// "ipv6-where" "ipv6-here" "mobregreq" "mobregrep" "photuris" "icmp6-type"
// "tagged" "tag" "keep" "modulate" "synproxy" "state" "label"
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_44(_tokenSet_44_data_,12);
const unsigned long PFCfgParser::_tokenSet_45_data_[] = { 192UL, 34361344UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// WORD EQUAL INT_CONST COMMA LESS_THAN GREATER_THAN EXLAMATION
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_42(_tokenSet_42_data_,6);
const unsigned long PFCfgParser::_tokenSet_43_data_[] = { 64UL, 4096UL, 0UL, 0UL, 0UL, 0UL };
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_45(_tokenSet_45_data_,8);
const unsigned long PFCfgParser::_tokenSet_46_data_[] = { 64UL, 4096UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// WORD INT_CONST
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_43(_tokenSet_43_data_,6);
const ANTLR_USE_NAMESPACE(antlr)BitSet PFCfgParser::_tokenSet_46(_tokenSet_46_data_,8);
+11 -3
View File
@@ -9,7 +9,7 @@
#line 11 "PFCfgParser.hpp"
#include <antlr/config.hpp>
/* $ANTLR 2.7.7 (20090306): "pf.g" -> "PFCfgParser.hpp"$ */
/* $ANTLR 2.7.7 (20100319): "pf.g" -> "PFCfgParser.hpp"$ */
#include <antlr/TokenStream.hpp>
#include <antlr/TokenBuffer.hpp>
#include "PFCfgParserTokenTypes.hpp"
@@ -134,6 +134,7 @@ public:
public: void port_def();
public: void rule_extended();
public: void block_return();
public: void icmp_code_by_name();
public: void direction();
public: void quick();
public: void route();
@@ -168,6 +169,7 @@ public:
public: void label();
public: void icmp_type_code();
public: void icmp_list();
public: void icmp_type_by_name();
public: void port_op();
public: void port_op_list();
public: void unary_port_op();
@@ -183,10 +185,10 @@ protected:
private:
static const char* tokenNames[];
#ifndef NO_STATIC_CONSTS
static const int NUM_TOKENS = 184;
static const int NUM_TOKENS = 238;
#else
enum {
NUM_TOKENS = 184
NUM_TOKENS = 238
};
#endif
@@ -278,6 +280,12 @@ private:
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_42;
static const unsigned long _tokenSet_43_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_43;
static const unsigned long _tokenSet_44_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_44;
static const unsigned long _tokenSet_45_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_45;
static const unsigned long _tokenSet_46_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_46;
};
#endif /*INC_PFCfgParser_hpp_*/
+112 -58
View File
@@ -1,7 +1,7 @@
#ifndef INC_PFCfgParserTokenTypes_hpp_
#define INC_PFCfgParserTokenTypes_hpp_
/* $ANTLR 2.7.7 (20090306): "pf.g" -> "PFCfgParserTokenTypes.hpp"$ */
/* $ANTLR 2.7.7 (20100319): "pf.g" -> "PFCfgParserTokenTypes.hpp"$ */
#ifndef CUSTOM_API
# define CUSTOM_API
@@ -135,63 +135,117 @@ struct CUSTOM_API PFCfgParserTokenTypes {
FLAGS = 124,
ICMP_TYPE = 125,
ICMP_CODE = 126,
ICMP6_TYPE = 127,
TAGGED = 128,
TAG = 129,
KEEP = 130,
MODULATE = 131,
SYNPROXY = 132,
STATE = 133,
LABEL = 134,
EXIT = 135,
QUIT = 136,
INTRFACE = 137,
ICMP6 = 138,
IGRP = 139,
IPSEC = 140,
NOS = 141,
PCP = 142,
PIM = 143,
PPTP = 144,
RIP = 145,
SNP = 146,
HOST = 147,
RANGE = 148,
LOG_LEVEL_ALERTS = 149,
LOG_LEVEL_CRITICAL = 150,
LOG_LEVEL_DEBUGGING = 151,
LOG_LEVEL_EMERGENCIES = 152,
LOG_LEVEL_ERRORS = 153,
LOG_LEVEL_INFORMATIONAL = 154,
LOG_LEVEL_NOTIFICATIONS = 155,
LOG_LEVEL_WARNINGS = 156,
LOG_LEVEL_DISABLE = 157,
LOG_LEVEL_INACTIVE = 158,
Whitespace = 159,
HEX_CONST = 160,
NUMBER = 161,
NEG_INT_CONST = 162,
HEX_DIGIT = 163,
DIGIT = 164,
NUM_3DIGIT = 165,
NUM_HEX_4DIGIT = 166,
NUMBER_ADDRESS_OR_WORD = 167,
PIPE_CHAR = 168,
NUMBER_SIGN = 169,
PERCENT = 170,
AMPERSAND = 171,
APOSTROPHE = 172,
PLUS = 173,
DOT = 174,
SEMICOLON = 175,
QUESTION = 176,
COMMERCIAL_AT = 177,
OPENING_SQUARE = 178,
CLOSING_SQUARE = 179,
CARET = 180,
UNDERLINE = 181,
TILDE = 182,
DOUBLE_QUOTE = 183,
LITERAL_echorep = 127,
LITERAL_unreach = 128,
LITERAL_squench = 129,
LITERAL_redir = 130,
LITERAL_althost = 131,
LITERAL_echoreq = 132,
LITERAL_routeradv = 133,
LITERAL_routersol = 134,
LITERAL_timex = 135,
LITERAL_paramprob = 136,
LITERAL_timereq = 137,
LITERAL_timerep = 138,
LITERAL_inforeq = 139,
LITERAL_inforep = 140,
LITERAL_maskreq = 141,
LITERAL_maskrep = 142,
LITERAL_trace = 143,
LITERAL_dataconv = 144,
LITERAL_mobredir = 145,
// "ipv6-where" = 146
// "ipv6-here" = 147
LITERAL_mobregreq = 148,
LITERAL_mobregrep = 149,
LITERAL_photuris = 150,
// "net-unr" = 151
// "host-unr" = 152
// "proto-unr" = 153
// "port-unr" = 154
LITERAL_needfrag = 155,
LITERAL_srcfail = 156,
// "net-unk" = 157
// "host-unk" = 158
LITERAL_isolate = 159,
// "net-prohib" = 160
// "host-prohib" = 161
// "net-tos" = 162
// "host-tos" = 163
// "filter-prohib" = 164
// "host-preced" = 165
// "cutoff-preced" = 166
// "redir-net" = 167
// "redir-host" = 168
// "redir-tos-net" = 169
// "redir-tos-host" = 170
// "normal-adv" = 171
// "common-adv" = 172
LITERAL_transit = 173,
LITERAL_reassemb = 174,
LITERAL_badhead = 175,
LITERAL_optmiss = 176,
LITERAL_badlen = 177,
// "unknown-ind" = 178
// "auth-fail" = 179
// "decrypt-fail" = 180
ICMP6_TYPE = 181,
TAGGED = 182,
TAG = 183,
KEEP = 184,
MODULATE = 185,
SYNPROXY = 186,
STATE = 187,
LABEL = 188,
EXIT = 189,
QUIT = 190,
INTRFACE = 191,
ICMP6 = 192,
IGRP = 193,
IPSEC = 194,
NOS = 195,
PCP = 196,
PIM = 197,
PPTP = 198,
RIP = 199,
SNP = 200,
HOST = 201,
RANGE = 202,
LOG_LEVEL_ALERTS = 203,
LOG_LEVEL_CRITICAL = 204,
LOG_LEVEL_DEBUGGING = 205,
LOG_LEVEL_EMERGENCIES = 206,
LOG_LEVEL_ERRORS = 207,
LOG_LEVEL_INFORMATIONAL = 208,
LOG_LEVEL_NOTIFICATIONS = 209,
LOG_LEVEL_WARNINGS = 210,
LOG_LEVEL_DISABLE = 211,
LOG_LEVEL_INACTIVE = 212,
Whitespace = 213,
HEX_CONST = 214,
NUMBER = 215,
NEG_INT_CONST = 216,
HEX_DIGIT = 217,
DIGIT = 218,
NUM_3DIGIT = 219,
NUM_HEX_4DIGIT = 220,
NUMBER_ADDRESS_OR_WORD = 221,
PIPE_CHAR = 222,
NUMBER_SIGN = 223,
PERCENT = 224,
AMPERSAND = 225,
APOSTROPHE = 226,
PLUS = 227,
DOT = 228,
SEMICOLON = 229,
QUESTION = 230,
COMMERCIAL_AT = 231,
OPENING_SQUARE = 232,
CLOSING_SQUARE = 233,
CARET = 234,
UNDERLINE = 235,
TILDE = 236,
DOUBLE_QUOTE = 237,
NULL_TREE_LOOKAHEAD = 3
};
#ifdef __cplusplus
+112 -58
View File
@@ -1,4 +1,4 @@
// $ANTLR 2.7.7 (20090306): pf.g -> PFCfgParserTokenTypes.txt$
// $ANTLR 2.7.7 (20100319): pf.g -> PFCfgParserTokenTypes.txt$
PFCfgParser // output token vocab name
NEWLINE=4
LINE_COMMENT=5
@@ -123,60 +123,114 @@ REPLY_TO="reply-to"=123
FLAGS="flags"=124
ICMP_TYPE="icmp-type"=125
ICMP_CODE="code"=126
ICMP6_TYPE="icmp6-type"=127
TAGGED="tagged"=128
TAG="tag"=129
KEEP="keep"=130
MODULATE="modulate"=131
SYNPROXY="synproxy"=132
STATE="state"=133
LABEL="label"=134
EXIT="exit"=135
QUIT="quit"=136
INTRFACE="interface"=137
ICMP6="icmp6"=138
IGRP="igrp"=139
IPSEC="ipsec"=140
NOS="nos"=141
PCP="pcp"=142
PIM="pim"=143
PPTP="pptp"=144
RIP="rip"=145
SNP="snp"=146
HOST="host"=147
RANGE="range"=148
LOG_LEVEL_ALERTS="alerts"=149
LOG_LEVEL_CRITICAL="critical"=150
LOG_LEVEL_DEBUGGING="debugging"=151
LOG_LEVEL_EMERGENCIES="emergencies"=152
LOG_LEVEL_ERRORS="errors"=153
LOG_LEVEL_INFORMATIONAL="informational"=154
LOG_LEVEL_NOTIFICATIONS="notifications"=155
LOG_LEVEL_WARNINGS="warnings"=156
LOG_LEVEL_DISABLE="disable"=157
LOG_LEVEL_INACTIVE="inactive"=158
Whitespace=159
HEX_CONST=160
NUMBER=161
NEG_INT_CONST=162
HEX_DIGIT=163
DIGIT=164
NUM_3DIGIT=165
NUM_HEX_4DIGIT=166
NUMBER_ADDRESS_OR_WORD=167
PIPE_CHAR=168
NUMBER_SIGN=169
PERCENT=170
AMPERSAND=171
APOSTROPHE=172
PLUS=173
DOT=174
SEMICOLON=175
QUESTION=176
COMMERCIAL_AT=177
OPENING_SQUARE=178
CLOSING_SQUARE=179
CARET=180
UNDERLINE=181
TILDE=182
DOUBLE_QUOTE=183
LITERAL_echorep="echorep"=127
LITERAL_unreach="unreach"=128
LITERAL_squench="squench"=129
LITERAL_redir="redir"=130
LITERAL_althost="althost"=131
LITERAL_echoreq="echoreq"=132
LITERAL_routeradv="routeradv"=133
LITERAL_routersol="routersol"=134
LITERAL_timex="timex"=135
LITERAL_paramprob="paramprob"=136
LITERAL_timereq="timereq"=137
LITERAL_timerep="timerep"=138
LITERAL_inforeq="inforeq"=139
LITERAL_inforep="inforep"=140
LITERAL_maskreq="maskreq"=141
LITERAL_maskrep="maskrep"=142
LITERAL_trace="trace"=143
LITERAL_dataconv="dataconv"=144
LITERAL_mobredir="mobredir"=145
"ipv6-where"=146
"ipv6-here"=147
LITERAL_mobregreq="mobregreq"=148
LITERAL_mobregrep="mobregrep"=149
LITERAL_photuris="photuris"=150
"net-unr"=151
"host-unr"=152
"proto-unr"=153
"port-unr"=154
LITERAL_needfrag="needfrag"=155
LITERAL_srcfail="srcfail"=156
"net-unk"=157
"host-unk"=158
LITERAL_isolate="isolate"=159
"net-prohib"=160
"host-prohib"=161
"net-tos"=162
"host-tos"=163
"filter-prohib"=164
"host-preced"=165
"cutoff-preced"=166
"redir-net"=167
"redir-host"=168
"redir-tos-net"=169
"redir-tos-host"=170
"normal-adv"=171
"common-adv"=172
LITERAL_transit="transit"=173
LITERAL_reassemb="reassemb"=174
LITERAL_badhead="badhead"=175
LITERAL_optmiss="optmiss"=176
LITERAL_badlen="badlen"=177
"unknown-ind"=178
"auth-fail"=179
"decrypt-fail"=180
ICMP6_TYPE="icmp6-type"=181
TAGGED="tagged"=182
TAG="tag"=183
KEEP="keep"=184
MODULATE="modulate"=185
SYNPROXY="synproxy"=186
STATE="state"=187
LABEL="label"=188
EXIT="exit"=189
QUIT="quit"=190
INTRFACE="interface"=191
ICMP6="icmp6"=192
IGRP="igrp"=193
IPSEC="ipsec"=194
NOS="nos"=195
PCP="pcp"=196
PIM="pim"=197
PPTP="pptp"=198
RIP="rip"=199
SNP="snp"=200
HOST="host"=201
RANGE="range"=202
LOG_LEVEL_ALERTS="alerts"=203
LOG_LEVEL_CRITICAL="critical"=204
LOG_LEVEL_DEBUGGING="debugging"=205
LOG_LEVEL_EMERGENCIES="emergencies"=206
LOG_LEVEL_ERRORS="errors"=207
LOG_LEVEL_INFORMATIONAL="informational"=208
LOG_LEVEL_NOTIFICATIONS="notifications"=209
LOG_LEVEL_WARNINGS="warnings"=210
LOG_LEVEL_DISABLE="disable"=211
LOG_LEVEL_INACTIVE="inactive"=212
Whitespace=213
HEX_CONST=214
NUMBER=215
NEG_INT_CONST=216
HEX_DIGIT=217
DIGIT=218
NUM_3DIGIT=219
NUM_HEX_4DIGIT=220
NUMBER_ADDRESS_OR_WORD=221
PIPE_CHAR=222
NUMBER_SIGN=223
PERCENT=224
AMPERSAND=225
APOSTROPHE=226
PLUS=227
DOT=228
SEMICOLON=229
QUESTION=230
COMMERCIAL_AT=231
OPENING_SQUARE=232
CLOSING_SQUARE=233
CARET=234
UNDERLINE=235
TILDE=236
DOUBLE_QUOTE=237
+127 -6
View File
@@ -851,11 +851,11 @@ block_return :
RETURN_ICMP { importer->block_action_params.push_back("return-icmp"); }
(
OPENING_PAREN
( WORD | INT_CONST )
( icmp_code_by_name | INT_CONST )
{ importer->block_action_params.push_back(LT(0)->getText()); }
(
COMMA
( WORD | INT_CONST )
( icmp_code_by_name | INT_CONST )
{
importer->error_tracker->registerError(
QString("Import of \"block return-icmp (icmp_code, icmp6_code)\" is not supported"));
@@ -1253,15 +1253,16 @@ icmp_type :
;
icmp_type_code { IcmpSpec is; } :
(
WORD { is.icmp_type_name = LT(0)->getText(); }
|
(
icmp_type_by_name { is.icmp_type_name = LT(0)->getText(); }
|
INT_CONST { is.icmp_type_int = LT(0)->getText(); }
)
(
ICMP_CODE
(
WORD { is.icmp_code_name = LT(0)->getText(); }
icmp_code_by_name { is.icmp_code_name = LT(0)->getText(); }
|
INT_CONST { is.icmp_code_int = LT(0)->getText(); }
)
@@ -1271,6 +1272,126 @@ icmp_type_code { IcmpSpec is; } :
}
;
icmp_type_by_name
:
(
"echorep"
|
"unreach"
|
"squench"
|
"redir"
|
"althost"
|
"echoreq"
|
"routeradv"
|
"routersol"
|
"timex"
|
"paramprob"
|
"timereq"
|
"timerep"
|
"inforeq"
|
"inforep"
|
"maskreq"
|
"maskrep"
|
"trace"
|
"dataconv"
|
"mobredir"
|
"ipv6-where"
|
"ipv6-here"
|
"mobregreq"
|
"mobregrep"
|
"skip"
|
"photuris"
)
;
icmp_code_by_name
:
(
"net-unr"
|
"host-unr"
|
"proto-unr"
|
"port-unr"
|
"needfrag"
|
"srcfail"
|
"net-unk"
|
"host-unk"
|
"isolate"
|
"net-prohib"
|
"host-prohib"
|
"net-tos"
|
"host-tos"
|
"filter-prohib"
|
"host-preced"
|
"cutoff-preced"
|
"redir-net"
|
"redir-host"
|
"redir-tos-net"
|
"redir-tos-host"
|
"normal-adv"
|
"common-adv"
|
"transit"
|
"reassemb"
|
"badhead"
|
"optmiss"
|
"badlen"
|
"unknown-ind"
|
"auth-fail"
|
"decrypt-fail"
)
;
icmp_list :
OPENING_BRACE
icmp_type_code
@@ -414,3 +414,23 @@ void PFImporterTest::rdrCommands()
"pf-rdr-rules.fwb");
}
void PFImporterTest::setTimeoutCommands()
{
platform = "pf";
std::istringstream instream(
openTestFile("test_data/pf-timeouts.conf"));
Importer* imp = new PFImporter(lib, instream, logger, "test_fw");
CPPUNIT_ASSERT_NO_THROW( imp->run() );
imp->finalize();
// db->setPredictableIds();
// db->saveFile("pf-timeouts.fwb");
compareResults(logger, "test_data/pf-timeouts.output", "pf-timeouts.output");
// compareFwbFiles("test_data/pf-timeouts.fwb",
// "pf-timeouts.fwb");
}
@@ -68,6 +68,7 @@ public:
void tcpFlagsMatchTest();
void natCommands();
void rdrCommands();
void setTimeoutCommands();
CPPUNIT_TEST_SUITE(PFImporterTest);
@@ -81,6 +82,7 @@ public:
CPPUNIT_TEST(tcpFlagsMatchTest);
CPPUNIT_TEST(natCommands);
CPPUNIT_TEST(rdrCommands);
CPPUNIT_TEST(setTimeoutCommands);
CPPUNIT_TEST_SUITE_END();
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE FWObjectDatabase SYSTEM "fwbuilder.dtd">
<FWObjectDatabase xmlns="http://www.fwbuilder.org/1.0/" version="21" lastModified="1306728766" id="root">
<FWObjectDatabase xmlns="http://www.fwbuilder.org/1.0/" version="21" lastModified="1307055157" id="root">
<Library id="syslib000" color="#d4f8ff" name="Standard" comment="Standard objects" ro="True">
<AnyNetwork id="sysid0" name="Any" comment="Any Network" ro="False" address="0.0.0.0" netmask="0.0.0.0"/>
<AnyIPService id="sysid1" protocol_num="0" name="Any" comment="Any IP Service" ro="False"/>
@@ -1,12 +1,5 @@
2: Warning: import of 'set' commands has not been implemented yet.
3: Warning: import of 'set' commands has not been implemented yet.
4: Warning: import of 'set' commands has not been implemented yet.
5: Warning: import of 'set' commands has not been implemented yet.
6: Warning: import of 'set' commands has not been implemented yet.
7: Warning: import of 'set' commands has not been implemented yet.
8: Warning: import of 'set' commands has not been implemented yet.
9: Warning: import of 'set' commands has not been implemented yet.
10: Warning: import of 'set' commands has not been implemented yet.
3: Parser error: line 3:26: expecting EQUAL, found '
'
Parser error:
Could not find enough information in the data file to create firewall object.
@@ -1,10 +1,14 @@
# these should be all timeouts we support in 4.3
set timeout { interval 10, frag 30 }
set timeout interval 10
set timeout frag 30
set timeout { tcp.first 60, tcp.opening 30, tcp.established 3600, tcp.closing 30, tcp.finwait 2, tcp.closed 10 }
set timeout { udp.first 20, udp.single 10, udp.multiple 15 }
set timeout { icmp.first 11, icmp.error 6 }
set timeout { other.first 40, other.single 20, other.multiple 30 }
set timeout { adaptive.start 10, adaptive.end 5 }
# invalid timeout name
set timeout foo 20
block log all
@@ -0,0 +1,5 @@
12: Parser error: line 12:13: unexpected token: foo
14: filtering rule: action block; interfaces:
Could not find enough information in the data file to create firewall interface objects.
Configuring timeouts:interval=10frag=30tcp.first=60tcp.opening=30tcp.established=3600tcp.closing=30tcp.finwait=2tcp.closed=10udp.first=20udp.single=10udp.multiple=15icmp.first=11icmp.error=6other.first=40other.single=20other.multiple=30adaptive.start=10adaptive.end=5