67 sizeof (dhcp_control_object_t),
69 if (status != ISC_R_SUCCESS)
70 log_fatal (
"Can't register control object type: %s",
71 isc_result_totext (status));
72 status = dhcp_control_allocate (&dhcp_control_object,
MDL);
73 if (status != ISC_R_SUCCESS)
74 log_fatal (
"Can't make initial control object: %s",
75 isc_result_totext (status));
88 sizeof (
struct group_object), 0,
90 if (status != ISC_R_SUCCESS)
91 log_fatal (
"Can't register group object type: %s",
92 isc_result_totext (status));
104 sizeof (
struct subnet), 0,
106 if (status != ISC_R_SUCCESS)
107 log_fatal (
"Can't register subnet object type: %s",
108 isc_result_totext (status));
111 (&dhcp_type_shared_network,
121 sizeof (
struct shared_network), 0,
RC_MISC);
122 if (status != ISC_R_SUCCESS)
123 log_fatal (
"Can't register shared network object type: %s",
124 isc_result_totext (status));
151 return ISC_R_NOMEMORY;
152 memcpy (group -> name,
155 group -> name [value -> u.
buffer.len] = 0;
158 return ISC_R_SUCCESS;
162 if (group -> group && group -> group -> statements)
164 if (!group -> group) {
166 return ISC_R_NOMEMORY;
174 (
char *) value->
u.
buffer.value,
176 "network client", 0);
177 if (status != ISC_R_SUCCESS || parse == NULL)
180 (&group -> group -> statements, parse, &lose,
186 return ISC_R_SUCCESS;
192 if (h -> inner && h -> inner -> type -> set_value) {
193 status = ((*(h -> inner -> type -> set_value))
194 (h -> inner, id, name, value));
199 return ISC_R_NOTFOUND;
216 name, group -> name,
MDL);
219 if (h -> inner && h -> inner -> type -> get_value) {
220 status = ((*(h -> inner -> type -> get_value))
221 (h -> inner, id,
name, value));
222 if (status == ISC_R_SUCCESS)
225 return ISC_R_NOTFOUND;
241 strlen (group ->
name),
MDL)) {
244 strlen (group ->
name),
246 group_object_dereference (&t,
MDL);
250 group ->
name = (
char *)0;
255 return ISC_R_SUCCESS;
259 const char *
name, va_list ap)
269 if (!strcmp (name,
"updated")) {
276 if (!group -> name) {
278 sprintf (hnbuf,
"ng%08lx%08lx",
280 (
unsigned long)group);
281 group -> name =
dmalloc (strlen (hnbuf) + 1,
MDL);
283 return ISC_R_NOMEMORY;
284 strcpy (group -> name, hnbuf);
292 if (h -> inner && h -> inner -> type -> get_value) {
293 status = ((*(h -> inner -> type -> signal_handler))
294 (h -> inner,
name, ap));
295 if (status == ISC_R_SUCCESS)
299 return ISC_R_SUCCESS;
300 return ISC_R_NOTFOUND;
317 if (status != ISC_R_SUCCESS)
320 if (status != ISC_R_SUCCESS)
325 if (h -> inner && h -> inner -> type -> stuff_values) {
326 status = ((*(h -> inner -> type -> stuff_values))
327 (c, id, h -> inner));
328 if (status == ISC_R_SUCCESS)
332 return ISC_R_SUCCESS;
347 if (status == ISC_R_SUCCESS) {
351 if (status != ISC_R_SUCCESS)
363 if (status == ISC_R_SUCCESS) {
368 tv -> value -> u.buffer.
value,
369 tv -> value -> u.buffer.len,
MDL)) {
373 group_object_dereference (&group,
MDL);
382 group_object_dereference (&group,
MDL);
385 return ISC_R_NOTFOUND;
395 return ISC_R_NOTFOUND;
397 return ISC_R_SUCCESS;
407 status = group_object_allocate (&group,
MDL);
408 if (status != ISC_R_SUCCESS)
412 group_object_dereference (&group,
MDL);
428 return ISC_R_IOERROR;
443 unsigned long newstate;
451 if (status != ISC_R_SUCCESS)
454 if (status == ISC_R_SUCCESS)
455 control -> state = value -> u.
integer;
460 if (h -> inner && h -> inner -> type -> set_value) {
461 status = ((*(h -> inner -> type -> set_value))
462 (h -> inner, id,
name, value));
467 return ISC_R_NOTFOUND;
484 name, (
int)control -> state,
MDL);
487 if (h -> inner && h -> inner -> type -> get_value) {
488 status = ((*(h -> inner -> type -> get_value))
489 (h -> inner, id,
name, value));
490 if (status == ISC_R_SUCCESS)
493 return ISC_R_NOTFOUND;
507 const char *
name, va_list ap)
517 if (h -> inner && h -> inner -> type -> get_value) {
518 status = ((*(h -> inner -> type -> signal_handler))
519 (h -> inner,
name, ap));
520 if (status == ISC_R_SUCCESS)
523 return ISC_R_NOTFOUND;
539 if (status != ISC_R_SUCCESS)
542 if (status != ISC_R_SUCCESS)
545 if (status != ISC_R_SUCCESS)
549 if (h -> inner && h -> inner -> type -> stuff_values) {
550 status = ((*(h -> inner -> type -> stuff_values))
551 (c, id, h -> inner));
552 if (status == ISC_R_SUCCESS)
556 return ISC_R_SUCCESS;
568 if (status == ISC_R_SUCCESS) {
572 if (status != ISC_R_SUCCESS)
587 return ISC_R_SUCCESS;
620 if (h -> inner && h -> inner -> type -> set_value) {
621 status = ((*(h -> inner -> type -> set_value))
622 (h -> inner, id,
name, value));
627 return ISC_R_NOTFOUND;
645 if (h -> inner && h -> inner -> type -> get_value) {
646 status = ((*(h -> inner -> type -> get_value))
647 (h -> inner, id,
name, value));
648 if (status == ISC_R_SUCCESS)
651 return ISC_R_NOTFOUND;
656 #if defined (DEBUG_MEMORY_LEAKAGE) || \
657 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
664 #if defined (DEBUG_MEMORY_LEAKAGE) || \
665 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
666 subnet = (
struct subnet *)h;
668 subnet_dereference (&subnet ->
next_subnet, file, line);
670 subnet_dereference (&subnet ->
next_sibling, file, line);
675 interface_dereference (&subnet ->
interface, file, line);
680 return ISC_R_SUCCESS;
684 const char *name, va_list ap)
696 if (h -> inner && h -> inner -> type -> get_value) {
697 status = ((*(h -> inner -> type -> signal_handler))
698 (h -> inner, name, ap));
699 if (status == ISC_R_SUCCESS)
703 return ISC_R_NOTFOUND;
720 if (h -> inner && h -> inner -> type -> stuff_values) {
721 status = ((*(h -> inner -> type -> stuff_values))
722 (c, id, h -> inner));
723 if (status == ISC_R_SUCCESS)
727 return ISC_R_SUCCESS;
740 return ISC_R_SUCCESS;
746 return ISC_R_NOTIMPLEMENTED;
752 return ISC_R_NOTIMPLEMENTED;
770 if (h -> inner && h -> inner -> type -> set_value) {
771 status = ((*(h -> inner -> type -> set_value))
772 (h -> inner, id, name, value));
777 return ISC_R_NOTFOUND;
796 if (h -> inner && h -> inner -> type -> get_value) {
797 status = ((*(h -> inner -> type -> get_value))
798 (h -> inner, id, name, value));
799 if (status == ISC_R_SUCCESS)
802 return ISC_R_NOTFOUND;
810 #if defined (DEBUG_MEMORY_LEAKAGE) || \
811 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
818 #if defined (DEBUG_MEMORY_LEAKAGE) || \
819 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
820 shared_network = (
struct shared_network *)h;
821 if (shared_network ->
next)
822 shared_network_dereference (&shared_network ->
next,
824 if (shared_network ->
name) {
825 dfree (shared_network ->
name, file, line);
826 shared_network ->
name = 0;
829 subnet_dereference (&shared_network ->
subnets, file, line);
831 interface_dereference (&shared_network ->
interface,
833 if (shared_network ->
pools)
835 &shared_network ->
pools, file, line);
836 if (shared_network ->
group)
838 #if defined (FAILOVER_PROTOCOL)
846 return ISC_R_SUCCESS;
863 if (h -> inner && h -> inner -> type -> get_value) {
864 status = ((*(h -> inner -> type -> signal_handler))
865 (h -> inner,
name, ap));
866 if (status == ISC_R_SUCCESS)
870 return ISC_R_NOTFOUND;
887 if (h -> inner && h -> inner -> type -> stuff_values) {
888 status = ((*(h -> inner -> type -> stuff_values))
889 (c, id, h -> inner));
890 if (status == ISC_R_SUCCESS)
894 return ISC_R_SUCCESS;
907 return ISC_R_SUCCESS;
913 return ISC_R_NOTIMPLEMENTED;
919 return ISC_R_NOTIMPLEMENTED;
#define GROUP_OBJECT_DYNAMIC
omapi_object_type_t * dhcp_type_shared_network
isc_result_t dhcp_control_remove(omapi_object_t *lp, omapi_object_t *id)
isc_result_t omapi_make_int_value(omapi_value_t **, omapi_data_string_t *, int, const char *, int)
isc_result_t omapi_object_reference(omapi_object_t **, omapi_object_t *, const char *, int)
isc_result_t end_parse(struct parse **cfile)
void * dmalloc(unsigned, const char *, int)
isc_result_t dhcp_control_set_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_typed_data_t *value)
isc_result_t dhcp_control_lookup(omapi_object_t **lp, omapi_object_t *id, omapi_object_t *ref)
#define DHCP_R_INVALIDARG
omapi_typed_data_t * value
struct group * root_group
dhcp_failover_state_t * failover_peer
isc_result_t dhcp_shared_network_set_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_typed_data_t *value)
#define DHCP_R_KEYCONFLICT
void log_fatal(const char *,...) __attribute__((__format__(__printf__
struct omapi_typed_data_t::@3::@4 buffer
isc_result_t dhcp_group_create(omapi_object_t **lp, omapi_object_t *id)
isc_result_t dhcp_group_lookup(omapi_object_t **lp, omapi_object_t *id, omapi_object_t *ref)
isc_result_t dhcp_group_destroy(omapi_object_t *h, const char *file, int line)
isc_result_t dhcp_group_remove(omapi_object_t *lp, omapi_object_t *id)
isc_result_t omapi_connection_put_uint32(omapi_object_t *, u_int32_t)
isc_result_t dhcp_control_create(omapi_object_t **lp, omapi_object_t *id)
isc_result_t dhcp_group_signal_handler(omapi_object_t *h, const char *name, va_list ap)
isc_result_t omapi_get_value_str(omapi_object_t *, omapi_object_t *, const char *, omapi_value_t **)
isc_result_t dhcp_group_set_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_typed_data_t *value)
omapi_object_type_t * dhcp_type_control
int group_dereference(struct group **ptr, const char *file, int line)
isc_result_t dhcp_subnet_create(omapi_object_t **lp, omapi_object_t *id)
int(* group_write_hook)(struct group_object *)
isc_result_t omapi_object_dereference(omapi_object_t **, const char *, int)
isc_result_t dhcp_subnet_set_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_typed_data_t *value)
isc_result_t dhcp_subnet_signal_handler(omapi_object_t *h, const char *name, va_list ap)
isc_result_t omapi_get_int_value(unsigned long *, omapi_typed_data_t *)
void dfree(void *, const char *, int)
union omapi_typed_data_t::@3 u
isc_result_t dhcp_control_destroy(omapi_object_t *h, const char *file, int line)
isc_result_t dhcp_control_stuff_values(omapi_object_t *c, omapi_object_t *id, omapi_object_t *h)
omapi_object_type_t * dhcp_type_interface
isc_result_t omapi_handle_td_lookup(omapi_object_t **, omapi_typed_data_t *)
isc_result_t dhcp_group_stuff_values(omapi_object_t *c, omapi_object_t *id, omapi_object_t *h)
isc_result_t dhcp_shared_network_destroy(omapi_object_t *h, const char *file, int line)
isc_result_t dhcp_control_get_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_value_t **value)
#define GROUP_OBJECT_DELETED
isc_result_t dhcp_shared_network_get_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_value_t **value)
isc_result_t dhcp_subnet_get_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_value_t **value)
isc_result_t omapi_connection_put_string(omapi_object_t *, const char *)
struct subnet * next_subnet
omapi_object_type_t * dhcp_type_group
dhcp_control_object_t * dhcp_control_object
isc_result_t dhcp_subnet_destroy(omapi_object_t *h, const char *file, int line)
isc_result_t omapi_value_dereference(omapi_value_t **, const char *, int)
isc_result_t omapi_object_type_register(omapi_object_type_t **, const char *, isc_result_t(*)(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *), isc_result_t(*)(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **), isc_result_t(*)(omapi_object_t *, const char *, int), isc_result_t(*)(omapi_object_t *, const char *, va_list), isc_result_t(*)(omapi_object_t *, omapi_object_t *, omapi_object_t *), isc_result_t(*)(omapi_object_t **, omapi_object_t *, omapi_object_t *), isc_result_t(*)(omapi_object_t **, omapi_object_t *), isc_result_t(*)(omapi_object_t *, omapi_object_t *), isc_result_t(*)(omapi_object_t *, const char *, int), isc_result_t(*)(omapi_object_t **, const char *, int), isc_result_t(*)(size_t), size_t, isc_result_t(*)(omapi_object_t *, const char *, int), int)
isc_result_t dhcp_shared_network_remove(omapi_object_t *lp, omapi_object_t *id)
isc_result_t dhcp_subnet_stuff_values(omapi_object_t *c, omapi_object_t *id, omapi_object_t *h)
isc_result_t dhcp_subnet_remove(omapi_object_t *lp, omapi_object_t *id)
isc_result_t dhcp_subnet_lookup(omapi_object_t **lp, omapi_object_t *id, omapi_object_t *ref)
int omapi_ds_strcmp(omapi_data_string_t *, const char *)
isc_result_t supersede_group(struct group_object *group, int writep)
struct subnet * next_sibling
isc_result_t dhcp_shared_network_signal_handler(omapi_object_t *h, const char *name, va_list ap)
struct interface_info * interface
isc_result_t interface_setup()
isc_result_t dhcp_group_get_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_value_t **value)
group_hash_t * group_name_hash
isc_result_t dhcp_shared_network_create(omapi_object_t **lp, omapi_object_t *id)
isc_result_t dhcp_shared_network_stuff_values(omapi_object_t *c, omapi_object_t *id, omapi_object_t *h)
struct ipv6_pool ** pools
struct shared_network * next
isc_result_t omapi_connection_put_name(omapi_object_t *, const char *)
isc_result_t dhcp_set_control_state(control_object_state_t oldstate, control_object_state_t newstate)
int parse_executable_statements(struct executable_statement **statements, struct parse *cfile, int *lose, enum expression_context case_context)
void dhcp_common_objects_setup(void)
isc_result_t dhcp_shared_network_lookup(omapi_object_t **lp, omapi_object_t *id, omapi_object_t *ref)
int clone_group(struct group **gp, struct group *group, const char *file, int line)
OMAPI_OBJECT_ALLOC(shared_network, struct shared_network, omapi_object_type_t *dhcp_type_shared_network)
struct interface_info * interface
isc_result_t new_parse(struct parse **cfile, int file, char *inbuf, unsigned buflen, const char *name, int eolp)
omapi_object_type_t * dhcp_type_subnet
isc_result_t dhcp_control_signal_handler(omapi_object_t *h, const char *name, va_list ap)
isc_result_t omapi_make_string_value(omapi_value_t **, omapi_data_string_t *, const char *, const char *, int)