Java Code Examples for org.onosproject.net.host.InterfaceIpAddress#valueOf()

The following examples show how to use org.onosproject.net.host.InterfaceIpAddress#valueOf() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultFabricNetworkTest.java    From onos with Apache License 2.0 5 votes vote down vote up
private static Interface createInterface(int index) {

        String name = "INTF_NAME_" + index;
        ConnectPoint cp = ConnectPoint.fromString("of:0011223344556677/" + index);
        InterfaceIpAddress intfIp1 = InterfaceIpAddress.valueOf("10.10.10." + index + "/32");
        InterfaceIpAddress intfIp2 = InterfaceIpAddress.valueOf("20.20.20." + index + "/32");
        List<InterfaceIpAddress> intfIps = ImmutableList.of(intfIp1, intfIp2);
        MacAddress mac = MacAddress.valueOf("00:00:00:00:00:00");
        VlanId vlanId = VlanId.NONE;

        return new Interface(name, cp, intfIps, mac, vlanId);
    }
 
Example 2
Source File: InterfaceManagerTest.java    From onos with Apache License 2.0 5 votes vote down vote up
private Interface createInterface(int i) {
    ConnectPoint cp = createConnectPoint(i);

    InterfaceIpAddress ia = InterfaceIpAddress.valueOf("192.168." + i + ".1/24");

    Interface intf = new Interface(Interface.NO_INTERFACE_NAME, cp,
            Collections.singletonList(ia),
            MacAddress.valueOf(i),
            VlanId.vlanId((short) i));

    return intf;
}