ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/conf_parser.y
(Generate patch)

Comparing ircd-hybrid/trunk/src/conf_parser.y (file contents):
Revision 7248 by michael, Thu Feb 4 17:21:58 2016 UTC vs.
Revision 7624 by michael, Thu Jun 23 12:44:09 2016 UTC

# Line 34 | Line 34
34   #include "conf.h"
35   #include "conf_class.h"
36   #include "conf_cluster.h"
37 + #include "conf_gecos.h"
38   #include "conf_pseudo.h"
39   #include "conf_resv.h"
40   #include "conf_service.h"
# Line 98 | Line 99 | static struct
99      max_total,
100      max_global,
101      max_local,
101    max_ident,
102      max_sendq,
103      max_recvq,
104      max_channels,
# Line 155 | Line 155 | reset_block_state(void)
155   %token  CALLER_ID_WAIT
156   %token  CAN_FLOOD
157   %token  CHANNEL
158 + %token  CHECK_CACHE
159   %token  CIDR_BITLEN_IPV4
160   %token  CIDR_BITLEN_IPV6
161   %token  CLASS
# Line 216 | Line 217 | reset_block_state(void)
217   %token  KNOCK_CLIENT_TIME
218   %token  KNOCK_DELAY_CHANNEL
219   %token  LEAF_MASK
220 + %token  LIBGEOIP_DATABASE_OPTIONS
221 + %token  LIBGEOIP_IPV4_DATABASE_FILE
222 + %token  LIBGEOIP_IPV6_DATABASE_FILE
223   %token  LISTEN
224   %token  MASK
225   %token  MAX_ACCEPT
226   %token  MAX_BANS
227   %token  MAX_CHANNELS
228   %token  MAX_GLOBAL
225 %token  MAX_IDENT
229   %token  MAX_IDLE
230   %token  MAX_LOCAL
231   %token  MAX_NICK_CHANGES
# Line 232 | Line 235 | reset_block_state(void)
235   %token  MAX_TARGETS
236   %token  MAX_TOPIC_LENGTH
237   %token  MAX_WATCH
238 + %token  MEMORY_CACHE
239   %token  MIN_IDLE
240   %token  MIN_NONWILDCARD
241   %token  MIN_NONWILDCARD_SIMPLE
242 + %token  MMAP_CACHE
243   %token  MODULE
244   %token  MODULES
245   %token  MOTD
# Line 286 | Line 291 | reset_block_state(void)
291   %token  SSL_DH_ELLIPTIC_CURVE
292   %token  SSL_DH_PARAM_FILE
293   %token  SSL_MESSAGE_DIGEST_ALGORITHM
294 + %token  STANDARD
295   %token  STATS_E_DISABLED
296   %token  STATS_I_OPER_ONLY
297   %token  STATS_K_OPER_ONLY
# Line 357 | Line 363 | reset_block_state(void)
363   %token  VHOST6
364   %token  WARN_NO_CONNECT_BLOCK
365   %token  WHOIS
366 + %token  WHOWAS_HISTORY_LENGTH
367   %token  XLINE
368   %token  XLINE_EXEMPT
369  
# Line 462 | Line 469 | serverinfo_item:        serverinfo_name
469                          serverinfo_ssl_certificate_file |
470                          serverinfo_ssl_cipher_list |
471                          serverinfo_ssl_message_digest_algorithm |
472 +                        serverinfo_libgeoip_database_options |
473 +                        serverinfo_libgeoip_ipv4_database_file |
474 +                        serverinfo_libgeoip_ipv6_database_file |
475                          error ';' ;
476  
477  
# Line 519 | Line 529 | serverinfo_ssl_dh_elliptic_curve: SSL_DH
529    }
530   };
531  
532 + serverinfo_libgeoip_database_options: LIBGEOIP_DATABASE_OPTIONS
533 + {
534 +  if (conf_parser_ctx.pass == 1)
535 +    ConfigServerInfo.libgeoip_database_options = 0;
536 + } '='  options_items ';';
537 +
538 + options_items: options_items ',' options_item | options_item;
539 + options_item: STANDARD
540 + {
541 + #ifdef HAVE_LIBGEOIP
542 +  if (conf_parser_ctx.pass == 1)
543 +    ConfigServerInfo.libgeoip_database_options |= GEOIP_STANDARD;
544 + #endif
545 + } | MEMORY_CACHE
546 + {
547 + #ifdef HAVE_LIBGEOIP
548 +  if (conf_parser_ctx.pass == 1)
549 +    ConfigServerInfo.libgeoip_database_options |= GEOIP_MEMORY_CACHE;
550 + #endif
551 + } | MMAP_CACHE
552 + {
553 + #ifdef HAVE_LIBGEOIP
554 +  if (conf_parser_ctx.pass == 1)
555 +    ConfigServerInfo.libgeoip_database_options |= GEOIP_MMAP_CACHE;
556 + #endif
557 + } | CHECK_CACHE
558 + {
559 + #ifdef HAVE_LIBGEOIP
560 +  if (conf_parser_ctx.pass == 1)
561 +    ConfigServerInfo.libgeoip_database_options |= GEOIP_CHECK_CACHE;
562 + #endif
563 + };
564 +
565 + serverinfo_libgeoip_ipv4_database_file:  LIBGEOIP_IPV4_DATABASE_FILE '=' QSTRING ';'
566 + {
567 +  if (conf_parser_ctx.pass == 2)
568 +  {
569 +    xfree(ConfigServerInfo.libgeoip_ipv4_database_file);
570 +    ConfigServerInfo.libgeoip_ipv4_database_file = xstrdup(yylval.string);
571 +
572 + #ifdef HAVE_LIBGEOIP
573 +    if (GeoIPv4_ctx)
574 +      GeoIP_delete(GeoIPv4_ctx);
575 +    GeoIPv4_ctx = GeoIP_open(yylval.string, ConfigServerInfo.libgeoip_database_options);
576 + #endif
577 +  }
578 + };
579 +
580 + serverinfo_libgeoip_ipv6_database_file:  LIBGEOIP_IPV6_DATABASE_FILE '=' QSTRING ';'
581 + {
582 +  if (conf_parser_ctx.pass == 2)
583 +  {
584 +    xfree(ConfigServerInfo.libgeoip_ipv6_database_file);
585 +    ConfigServerInfo.libgeoip_ipv6_database_file = xstrdup(yylval.string);
586 +
587 + #ifdef HAVE_LIBGEOIP
588 +    if (GeoIPv6_ctx)
589 +      GeoIP_delete(GeoIPv6_ctx);
590 +    GeoIPv6_ctx = GeoIP_open(yylval.string, ConfigServerInfo.libgeoip_database_options);
591 + #endif
592 +  }
593 + };
594 +
595   serverinfo_name: NAME '=' QSTRING ';'
596   {
597    /* This isn't rehashable */
# Line 972 | Line 1045 | oper_entry: OPERATOR
1045    {
1046      struct MaskItem *conf = NULL;
1047      struct split_nuh_item nuh;
1048 +    char *s = node->data;
1049  
1050 <    nuh.nuhmask  = node->data;
1050 >    if (EmptyString(s))
1051 >      continue;
1052 >
1053 >    nuh.nuhmask  = s;
1054      nuh.nickptr  = NULL;
1055      nuh.userptr  = block_state.user.buf;
1056      nuh.hostptr  = block_state.host.buf;
# Line 1336 | Line 1413 | class_entry: CLASS
1413    class->max_total = block_state.max_total.value;
1414    class->max_global = block_state.max_global.value;
1415    class->max_local = block_state.max_local.value;
1339  class->max_ident = block_state.max_ident.value;
1416    class->max_sendq = block_state.max_sendq.value;
1417    class->max_recvq = block_state.max_recvq.value;
1418    class->max_channels = block_state.max_channels.value;
# Line 1371 | Line 1447 | class_item:     class_name |
1447                  class_max_number |
1448                  class_max_global |
1449                  class_max_local |
1450 <                class_max_ident |
1451 <                class_sendq | class_recvq |
1450 >                class_sendq |
1451 >                class_recvq |
1452                  class_min_idle |
1453                  class_max_idle |
1454                  class_flags |
# Line 1426 | Line 1502 | class_max_local: MAX_LOCAL '=' NUMBER ';
1502      block_state.max_local.value = $3;
1503   };
1504  
1429 class_max_ident: MAX_IDENT '=' NUMBER ';'
1430 {
1431  if (conf_parser_ctx.pass == 1)
1432    block_state.max_ident.value = $3;
1433 };
1434
1505   class_sendq: SENDQ '=' sizespec ';'
1506   {
1507    if (conf_parser_ctx.pass == 1)
# Line 1596 | Line 1666 | auth_entry: IRCD_AUTH
1666    {
1667      struct MaskItem *conf = NULL;
1668      struct split_nuh_item nuh;
1669 +    char *s = node->data;
1670 +
1671 +    if (EmptyString(s))
1672 +      continue;
1673  
1674 <    nuh.nuhmask  = node->data;
1674 >    nuh.nuhmask  = s;
1675      nuh.nickptr  = NULL;
1676      nuh.userptr  = block_state.user.buf;
1677      nuh.hostptr  = block_state.host.buf;
# Line 1760 | Line 1834 | resv_entry: RESV
1834    if (conf_parser_ctx.pass != 2)
1835      break;
1836  
1837 <  create_resv(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list);
1837 >  resv_make(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list);
1838   };
1839  
1840   resv_items:     resv_items resv_item | resv_item;
# Line 2342 | Line 2416 | gecos_entry: GECOS
2416      reset_block_state();
2417   } '{' gecos_items '}' ';'
2418   {
2345  struct MaskItem *conf = NULL;
2346
2419    if (conf_parser_ctx.pass != 2)
2420      break;
2421  
2422    if (!block_state.name.buf[0])
2423      break;
2424  
2425 <  conf = conf_make(CONF_XLINE);
2426 <  conf->name = xstrdup(block_state.name.buf);
2425 >  struct GecosItem *gecos = gecos_make();
2426 >  gecos->mask = xstrdup(block_state.name.buf);
2427  
2428    if (block_state.rpass.buf[0])
2429 <    conf->reason = xstrdup(block_state.rpass.buf);
2429 >    gecos->reason = xstrdup(block_state.rpass.buf);
2430    else
2431 <    conf->reason = xstrdup(CONF_NOREASON);
2431 >    gecos->reason = xstrdup(CONF_NOREASON);
2432   };
2433  
2434   gecos_items: gecos_items gecos_item | gecos_item;
# Line 2389 | Line 2461 | general_item:       general_away_count |
2461                      general_max_nick_time |
2462                      general_max_nick_changes |
2463                      general_max_accept |
2464 +                    general_whowas_history_length |
2465                      general_anti_spam_exit_message_time |
2466                      general_ts_warn_delta |
2467                      general_ts_max_delta |
# Line 2444 | Line 2517 | general_max_watch: MAX_WATCH '=' NUMBER
2517    ConfigGeneral.max_watch = $3;
2518   };
2519  
2520 + general_whowas_history_length: WHOWAS_HISTORY_LENGTH '=' NUMBER ';'
2521 + {
2522 +  ConfigGeneral.whowas_history_length = $3;
2523 + };
2524 +
2525   general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';'
2526   {
2527    if (conf_parser_ctx.pass == 2)

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)