Exemplo n.º 1
0
func (r *session) OnDescReply(f openflow.Factory, w trans.Writer, v openflow.DescReply) error {
	r.log.Debug("Session: DESC_REPLY is received")

	if !r.negotiated {
		return errNotNegotiated
	}

	r.log.Debug(fmt.Sprintf("Session: Manufacturer=%v", v.Manufacturer()))
	r.log.Debug(fmt.Sprintf("Session: Hardware=%v", v.Hardware()))
	r.log.Debug(fmt.Sprintf("Session: Software=%v", v.Software()))
	r.log.Debug(fmt.Sprintf("Session: Serial=%v", v.Serial()))
	r.log.Debug(fmt.Sprintf("Session: Description=%v", v.Description()))

	desc := Descriptions{
		Manufacturer: v.Manufacturer(),
		Hardware:     v.Hardware(),
		Software:     v.Software(),
		Serial:       v.Serial(),
		Description:  v.Description(),
	}
	r.device.setDescriptions(desc)

	return r.handler.OnDescReply(f, w, v)
}
Exemplo n.º 2
0
func isHP2920_24G(msg openflow.DescReply) bool {
	return strings.HasPrefix(msg.Manufacturer(), "HP") && strings.HasPrefix(msg.Hardware(), "2920-24G")
}