use of org.onosproject.net.host.DefaultHostDescription in project onos by opennetworkinglab.
the class NetworkConfigHostProvider method updateHost.
/**
* Updates host information.
* IP information will be replaced if host exists.
*
* @param mac MAC address of the host
* @param vlan VLAN ID of the host
* @param locations Locations of the host
* @param auxLocations auxiliary locations of the host
* @param ips Set of IP addresses of the host
* @param innerVlan host inner VLAN identifier
* @param outerTpid outer TPID of a host
*/
protected void updateHost(MacAddress mac, VlanId vlan, Set<HostLocation> locations, Set<HostLocation> auxLocations, Set<IpAddress> ips, VlanId innerVlan, EthType outerTpid) {
HostId hid = HostId.hostId(mac, vlan);
HostDescription desc = new DefaultHostDescription(mac, vlan, locations, auxLocations, ips, innerVlan, outerTpid, true);
providerService.hostDetected(hid, desc, true);
}
use of org.onosproject.net.host.DefaultHostDescription in project onos by opennetworkinglab.
the class NetworkConfigHostProvider method addHost.
/**
* Adds host information.
* IP information will be appended if host exists.
*
* @param mac MAC address of the host
* @param vlan VLAN ID of the host
* @param locations Locations of the host
* @param auxLocations auxiliary locations of the host
* @param ips Set of IP addresses of the host
* @param innerVlan host inner VLAN identifier
* @param outerTpid outer TPID of a host
*/
protected void addHost(MacAddress mac, VlanId vlan, Set<HostLocation> locations, Set<HostLocation> auxLocations, Set<IpAddress> ips, VlanId innerVlan, EthType outerTpid) {
HostId hid = HostId.hostId(mac, vlan);
HostDescription desc = (ips != null) ? new DefaultHostDescription(mac, vlan, locations, auxLocations, ips, innerVlan, outerTpid, true) : new DefaultHostDescription(mac, vlan, locations, auxLocations, Collections.emptySet(), innerVlan, outerTpid, true);
providerService.hostDetected(hid, desc, true);
}
use of org.onosproject.net.host.DefaultHostDescription in project onos by opennetworkinglab.
the class NetworkConfigHostProvider method addHost.
/**
* Adds host information.
* IP information will be appended if host exists.
*
* @param mac MAC address of the host
* @param vlan VLAN ID of the host
* @param locations Location of the host
* @param ips Set of IP addresses of the host
*/
protected void addHost(MacAddress mac, VlanId vlan, Set<HostLocation> locations, Set<IpAddress> ips) {
HostId hid = HostId.hostId(mac, vlan);
HostDescription desc = (ips != null) ? new DefaultHostDescription(mac, vlan, locations, ips, true) : new DefaultHostDescription(mac, vlan, locations, Collections.emptySet(), true);
providerService.hostDetected(hid, desc, true);
}
use of org.onosproject.net.host.DefaultHostDescription in project onos by opennetworkinglab.
the class NetworkConfigHostProviderTest method setUp.
@Before
public void setUp() {
provider.providerService = providerService;
// Initialize test variables
ips.add(IpAddress.valueOf("10.0.0.1"));
ips.add(IpAddress.valueOf("192.168.0.1"));
hostDescription = new DefaultHostDescription(mac, vlan, locations, auxLocations, ips, innerVlan, outerTpid, true);
}
use of org.onosproject.net.host.DefaultHostDescription in project onos by opennetworkinglab.
the class OpenstackSwitchingHostProviderTest method testProcessPortAddedForNewAddition.
/**
* Tests the process port added method for new addition case.
*/
@Test
public void testProcessPortAddedForNewAddition() {
org.onosproject.net.Port port = new DefaultPort(DEV2, P1, true, ANNOTATIONS);
DeviceEvent event = new DeviceEvent(DeviceEvent.Type.PORT_ADDED, DEV2, port);
target.portAddedHelper(event);
HostId hostId = HostId.hostId(HOST_MAC2);
HostDescription hostDesc = new DefaultHostDescription(HOST_MAC2, VlanId.NONE, new HostLocation(CP21, System.currentTimeMillis()), ImmutableSet.of(HOST_IP11), ANNOTATIONS);
verifyHostResult(hostId, hostDesc);
}
Aggregations