#ifndef lint
static char copyright[] =
-"$Id: omapi.c,v 1.1 1999/09/08 01:36:05 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: omapi.c,v 1.2 1999/09/09 21:12:12 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
omapi_object_type_t *dhcp_type_lease;
omapi_object_type_t *dhcp_type_group;
-omapi_object_type_t *dhcp_type_host;
omapi_object_type_t *dhcp_type_pool;
omapi_object_type_t *dhcp_type_shared_network;
omapi_object_type_t *dhcp_type_subnet;
isc_result_t status;
int foo;
- if (h -> type != omapi_type_message)
+ if (h -> type != dhcp_type_lease)
return ISC_R_INVALIDARG;
lease = (struct lease *)h;
isc_result_t status;
int foo;
- if (h -> type != omapi_type_message)
+ if (h -> type != dhcp_type_host)
return ISC_R_INVALIDARG;
host = (struct host_decl *)h;
return ISC_R_SUCCESS;
}
+ /* The "known" flag isn't supported in the database yet, but it's
+ legitimate. */
+ if (!omapi_ds_strcmp (name, "known")) {
+ return ISC_R_SUCCESS;
+ }
+
/* Try to find some inner object that can take the value. */
if (h -> inner && h -> inner -> type -> set_value) {
status = ((*(h -> inner -> type -> set_value))
return ISC_R_NOMEMORY;
strcpy (host -> name, hnbuf);
}
- enter_host (host, 1);
- if (!write_host (host))
- return ISC_R_IOERROR;
+ enter_host (host, 1, 1);
}
/* Try to find some inner object that can take the value. */
(c, host -> client_identifier.len));
if (status != ISC_R_SUCCESS)
return status;
+ status = (omapi_connection_copyin
+ (c,
+ host -> client_identifier.data,
+ host -> client_identifier.len));
+ if (status != ISC_R_SUCCESS)
+ return status;
}
status = omapi_connection_put_name (c, "name");
return ISC_R_NOMEMORY;
memset (hp, 0, sizeof *hp);
hp -> refcnt = 0;
+ hp -> type = dhcp_type_host;
+ hp -> group = &root_group; /* XXX */
return omapi_object_reference (lp, (omapi_object_t *)hp,
"dhcp_host_create");
}
isc_result_t status;
int foo;
- if (h -> type != omapi_type_message)
+ if (h -> type != dhcp_type_pool)
return ISC_R_INVALIDARG;
pool = (struct pool *)h;