Viewing file: dhcdbd.h (3.85 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* dhcdbd.h * * Dynamic Host Configuration Client manager D-BUS Daemon * * Copyright (c) Jason Vas Dias <jvdias@redhat.com>, Red Hat Inc., 2005 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation at * http://www.fsf.org/licensing/licenses/gpl.txt * and included in this software distribution as the "LICENSE" file. * * 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. */ #ifndef DHCDBD_H #define DHCDBD_H
#ifndef DHCDBD_DESTINATION #define DHCDBD_DESTINATION "com.redhat.dhcp" #endif #ifndef DHCDBD_OBJECT_PATH #define DHCDBD_OBJECT_PATH "/com/redhat/dhcp" #endif #ifndef DHCDBD_INTERFACE_PREFIX #define DHCDBD_INTERFACE_PREFIX "com.redhat.dhcp" #endif #ifndef DHCDBD_DHCLIENT_BIN #define DHCDBD_DHCLIENT_BIN "/sbin/dhclient" #endif #ifndef DHCDBD_DHCLIENT_LEASE_DIR #define DHCDBD_DHCLIENT_LEASE_DIR "/var/lib/dhclient/" #endif #ifndef DHCDBD_DHCLIENT_LEASE_PFX #define DHCDBD_DHCLIENT_LEASE_PFX "dhclient-" #endif #ifndef DHCDBD_DHCLIENT_LEASE_SFX #define DHCDBD_DHCLIENT_LEASE_SFX ".leases" #endif #ifndef DHCDBD_PID_FILE #define DHCDBD_PID_FILE "/var/run/dhcdbd.pid" #endif #ifndef DHCDBD_DHCLIENT_PID_PFX #define DHCDBD_DHCLIENT_PID_PFX "/var/run/dhclient-" #endif #ifndef DHCDBD_DHCLIENT_PID_SFX #define DHCDBD_DHCLIENT_PID_SFX ".pid" #endif #ifndef DHCDBD_DHCLIENT_CONF_PFX #define DHCDBD_DHCLIENT_CONF_PFX "/etc/dhclient" #endif #ifndef DHCDBD_DHCLIENT_CONF_SEP #define DHCDBD_DHCLIENT_CONF_SEP "-" #endif #ifndef DHCDBD_DHCLIENT_CONF_SFX #define DHCDBD_DHCLIENT_CONF_SFX ".conf" #endif #ifndef DHCLIENT_EXTENDED_OPTION_ENVIRONMENT #define DHCLIENT_EXTENDED_OPTION_ENVIRONMENT 1 #endif
#define DHCDBD_INTERFACE_TEXT "text" #define DHCDBD_INTERFACE_BIN "binary" #define DHCDBD_INTERFACE_DBUS "dbus" #define DHCDBD_INTERFACE_SUBS "subscribe"
typedef enum dhcdbd_dhcsflags_e { DHCLIENT_SCRIPT_DEFAULT = 0, DHCLIENT_SCRIPT_NO_RESOLV = 1, DHCLIENT_SCRIPT_NO_IFCONFIG = 2, DHCLIENT_SCRIPT_NO_ROUTES = 4, DHCLIENT_SCRIPT_NO_YPCONF = 8, DHCLIENT_SCRIPT_NO_NTPCONF =16, DHCLIENT_SCRIPT_DBUS_ONLY =31 } DHCDBD_DHCLIENT_SCRIPT_MODE;
typedef enum dhcdbd_dhcflags_e { DHCLIENT_PERSISTENT = 1, DHCLIENT_RELEASE = 2, DHCLIENT_NO_LEASES = 4 } DHCDBD_DHCLIENT_FLAGS;
typedef enum dhcdbd_dhcs_e /* these correspond to "reason" dhcp option values */ { DHC_NBI, /* no broadcast interfaces found */ DHC_PREINIT, /* configuration started */ DHC_BOUND, /* lease obtained */ DHC_RENEW, /* lease renewed */ DHC_REBOOT, /* have valid lease, but now obtained a different one */ DHC_REBIND, /* new, different lease */ DHC_STOP, /* remove old lease */ DHC_MEDIUM, /* media selection begun */ DHC_TIMEOUT, /* timed out contacting DHCP server */ DHC_FAIL, /* all attempts to contact server timed out, sleeping */ DHC_EXPIRE, /* lease has expired, renewing */ DHC_RELEASE, /* releasing lease */ /* "fake" states generated by dhcdbd: */ DHC_START, /* sent when dhclient started OK */ DHC_ABEND, /* dhclient exited abnormally */ DHC_END, /* dhclient exited normally */ DHC_END_OPTIONS, /* last option in subscription sent */ DHC_INVALID=255 } DHCDBD_dhclient_state;
typedef enum { D_BUS_SESSION, D_BUS_SYSTEM, D_BUS_STARTER } D_BUS_TYPE;
extern char *dhcdbd_destination, *dhcdbd_object_path, *dhcdbd_interface_prefix;
extern int dhcdbd_daemonize;
extern int dhcdbd_run( D_BUS_TYPE bus );
#endif
|