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 7282 by michael, Sun Feb 7 18:04:26 2016 UTC vs.
Revision 8752 by michael, Tue Jan 1 11:07:01 2019 UTC

# Line 1 | Line 1
1   /*
2   *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3   *
4 < *  Copyright (c) 2000-2016 ircd-hybrid development team
4 > *  Copyright (c) 2000-2019 ircd-hybrid development team
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 31 | Line 31
31   #include "stdinc.h"
32   #include "ircd.h"
33   #include "list.h"
34 + #include "parse.h"
35   #include "conf.h"
36   #include "conf_class.h"
37   #include "conf_cluster.h"
38 + #include "conf_gecos.h"
39   #include "conf_pseudo.h"
40   #include "conf_resv.h"
41   #include "conf_service.h"
# Line 91 | Line 93 | static struct
93      port,
94      aftype,
95      ping_freq,
96 <    max_perip,
96 >    max_perip_local,
97 >    max_perip_global,
98      con_freq,
99      min_idle,
100      max_idle,
101      max_total,
99    max_global,
100    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
158   %token  CIDR_BITLEN_IPV4
159   %token  CIDR_BITLEN_IPV6
160   %token  CLASS
# Line 164 | Line 163 | reset_block_state(void)
163   %token  CONNECTFREQ
164   %token  CYCLE_ON_HOST_CHANGE
165   %token  DEFAULT_FLOODCOUNT
166 + %token  DEFAULT_FLOODTIME
167   %token  DEFAULT_JOIN_FLOOD_COUNT
168   %token  DEFAULT_JOIN_FLOOD_TIME
169   %token  DEFAULT_MAX_CLIENTS
# Line 202 | Line 202 | reset_block_state(void)
202   %token  INVITE_CLIENT_COUNT
203   %token  INVITE_CLIENT_TIME
204   %token  INVITE_DELAY_CHANNEL
205 + %token  INVITE_EXPIRE_TIME
206   %token  IP
207   %token  IRCD_AUTH
208   %token  IRCD_FLAGS
# Line 217 | Line 218 | reset_block_state(void)
218   %token  KNOCK_CLIENT_TIME
219   %token  KNOCK_DELAY_CHANNEL
220   %token  LEAF_MASK
220 %token  LIBGEOIP_DATABASE_OPTIONS
221 %token  LIBGEOIP_IPV4_DATABASE_FILE
222 %token  LIBGEOIP_IPV6_DATABASE_FILE
221   %token  LISTEN
222   %token  MASK
223   %token  MAX_ACCEPT
224   %token  MAX_BANS
225 + %token  MAX_BANS_LARGE
226   %token  MAX_CHANNELS
228 %token  MAX_GLOBAL
229 %token  MAX_IDENT
227   %token  MAX_IDLE
228 < %token  MAX_LOCAL
228 > %token  MAX_INVITES
229   %token  MAX_NICK_CHANGES
230   %token  MAX_NICK_LENGTH
231   %token  MAX_NICK_TIME
# Line 236 | Line 233 | reset_block_state(void)
233   %token  MAX_TARGETS
234   %token  MAX_TOPIC_LENGTH
235   %token  MAX_WATCH
239 %token  MEMORY_CACHE
236   %token  MIN_IDLE
237   %token  MIN_NONWILDCARD
238   %token  MIN_NONWILDCARD_SIMPLE
243 %token  MMAP_CACHE
239   %token  MODULE
240   %token  MODULES
241   %token  MOTD
# Line 254 | Line 249 | reset_block_state(void)
249   %token  NO_TILDE
250   %token  NUMBER
251   %token  NUMBER_PER_CIDR
252 < %token  NUMBER_PER_IP
252 > %token  NUMBER_PER_IP_GLOBAL
253 > %token  NUMBER_PER_IP_LOCAL
254   %token  OPER_ONLY_UMODES
255   %token  OPER_UMODES
256   %token  OPERATOR
# Line 292 | Line 288 | reset_block_state(void)
288   %token  SSL_DH_ELLIPTIC_CURVE
289   %token  SSL_DH_PARAM_FILE
290   %token  SSL_MESSAGE_DIGEST_ALGORITHM
295 %token  STANDARD
291   %token  STATS_E_DISABLED
292   %token  STATS_I_OPER_ONLY
293   %token  STATS_K_OPER_ONLY
# Line 364 | Line 359 | reset_block_state(void)
359   %token  VHOST6
360   %token  WARN_NO_CONNECT_BLOCK
361   %token  WHOIS
362 + %token  WHOWAS_HISTORY_LENGTH
363   %token  XLINE
364   %token  XLINE_EXEMPT
365  
# Line 469 | Line 465 | serverinfo_item:        serverinfo_name
465                          serverinfo_ssl_certificate_file |
466                          serverinfo_ssl_cipher_list |
467                          serverinfo_ssl_message_digest_algorithm |
472                        serverinfo_libgeoip_database_options |
473                        serverinfo_libgeoip_ipv4_database_file |
474                        serverinfo_libgeoip_ipv6_database_file |
468                          error ';' ;
469  
470  
# Line 529 | Line 522 | serverinfo_ssl_dh_elliptic_curve: SSL_DH
522    }
523   };
524  
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
525   serverinfo_name: NAME '=' QSTRING ';'
526   {
527    /* This isn't rehashable */
528    if (conf_parser_ctx.pass == 2 && !ConfigServerInfo.name)
529    {
530 <    if (valid_servname(yylval.string))
530 >    if (server_valid_name(yylval.string) == true)
531        ConfigServerInfo.name = xstrdup(yylval.string);
532      else
533      {
# Line 1045 | Line 975 | oper_entry: OPERATOR
975    {
976      struct MaskItem *conf = NULL;
977      struct split_nuh_item nuh;
978 +    char *s = node->data;
979  
980 <    nuh.nuhmask  = node->data;
980 >    if (EmptyString(s))
981 >      continue;
982 >
983 >    nuh.nuhmask  = s;
984      nuh.nickptr  = NULL;
985      nuh.userptr  = block_state.user.buf;
986      nuh.hostptr  = block_state.host.buf;
# Line 1397 | Line 1331 | class_entry: CLASS
1331    if (!block_state.class.buf[0])
1332      break;
1333  
1334 <  if (!(class = class_find(block_state.class.buf, 0)))
1334 >  if (!(class = class_find(block_state.class.buf, false)))
1335      class = class_make();
1336  
1337    class->active = 1;
1338    xfree(class->name);
1339    class->name = xstrdup(block_state.class.buf);
1340    class->ping_freq = block_state.ping_freq.value;
1341 <  class->max_perip = block_state.max_perip.value;
1341 >  class->max_perip_local = block_state.max_perip_local.value;
1342 >  class->max_perip_global = block_state.max_perip_global.value;
1343    class->con_freq = block_state.con_freq.value;
1344    class->max_total = block_state.max_total.value;
1410  class->max_global = block_state.max_global.value;
1411  class->max_local = block_state.max_local.value;
1412  class->max_ident = block_state.max_ident.value;
1345    class->max_sendq = block_state.max_sendq.value;
1346    class->max_recvq = block_state.max_recvq.value;
1347    class->max_channels = block_state.max_channels.value;
# Line 1425 | Line 1357 | class_entry: CLASS
1357    class->min_idle = block_state.min_idle.value;
1358    class->max_idle = block_state.max_idle.value;
1359  
1360 <  rebuild_cidr_list(class);
1361 <
1360 >  int diff = (class->cidr_bitlen_ipv4 != block_state.cidr_bitlen_ipv4.value ||
1361 >              class->cidr_bitlen_ipv6 != block_state.cidr_bitlen_ipv6.value);
1362    class->cidr_bitlen_ipv4 = block_state.cidr_bitlen_ipv4.value;
1363    class->cidr_bitlen_ipv6 = block_state.cidr_bitlen_ipv6.value;
1364    class->number_per_cidr = block_state.number_per_cidr.value;
1365 +
1366 +  if (diff)
1367 +    class_ip_limit_rebuild(class);
1368   };
1369  
1370   class_items:    class_items class_item | class_item;
# Line 1438 | Line 1373 | class_item:     class_name |
1373                  class_cidr_bitlen_ipv6 |
1374                  class_ping_time |
1375                  class_number_per_cidr |
1376 <                class_number_per_ip |
1376 >                class_number_per_ip_local |
1377 >                class_number_per_ip_global |
1378                  class_connectfreq |
1379                  class_max_channels |
1380                  class_max_number |
1381 <                class_max_global |
1382 <                class_max_local |
1447 <                class_max_ident |
1448 <                class_sendq | class_recvq |
1381 >                class_sendq |
1382 >                class_recvq |
1383                  class_min_idle |
1384                  class_max_idle |
1385                  class_flags |
# Line 1463 | Line 1397 | class_ping_time: PING_TIME '=' timespec
1397      block_state.ping_freq.value = $3;
1398   };
1399  
1400 < class_number_per_ip: NUMBER_PER_IP '=' NUMBER ';'
1400 > class_number_per_ip_local: NUMBER_PER_IP_LOCAL '=' NUMBER ';'
1401   {
1402    if (conf_parser_ctx.pass == 1)
1403 <    block_state.max_perip.value = $3;
1403 >    block_state.max_perip_local.value = $3;
1404 > };
1405 >
1406 > class_number_per_ip_global: NUMBER_PER_IP_GLOBAL '=' NUMBER ';'
1407 > {
1408 >  if (conf_parser_ctx.pass == 1)
1409 >    block_state.max_perip_global.value = $3;
1410   };
1411  
1412   class_connectfreq: CONNECTFREQ '=' timespec ';'
# Line 1487 | Line 1427 | class_max_number: MAX_NUMBER '=' NUMBER
1427      block_state.max_total.value = $3;
1428   };
1429  
1490 class_max_global: MAX_GLOBAL '=' NUMBER ';'
1491 {
1492  if (conf_parser_ctx.pass == 1)
1493    block_state.max_global.value = $3;
1494 };
1495
1496 class_max_local: MAX_LOCAL '=' NUMBER ';'
1497 {
1498  if (conf_parser_ctx.pass == 1)
1499    block_state.max_local.value = $3;
1500 };
1501
1502 class_max_ident: MAX_IDENT '=' NUMBER ';'
1503 {
1504  if (conf_parser_ctx.pass == 1)
1505    block_state.max_ident.value = $3;
1506 };
1507
1430   class_sendq: SENDQ '=' sizespec ';'
1431   {
1432    if (conf_parser_ctx.pass == 1)
# Line 1669 | Line 1591 | auth_entry: IRCD_AUTH
1591    {
1592      struct MaskItem *conf = NULL;
1593      struct split_nuh_item nuh;
1594 +    char *s = node->data;
1595 +
1596 +    if (EmptyString(s))
1597 +      continue;
1598  
1599 <    nuh.nuhmask  = node->data;
1599 >    nuh.nuhmask  = s;
1600      nuh.nickptr  = NULL;
1601      nuh.userptr  = block_state.user.buf;
1602      nuh.hostptr  = block_state.host.buf;
# Line 1871 | Line 1797 | service_name: NAME '=' QSTRING ';'
1797    if (conf_parser_ctx.pass != 2)
1798      break;
1799  
1800 <  if (valid_servname(yylval.string))
1800 >  if (server_valid_name(yylval.string) == true)
1801    {
1802      struct ServiceItem *service = service_make();
1803      service->name = xstrdup(yylval.string);
# Line 2415 | Line 2341 | gecos_entry: GECOS
2341      reset_block_state();
2342   } '{' gecos_items '}' ';'
2343   {
2418  struct MaskItem *conf = NULL;
2419
2344    if (conf_parser_ctx.pass != 2)
2345      break;
2346  
2347    if (!block_state.name.buf[0])
2348      break;
2349  
2350 <  conf = conf_make(CONF_XLINE);
2351 <  conf->name = xstrdup(block_state.name.buf);
2350 >  struct GecosItem *gecos = gecos_make();
2351 >  gecos->mask = xstrdup(block_state.name.buf);
2352  
2353    if (block_state.rpass.buf[0])
2354 <    conf->reason = xstrdup(block_state.rpass.buf);
2354 >    gecos->reason = xstrdup(block_state.rpass.buf);
2355    else
2356 <    conf->reason = xstrdup(CONF_NOREASON);
2356 >    gecos->reason = xstrdup(CONF_NOREASON);
2357   };
2358  
2359   gecos_items: gecos_items gecos_item | gecos_item;
# Line 2462 | Line 2386 | general_item:       general_away_count |
2386                      general_max_nick_time |
2387                      general_max_nick_changes |
2388                      general_max_accept |
2389 +                    general_whowas_history_length |
2390                      general_anti_spam_exit_message_time |
2391                      general_ts_warn_delta |
2392                      general_ts_max_delta |
# Line 2485 | Line 2410 | general_item:       general_away_count |
2410                      general_caller_id_wait |
2411                      general_opers_bypass_callerid |
2412                      general_default_floodcount |
2413 +                    general_default_floodtime |
2414                      general_min_nonwildcard |
2415                      general_min_nonwildcard_simple |
2416                      general_throttle_count |
# Line 2517 | Line 2443 | general_max_watch: MAX_WATCH '=' NUMBER
2443    ConfigGeneral.max_watch = $3;
2444   };
2445  
2446 + general_whowas_history_length: WHOWAS_HISTORY_LENGTH '=' NUMBER ';'
2447 + {
2448 +  ConfigGeneral.whowas_history_length = $3;
2449 + };
2450 +
2451   general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';'
2452   {
2453    if (conf_parser_ctx.pass == 2)
# Line 2867 | Line 2798 | general_default_floodcount: DEFAULT_FLOO
2798    ConfigGeneral.default_floodcount = $3;
2799   };
2800  
2801 + general_default_floodtime: DEFAULT_FLOODTIME '=' timespec ';'
2802 + {
2803 +  ConfigGeneral.default_floodtime = $3;
2804 + };
2805 +
2806  
2807   /***************************************************************************
2808   * channel {} section
# Line 2875 | Line 2811 | channel_entry: CHANNEL '{' channel_items
2811  
2812   channel_items:      channel_items channel_item | channel_item;
2813   channel_item:       channel_max_bans |
2814 +                    channel_max_bans_large |
2815                      channel_invite_client_count |
2816                      channel_invite_client_time |
2817                      channel_invite_delay_channel |
2818 +                    channel_invite_expire_time |
2819                      channel_knock_client_count |
2820                      channel_knock_client_time |
2821                      channel_knock_delay_channel |
2822                      channel_max_channels |
2823 +                    channel_max_invites |
2824                      channel_default_join_flood_count |
2825                      channel_default_join_flood_time |
2826                      channel_disable_fake_channels |
# Line 2907 | Line 2846 | channel_invite_delay_channel: INVITE_DEL
2846    ConfigChannel.invite_delay_channel = $3;
2847   };
2848  
2849 + channel_invite_expire_time: INVITE_EXPIRE_TIME '=' timespec ';'
2850 + {
2851 +  ConfigChannel.invite_expire_time = $3;
2852 + };
2853 +
2854   channel_knock_client_count: KNOCK_CLIENT_COUNT '=' NUMBER ';'
2855   {
2856    ConfigChannel.knock_client_count = $3;
# Line 2927 | Line 2871 | channel_max_channels: MAX_CHANNELS '=' N
2871    ConfigChannel.max_channels = $3;
2872   };
2873  
2874 + channel_max_invites: MAX_INVITES '=' NUMBER ';'
2875 + {
2876 +  ConfigChannel.max_invites = $3;
2877 + };
2878 +
2879   channel_max_bans: MAX_BANS '=' NUMBER ';'
2880   {
2881    ConfigChannel.max_bans = $3;
2882   };
2883  
2884 + channel_max_bans_large: MAX_BANS_LARGE '=' NUMBER ';'
2885 + {
2886 +  ConfigChannel.max_bans_large = $3;
2887 + };
2888 +
2889   channel_default_join_flood_count: DEFAULT_JOIN_FLOOD_COUNT '=' NUMBER ';'
2890   {
2891    ConfigChannel.default_join_flood_count = yylval.number;

Comparing ircd-hybrid/trunk/src/conf_parser.y (property svn:keywords):
Revision 7282 by michael, Sun Feb 7 18:04:26 2016 UTC vs.
Revision 8752 by michael, Tue Jan 1 11:07:01 2019 UTC

# Line 1 | Line 1
1 < Id Revision
1 > Id

Diff Legend

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