code: func (n *RegisteredNexthop) Serialize() ([]byte, error) {
  	// Connected (1 byte)
  	buf := make([]byte, 4)
  	buf[0] = byte(n.Connected)
  
  	// Address Family (2 bytes)
  	binary.BigEndian.PutUint16(buf[1:3], n.Family)
  	// Prefix Length (1 byte)
  	addrByteLen, err := addressByteLength(uint8(n.Family))
  	if err != nil {
  		return nil, err
  	}
  
  	buf[3] = byte(addrByteLen * 8)
  	// Prefix (variable)
  	switch n.Family {
  	case uint16(syscall.AF_INET):
  		buf = append(buf, n.Prefix.To4()...)
  	case uint16(syscall.AF_INET6):
  		buf = append(buf, n.Prefix.To16()...)
  	default:
  		return nil, fmt.Errorf("invalid address family: %d", n.Family)
  	}
  
  	return buf, nil
  }
docs: // Reference: sendmsg_nexthop in bgpd/bgp_nht.c of Quagga1.2.x (ZAPI3)
  // Reference: sendmsg_zebra_rnh in bgpd/bgp_nht.c of FRR3.x (ZAPI4)
  // Reference: zclient_send_rnh function in lib/zclient.c of FRR5.x (ZAPI5)