use of org.batfish.question.ipsecvpnstatus.IpsecVpnInfo.Problem in project batfish by batfish.
the class IpsecVpnStatusAnswerer method analyzeIpsecVpn.
@VisibleForTesting
public static IpsecVpnInfo analyzeIpsecVpn(IpsecVpn ipsecVpn) {
SortedSet<Problem> problems = new TreeSet<>();
IpsecVpn remoteIpsecVpn = null;
if (ipsecVpn.getRemoteIpsecVpn() == null) {
problems.add(Problem.MISSING_REMOTE_ENDPOINT);
} else {
if (ipsecVpn.getCandidateRemoteIpsecVpns().size() != 1) {
problems.add(Problem.MULTIPLE_REMOTE_ENDPOINTS);
}
remoteIpsecVpn = ipsecVpn.getRemoteIpsecVpn();
if (!ipsecVpn.compatibleIkeProposals(remoteIpsecVpn)) {
problems.add(Problem.INCOMPATIBLE_IKE_PROPOSALS);
}
if (!ipsecVpn.compatibleIpsecProposals(remoteIpsecVpn)) {
problems.add(Problem.INCOMPATIBLE_IPSEC_PROPOSALS);
}
if (!ipsecVpn.compatiblePreSharedKey(remoteIpsecVpn)) {
problems.add(Problem.INCOMPATIBLE_PRE_SHARED_KEY);
}
}
if (problems.size() == 0) {
problems.add(Problem.NONE);
}
return new IpsecVpnInfo(ipsecVpn, problems, remoteIpsecVpn);
}
Aggregations