Diff for /embedaddon/dhcp/common/comapi.c between versions 1.1 and 1.1.1.1

version 1.1, 2012/02/21 22:30:18 version 1.1.1.1, 2012/10/09 09:06:54
Line 3 Line 3
    OMAPI object interfaces for the DHCP server. */     OMAPI object interfaces for the DHCP server. */
   
 /*  /*
    * Copyright (c) 2012 Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 2004-2007,2009 by Internet Systems Consortium, Inc. ("ISC")   * Copyright (c) 2004-2007,2009 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1999-2003 by Internet Software Consortium   * Copyright (c) 1999-2003 by Internet Software Consortium
  *   *
Line 435  isc_result_t dhcp_group_remove (omapi_object_t *lp, Line 436  isc_result_t dhcp_group_remove (omapi_object_t *lp,
   
         status = dhcp_group_destroy ((omapi_object_t *)group, MDL);          status = dhcp_group_destroy ((omapi_object_t *)group, MDL);
   
        return ISC_R_SUCCESS;        return status;
 }  }
   
 isc_result_t dhcp_control_set_value  (omapi_object_t *h,  isc_result_t dhcp_control_set_value  (omapi_object_t *h,
Line 511  isc_result_t dhcp_control_destroy (omapi_object_t *h, Line 512  isc_result_t dhcp_control_destroy (omapi_object_t *h,
 isc_result_t dhcp_control_signal_handler (omapi_object_t *h,  isc_result_t dhcp_control_signal_handler (omapi_object_t *h,
                                         const char *name, va_list ap)                                          const char *name, va_list ap)
 {  {
        dhcp_control_object_t *control;        /* In this function h should be a (dhcp_control_object_t *) */
         isc_result_t status;          isc_result_t status;
   
         if (h -> type != dhcp_type_control)          if (h -> type != dhcp_type_control)
                 return ISC_R_INVALIDARG;                  return ISC_R_INVALIDARG;
         control = (dhcp_control_object_t *)h;  
   
         /* Try to find some inner object that can take the value. */          /* Try to find some inner object that can take the value. */
         if (h -> inner && h -> inner -> type -> get_value) {          if (h -> inner && h -> inner -> type -> get_value) {
Line 572  isc_result_t dhcp_control_lookup (omapi_object_t **lp, Line 572  isc_result_t dhcp_control_lookup (omapi_object_t **lp,
                 status = omapi_get_value_str (ref, id, "handle", &tv);                  status = omapi_get_value_str (ref, id, "handle", &tv);
                 if (status == ISC_R_SUCCESS) {                  if (status == ISC_R_SUCCESS) {
                         status = omapi_handle_td_lookup (lp, tv -> value);                          status = omapi_handle_td_lookup (lp, tv -> value);
                        
                         omapi_value_dereference (&tv, MDL);                          omapi_value_dereference (&tv, MDL);
                         if (status != ISC_R_SUCCESS)                          if (status != ISC_R_SUCCESS)
                                 return status;                                  return status;
                        
                         /* Don't return the object if the type is wrong. */                          /* Don't return the object if the type is wrong. */
                         if ((*lp) -> type != dhcp_type_control) {                          if ((*lp) -> type != dhcp_type_control) {
                                 omapi_object_dereference (lp, MDL);                                  omapi_object_dereference (lp, MDL);
Line 612  isc_result_t dhcp_subnet_set_value  (omapi_object_t *h Line 612  isc_result_t dhcp_subnet_set_value  (omapi_object_t *h
                                      omapi_data_string_t *name,                                       omapi_data_string_t *name,
                                      omapi_typed_data_t *value)                                       omapi_typed_data_t *value)
 {  {
        struct subnet *subnet;        /* In this function h should be a (struct subnet *) */
         isc_result_t status;          isc_result_t status;
   
         if (h -> type != dhcp_type_subnet)          if (h -> type != dhcp_type_subnet)
                 return ISC_R_INVALIDARG;                  return ISC_R_INVALIDARG;
         subnet = (struct subnet *)h;  
   
         /* No values to set yet. */          /* No values to set yet. */
   
Line 628  isc_result_t dhcp_subnet_set_value  (omapi_object_t *h Line 627  isc_result_t dhcp_subnet_set_value  (omapi_object_t *h
                 if (status == ISC_R_SUCCESS || status == ISC_R_UNCHANGED)                  if (status == ISC_R_SUCCESS || status == ISC_R_UNCHANGED)
                         return status;                          return status;
         }          }
                          
         return ISC_R_NOTFOUND;          return ISC_R_NOTFOUND;
 }  }
   
Line 637  isc_result_t dhcp_subnet_get_value (omapi_object_t *h, Line 636  isc_result_t dhcp_subnet_get_value (omapi_object_t *h,
                                     omapi_data_string_t *name,                                      omapi_data_string_t *name,
                                     omapi_value_t **value)                                      omapi_value_t **value)
 {  {
        struct subnet *subnet;        /* In this function h should be a (struct subnet *) */
         isc_result_t status;          isc_result_t status;
   
         if (h -> type != dhcp_type_subnet)          if (h -> type != dhcp_type_subnet)
                 return ISC_R_INVALIDARG;                  return ISC_R_INVALIDARG;
         subnet = (struct subnet *)h;  
   
         /* No values to get yet. */          /* No values to get yet. */
   
Line 658  isc_result_t dhcp_subnet_get_value (omapi_object_t *h, Line 656  isc_result_t dhcp_subnet_get_value (omapi_object_t *h,
   
 isc_result_t dhcp_subnet_destroy (omapi_object_t *h, const char *file, int line)  isc_result_t dhcp_subnet_destroy (omapi_object_t *h, const char *file, int line)
 {  {
         struct subnet *subnet;  
   
         if (h -> type != dhcp_type_subnet)          if (h -> type != dhcp_type_subnet)
                 return ISC_R_INVALIDARG;                  return ISC_R_INVALIDARG;
         subnet = (struct subnet *)h;  
   
 #if defined (DEBUG_MEMORY_LEAKAGE) || \  #if defined (DEBUG_MEMORY_LEAKAGE) || \
                 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)                  defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
           struct subnet *subnet = (struct subnet *)h;
   
         if (subnet -> next_subnet)          if (subnet -> next_subnet)
                 subnet_dereference (&subnet -> next_subnet, file, line);                  subnet_dereference (&subnet -> next_subnet, file, line);
         if (subnet -> next_sibling)          if (subnet -> next_sibling)
Line 685  isc_result_t dhcp_subnet_destroy (omapi_object_t *h, c Line 683  isc_result_t dhcp_subnet_destroy (omapi_object_t *h, c
 isc_result_t dhcp_subnet_signal_handler (omapi_object_t *h,  isc_result_t dhcp_subnet_signal_handler (omapi_object_t *h,
                                          const char *name, va_list ap)                                           const char *name, va_list ap)
 {  {
        struct subnet *subnet;        /* In this function h should be a (struct subnet *) */
         isc_result_t status;          isc_result_t status;
         int updatep = 0;          int updatep = 0;
   
         if (h -> type != dhcp_type_subnet)          if (h -> type != dhcp_type_subnet)
                 return ISC_R_INVALIDARG;                  return ISC_R_INVALIDARG;
         subnet = (struct subnet *)h;  
   
         /* Can't write subnets yet. */          /* Can't write subnets yet. */
   
Line 711  isc_result_t dhcp_subnet_stuff_values (omapi_object_t  Line 708  isc_result_t dhcp_subnet_stuff_values (omapi_object_t 
                                        omapi_object_t *id,                                         omapi_object_t *id,
                                        omapi_object_t *h)                                         omapi_object_t *h)
 {  {
        struct subnet *subnet;        /* In this function h should be a (struct subnet *) */
         isc_result_t status;          isc_result_t status;
   
         if (h -> type != dhcp_type_subnet)          if (h -> type != dhcp_type_subnet)
                 return ISC_R_INVALIDARG;                  return ISC_R_INVALIDARG;
         subnet = (struct subnet *)h;  
   
         /* Can't stuff subnet values yet. */          /* Can't stuff subnet values yet. */
   
Line 761  isc_result_t dhcp_shared_network_set_value  (omapi_obj Line 757  isc_result_t dhcp_shared_network_set_value  (omapi_obj
                                              omapi_data_string_t *name,                                               omapi_data_string_t *name,
                                              omapi_typed_data_t *value)                                               omapi_typed_data_t *value)
 {  {
        struct shared_network *shared_network;        /* In this function h should be a (struct shared_network *) */
         isc_result_t status;          isc_result_t status;
   
         if (h -> type != dhcp_type_shared_network)          if (h -> type != dhcp_type_shared_network)
                 return ISC_R_INVALIDARG;                  return ISC_R_INVALIDARG;
         shared_network = (struct shared_network *)h;  
   
         /* No values to set yet. */          /* No values to set yet. */
   
Line 777  isc_result_t dhcp_shared_network_set_value  (omapi_obj Line 772  isc_result_t dhcp_shared_network_set_value  (omapi_obj
                 if (status == ISC_R_SUCCESS || status == ISC_R_UNCHANGED)                  if (status == ISC_R_SUCCESS || status == ISC_R_UNCHANGED)
                         return status;                          return status;
         }          }
                          
         return ISC_R_NOTFOUND;          return ISC_R_NOTFOUND;
 }  }
   
Line 787  isc_result_t dhcp_shared_network_get_value (omapi_obje Line 782  isc_result_t dhcp_shared_network_get_value (omapi_obje
                                             omapi_data_string_t *name,                                              omapi_data_string_t *name,
                                             omapi_value_t **value)                                              omapi_value_t **value)
 {  {
        struct shared_network *shared_network;        /* In this function h should be a (struct shared_network *) */
         isc_result_t status;          isc_result_t status;
   
         if (h -> type != dhcp_type_shared_network)          if (h -> type != dhcp_type_shared_network)
                 return ISC_R_INVALIDARG;                  return ISC_R_INVALIDARG;
         shared_network = (struct shared_network *)h;  
   
         /* No values to get yet. */          /* No values to get yet. */
   
Line 809  isc_result_t dhcp_shared_network_get_value (omapi_obje Line 803  isc_result_t dhcp_shared_network_get_value (omapi_obje
 isc_result_t dhcp_shared_network_destroy (omapi_object_t *h,  isc_result_t dhcp_shared_network_destroy (omapi_object_t *h,
                                           const char *file, int line)                                            const char *file, int line)
 {  {
        struct shared_network *shared_network;        /* In this function h should be a (struct shared_network *) */
   
         if (h -> type != dhcp_type_shared_network)          if (h -> type != dhcp_type_shared_network)
                 return ISC_R_INVALIDARG;                  return ISC_R_INVALIDARG;
         shared_network = (struct shared_network *)h;  
   
 #if defined (DEBUG_MEMORY_LEAKAGE) || \  #if defined (DEBUG_MEMORY_LEAKAGE) || \
                 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)                  defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
           struct shared_network *shared_network = (struct shared_network *)h;
         if (shared_network -> next)          if (shared_network -> next)
                 shared_network_dereference (&shared_network -> next,                  shared_network_dereference (&shared_network -> next,
                                             file, line);                                              file, line);
Line 849  isc_result_t dhcp_shared_network_signal_handler (omapi Line 843  isc_result_t dhcp_shared_network_signal_handler (omapi
                                                  const char *name,                                                   const char *name,
                                                  va_list ap)                                                   va_list ap)
 {  {
        struct shared_network *shared_network;        /* In this function h should be a (struct shared_network *) */
         isc_result_t status;          isc_result_t status;
         int updatep = 0;          int updatep = 0;
   
         if (h -> type != dhcp_type_shared_network)          if (h -> type != dhcp_type_shared_network)
                 return ISC_R_INVALIDARG;                  return ISC_R_INVALIDARG;
         shared_network = (struct shared_network *)h;  
   
         /* Can't write shared_networks yet. */          /* Can't write shared_networks yet. */
   
Line 875  isc_result_t dhcp_shared_network_stuff_values (omapi_o Line 868  isc_result_t dhcp_shared_network_stuff_values (omapi_o
                                                omapi_object_t *id,                                                 omapi_object_t *id,
                                                omapi_object_t *h)                                                 omapi_object_t *h)
 {  {
        struct shared_network *shared_network;        /* In this function h should be a (struct shared_network *) */
         isc_result_t status;          isc_result_t status;
   
         if (h -> type != dhcp_type_shared_network)          if (h -> type != dhcp_type_shared_network)
                 return ISC_R_INVALIDARG;                  return ISC_R_INVALIDARG;
         shared_network = (struct shared_network *)h;  
   
         /* Can't stuff shared_network values yet. */          /* Can't stuff shared_network values yet. */
   

Removed from v.1.1  
changed lines
  Added in v.1.1.1.1


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>