func (r *session) OnPortDescReply(f openflow.Factory, w trans.Writer, v openflow.PortDescReply) error { r.log.Debug(fmt.Sprintf("Session: PORT_DESC_REPLY is received (# of ports=%v)", len(v.Ports()))) if !r.negotiated { return errNotNegotiated } return r.handler.OnPortDescReply(f, w, v) }
func (r *of13Session) OnPortDescReply(f openflow.Factory, w trans.Writer, v openflow.PortDescReply) error { ports := v.Ports() for _, p := range ports { if p.Number() > of13.OFPP_MAX { continue } r.device.addPort(p.Number(), p) if !p.IsPortDown() && !p.IsLinkDown() && r.device.isValid() { // Send LLDP to update network topology if err := sendLLDP(r.device.ID(), f, w, p); err != nil { r.log.Err(fmt.Sprintf("OF13Session: failed to send LLDP: %v", err)) } } r.log.Debug(fmt.Sprintf("OF13Session: PortNum=%v, AdminUp=%v, LinkUp=%v", p.Number(), !p.IsPortDown(), !p.IsLinkDown())) if err := sendQueueConfigRequest(f, w, p.Number()); err != nil { r.log.Err(fmt.Sprintf("OF13Session: sending queue config request: %v", err)) } } return nil }