45 const char *algorithm,
46 const unsigned char *secret,
52 status = omapi_auth_key_new (&key,
MDL);
53 if (status != ISC_R_SUCCESS)
56 key -> name =
dmalloc (strlen (name) + 1,
MDL);
58 omapi_auth_key_dereference (&key,
MDL);
59 return ISC_R_NOMEMORY;
61 strcpy (key -> name, name);
65 if (strchr (algorithm,
'.') == 0) {
66 static char add[] =
".SIG-ALG.REG.INT.";
67 key -> algorithm =
dmalloc (strlen (algorithm) +
69 if (!key -> algorithm) {
70 omapi_auth_key_dereference (&key,
MDL);
71 return ISC_R_NOMEMORY;
73 strcpy (key -> algorithm, algorithm);
74 strcat (key -> algorithm, add);
76 key -> algorithm =
dmalloc (strlen (algorithm) + 1,
MDL);
77 if (!key -> algorithm) {
78 omapi_auth_key_dereference (&key,
MDL);
79 return ISC_R_NOMEMORY;
81 strcpy (key -> algorithm, algorithm);
85 if (status != ISC_R_SUCCESS) {
86 omapi_auth_key_dereference (&key,
MDL);
89 memcpy (key -> key -> value, secret, secret_len);
90 key -> key -> len = secret_len;
108 const char *object_type)
117 if (status != ISC_R_SUCCESS)
122 if (status != ISC_R_SUCCESS) {
127 if (status != ISC_R_SUCCESS) {
135 if (status != ISC_R_SUCCESS) {
144 if (status != ISC_R_SUCCESS) {
153 if (status != ISC_R_SUCCESS)
184 if (status != ISC_R_SUCCESS)
188 if (status != ISC_R_SUCCESS) {
194 if (status != ISC_R_SUCCESS) {
201 if (status != ISC_R_SUCCESS) {
209 if (status != ISC_R_SUCCESS) {
217 if (status != ISC_R_SUCCESS) {
223 if (remote -> rtype) {
225 "type", remote -> rtype);
226 if (status != ISC_R_SUCCESS) {
233 if (status != ISC_R_SUCCESS) {
242 if (status != ISC_R_SUCCESS)
266 if (status == ISC_R_SUCCESS)
267 ro -> remote_handle = rh;
271 if (h -> inner && h -> inner -> type -> set_value)
272 return (*(h -> inner -> type -> set_value))
273 (h -> inner, id,
name, value);
274 return ISC_R_NOTFOUND;
285 if (h -> inner && h -> inner -> type -> get_value)
286 return (*(h -> inner -> type -> get_value))
287 (h -> inner, id,
name, value);
288 return ISC_R_NOTFOUND;
292 const char *
name, va_list ap)
301 if (!strcmp (name,
"updated")) {
302 p -> waitstatus = ISC_R_SUCCESS;
307 if (!strcmp (name,
"status")) {
308 p -> waitstatus = va_arg (ap, isc_result_t);
317 if (p -> inner && p -> inner -> type -> signal_handler)
318 return (*(p -> inner -> type -> signal_handler))
319 (p -> inner,
name, ap);
321 return ISC_R_SUCCESS;
337 return ISC_R_SUCCESS;
350 if (p -> inner && p -> inner -> type -> stuff_values)
351 return (*(p -> inner -> type -> stuff_values)) (c, id,
353 return ISC_R_SUCCESS;
isc_result_t omapi_typed_data_new(const char *, int, omapi_typed_data_t **, omapi_datatype_t,...)
isc_result_t omapi_generic_clear_flags(omapi_object_t *)
isc_result_t omapi_message_new(omapi_object_t **, const char *, int)
isc_result_t omapi_object_reference(omapi_object_t **, omapi_object_t *, const char *, int)
isc_result_t dhcpctl_remote_get_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_value_t **value)
isc_result_t omapi_message_register(omapi_object_t *)
#define DHCP_R_INVALIDARG
isc_result_t omapi_signal_in(omapi_object_t *, const char *,...)
isc_result_t dhcpctl_remote_destroy(omapi_object_t *h, const char *file, int line)
isc_result_t omapi_set_object_value(omapi_object_t *, omapi_object_t *, const char *, omapi_object_t *)
isc_result_t omapi_message_unregister(omapi_object_t *)
dhcpctl_status dhcpctl_new_authenticator(dhcpctl_handle *h, const char *name, const char *algorithm, const unsigned char *secret, unsigned secret_len)
isc_result_t dhcpctl_remote_stuff_values(omapi_object_t *c, omapi_object_t *id, omapi_object_t *p)
dhcpctl_status dhcpctl_new_object(dhcpctl_handle *h, dhcpctl_handle connection, const char *object_type)
isc_result_t dhcpctl_status
isc_result_t omapi_set_boolean_value(omapi_object_t *, omapi_object_t *, const char *, int)
omapi_data_string_t * key
isc_result_t omapi_object_dereference(omapi_object_t **, const char *, int)
omapi_object_t * dhcpctl_handle
isc_result_t omapi_set_value_str(omapi_object_t *, omapi_object_t *, const char *, omapi_typed_data_t *)
isc_result_t omapi_generic_new(omapi_object_t **, const char *, int)
isc_result_t omapi_get_int_value(unsigned long *, omapi_typed_data_t *)
void dfree(void *, const char *, int)
isc_result_t omapi_protocol_send_message(omapi_object_t *, omapi_object_t *, omapi_object_t *, omapi_object_t *)
omapi_object_type_t * dhcpctl_remote_type
void * dmalloc(size_t, const char *, int)
omapi_typed_data_t * rtype
isc_result_t omapi_typed_data_reference(omapi_typed_data_t **, omapi_typed_data_t *, const char *, int)
omapi_object_type_t * omapi_type_generic
isc_result_t omapi_object_allocate(omapi_object_t **, omapi_object_type_t *, size_t, const char *, int)
int omapi_ds_strcmp(omapi_data_string_t *, const char *)
isc_result_t omapi_data_string_new(omapi_data_string_t **, unsigned, const char *, int)
isc_result_t dhcpctl_remote_signal_handler(omapi_object_t *o, const char *name, va_list ap)
isc_result_t omapi_set_int_value(omapi_object_t *, omapi_object_t *, const char *, int)
isc_result_t dhcpctl_remote_set_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_typed_data_t *value)
dhcpctl_status dhcpctl_open_object(dhcpctl_handle h, dhcpctl_handle connection, int flags)
isc_result_t omapi_typed_data_dereference(omapi_typed_data_t **, const char *, int)