Tabnine Logo
IkePhase1Proposal
Code IndexAdd Tabnine to your IDE (free)

How to use
IkePhase1Proposal
in
org.batfish.datamodel

Best Java code snippets using org.batfish.datamodel.IkePhase1Proposal (Showing top 16 results out of 315)

origin: batfish/batfish

if (initiatorProposal.isCompatibleWith(responderProposal)) {
 IkePhase1Proposal negotiatedProposal =
   new IkePhase1Proposal("~NEGOTIATED_IKE_P1_PROPOSAL~");
 negotiatedProposal.setHashingAlgorithm(initiatorProposal.getHashingAlgorithm());
 negotiatedProposal.setEncryptionAlgorithm(initiatorProposal.getEncryptionAlgorithm());
 negotiatedProposal.setDiffieHellmanGroup(initiatorProposal.getDiffieHellmanGroup());
 negotiatedProposal.setAuthenticationMethod(initiatorProposal.getAuthenticationMethod());
 if (initiatorProposal.getLifetimeSeconds() != null
   && responderProposal.getLifetimeSeconds() != null) {
  negotiatedProposal.setLifetimeSeconds(
    Math.min(
      initiatorProposal.getLifetimeSeconds(),
      responderProposal.getLifetimeSeconds()));
origin: batfish/batfish

 @Override
 protected String featureValueOf(IkePhase1Proposal actual) {
  return actual.getName();
 }
}
origin: batfish/batfish

private IkePhase1Proposal toIkePhase1Proposal(IkeProposal ikeProposal) {
 IkePhase1Proposal ikePhase1Proposal = new IkePhase1Proposal(ikeProposal.getName());
 ikePhase1Proposal.setDiffieHellmanGroup(ikeProposal.getDiffieHellmanGroup());
 ikePhase1Proposal.setAuthenticationMethod(ikeProposal.getAuthenticationMethod());
 ikePhase1Proposal.setEncryptionAlgorithm(ikeProposal.getEncryptionAlgorithm());
 ikePhase1Proposal.setLifetimeSeconds(ikeProposal.getLifetimeSeconds());
 ikePhase1Proposal.setHashingAlgorithm(ikeProposal.getAuthenticationAlgorithm());
 return ikePhase1Proposal;
}
origin: batfish/batfish

@Test
public void testGenerateRowsIke1KeyFail() {
 // IPSecSession does not have IKE phase 1 key set
 _ipsecSessionBuilder.setNegotiatedIkeP1Proposal(new IkePhase1Proposal("test_ike_proposal"));
 _graph.putEdgeValue(
   new IpsecPeerConfigId(INITIATOR_IPSEC_PEER_CONFIG, INITIATOR_HOST_NAME),
   new IpsecPeerConfigId(RESPONDER_IPSEC_PEER_CONFIG, RESPONDER_HOST_NAME),
   _ipsecSessionBuilder.build());
 Multiset<IpsecSessionInfo> ipsecSessionInfos =
   rawAnswer(
     _networkConfigurations,
     _graph,
     ImmutableSet.of(INITIATOR_HOST_NAME),
     ImmutableSet.of(RESPONDER_HOST_NAME));
 // answer should have exactly one row
 assertThat(ipsecSessionInfos, hasSize(1));
 assertThat(
   ipsecSessionInfos.iterator().next(),
   hasIpsecSessionStatus(equalTo(IKE_PHASE1_KEY_MISMATCH)));
}
origin: batfish/batfish

 @Override
 protected DiffieHellmanGroup featureValueOf(IkePhase1Proposal actual) {
  return actual.getDiffieHellmanGroup();
 }
}
origin: batfish/batfish

 @Override
 protected IkeAuthenticationMethod featureValueOf(IkePhase1Proposal actual) {
  return actual.getAuthenticationMethod();
 }
}
origin: batfish/batfish

 @Override
 protected IkeHashingAlgorithm featureValueOf(IkePhase1Proposal actual) {
  return actual.getHashingAlgorithm();
 }
}
origin: batfish/batfish

 @Override
 protected EncryptionAlgorithm featureValueOf(IkePhase1Proposal actual) {
  return actual.getEncryptionAlgorithm();
 }
}
origin: batfish/batfish

 @Override
 protected Integer featureValueOf(IkePhase1Proposal actual) {
  return actual.getLifetimeSeconds();
 }
}
origin: batfish/batfish

static IkePhase1Proposal toIkePhase1Proposal(IsakmpPolicy isakmpPolicy) {
 IkePhase1Proposal ikePhase1Proposal = new IkePhase1Proposal(isakmpPolicy.getName().toString());
 ikePhase1Proposal.setDiffieHellmanGroup(isakmpPolicy.getDiffieHellmanGroup());
 ikePhase1Proposal.setAuthenticationMethod(isakmpPolicy.getAuthenticationMethod());
 ikePhase1Proposal.setEncryptionAlgorithm(isakmpPolicy.getEncryptionAlgorithm());
 ikePhase1Proposal.setLifetimeSeconds(isakmpPolicy.getLifetimeSeconds());
 ikePhase1Proposal.setHashingAlgorithm(isakmpPolicy.getHashAlgorithm());
 return ikePhase1Proposal;
}
origin: batfish/batfish

