+Hostname1 *hostnamed_interf;
+
+GMainLoop *hostnamed_loop;
+
+guint bus_descriptor;
+gboolean dbus_interface_exported; /* reliable because of gdbus operational guarantees */
+
+gchar *CHASSIS, *ICON;
+
+/* TODO no specific vm or laptop icon in gnome
+ * NOTE paravirtualization on xen is only available for linuxes right now
+ * dmesg on linux systems reveals xen and virtualization method (HVM or PVM)
+ * but we will worry about those later */
+const struct SYSCTL_LOOKUP_TABLE chassis_indicator_table[] =
+{
+ { "QEMU Virtual CPU", "container", NULL, FALSE, FALSE }, /* could be QEMU running in userspace or as part of KVM */
+ { "KVM", "vm", "drive-multidisk", FALSE, FALSE },
+ { "SmartDC HVM", "vm", "drive-multidisk", TRUE, TRUE }, /* oracle solaris kvm */
+ { "VirtualBox", "container", "drive-optical", TRUE, TRUE },
+ { "VMware, Inc.", "container", "drive-optical", TRUE, TRUE },
+ { "VMware Virtual Platform", "container", "drive-optical", TRUE, TRUE },
+ { "Parallels", "container", "drive-optical", TRUE, TRUE } /* need verification */
+};
+
+/* archs to check against when determining if machine is server */
+const gchar *server_archs[] = {
+ "hppa",
+ "sparc",
+ "sparc64"
+};
+
+/* --- begin method/property/dbus signal code --- */
+
+static gboolean
+on_handle_set_hostname(Hostname1 *hn1_passed_interf,
+ GDBusMethodInvocation *invoc,
+ const gchar *greet,
+ gpointer data) {
+ return FALSE;
+}
+
+static gboolean
+on_handle_set_static_hostname(Hostname1 *hn1_passed_interf,
+ GDBusMethodInvocation *invoc,
+ const gchar *greet,
+ gpointer data) {
+ return FALSE;
+}
+
+static gboolean
+on_handle_set_pretty_hostname(Hostname1 *hn1_passed_interf,
+ GDBusMethodInvocation *invoc,
+ const gchar *greet,
+ gpointer data) {
+ return FALSE;
+}
+
+static gboolean
+on_handle_set_chassis(Hostname1 *hn1_passed_interf,
+ GDBusMethodInvocation *invoc,
+ const gchar *greet,
+ gpointer data) {
+ return FALSE;
+}
+
+static gboolean
+on_handle_set_icon_name(Hostname1 *hn1_passed_interf,
+ GDBusMethodInvocation *invoc,
+ const gchar *greet,
+ gpointer data) {
+ return FALSE;
+}
+
+/* note: all hostnamed/hostname1's properties are read-only,
+ * and do not need set_ functions, gdbus-codegen realized
+ * this from the XML and handled the to-be error of trying
+ * to set a read-only property's value
+ */
+
+const gchar *
+our_get_hostname() {
+
+ gchar *hostname_buf, *ret;
+ size_t hostname_divider;
+
+ hostname_buf = (gchar*) g_malloc0(MAXHOSTNAMELEN);
+ ret = (gchar*) g_malloc0(MAXHOSTNAMELEN);
+
+ g_ptr_array_add(hostnamed_freeable, hostname_buf);
+ g_ptr_array_add(hostnamed_freeable, ret);
+
+ if(gethostname(hostname_buf, MAXHOSTNAMELEN) || g_strcmp0(hostname_buf, "") == 0)
+ return "localhost";
+
+ hostname_divider = strcspn(hostname_buf, ".");
+
+ return strncpy(ret, hostname_buf, hostname_divider);
+}
+
+const gchar *
+our_get_static_hostname() {
+
+ const gchar *pretty_hostname;
+ const gchar *ret;
+
+ pretty_hostname = our_get_pretty_hostname();
+
+ if(g_strcmp0(pretty_hostname, "") == 0)
+ ret = our_get_hostname();
+
+ else if((ret = g_hostname_to_ascii(pretty_hostname))) {
+
+ g_ptr_array_add(hostnamed_freeable, (gpointer)ret);
+ return ret;
+ }
+
+ return ret;
+}
+
+const gchar *
+our_get_pretty_hostname() {
+
+ GKeyFile *config;
+ gchar *ret;
+
+ config = g_key_file_new();
+
+ if(g_key_file_load_from_file(config, "/etc/systemd_compat.conf", G_KEY_FILE_NONE, NULL)
+ && (ret = g_key_file_get_value(config, "hostnamed", "PrettyHostname", NULL))) { /* ret might need to be freed, docs dont specify but i am suspicious */
+
+ g_key_file_unref(config);
+ return ret;
+ }
+
+ if(config)
+ g_free(config);
+
+ return "";
+}
+
+const gchar *
+our_get_chassis() {
+
+ if(CHASSIS)
+ return CHASSIS;
+
+ return "desktop";
+}
+
+const gchar *
+our_get_icon_name() {
+
+ if(ICON)
+ return ICON;
+
+ return "";
+}
+
+const gchar *
+our_get_kernel_name() {
+
+ return "TODO";
+}
+
+const gchar *
+our_get_kernel_version() {
+
+ return "TODO";
+}
+
+const gchar *
+our_get_kernel_release() {
+
+ return "TODO";
+}
+
+const gchar *
+our_get_os_cpename() {
+
+ return "TODO";
+}
+
+const gchar *
+our_get_os_pretty_name() {
+
+ return "TODO";
+}