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 7257 by michael, Thu Feb 4 17:21:58 2016 UTC vs.
Revision 7258 by michael, Sat Feb 6 17:29:57 2016 UTC

# 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
# Line 232 | Line 236 | reset_block_state(void)
236   %token  MAX_TARGETS
237   %token  MAX_TOPIC_LENGTH
238   %token  MAX_WATCH
239 + %token  MEMORY_CACHE
240   %token  MIN_IDLE
241   %token  MIN_NONWILDCARD
242   %token  MIN_NONWILDCARD_SIMPLE
243 + %token  MMAP_CACHE
244   %token  MODULE
245   %token  MODULES
246   %token  MOTD
# Line 286 | Line 292 | reset_block_state(void)
292   %token  SSL_DH_ELLIPTIC_CURVE
293   %token  SSL_DH_PARAM_FILE
294   %token  SSL_MESSAGE_DIGEST_ALGORITHM
295 + %token  STANDARD
296   %token  STATS_E_DISABLED
297   %token  STATS_I_OPER_ONLY
298   %token  STATS_K_OPER_ONLY
# 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 */

Diff Legend

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