66 sizeof (dhcp_control_object_t),
68 if (status != ISC_R_SUCCESS)
69 log_fatal (
"Can't register control object type: %s",
70 isc_result_totext (status));
71 status = dhcp_control_allocate (&dhcp_control_object,
MDL);
72 if (status != ISC_R_SUCCESS)
73 log_fatal (
"Can't make initial control object: %s",
74 isc_result_totext (status));
87 sizeof (
struct group_object), 0,
89 if (status != ISC_R_SUCCESS)
90 log_fatal (
"Can't register group object type: %s",
91 isc_result_totext (status));
103 sizeof (
struct subnet), 0,
105 if (status != ISC_R_SUCCESS)
106 log_fatal (
"Can't register subnet object type: %s",
107 isc_result_totext (status));
110 (&dhcp_type_shared_network,
120 sizeof (
struct shared_network), 0,
RC_MISC);
121 if (status != ISC_R_SUCCESS)
122 log_fatal (
"Can't register shared network object type: %s",
123 isc_result_totext (status));
150 return ISC_R_NOMEMORY;
151 memcpy (group -> name,
154 group -> name [value -> u.
buffer.len] = 0;
157 return ISC_R_SUCCESS;
161 if (group -> group && group -> group -> statements)
163 if (!group -> group) {
165 return ISC_R_NOMEMORY;
173 (
char *) value->
u.
buffer.value,
175 "network client", 0);
176 if (status != ISC_R_SUCCESS || parse == NULL)
179 (&group -> group -> statements, parse, &lose,
185 return ISC_R_SUCCESS;
191 if (h -> inner && h -> inner -> type -> set_value) {
192 status = ((*(h -> inner -> type -> set_value))
193 (h -> inner, id, name, value));
198 return ISC_R_NOTFOUND;
215 name, group -> name,
MDL);
218 if (h -> inner && h -> inner -> type -> get_value) {
219 status = ((*(h -> inner -> type -> get_value))
220 (h -> inner, id,
name, value));
221 if (status == ISC_R_SUCCESS)
224 return ISC_R_NOTFOUND;
240 strlen (group ->
name),
MDL)) {
243 strlen (group ->
name),
245 group_object_dereference (&t,
MDL);
249 group ->
name = (
char *)0;
254 return ISC_R_SUCCESS;
258 const char *
name, va_list ap)
268 if (!strcmp (name,
"updated")) {
275 if (!group -> name) {
277 sprintf (hnbuf,
"ng%08lx%08lx",
279 (
unsigned long)group);
280 group -> name =
dmalloc (strlen (hnbuf) + 1,
MDL);
282 return ISC_R_NOMEMORY;
283 strcpy (group -> name, hnbuf);
291 if (h -> inner && h -> inner -> type -> get_value) {
292 status = ((*(h -> inner -> type -> signal_handler))
293 (h -> inner,
name, ap));
294 if (status == ISC_R_SUCCESS)
298 return ISC_R_SUCCESS;
299 return ISC_R_NOTFOUND;
316 if (status != ISC_R_SUCCESS)
319 if (status != ISC_R_SUCCESS)
324 if (h -> inner && h -> inner -> type -> stuff_values) {
325 status = ((*(h -> inner -> type -> stuff_values))
326 (c, id, h -> inner));
327 if (status == ISC_R_SUCCESS)
331 return ISC_R_SUCCESS;
346 if (status == ISC_R_SUCCESS) {
350 if (status != ISC_R_SUCCESS)
362 if (status == ISC_R_SUCCESS) {
367 tv -> value -> u.buffer.
value,
368 tv -> value -> u.buffer.len,
MDL)) {
372 group_object_dereference (&group,
MDL);
381 group_object_dereference (&group,
MDL);
384 return ISC_R_NOTFOUND;
394 return ISC_R_NOTFOUND;
396 return ISC_R_SUCCESS;
406 status = group_object_allocate (&group,
MDL);
407 if (status != ISC_R_SUCCESS)
411 group_object_dereference (&group,
MDL);
427 return ISC_R_IOERROR;
442 unsigned long newstate;
450 if (status != ISC_R_SUCCESS)
453 if (status == ISC_R_SUCCESS)
454 control -> state = value -> u.
integer;
459 if (h -> inner && h -> inner -> type -> set_value) {
460 status = ((*(h -> inner -> type -> set_value))
461 (h -> inner, id,
name, value));
466 return ISC_R_NOTFOUND;
483 name, (
int)control -> state,
MDL);
486 if (h -> inner && h -> inner -> type -> get_value) {
487 status = ((*(h -> inner -> type -> get_value))
488 (h -> inner, id,
name, value));
489 if (status == ISC_R_SUCCESS)
492 return ISC_R_NOTFOUND;
506 const char *
name, va_list ap)
516 if (h -> inner && h -> inner -> type -> get_value) {
517 status = ((*(h -> inner -> type -> signal_handler))
518 (h -> inner,
name, ap));
519 if (status == ISC_R_SUCCESS)
522 return ISC_R_NOTFOUND;
538 if (status != ISC_R_SUCCESS)
541 if (status != ISC_R_SUCCESS)
544 if (status != ISC_R_SUCCESS)
548 if (h -> inner && h -> inner -> type -> stuff_values) {
549 status = ((*(h -> inner -> type -> stuff_values))
550 (c, id, h -> inner));
551 if (status == ISC_R_SUCCESS)
555 return ISC_R_SUCCESS;
567 if (status == ISC_R_SUCCESS) {
571 if (status != ISC_R_SUCCESS)
586 return ISC_R_SUCCESS;
619 if (h -> inner && h -> inner -> type -> set_value) {
620 status = ((*(h -> inner -> type -> set_value))
621 (h -> inner, id,
name, value));
626 return ISC_R_NOTFOUND;
644 if (h -> inner && h -> inner -> type -> get_value) {
645 status = ((*(h -> inner -> type -> get_value))
646 (h -> inner, id,
name, value));
647 if (status == ISC_R_SUCCESS)
650 return ISC_R_NOTFOUND;
660 subnet = (
struct subnet *)h;
662 subnet_dereference (&subnet ->
next_subnet, file, line);
664 subnet_dereference (&subnet ->
next_sibling, file, line);
669 interface_dereference (&subnet ->
interface, file, line);
673 return ISC_R_SUCCESS;
677 const char *name, va_list ap)
689 if (h -> inner && h -> inner -> type -> get_value) {
690 status = ((*(h -> inner -> type -> signal_handler))
691 (h -> inner, name, ap));
692 if (status == ISC_R_SUCCESS)
696 return ISC_R_NOTFOUND;
713 if (h -> inner && h -> inner -> type -> stuff_values) {
714 status = ((*(h -> inner -> type -> stuff_values))
715 (c, id, h -> inner));
716 if (status == ISC_R_SUCCESS)
720 return ISC_R_SUCCESS;
733 return ISC_R_SUCCESS;
739 return ISC_R_NOTIMPLEMENTED;
745 return ISC_R_NOTIMPLEMENTED;
763 if (h -> inner && h -> inner -> type -> set_value) {
764 status = ((*(h -> inner -> type -> set_value))
765 (h -> inner, id, name, value));
770 return ISC_R_NOTFOUND;
789 if (h -> inner && h -> inner -> type -> get_value) {
790 status = ((*(h -> inner -> type -> get_value))
791 (h -> inner, id, name, value));
792 if (status == ISC_R_SUCCESS)
795 return ISC_R_NOTFOUND;
808 shared_network = (
struct shared_network *)h;
809 if (shared_network ->
next)
810 shared_network_dereference (&shared_network ->
next,
812 if (shared_network ->
name) {
813 dfree (shared_network ->
name, file, line);
814 shared_network ->
name = 0;
817 subnet_dereference (&shared_network ->
subnets, file, line);
819 interface_dereference (&shared_network ->
interface,
821 if (shared_network ->
pools)
823 &shared_network ->
pools, file, line);
824 if (shared_network ->
group)
826 #if defined (FAILOVER_PROTOCOL) 833 return ISC_R_SUCCESS;
850 if (h -> inner && h -> inner -> type -> get_value) {
851 status = ((*(h -> inner -> type -> signal_handler))
852 (h -> inner,
name, ap));
853 if (status == ISC_R_SUCCESS)
857 return ISC_R_NOTFOUND;
874 if (h -> inner && h -> inner -> type -> stuff_values) {
875 status = ((*(h -> inner -> type -> stuff_values))
876 (c, id, h -> inner));
877 if (status == ISC_R_SUCCESS)
881 return ISC_R_SUCCESS;
894 return ISC_R_SUCCESS;
900 return ISC_R_NOTIMPLEMENTED;
906 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 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 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_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)