Codota Logo
IkePhase1Proposal
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
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 EncryptionAlgorithm featureValueOf(IkePhase1Proposal actual) {
  return actual.getEncryptionAlgorithm();
 }
}
origin: batfish/batfish

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

 @Override
 protected IkeHashingAlgorithm featureValueOf(IkePhase1Proposal actual) {
  return actual.getHashingAlgorithm();
 }
}
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

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • orElseThrow (Optional)
  • getSharedPreferences (Context)
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now