[dhcp-agent-commits] dhcp-agent/src dhcp-client-conf.c,1.21,1.22 dhcp-client-conf.h,1.13,1.14
Status: Alpha
                
                Brought to you by:
                
                    actmodern
                    
                
            | 
     
      
      
      From: <act...@us...> - 2003-03-27 01:39:22
      
     
   | 
Update of /cvsroot/dhcp-agent/dhcp-agent/src
In directory sc8-pr-cvs1:/tmp/cvs-serv13664
Modified Files:
	dhcp-client-conf.c dhcp-client-conf.h 
Log Message:
added override
Index: dhcp-client-conf.c
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-conf.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** dhcp-client-conf.c	26 Mar 2003 05:23:02 -0000	1.21
--- dhcp-client-conf.c	27 Mar 2003 01:39:16 -0000	1.22
***************
*** 124,127 ****
--- 124,131 ----
  static const arg_symbol_t  *prepend_arg_symbols[] = { NULL, NULL, NULL };
  
+ static const arg_type_t     override_arg_types[] = { CONF_STRING, CONF_ASSIGNMENT, CONF_STRING_LIST };
+ static const char         **override_arg_strings[] = { NULL, NULL, NULL };
+ static const arg_symbol_t  *override_arg_symbols[] = { NULL, NULL, NULL };
+ 
  static const arg_type_t     server_arg_types[] = { CONF_IDENTIFIER, CONF_ADDRESS, CONF_GROUP };
  static const char         **server_arg_strings[] = { server_strings, NULL, NULL };
***************
*** 200,204 ****
  };
  
- 
  /* prepend command. */
  static const command_t command_prepend = {
--- 204,207 ----
***************
*** 211,214 ****
--- 214,227 ----
  };
  
+ /* prepend command. */
+ static const command_t command_override = {
+     DIRECTIVE_OVERRIDE,
+     "override",
+     3,
+     override_arg_strings,
+     override_arg_types,
+     override_arg_symbols,
+ };
+ 
  static const command_t *commands[] = {
      &command_set_boolean,
***************
*** 220,223 ****
--- 233,237 ----
      &command_append,
      &command_prepend,
+     &command_override,
      NULL,
  };
***************
*** 234,237 ****
--- 248,252 ----
  static int directive_append_handler(client_conf_params_t *params, void *directive_data, directive_group_t group_type, void *group_data);
  static int directive_prepend_handler(client_conf_params_t *params, void *directive_data, directive_group_t group_type, void *group_data);
+ static int directive_override_handler(client_conf_params_t *params, void *directive_data, directive_group_t group_type, void *group_data);
  
  /* indexed by directive types in dhcp-client-conf.h . */
***************
*** 245,248 ****
--- 260,264 ----
      directive_append_handler,
      directive_prepend_handler,
+     directive_override_handler,
  };
  
***************
*** 622,625 ****
--- 638,642 ----
      params->append_options = list_create();
      params->prepend_options = list_create();
+     params->override_options = list_create();
  
      return params;
***************
*** 634,637 ****
--- 651,655 ----
      list_destroy(params->append_options, cache_entry_destroy_l);
      list_destroy(params->prepend_options, cache_entry_destroy_l);
+     list_destroy(params->override_options, cache_entry_destroy_l);
  
      xfree(params);
***************
*** 890,893 ****
--- 908,915 ----
          break;
  
+     case CLIENT_VAR_OVERRIDE_OPTIONS:        
+         list_add(params->override_options, ce);
+         break;
+ 
      default:
          FATAL_MESSAGE("i have encountered a bug. i shouldn't be here.");
***************
*** 905,908 ****
--- 927,935 ----
  {
      return directive_static_cache_entry_handler_proc(params, directive_data, group_type, group_data, CLIENT_VAR_PREPEND_OPTIONS);
+ }
+ 
+ static int directive_override_handler(client_conf_params_t *params, void *directive_data, directive_group_t group_type, void *group_data)
+ {
+     return directive_static_cache_entry_handler_proc(params, directive_data, group_type, group_data, CLIENT_VAR_OVERRIDE_OPTIONS);
  }
  
Index: dhcp-client-conf.h
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-conf.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** dhcp-client-conf.h	26 Mar 2003 05:23:02 -0000	1.13
--- dhcp-client-conf.h	27 Mar 2003 01:39:16 -0000	1.14
***************
*** 55,58 ****
--- 55,59 ----
      list_t      *append_options;                           /* options append values to. */
      list_t      *prepend_options;                          /* options prepend values to. */
+     list_t      *override_options;                         /* options override values. */
  
  } client_conf_params_t;
***************
*** 74,78 ****
  /* directive types. */
  enum directive_types { DIRECTIVE_SET_BOOLEAN = 0, DIRECTIVE_SET, DIRECTIVE_REQUEST, DIRECTIVE_REQUIRE, DIRECTIVE_SERVER_GROUP, 
!                        DIRECTIVE_CONFIGURE, DIRECTIVE_APPEND, DIRECTIVE_PREPEND };
  
  /* symbols for variable substitution. */
--- 75,79 ----
  /* directive types. */
  enum directive_types { DIRECTIVE_SET_BOOLEAN = 0, DIRECTIVE_SET, DIRECTIVE_REQUEST, DIRECTIVE_REQUIRE, DIRECTIVE_SERVER_GROUP, 
!                        DIRECTIVE_CONFIGURE, DIRECTIVE_APPEND, DIRECTIVE_PREPEND, DIRECTIVE_OVERRIDE };
  
  /* symbols for variable substitution. */
***************
*** 80,84 ****
                     CLIENT_VAR_INTERFACE_MTU, CLIENT_VAR_DO_MEASURE_ROUTER_LATENCY_ICMP, 
                     CLIENT_VAR_REQUEST_OPTIONS, CLIENT_VAR_REQUIRE_OPTIONS, CLIENT_VAR_CONFIGURE_OPTIONS, CLIENT_VAR_APPEND_OPTIONS, 
!                    CLIENT_VAR_PREPEND_OPTIONS };
  
  /* server symbol substitution. */
--- 81,85 ----
                     CLIENT_VAR_INTERFACE_MTU, CLIENT_VAR_DO_MEASURE_ROUTER_LATENCY_ICMP, 
                     CLIENT_VAR_REQUEST_OPTIONS, CLIENT_VAR_REQUIRE_OPTIONS, CLIENT_VAR_CONFIGURE_OPTIONS, CLIENT_VAR_APPEND_OPTIONS, 
!                    CLIENT_VAR_PREPEND_OPTIONS, CLIENT_VAR_OVERRIDE_OPTIONS };
  
  /* server symbol substitution. */
 |