@Override protected IpsecPhase2Proposal featureValueOf(IpsecSession actual) { return actual.getNegotiatedIpsecP2Proposal(); } }
@Override protected IkePhase1Key featureValueOf(IpsecSession actual) { return actual.getNegotiatedIkeP1Key(); } }
@Override protected IkePhase1Proposal featureValueOf(IpsecSession actual) { return actual.getNegotiatedIkeP1Proposal(); } }
private static void processNeighbor( IpsecPeerConfigId ipsecPeerConfigIdNeighbor, IpsecSessionInfo.Builder ipsecSessioningInfoBuilder, IpsecPeerConfig ipsecPeerConfigNeighbor, IpsecSession ipsecSession) { ipsecSessioningInfoBuilder.setResponderHostname(ipsecPeerConfigIdNeighbor.getHostName()); ipsecSessioningInfoBuilder.setResponderInterface(ipsecPeerConfigNeighbor.getSourceInterface()); ipsecSessioningInfoBuilder.setResponderIp(ipsecPeerConfigNeighbor.getLocalAddress()); ipsecSessioningInfoBuilder.setResponderTunnelInterface( ipsecPeerConfigNeighbor.getTunnelInterface()); if (ipsecSession.getNegotiatedIkeP1Proposal() == null) { ipsecSessioningInfoBuilder.setIpsecSessionStatus(IKE_PHASE1_FAILED); } else if (ipsecSession.getNegotiatedIkeP1Key() == null) { ipsecSessioningInfoBuilder.setIpsecSessionStatus(IKE_PHASE1_KEY_MISMATCH); } else if (ipsecSession.getNegotiatedIpsecP2Proposal() == null) { ipsecSessioningInfoBuilder.setIpsecSessionStatus(IPSEC_PHASE2_FAILED); } else { ipsecSessioningInfoBuilder.setIpsecSessionStatus(IPSEC_SESSION_ESTABLISHED); } }
/** * Gets the {@link IpsecSession} between two {@link IpsecPeerConfig}s where the initiator should * always be an {@link IpsecStaticPeerConfig}. Returned {@link IpsecSession} object will have * respective fields for IKE P1 proposals, IKE P1 keys and IPSec P2 proposals populated depending * on the negotiation. */ @Nonnull private static IpsecSession getIpsecSession( Configuration initiatorOwner, Configuration peerOwner, IpsecStaticPeerConfig initiator, IpsecPeerConfig candidatePeer) { IpsecSession.Builder ipsecSessionBuilder = IpsecSession.builder(); negotiateIkeP1(initiatorOwner, peerOwner, initiator, candidatePeer, ipsecSessionBuilder); if (ipsecSessionBuilder.getNegotiatedIkeP1Proposal() == null || ipsecSessionBuilder.getNegotiatedIkeP1Key() == null) { return ipsecSessionBuilder.build(); } negotiateIpsecP2(initiatorOwner, peerOwner, initiator, candidatePeer, ipsecSessionBuilder); return ipsecSessionBuilder.build(); }
public IpsecSession build() { return new IpsecSession( _initiatorIkeP1Policy, _initiatorIpsecP2Policy, _negotiatedIkeP1Proposal, _negotiatedIkeP1Key, _negotiatedIpsecP2Proposal, _responderIkeP1Policy, _responderIpsecP2Policy); }
.setTunnelInterface("Tunnel_interface"); _graph = ValueGraphBuilder.directed().allowsSelfLoops(false).build(); _ipsecSessionBuilder = IpsecSession.builder();
ipsecTopology.edgeValue(endpoint.nodeU(), endpoint.nodeV()); return ipsecSession.isPresent() && ipsecSession.get().getNegotiatedIpsecP2Proposal() != null; }) .forEach(
&& edgeIpsecSession.get().getNegotiatedIpsecP2Proposal() != null) { successfulIPsecEdges.add(new Edge(tunnelEndPointU, tunnelEndPointV));