Newer
Older
Christoph Petrausch
committed
"io"
Christoph Petrausch
committed
log "github.com/sirupsen/logrus"
func serializeAndSendUpdate(out io.Writer, update serializeAbleUpdate, opt *types.Options) error {
updateBytes, err := update.SerializeUpdate(opt)
Christoph Petrausch
committed
if err != nil {
log.Errorf("Unable to serialize BGP Update: %v", err)
return nil
}
_, err = out.Write(updateBytes)
if err != nil {
return fmt.Errorf("Failed sending Update: %v", err)
}
return nil
}
type serializeAbleUpdate interface {
SerializeUpdate(opt *types.Options) ([]byte, error)
}