Beispiel #1
0
 public override bool PortStatus(OfpPortStatus status, IConnection handler)
 {
     if (status.Reason == OfpPortReason.OFPPR_ADD || status.Reason == OfpPortReason.OFPPR_MODIFY)
     {
         SendLldpPacket(handler, status.Desc);
     }
     if (status.Reason == OfpPortReason.OFPPR_DELETE)
     {
         _controller.Topo.RemoveLinkByPortNo(handler.SwitchFeatures.DatapathId, status.Desc.PortNo);
     }
     return(false);
 }
Beispiel #2
0
 /// <summary>
 /// 处理端口状态消息
 /// </summary>
 /// <param name="status"></param>
 /// <param name="handler"></param>
 /// <returns></returns>
 public virtual bool PortStatus(OfpPortStatus status, IConnection handler)
 {
     foreach (var plugin in Plugins.Values.Where(plugin => plugin.Active))
     {
         try
         {
             bool result = plugin.MessageHandler.PortStatus(status, handler);
             if (result)
             {
                 break;
             }
         }
         catch (Exception e)
         {
             Debug.WriteLine(e);
         }
     }
     return(true);
 }
Beispiel #3
0
        private void PortStatus(MemoryStream ms, OfpHeader header)
        {
            OfpPortStatus status = new OfpPortStatus(ms, header);

            _controller.PluginSystem.PortStatus(status, this);
        }
Beispiel #4
0
 /// <summary>
 /// 处理端口状态消息
 /// </summary>
 /// <param name="status"></param>
 /// <param name="handler"></param>
 /// <returns></returns>
 public virtual bool PortStatus(OfpPortStatus status, IConnection handler)
 {
     return(false);
 }