Java Code Examples for org.onosproject.net.HostId#vlanId()
The following examples show how to use
org.onosproject.net.HostId#vlanId() .
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: HostLocationProvider.java From onos with Apache License 2.0 | 6 votes |
/** * Updates IP address for an existing host. * * @param hid host ID * @param ip IP address */ private void updateHostIp(HostId hid, IpAddress ip) { Host host = hostService.getHost(hid); if (host == null) { log.warn("Fail to update IP for {}. Host does not exist", hid); return; } HostDescription desc = new DefaultHostDescription(hid.mac(), hid.vlanId(), host.locations(), Sets.newHashSet(ip), false); try { providerService.hostDetected(hid, desc, false); } catch (IllegalStateException e) { log.debug("Host {} suppressed", hid); } }
Example 2
Source File: DhcpRecord.java From onos with Apache License 2.0 | 5 votes |
/** * Creates a DHCP record for a host (mac + vlan). * * @param hostId the host id for the host */ public DhcpRecord(HostId hostId) { checkNotNull(hostId, "Host id can't be null"); this.locations = Sets.newHashSet(); this.macAddress = hostId.mac(); this.vlanId = hostId.vlanId(); this.lastSeen = System.currentTimeMillis(); this.directlyConnected = false; this.v6Counters = new DhcpRelayCounters(); }
Example 3
Source File: DistributedHostStoreTest.java From onos with Apache License 2.0 | 5 votes |
private static HostDescription createHostDesc(HostId hostId, Set<IpAddress> ips, boolean configured, Set<HostLocation> locations) { return locations.isEmpty() ? new DefaultHostDescription(hostId.mac(), hostId.vlanId(), HostLocation.NONE, ips, configured) : new DefaultHostDescription(hostId.mac(), hostId.vlanId(), locations, ips, configured); }
Example 4
Source File: TopologySimulator.java From onos with Apache License 2.0 | 2 votes |
/** * Generates a host description from the given id and location information. * * @param hostId host identifier * @param ip host IP * @param deviceId edge device * @param port edge port * @return host description */ static HostDescription description(HostId hostId, IpAddress ip, DeviceId deviceId, int port) { HostLocation location = new HostLocation(deviceId, portNumber(port), 0L); return new DefaultHostDescription(hostId.mac(), hostId.vlanId(), location, ip); }
Example 5
Source File: CustomTopologySimulator.java From onos with Apache License 2.0 | 2 votes |
/** * Creates a simulated host. * * @param hostId host identifier * @param location host location * @param hostIp host IP address */ public void createHost(HostId hostId, HostLocation location, IpAddress hostIp) { DefaultHostDescription description = new DefaultHostDescription(hostId.mac(), hostId.vlanId(), location, hostIp); hostProviderService.hostDetected(hostId, description, false); }
Example 6
Source File: CustomTopologySimulator.java From onos with Apache License 2.0 | 2 votes |
/** * Creates a simulated multi-homed host. * * @param hostId host identifier * @param locations host locations * @param hostIps host IP addresses */ public void createHost(HostId hostId, Set<HostLocation> locations, Set<IpAddress> hostIps) { DefaultHostDescription description = new DefaultHostDescription(hostId.mac(), hostId.vlanId(), locations, hostIps, false); hostProviderService.hostDetected(hostId, description, false); }