Esempio n. 1
0
  public static VRRPGroup newParamsVRRPGroupWithOneEndpoint(
      String virtualIPAddress,
      String interfaceName,
      String interfaceIPAddress,
      String interfaceSubnetMask) {
    // VRRPGroup
    VRRPGroup vrrpGroup = new VRRPGroup();
    vrrpGroup.setVrrpName(201);
    vrrpGroup.setVirtualIPAddress(virtualIPAddress);

    // VRRPProtocolEndpoint
    VRRPProtocolEndpoint vrrProtocolEndpoint1 = new VRRPProtocolEndpoint();
    vrrProtocolEndpoint1.setPriority(100);
    vrrProtocolEndpoint1.setService(vrrpGroup);

    // IPProtocolEndpoint
    IPProtocolEndpoint ipProtocolEndpoint1 = new IPProtocolEndpoint();
    ipProtocolEndpoint1.setIPv4Address(interfaceIPAddress);
    ipProtocolEndpoint1.setSubnetMask(interfaceSubnetMask);
    vrrProtocolEndpoint1.bindServiceAccessPoint(ipProtocolEndpoint1);

    // EthernetPort
    EthernetPort eth1 = new EthernetPort();
    eth1.setLinkTechnology(NetworkPort.LinkTechnology.ETHERNET);
    eth1.setName(interfaceName);
    ipProtocolEndpoint1.addLogiaclPort(eth1);

    return vrrpGroup;
  }
Esempio n. 2
0
 public static Object newParamsInterfaceGRE() {
   EthernetPort eth = new EthernetPort();
   eth.setName("gr-0/3/2");
   eth.setPortNumber(2);
   IPProtocolEndpoint ip = new IPProtocolEndpoint();
   ip.setIPv4Address("192.168.32.1");
   ip.setSubnetMask("255.255.255.0");
   eth.addProtocolEndpoint(ip);
   return eth;
 }
Esempio n. 3
0
 /*
  * test of an interface ethernet without vlan encapsulation
  */
 public static Object newParamsInterfaceEthernet() {
   EthernetPort eth = new EthernetPort();
   eth.setLinkTechnology(NetworkPort.LinkTechnology.ETHERNET);
   eth.setName("fe-0/3/2");
   IPProtocolEndpoint ip = new IPProtocolEndpoint();
   ip.setIPv4Address("192.168.32.1");
   ip.setSubnetMask("255.255.255.0");
   eth.addProtocolEndpoint(ip);
   return eth;
 }
Esempio n. 4
0
  /*
   * test of an interface ethernet without vlan encapsulation
   */
  public static Object newParamsInterfaceLT() {
    LogicalTunnelPort ltp = new LogicalTunnelPort();
    ltp.setLinkTechnology(NetworkPort.LinkTechnology.ETHERNET);
    ltp.setName("lt-0/3/2");
    ltp.setPeer_unit(101);
    IPProtocolEndpoint ip = new IPProtocolEndpoint();
    ip.setIPv4Address("192.168.32.1");
    ip.setSubnetMask("255.255.255.0");
    ltp.addProtocolEndpoint(ip);

    return ltp;
  }
Esempio n. 5
0
 public static Object newParamsInterfaceEtherVLAN() {
   EthernetPort eth = new EthernetPort();
   eth.setLinkTechnology(NetworkPort.LinkTechnology.OTHER);
   eth.setName("fe-0/3/2");
   eth.setPortNumber(2);
   IPProtocolEndpoint ip = new IPProtocolEndpoint();
   ip.setIPv4Address("192.168.32.1");
   ip.setSubnetMask("255.255.255.0");
   eth.addProtocolEndpoint(ip);
   VLANEndpoint vlan = new VLANEndpoint();
   vlan.setVlanID(2);
   eth.addProtocolEndpoint(vlan);
   return eth;
 }
Esempio n. 6
0
  /*
   * (non-Javadoc)
   *
   * @see org.opennaas.extensions.router.capability.ip.IIPCapability#setIPv4(org.opennaas.extensions.router.model.LogicalPort)
   */
  @Override
  public void setIPv4(LogicalDevice iface, IPProtocolEndpoint ipProtocolEndpoint)
      throws CapabilityException {
    NetworkPort param = new NetworkPort();
    param.setName(iface.getName());
    if (iface instanceof NetworkPort) {
      param.setPortNumber(((NetworkPort) iface).getPortNumber());
      param.setLinkTechnology(((NetworkPort) iface).getLinkTechnology());
    }
    IPProtocolEndpoint ip = new IPProtocolEndpoint();
    ip.setIPv4Address(ipProtocolEndpoint.getIPv4Address());
    ip.setSubnetMask(ipProtocolEndpoint.getSubnetMask());
    param.addProtocolEndpoint(ipProtocolEndpoint);

    IAction action = createActionAndCheckParams(IPActionSet.SET_IPv4, param);
    queueAction(action);
  }
Esempio n. 7
0
 /** @return */
 public static IPProtocolEndpoint getIPProtocolEndPoint() {
   IPProtocolEndpoint ipProtocolEndpoint = new IPProtocolEndpoint();
   ipProtocolEndpoint.setIPv4Address("192.168.0.1");
   ipProtocolEndpoint.setSubnetMask("255.255.255.0");
   return ipProtocolEndpoint;
 }