/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2013 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <tevent.h>
#include <talloc.h>
#include <time.h>
#include <string.h>
#include "providers/be_ptask_private.h"
#include "providers/be_ptask.h"
enum be_ptask_schedule {
};
enum be_ptask_delay {
};
enum be_ptask_delay delay_type,
enum be_ptask_schedule from);
{
return 0;
}
return 0;
}
{
return;
}
}
{
}
struct tevent_timer *tt,
void *pvt)
{
}
struct tevent_timer *tt,
void *pvt)
{
case BE_PTASK_OFFLINE_SKIP:
return;
case BE_PTASK_OFFLINE_DISABLE:
/* This case is normally handled by offline callback but we
* should handle it here as well since we can get here in some
* special cases for example unit tests or tevent events order. */
return;
case BE_PTASK_OFFLINE_EXECUTE:
/* continue */
break;
}
}
/* skip this iteration and try again later */
return;
}
/* schedule timeout */
/* If we can't guarantee a timeout,
* we need to cancel the request. */
}
}
return;
}
{
switch (ret) {
case EOK:
break;
default:
break;
}
}
enum be_ptask_delay delay_type,
enum be_ptask_schedule from)
{
return;
}
switch (delay_type) {
case BE_PTASK_FIRST_DELAY:
break;
case BE_PTASK_ENABLED_DELAY:
break;
case BE_PTASK_PERIOD:
/* double the period for the next execution */
}
break;
}
/* add random offset */
if (task->random_offset != 0) {
}
switch (from) {
break;
"from last execution time [%lu]\n",
break;
}
}
/* nothing we can do about it */
}
}
enum be_ptask_offline offline,
void *pvt,
const char *name,
{
return EINVAL;
}
goto done;
}
goto done;
}
if (offline == BE_PTASK_OFFLINE_DISABLE) {
/* install offline and online callbacks */
"Unable to install online callback [%d]: %s\n",
goto done;
}
"Unable to install offline callback [%d]: %s\n",
goto done;
}
}
}
done:
}
return ret;
}
{
return;
}
}
/* Disable the task, but if a request already in progress, let it finish. */
{
}
{
talloc_zfree(*task);
}
{
}
{
}
struct be_ptask_sync_ctx {
void *pvt;
};
struct be_ptask_sync_state {
int dummy;
};
/* This is not an asynchronous request so there is not any _done function. */
static struct tevent_req *
struct tevent_context *ev,
void *pvt)
{
return NULL;
}
} else {
}
return req;
}
{
return EOK;
}
enum be_ptask_offline offline,
void *pvt,
const char *name,
{
goto done;
}
goto done;
}
done:
}
return ret;
}