@LogMessageDoc(level="ERROR",message="Failure sending LLDP out port {port} on switch {switch}",explanation="An I/O error occured while sending LLDP message " + "to the switch.",recommendation=LogMessageDoc.CHECK_SWITCH) protected void sendDiscoveryMessage(DatapathId sw,OFPort port,boolean isStandard,boolean isReverse){
  if (!isOutgoingDiscoveryAllowed(sw,port,isStandard,isReverse))   return;
  IOFSwitch iofSwitch=switchService.getSwitch(sw);
  OFPortDesc ofpPort=iofSwitch.getPort(port);
  if (log.isTraceEnabled()) {
    log.trace("Sending LLDP packet out of swich: {}, port: {}",sw.toString(),port.getPortNumber());
  }
  OFPacketOut po=generateLLDPMessage(sw,port,isStandard,isReverse);
  OFPacketOut.Builder pob=po.createBuilder();
  List<OFAction> actions=getDiscoveryActions(iofSwitch,ofpPort.getPortNo());
  pob.setActions(actions);
  iofSwitch.write(pob.build());
  iofSwitch.flush();
}

@ LogMessageDoc ( level = "ERROR" , message = "Failure sending LLDP out port {port} on switch {switch}" , explanation = "An I/O error occured while sending LLDP message " + "to the switch." , recommendation = LogMessageDoc . CHECK_SWITCH ) protected void sendDiscoveryMessage ( DatapathId sw , OFPort port , boolean isStandard , boolean isReverse ) { if ( ! isOutgoingDiscoveryAllowed ( sw , port , isStandard , isReverse ) ) return ; IOFSwitch iofSwitch = switchService . getSwitch ( sw ) ; OFPortDesc ofpPort = iofSwitch . getPort ( port ) ; if ( log . isTraceEnabled ( ) ) { log . trace ( "Sending LLDP packet out of swich: {}, port: {}" , sw . toString ( ) , port . getPortNumber ( ) ) ; } OFPacketOut po = generateLLDPMessage ( sw , port , isStandard , isReverse ) ; OFPacketOut . Builder pob = po . createBuilder ( ) ; List < OFAction > actions = getDiscoveryActions ( iofSwitch , ofpPort . getPortNo ( ) ) ; pob . setActions ( actions ) ; iofSwitch . write ( pob . build ( ) ) ; iofSwitch . flush ( ) ; }
send link discovery message out of a given switch port . the discovery message may be a standard lldp or a modified lldp , where the dst mac address is set to : ff . todo : the modified lldp will updated in the future and may use a different eth - type .
