monitor_sbus.c revision f1bc4e8b9daf04a5cb4b9464021bb9e816eed3ea
/*
SSSD
Data Provider Helpers
Copyright (C) Stephen Gallagher <sgallagh@redhat.com> 2009
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/>.
*/
/* Needed for res_init() */
#include <resolv.h>
#include "sbus/sssd_dbus.h"
#include "monitor/monitor_interfaces.h"
{
char *default_address;
if (default_address == NULL) {
return ENOMEM;
}
return EOK;
}
{
int type;
if (!reply) {
/* reply should never be null. This function shouldn't be called
* until reply is valid or timeout has occurred. If reply is NULL
* here, something is seriously wrong and we should bail out.
*/
DEBUG(0, ("Severe error. A reply callback was called but no"
" reply was received and no timeout occurred\n"));
/* FIXME: Destroy this connection ? */
goto done;
}
switch (type) {
if (!ret) {
/* FIXME: Destroy this connection ? */
goto done;
}
break;
case DBUS_MESSAGE_TYPE_ERROR:
DEBUG(0,("The Monitor returned an error [%s]\n",
/* Falling through to default intentionally*/
default:
/*
* Timeout or other error occurred or something
* unexpected happened.
* It doesn't matter which, because either way we
* know that this connection isn't trustworthy.
* We'll destroy it now.
*/
/* FIXME: Destroy this connection ? */
break;
}
done:
}
{
int retval;
/* create the message */
DEBUG(0, ("Out of memory?!\n"));
return ENOMEM;
}
if (!ret) {
return EIO;
}
return retval;
}
struct sbus_connection *conn)
{
if (!ret) {
return EIO;
}
/* send reply back */
return EOK;
}
struct sbus_connection *conn)
{
int ret;
if(ret != 0) {
return EIO;
}
/* Send an empty reply to acknowledge receipt */
}
struct sbus_connection *conn)
{
int ret;
ret = rotate_debug_files();
if (ret) {
return ret;
}
}