Skip to content

Commit

Permalink
Merge pull request #91 from batfish/unstable
Browse files Browse the repository at this point in the history
prepare for 0.13.0
  • Loading branch information
arifogel committed Apr 5, 2017
2 parents 4b3925d + 40c0fdd commit 32d946c
Show file tree
Hide file tree
Showing 72 changed files with 6,989 additions and 5,537 deletions.
Binary file added lib/commons/commons-collections4-4.1-sources.jar
Binary file not shown.
Binary file added lib/commons/commons-collections4-4.1.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public final class Version {

private static final String UNKNOWN_VERSION = "0.0.0";

private static final String VERSION = "0.12.0";
private static final String VERSION = "0.13.0";

public static void checkCompatibleVersion(String myName, String otherName,
String otherVersion) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,6 @@ public boolean equals(Object o) {
if (this._allowRemoteAsOut != other._allowRemoteAsOut) {
return false;
}
if (!CommonUtil.bothNullOrEqual(this._candidateRemoteBgpNeighbors,
other._candidateRemoteBgpNeighbors)) {
return false;
}
if (_clusterId == null) {
if (other._clusterId != null) {
return false;
Expand Down Expand Up @@ -352,10 +348,6 @@ else if (!this._clusterId.equals(other._clusterId)) {
if (!this._remoteAs.equals(other._remoteAs)) {
return false;
}
if (!CommonUtil.bothNullOrEqual(this._remoteBgpNeighbor,
other._remoteBgpNeighbor)) {
return false;
}
if (this._routeReflectorClient != other._routeReflectorClient) {
return false;
}
Expand Down
1 change: 1 addition & 0 deletions projects/batfish/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@
<classpathentry kind="lib" path="lib/jackson/jackson-core-2.9.0-SNAPSHOT.jar" sourcepath="lib/jackson/jackson-core-2.9.0-SNAPSHOT-sources.jar"/>
<classpathentry kind="lib" path="lib/jackson/jackson-databind-2.9.0-SNAPSHOT.jar" sourcepath="lib/jackson/jackson-databind-2.9.0-SNAPSHOT-sources.jar"/>
<classpathentry kind="lib" path="lib/guava/guava-21.0.jar" sourcepath="lib/guava/guava-21.0-sources.jar"/>
<classpathentry kind="lib" path="lib/commons/commons-collections4-4.1.jar" sourcepath="lib/commons/commons-collections4-4.1-sources.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions projects/batfish/lib/commons/commons-collections4-4.1.jar
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ private void computeFixedPoint(Map<String, Node> nodes, Topology topology,
vr.initStaticRib();
vr.importRib(vr._independentRib, vr._staticInterfaceRib);
vr.importRib(vr._mainRib, vr._staticInterfaceRib);
vr.initOspfInterfaceCosts();
vr.initBaseOspfRoutes();
vr.initEbgpTopology(dp);
vr.initBaseBgpRibs(externalAdverts);
Expand Down
7 changes: 0 additions & 7 deletions projects/batfish/src/org/batfish/bdp/VirtualRouter.java
Original file line number Diff line number Diff line change
Expand Up @@ -542,13 +542,6 @@ public void initOspfExports() {
}
}

public void initOspfInterfaceCosts() {
OspfProcess proc = _vrf.getOspfProcess();
if (proc != null) {
proc.initInterfaceCosts();
}
}

public void initRibs() {
_bgpRib = new BgpRib(this);
_connectedRib = new ConnectedRib(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ private static SubRange toSubRange(SubrangeContext ctx) {

private CiscoConfiguration _configuration;

private AaaAccountingCommands _currentAaaAccountingCommands;
@SuppressWarnings("unused")
private List<AaaAccountingCommands> _currentAaaAccountingCommands;

private AaaAuthenticationLoginList _currentAaaAuthenticationLoginList;

Expand Down Expand Up @@ -478,19 +479,29 @@ public void enterAaa_accounting_commands(
Aaa_accounting_commandsContext ctx) {
Map<String, AaaAccountingCommands> commands = _configuration.getCf()
.getAaa().getAccounting().getCommands();
String level;
if (ctx.level != null) {
level = ctx.level.getText();
Set<String> levels = new TreeSet<>();
if (ctx.levels != null) {
List<SubRange> range = toRange(ctx.levels);
for (SubRange subRange : range) {
for (int i = subRange.getStart(); i <= subRange.getEnd(); i++) {
String level = Integer.toString(i);
levels.add(level);
}
}
}
else {
level = AaaAccounting.DEFAULT_COMMANDS;
levels.add(AaaAccounting.DEFAULT_COMMANDS);
}
AaaAccountingCommands c = commands.get(level);
if (c == null) {
c = new AaaAccountingCommands();
commands.put(level, _currentAaaAccountingCommands);
List<AaaAccountingCommands> currentAaaAccountingCommands = new ArrayList<>();
for (String level : levels) {
AaaAccountingCommands c = commands.get(level);
if (c == null) {
c = new AaaAccountingCommands();
commands.put(level, c);
}
currentAaaAccountingCommands.add(c);
}
_currentAaaAccountingCommands = c;
_currentAaaAccountingCommands = currentAaaAccountingCommands;
}

@Override
Expand Down Expand Up @@ -600,6 +611,10 @@ public void enterExtended_access_list_stanza(
name = ctx.name.getText();
definitionLine = ctx.name.getStart().getLine();
}
else if (ctx.shortname != null) {
name = ctx.shortname.getText();
definitionLine = ctx.shortname.getStart().getLine();
}
else if (ctx.num != null) {
name = ctx.num.getText();
definitionLine = ctx.num.getLine();
Expand Down Expand Up @@ -4016,8 +4031,10 @@ public void exitS_ip_domain_name(S_ip_domain_nameContext ctx) {
@Override
public void exitS_ip_name_server(S_ip_name_serverContext ctx) {
Set<String> dnsServers = _configuration.getDnsServers();
String domainName = ctx.hostname.getText();
dnsServers.add(domainName);
for (Ip_hostnameContext ipCtx : ctx.hostnames) {
String domainName = ipCtx.getText();
dnsServers.add(domainName);
}
}

@Override
Expand Down
78 changes: 77 additions & 1 deletion projects/batfish/src/org/batfish/grammar/cisco/CiscoLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ tokens {
RAW_TEXT,
SELF_SIGNED,
SLIP_PPP,
TEXT,
VALUE
} // Cisco Keywords

Expand Down Expand Up @@ -499,6 +500,11 @@ ALLOW_DEFAULT
'allow-default'
;

ALLOW_NOPASSWORD_REMOTE_LOGIN
:
'allow-nopassword-remote-login'
;

ALLOW_SELF_PING
:
'allow-self-ping'
Expand Down Expand Up @@ -986,6 +992,11 @@ BIDIR_OFFER_LIMIT
'bidir-offer-limit'
;

BIDIR_RP_LIMIT
:
'bidir-rp-limit'
;

BIFF
:
'biff'
Expand Down Expand Up @@ -5509,6 +5520,16 @@ ON
'on'
;

ON_FAILURE
:
'on-failure'
;

ON_SUCCESS
:
'on-success'
;

ONE
:
'one'
Expand Down Expand Up @@ -6354,6 +6375,11 @@ PROXY_SERVER
'proxy-server'
;

PSEUDO_INFORMATION
:
'pseudo-information'
;

PSEUDOWIRE
:
'pseudowire'
Expand Down Expand Up @@ -7394,6 +7420,11 @@ SFTP
'sftp'
;

SG_EXPIRY_TIMER
:
'sg-expiry-timer'
;

SGBP
:
'sgbp'
Expand Down Expand Up @@ -8641,6 +8672,11 @@ USE_ACL
'use-acl'
;

USE_BIA
:
'use-bia'
;

USE_IPV4_ACL
:
'use-ipv4-acl'
Expand Down Expand Up @@ -9003,6 +9039,11 @@ WAVELENGTH
'wavelength'
;

WCCP
:
'wccp'
;

WEBVPN
:
'webvpn'
Expand Down Expand Up @@ -9906,6 +9947,11 @@ M_Authentication_PASSWORD_PROMPT
'password-prompt' -> type ( PASSWORD_PROMPT ) , popMode
;

M_Authentication_POLICY
:
'policy' -> type ( POLICY ) , popMode
;

M_Authentication_PPP
:
'ppp' -> type ( PPP ) , popMode
Expand Down Expand Up @@ -9941,9 +9987,15 @@ M_Authentication_TELNET
'telnet' -> type ( TELNET ) , popMode
;

M_Authentication_TEXT
:
'text' -> type ( TEXT ) , popMode
;

M_Authentication_USERNAME_PROMPT
:
'username-prompt' -> type ( USERNAME_PROMPT ) , popMode
'username-prompt' -> type ( USERNAME_PROMPT ) , mode (
M_AuthenticationUsernamePrompt )
;

M_Authentication_VARIABLE
Expand All @@ -9956,6 +10008,30 @@ M_Authentication_WS
F_Whitespace+ -> channel ( HIDDEN )
;

mode M_AuthenticationUsernamePrompt;

M_AuthenticationUsernamePrompt_DOUBLE_QUOTE
:
'"' -> type ( DOUBLE_QUOTE ) , mode ( M_AuthenticationUsernamePromptText )
;

M_AuthenticationUsernamePrompt_WS
:
F_Whitespace+ -> channel ( HIDDEN )
;

mode M_AuthenticationUsernamePromptText;

M_AuthenticationUsernamePromptText_RAW_TEXT
:
~'"'+ -> type ( RAW_TEXT )
;

M_AuthenticationUsernamePromptText_DOUBLE_QUOTE
:
'"' -> type ( DOUBLE_QUOTE ) , popMode
;

mode M_Banner;

M_Banner_CONFIG_SAVE
Expand Down
31 changes: 29 additions & 2 deletions projects/batfish/src/org/batfish/grammar/cisco/CiscoParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ ip_ssh_null
:
(
AUTHENTICATION_RETRIES
| CLIENT
| PORT
| SOURCE_INTERFACE
| TIME_OUT
Expand Down Expand Up @@ -1453,13 +1454,15 @@ pim_null
| BIDIR_ENABLE
| BIDIR_OFFER_INTERVAL
| BIDIR_OFFER_LIMIT
| BIDIR_RP_LIMIT
| BSR_CANDIDATE
| DM_FALLBACK
| LOG_NEIGHBOR_CHANGES
| REGISTER_RATE_LIMIT
| REGISTER_SOURCE
| RPF_VECTOR
| SEND_RP_DISCOVERY
| SG_EXPIRY_TIMER
| SNOOPING
| V1_RP_REACHABILITY
) ~NEWLINE* NEWLINE
Expand Down Expand Up @@ -1924,7 +1927,13 @@ s_ip_name_server
IP NAME_SERVER
(
VRF vrf = variable
)? hostname = variable_hostname NEWLINE
)?
(
hostnames += ip_hostname
)+
(
USE_VRF vrf = variable
)? NEWLINE
;

s_ip_nat
Expand Down Expand Up @@ -2218,6 +2227,7 @@ s_spanning_tree
NO? SPANNING_TREE
(
spanning_tree_mst
| spanning_tree_pseudo_information
| spanning_tree_null
)
;
Expand Down Expand Up @@ -2310,7 +2320,7 @@ s_tunnel_group

s_vlan
:
VLAN
NO? VLAN
(
ACCESS_MAP
| DEC
Expand Down Expand Up @@ -2436,6 +2446,14 @@ spanning_tree_mst_null
) ~NEWLINE* NEWLINE
;

spanning_tree_pseudo_information
:
PSEUDO_INFORMATION NEWLINE
(
spti_null
)*
;

spanning_tree_null
:
(
Expand All @@ -2459,6 +2477,14 @@ spanning_tree_null
) ~NEWLINE* NEWLINE
;

spti_null
:
NO?
(
MST
) ~NEWLINE* NEWLINE
;

srlg_interface_numeric_stanza
:
DEC ~NEWLINE* NEWLINE
Expand Down Expand Up @@ -2650,6 +2676,7 @@ stanza
| s_statistics
| s_stcapp
| s_switchport
| s_table_map
| s_tacacs
| s_tacacs_server
| s_tap
Expand Down

0 comments on commit 32d946c

Please sign in to comment.