@Test
public void testGenerateRowsIpsec2Fail() {
 // IPSecSession does not have IPSec phase 2 proposal set
 _ipsecSessionBuilder.setNegotiatedIkeP1Proposal(new IkePhase1Proposal("test_ike_proposal"));
 _ipsecSessionBuilder.setNegotiatedIkeP1Key(new IkePhase1Key());
 _graph.putEdgeValue(
   new IpsecPeerConfigId(INITIATOR_IPSEC_PEER_CONFIG, INITIATOR_HOST_NAME),
   new IpsecPeerConfigId(RESPONDER_IPSEC_PEER_CONFIG, RESPONDER_HOST_NAME),
   _ipsecSessionBuilder.build());
 Multiset<IpsecSessionInfo> ipsecSessionInfos =
   rawAnswer(
     _networkConfigurations,
     _graph,
     ImmutableSet.of(INITIATOR_HOST_NAME),
     ImmutableSet.of(RESPONDER_HOST_NAME));
 // answer should have exactly one row
 assertThat(ipsecSessionInfos, hasSize(1));
 assertThat(
   ipsecSessionInfos.iterator().next(), hasIpsecSessionStatus(equalTo(IPSEC_PHASE2_FAILED)));
}
origin: batfish/batfish

@Nonnull
private static IkePhase1Proposal toIkePhase1Proposal(
  String proposalName, IpsecTunnel ipsecTunnel) {
 IkePhase1Proposal ikePhase1Proposal = new IkePhase1Proposal(proposalName);
 if (ipsecTunnel.getIkePreSharedKeyHash() != null) {
  ikePhase1Proposal.setAuthenticationMethod(IkeAuthenticationMethod.PRE_SHARED_KEYS);
 }
 ikePhase1Proposal.setHashingAlgorithm(
   toIkeAuthenticationAlgorithm(ipsecTunnel.getIkeAuthProtocol()));
 ikePhase1Proposal.setDiffieHellmanGroup(
   toDiffieHellmanGroup(ipsecTunnel.getIkePerfectForwardSecrecy()));
 ikePhase1Proposal.setEncryptionAlgorithm(
   toEncryptionAlgorithm(ipsecTunnel.getIkeEncryptionProtocol()));
 return ikePhase1Proposal;
}
origin: batfish/batfish

@Test
public void testGenerateRowsIpsecEstablished() {
 // IPSecSession has all phases negotiated and IKE phase 1 key consistent
 _ipsecSessionBuilder.setNegotiatedIkeP1Proposal(new IkePhase1Proposal("test_ike_proposal"));
 _ipsecSessionBuilder.setNegotiatedIkeP1Key(new IkePhase1Key());
 _ipsecSessionBuilder.setNegotiatedIpsecP2Proposal(new IpsecPhase2Proposal());
 _graph.putEdgeValue(
   new IpsecPeerConfigId(INITIATOR_IPSEC_PEER_CONFIG, INITIATOR_HOST_NAME),
   new IpsecPeerConfigId(RESPONDER_IPSEC_PEER_CONFIG, RESPONDER_HOST_NAME),
   _ipsecSessionBuilder.build());
 Multiset<IpsecSessionInfo> ipsecSessionInfos =
   rawAnswer(
     _networkConfigurations,
     _graph,
     ImmutableSet.of(INITIATOR_HOST_NAME),
     ImmutableSet.of(RESPONDER_HOST_NAME));
 // answer should have exactly one row
 assertThat(ipsecSessionInfos, hasSize(1));
 assertThat(
   ipsecSessionInfos.iterator().next(),
   hasIpsecSessionStatus(equalTo(IPSEC_SESSION_ESTABLISHED)));
}
origin: batfish/batfish

c.getIkePhase1Proposals().put(ikePhase1Proposal.getName(), ikePhase1Proposal);
origin: batfish/batfish

String newIkeProposalName = ikeGroupName + ":" + ikeProposalEntry.getKey();
IkeProposal ikeProposal = ikeProposalEntry.getValue();
IkePhase1Proposal ikePhase1Proposal = new IkePhase1Proposal(newIkeProposalName);
ikePhase1Proposal.setDiffieHellmanGroup(ikeProposal.getDhGroup());
ikePhase1Proposal.setEncryptionAlgorithm(ikeProposal.getEncryptionAlgorithm());
ikePhase1Proposal.setLifetimeSeconds(ikeGroup.getLifetimeSeconds());
ikePhase1Proposal.setHashingAlgorithm(
  ikeProposal.getHashAlgorithm().toIkeAuthenticationAlgorithm());
ikePhase1Proposal.setAuthenticationMethod(ipsecPeer.getAuthenticationMode());
ikePhase1ProposalMapBuilder.put(newIkeProposalName, ikePhase1Proposal);
ikePhase1Policy.getIkePhase1Proposals().add(newIkeProposalName);
origin: batfish/batfish

  ImmutableSortedMap.of(ikePhase1PolicyName, new IkePhase1Policy(ikePhase1PolicyName)));
config.setIkePhase1Proposals(
  ImmutableSortedMap.of(ikePhase1ProposalName, new IkePhase1Proposal(ikePhase1ProposalName)));
config.setIpAccessLists(
  ImmutableSortedMap.of(ipAccessListName, new IpAccessList(ipAccessListName)));
org.batfish.datamodelIkePhase1Proposal

Javadoc

Represents the IKE proposal used for IKE phase 1 negotiation

Most used methods

  • <init>
  • getAuthenticationMethod
  • getDiffieHellmanGroup
  • getEncryptionAlgorithm
  • getHashingAlgorithm
  • getLifetimeSeconds
  • getName
  • setAuthenticationMethod
  • setDiffieHellmanGroup
  • setEncryptionAlgorithm
  • setHashingAlgorithm
  • setLifetimeSeconds
  • setHashingAlgorithm,
  • setLifetimeSeconds,
  • isCompatibleWith

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • getApplicationContext (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • JTable (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Runner (org.openjdk.jmh.runner)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now