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 3933 by michael, Mon Jun 9 17:56:42 2014 UTC vs.
Revision 7624 by michael, Thu Jun 23 12:44:09 2016 UTC

# Line 1 | Line 1
1   /*
2   *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3   *
4 < *  Copyright (c) 2000-2014 ircd-hybrid development team
4 > *  Copyright (c) 2000-2016 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 15 | Line 15
15   *
16   *  You should have received a copy of the GNU General Public License
17   *  along with this program; if not, write to the Free Software
18 < *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
18 > *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19   *  USA
20   */
21  
# Line 27 | Line 27
27  
28   %{
29  
30 #define YY_NO_UNPUT
31 #include <sys/types.h>
32 #include <string.h>
33
30   #include "config.h"
31   #include "stdinc.h"
32   #include "ircd.h"
33   #include "list.h"
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"
41 + #include "conf_shared.h"
42   #include "event.h"
43 + #include "id.h"
44   #include "log.h"
42 #include "client.h"     /* for UMODE_ALL only */
45   #include "irc_string.h"
46   #include "memory.h"
47   #include "modules.h"
48   #include "server.h"
49   #include "hostmask.h"
48 #include "send.h"
50   #include "listener.h"
50 #include "resv.h"
51 #include "numeric.h"
51   #include "user.h"
52   #include "motd.h"
53  
55 #ifdef HAVE_LIBCRYPTO
56 #include <openssl/rsa.h>
57 #include <openssl/bio.h>
58 #include <openssl/pem.h>
59 #include <openssl/dh.h>
60 #endif
61
62 #include "rsa.h"
63
54   int yylex(void);
55  
56   static struct
# Line 76 | Line 66 | static struct
66    {
67      char buf[IRCD_BUFSIZE];
68    } name,
69 +    nick,
70      user,
71      host,
72      addr,
# Line 85 | Line 76 | static struct
76      cert,
77      rpass,
78      spass,
79 <    class;
79 >    whois,
80 >    class,
81 >    target,
82 >    prepend,
83 >    command;
84  
85    struct
86    {
# Line 104 | Line 99 | static struct
99      max_total,
100      max_global,
101      max_local,
107    max_ident,
102      max_sendq,
103      max_recvq,
104      max_channels,
# Line 116 | Line 110 | static struct
110   static void
111   reset_block_state(void)
112   {
113 <  dlink_node *ptr = NULL, *ptr_next = NULL;
113 >  dlink_node *node = NULL, *node_next = NULL;
114  
115 <  DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.mask.list.head)
115 >  DLINK_FOREACH_SAFE(node, node_next, block_state.mask.list.head)
116    {
117 <    MyFree(ptr->data);
118 <    dlinkDelete(ptr, &block_state.mask.list);
119 <    free_dlink_node(ptr);
117 >    xfree(node->data);
118 >    dlinkDelete(node, &block_state.mask.list);
119 >    free_dlink_node(node);
120    }
121  
122 <  DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.leaf.list.head)
122 >  DLINK_FOREACH_SAFE(node, node_next, block_state.leaf.list.head)
123    {
124 <    MyFree(ptr->data);
125 <    dlinkDelete(ptr, &block_state.leaf.list);
126 <    free_dlink_node(ptr);
124 >    xfree(node->data);
125 >    dlinkDelete(node, &block_state.leaf.list);
126 >    free_dlink_node(node);
127    }
128  
129 <  DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.hub.list.head)
129 >  DLINK_FOREACH_SAFE(node, node_next, block_state.hub.list.head)
130    {
131 <    MyFree(ptr->data);
132 <    dlinkDelete(ptr, &block_state.hub.list);
133 <    free_dlink_node(ptr);
131 >    xfree(node->data);
132 >    dlinkDelete(node, &block_state.hub.list);
133 >    free_dlink_node(node);
134    }
135  
136    memset(&block_state, 0, sizeof(block_state));
# Line 155 | Line 149 | reset_block_state(void)
149   %token  ANTI_NICK_FLOOD
150   %token  ANTI_SPAM_EXIT_MESSAGE_TIME
151   %token  AUTOCONN
152 + %token  AWAY_COUNT
153 + %token  AWAY_TIME
154   %token  BYTES KBYTES MBYTES
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
162 + %token  CLOSE
163   %token  CONNECT
164   %token  CONNECTFREQ
165   %token  CYCLE_ON_HOST_CHANGE
166   %token  DEFAULT_FLOODCOUNT
167 < %token  DEFAULT_SPLIT_SERVER_COUNT
168 < %token  DEFAULT_SPLIT_USER_COUNT
167 > %token  DEFAULT_JOIN_FLOOD_COUNT
168 > %token  DEFAULT_JOIN_FLOOD_TIME
169 > %token  DEFAULT_MAX_CLIENTS
170   %token  DENY
171   %token  DESCRIPTION
172   %token  DIE
173   %token  DISABLE_AUTH
174   %token  DISABLE_FAKE_CHANNELS
175   %token  DISABLE_REMOTE_COMMANDS
176 + %token  DLINE_MIN_CIDR
177 + %token  DLINE_MIN_CIDR6
178   %token  DOTS_IN_IDENT
178 %token  EGDPOOL_PATH
179   %token  EMAIL
180   %token  ENCRYPTED
181   %token  EXCEED_LIMIT
182   %token  EXEMPT
183   %token  FAILED_OPER_NOTICE
184   %token  FLATTEN_LINKS
185 + %token  FLATTEN_LINKS_DELAY
186 + %token  FLATTEN_LINKS_FILE
187   %token  GECOS
188   %token  GENERAL
187 %token  GLINE
188 %token  GLINE_DURATION
189 %token  GLINE_ENABLE
190 %token  GLINE_EXEMPT
191 %token  GLINE_MIN_CIDR
192 %token  GLINE_MIN_CIDR6
193 %token  GLINE_REQUEST_DURATION
194 %token  GLOBAL_KILL
195 %token  HAVENT_READ_CONF
189   %token  HIDDEN
190   %token  HIDDEN_NAME
191   %token  HIDE_CHANS
# Line 201 | Line 194 | reset_block_state(void)
194   %token  HIDE_SERVER_IPS
195   %token  HIDE_SERVERS
196   %token  HIDE_SERVICES
204 %token  HIDE_SPOOF_IPS
197   %token  HOST
198   %token  HUB
199   %token  HUB_MASK
# Line 209 | Line 201 | reset_block_state(void)
201   %token  INVISIBLE_ON_CONNECT
202   %token  INVITE_CLIENT_COUNT
203   %token  INVITE_CLIENT_TIME
204 + %token  INVITE_DELAY_CHANNEL
205   %token  IP
206   %token  IRCD_AUTH
207   %token  IRCD_FLAGS
208   %token  IRCD_SID
209 < %token  JOIN_FLOOD_COUNT
217 < %token  JOIN_FLOOD_TIME
209 > %token  JOIN
210   %token  KILL
211   %token  KILL_CHASE_TIME_LIMIT
212   %token  KLINE
213   %token  KLINE_EXEMPT
214 + %token  KLINE_MIN_CIDR
215 + %token  KLINE_MIN_CIDR6
216   %token  KNOCK_CLIENT_COUNT
217   %token  KNOCK_CLIENT_TIME
218   %token  KNOCK_DELAY_CHANNEL
219   %token  LEAF_MASK
220 < %token  LINKS_DELAY
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
233 %token  MAX_IDENT
229   %token  MAX_IDLE
230   %token  MAX_LOCAL
231   %token  MAX_NICK_CHANGES
# Line 240 | 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 252 | Line 249 | reset_block_state(void)
249   %token  NETWORK_DESC
250   %token  NETWORK_NAME
251   %token  NICK
255 %token  NO_CREATE_ON_SPLIT
256 %token  NO_JOIN_ON_SPLIT
252   %token  NO_OPER_FLOOD
253   %token  NO_TILDE
254   %token  NUMBER
255   %token  NUMBER_PER_CIDR
256   %token  NUMBER_PER_IP
257   %token  OPER_ONLY_UMODES
263 %token  OPER_PASS_RESV
258   %token  OPER_UMODES
259   %token  OPERATOR
260   %token  OPERS_BYPASS_CALLERID
# Line 282 | Line 276 | reset_block_state(void)
276   %token  RESV
277   %token  RESV_EXEMPT
278   %token  RSA_PRIVATE_KEY_FILE
285 %token  RSA_PUBLIC_KEY_FILE
279   %token  SECONDS MINUTES HOURS DAYS WEEKS MONTHS YEARS
280   %token  SEND_PASSWORD
281   %token  SENDQ
# Line 295 | Line 288 | reset_block_state(void)
288   %token  SSL_CERTIFICATE_FILE
289   %token  SSL_CERTIFICATE_FINGERPRINT
290   %token  SSL_CONNECTION_REQUIRED
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
298 + %token  STATS_M_OPER_ONLY
299   %token  STATS_O_OPER_ONLY
300   %token  STATS_P_OPER_ONLY
301   %token  STATS_U_OPER_ONLY
# Line 306 | Line 303 | reset_block_state(void)
303   %token  T_BOTS
304   %token  T_CALLERID
305   %token  T_CCONN
306 + %token  T_COMMAND
307   %token  T_CLUSTER
308   %token  T_DEAF
309   %token  T_DEBUG
# Line 320 | Line 318 | reset_block_state(void)
318   %token  T_IPV6
319   %token  T_LOCOPS
320   %token  T_LOG
323 %token  T_MAX_CLIENTS
321   %token  T_NCHANGE
322   %token  T_NONONREG
323 + %token  T_OPME
324 + %token  T_PREPEND
325 + %token  T_PSEUDO
326   %token  T_RECVQ
327   %token  T_REJ
328   %token  T_RESTART
329   %token  T_SERVER
330   %token  T_SERVICE
331 %token  T_SERVICES_NAME
331   %token  T_SERVNOTICE
332   %token  T_SET
333   %token  T_SHARED
# Line 338 | Line 337 | reset_block_state(void)
337   %token  T_SPY
338   %token  T_SSL
339   %token  T_SSL_CIPHER_LIST
340 < %token  T_SSL_CLIENT_METHOD
342 < %token  T_SSL_SERVER_METHOD
343 < %token  T_SSLV3
344 < %token  T_TLSV1
340 > %token  T_TARGET
341   %token  T_UMODES
342   %token  T_UNAUTH
343   %token  T_UNDLINE
# Line 356 | Line 352 | reset_block_state(void)
352   %token  THROTTLE_TIME
353   %token  TKLINE_EXPIRE_NOTICES
354   %token  TMASKED
359 %token  TRUE_NO_OPER_FLOOD
355   %token  TS_MAX_DELTA
356   %token  TS_WARN_DELTA
357   %token  TWODOTS
358   %token  TYPE
359   %token  UNKLINE
365 %token  USE_EGD
360   %token  USE_LOGGING
361   %token  USER
362   %token  VHOST
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  
370   %type  <string> QSTRING
371   %type  <number> NUMBER
# Line 403 | Line 400 | conf_item:        admin_entry
400                  | gecos_entry
401                  | modules_entry
402                  | motd_entry
403 +                | pseudo_entry
404                  | error ';'
405                  | error '}'
406          ;
# Line 428 | Line 426 | sizespec:   NUMBER sizespec_ { $$ = $1 +
426  
427  
428   /***************************************************************************
429 < *  section modules
429 > * modules {} section
430   ***************************************************************************/
431 < modules_entry: MODULES
434 <  '{' modules_items '}' ';';
431 > modules_entry: MODULES '{' modules_items '}' ';';
432  
433   modules_items:  modules_items modules_item | modules_item;
434   modules_item:   modules_module | modules_path | error ';' ;
# Line 449 | Line 446 | modules_path: PATH '=' QSTRING ';'
446   };
447  
448  
449 + /***************************************************************************
450 + * serverinfo {}  section
451 + ***************************************************************************/
452   serverinfo_entry: SERVERINFO '{' serverinfo_items '}' ';';
453  
454   serverinfo_items:       serverinfo_items serverinfo_item | serverinfo_item ;
# Line 458 | Line 458 | serverinfo_item:        serverinfo_name
458                          serverinfo_description |
459                          serverinfo_network_name |
460                          serverinfo_network_desc |
461 <                        serverinfo_max_clients |
461 >                        serverinfo_default_max_clients |
462                          serverinfo_max_nick_length |
463                          serverinfo_max_topic_length |
464                          serverinfo_ssl_dh_param_file |
465 +                        serverinfo_ssl_dh_elliptic_curve |
466                          serverinfo_rsa_private_key_file |
467                          serverinfo_vhost6 |
468                          serverinfo_sid |
469                          serverinfo_ssl_certificate_file |
469                        serverinfo_ssl_client_method |
470                        serverinfo_ssl_server_method |
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  
475 serverinfo_ssl_client_method: T_SSL_CLIENT_METHOD '=' client_method_types ';' ;
476 serverinfo_ssl_server_method: T_SSL_SERVER_METHOD '=' server_method_types ';' ;
477
478 client_method_types: client_method_types ',' client_method_type_item | client_method_type_item;
479 client_method_type_item: T_SSLV3
480 {
481 #ifdef HAVE_LIBCRYPTO
482  if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx)
483    SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_SSLv3);
484 #endif
485 } | T_TLSV1
486 {
487 #ifdef HAVE_LIBCRYPTO
488  if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx)
489    SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_TLSv1);
490 #endif
491 };
492
493 server_method_types: server_method_types ',' server_method_type_item | server_method_type_item;
494 server_method_type_item: T_SSLV3
495 {
496 #ifdef HAVE_LIBCRYPTO
497  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
498    SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3);
499 #endif
500 } | T_TLSV1
501 {
502 #ifdef HAVE_LIBCRYPTO
503  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
504    SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1);
505 #endif
506 };
507
478   serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';'
479   {
480 < #ifdef HAVE_LIBCRYPTO
511 <  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
480 >  if (conf_parser_ctx.pass == 2)
481    {
482 <    if (!ServerInfo.rsa_private_key_file)
483 <    {
515 <      conf_error_report("No rsa_private_key_file specified, SSL disabled");
516 <      break;
517 <    }
518 <
519 <    if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string,
520 <                                     SSL_FILETYPE_PEM) <= 0 ||
521 <        SSL_CTX_use_certificate_file(ServerInfo.client_ctx, yylval.string,
522 <                                     SSL_FILETYPE_PEM) <= 0)
523 <    {
524 <      report_crypto_errors();
525 <      conf_error_report("Could not open/read certificate file");
526 <      break;
527 <    }
528 <
529 <    if (SSL_CTX_use_PrivateKey_file(ServerInfo.server_ctx, ServerInfo.rsa_private_key_file,
530 <                                    SSL_FILETYPE_PEM) <= 0 ||
531 <        SSL_CTX_use_PrivateKey_file(ServerInfo.client_ctx, ServerInfo.rsa_private_key_file,
532 <                                    SSL_FILETYPE_PEM) <= 0)
533 <    {
534 <      report_crypto_errors();
535 <      conf_error_report("Could not read RSA private key");
536 <      break;
537 <    }
538 <
539 <    if (!SSL_CTX_check_private_key(ServerInfo.server_ctx) ||
540 <        !SSL_CTX_check_private_key(ServerInfo.client_ctx))
541 <    {
542 <      report_crypto_errors();
543 <      conf_error_report("Could not read RSA private key");
544 <      break;
545 <    }
482 >    xfree(ConfigServerInfo.ssl_certificate_file);
483 >    ConfigServerInfo.ssl_certificate_file = xstrdup(yylval.string);
484    }
547 #endif
485   };
486  
487   serverinfo_rsa_private_key_file: RSA_PRIVATE_KEY_FILE '=' QSTRING ';'
488   {
489 < #ifdef HAVE_LIBCRYPTO
553 <  BIO *file = NULL;
554 <
555 <  if (conf_parser_ctx.pass != 1)
556 <    break;
557 <
558 <  if (ServerInfo.rsa_private_key)
489 >  if (conf_parser_ctx.pass == 2)
490    {
491 <    RSA_free(ServerInfo.rsa_private_key);
492 <    ServerInfo.rsa_private_key = NULL;
491 >    xfree(ConfigServerInfo.rsa_private_key_file);
492 >    ConfigServerInfo.rsa_private_key_file = xstrdup(yylval.string);
493    }
494 + };
495  
496 <  if (ServerInfo.rsa_private_key_file)
496 > serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';'
497 > {
498 >  if (conf_parser_ctx.pass == 2)
499    {
500 <    MyFree(ServerInfo.rsa_private_key_file);
501 <    ServerInfo.rsa_private_key_file = NULL;
500 >    xfree(ConfigServerInfo.ssl_dh_param_file);
501 >    ConfigServerInfo.ssl_dh_param_file = xstrdup(yylval.string);
502    }
503 + };
504  
505 <  ServerInfo.rsa_private_key_file = xstrdup(yylval.string);
506 <
507 <  if ((file = BIO_new_file(yylval.string, "r")) == NULL)
505 > serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
506 > {
507 >  if (conf_parser_ctx.pass == 2)
508    {
509 <    conf_error_report("File open failed, ignoring");
510 <    break;
509 >    xfree(ConfigServerInfo.ssl_cipher_list);
510 >    ConfigServerInfo.ssl_cipher_list = xstrdup(yylval.string);
511    }
512 + };
513  
514 <  ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
515 <
516 <  BIO_set_close(file, BIO_CLOSE);
581 <  BIO_free(file);
582 <
583 <  if (ServerInfo.rsa_private_key == NULL)
514 > serverinfo_ssl_message_digest_algorithm: SSL_MESSAGE_DIGEST_ALGORITHM '=' QSTRING ';'
515 > {
516 >  if (conf_parser_ctx.pass == 2)
517    {
518 <    conf_error_report("Couldn't extract key, ignoring");
519 <    break;
518 >    xfree(ConfigServerInfo.ssl_message_digest_algorithm);
519 >    ConfigServerInfo.ssl_message_digest_algorithm = xstrdup(yylval.string);
520    }
521 + }
522  
523 <  if (!RSA_check_key(ServerInfo.rsa_private_key))
523 > serverinfo_ssl_dh_elliptic_curve: SSL_DH_ELLIPTIC_CURVE '=' QSTRING ';'
524 > {
525 >  if (conf_parser_ctx.pass == 2)
526    {
527 <    RSA_free(ServerInfo.rsa_private_key);
528 <    ServerInfo.rsa_private_key = NULL;
593 <
594 <    conf_error_report("Invalid key, ignoring");
595 <    break;
527 >    xfree(ConfigServerInfo.ssl_dh_elliptic_curve);
528 >    ConfigServerInfo.ssl_dh_elliptic_curve = xstrdup(yylval.string);
529    }
530 + };
531  
532 <  if (RSA_size(ServerInfo.rsa_private_key) < 128)
533 <  {
534 <    RSA_free(ServerInfo.rsa_private_key);
535 <    ServerInfo.rsa_private_key = NULL;
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 <    conf_error_report("Ignoring serverinfo::rsa_private_key_file -- need at least a 1024 bit key size");
539 <  }
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_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';'
565 > serverinfo_libgeoip_ipv4_database_file:  LIBGEOIP_IPV4_DATABASE_FILE '=' QSTRING ';'
566   {
567 < /* TBD - XXX: error reporting */
611 < #ifdef HAVE_LIBCRYPTO
612 <  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
567 >  if (conf_parser_ctx.pass == 2)
568    {
569 <    BIO *file = BIO_new_file(yylval.string, "r");
569 >    xfree(ConfigServerInfo.libgeoip_ipv4_database_file);
570 >    ConfigServerInfo.libgeoip_ipv4_database_file = xstrdup(yylval.string);
571  
572 <    if (file)
573 <    {
574 <      DH *dh = PEM_read_bio_DHparams(file, NULL, NULL, NULL);
575 <
620 <      BIO_free(file);
621 <
622 <      if (dh)
623 <      {
624 <        if (DH_size(dh) < 128)
625 <          conf_error_report("Ignoring serverinfo::ssl_dh_param_file -- need at least a 1024 bit DH prime size");
626 <        else
627 <          SSL_CTX_set_tmp_dh(ServerInfo.server_ctx, dh);
628 <
629 <        DH_free(dh);
630 <      }
631 <    }
632 <  }
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_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
580 > serverinfo_libgeoip_ipv6_database_file:  LIBGEOIP_IPV6_DATABASE_FILE '=' QSTRING ';'
581   {
582 < #ifdef HAVE_LIBCRYPTO
583 <  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
584 <    SSL_CTX_set_cipher_list(ServerInfo.server_ctx, yylval.string);
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 */
598 <  if (conf_parser_ctx.pass == 2 && !ServerInfo.name)
597 >  /* This isn't rehashable */
598 >  if (conf_parser_ctx.pass == 2 && !ConfigServerInfo.name)
599    {
600      if (valid_servname(yylval.string))
601 <      ServerInfo.name = xstrdup(yylval.string);
601 >      ConfigServerInfo.name = xstrdup(yylval.string);
602      else
603      {
604        conf_error_report("Ignoring serverinfo::name -- invalid name. Aborting.");
605 <      exit(0);
605 >      exit(EXIT_FAILURE);
606      }
607    }
608   };
609  
610   serverinfo_sid: IRCD_SID '=' QSTRING ';'
611   {
612 <  /* this isn't rehashable */
613 <  if (conf_parser_ctx.pass == 2 && !ServerInfo.sid)
612 >  /* This isn't rehashable */
613 >  if (conf_parser_ctx.pass == 2 && !ConfigServerInfo.sid)
614    {
615      if (valid_sid(yylval.string))
616 <      ServerInfo.sid = xstrdup(yylval.string);
616 >      ConfigServerInfo.sid = xstrdup(yylval.string);
617      else
618      {
619        conf_error_report("Ignoring serverinfo::sid -- invalid SID. Aborting.");
620 <      exit(0);
620 >      exit(EXIT_FAILURE);
621      }
622    }
623   };
# Line 675 | Line 626 | serverinfo_description: DESCRIPTION '='
626   {
627    if (conf_parser_ctx.pass == 2)
628    {
629 <    MyFree(ServerInfo.description);
630 <    ServerInfo.description = xstrdup(yylval.string);
629 >    xfree(ConfigServerInfo.description);
630 >    ConfigServerInfo.description = xstrdup(yylval.string);
631 >    strlcpy(me.info, ConfigServerInfo.description, sizeof(me.info));
632    }
633   };
634  
# Line 689 | Line 641 | serverinfo_network_name: NETWORK_NAME '=
641      if ((p = strchr(yylval.string, ' ')))
642        *p = '\0';
643  
644 <    MyFree(ServerInfo.network_name);
645 <    ServerInfo.network_name = xstrdup(yylval.string);
644 >    xfree(ConfigServerInfo.network_name);
645 >    ConfigServerInfo.network_name = xstrdup(yylval.string);
646    }
647   };
648  
# Line 699 | Line 651 | serverinfo_network_desc: NETWORK_DESC '=
651    if (conf_parser_ctx.pass != 2)
652      break;
653  
654 <  MyFree(ServerInfo.network_desc);
655 <  ServerInfo.network_desc = xstrdup(yylval.string);
654 >  xfree(ConfigServerInfo.network_desc);
655 >  ConfigServerInfo.network_desc = xstrdup(yylval.string);
656   };
657  
658   serverinfo_vhost: VHOST '=' QSTRING ';'
# Line 721 | Line 673 | serverinfo_vhost: VHOST '=' QSTRING ';'
673      {
674        assert(res);
675  
676 <      memcpy(&ServerInfo.ip, res->ai_addr, res->ai_addrlen);
677 <      ServerInfo.ip.ss.ss_family = res->ai_family;
678 <      ServerInfo.ip.ss_len = res->ai_addrlen;
676 >      memcpy(&ConfigServerInfo.ip, res->ai_addr, res->ai_addrlen);
677 >      ConfigServerInfo.ip.ss.ss_family = res->ai_family;
678 >      ConfigServerInfo.ip.ss_len = res->ai_addrlen;
679        freeaddrinfo(res);
680  
681 <      ServerInfo.specific_ipv4_vhost = 1;
681 >      ConfigServerInfo.specific_ipv4_vhost = 1;
682      }
683    }
684   };
685  
686   serverinfo_vhost6: VHOST6 '=' QSTRING ';'
687   {
736 #ifdef IPV6
688    if (conf_parser_ctx.pass == 2 && *yylval.string != '*')
689    {
690      struct addrinfo hints, *res;
# Line 750 | Line 701 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
701      {
702        assert(res);
703  
704 <      memcpy(&ServerInfo.ip6, res->ai_addr, res->ai_addrlen);
705 <      ServerInfo.ip6.ss.ss_family = res->ai_family;
706 <      ServerInfo.ip6.ss_len = res->ai_addrlen;
704 >      memcpy(&ConfigServerInfo.ip6, res->ai_addr, res->ai_addrlen);
705 >      ConfigServerInfo.ip6.ss.ss_family = res->ai_family;
706 >      ConfigServerInfo.ip6.ss_len = res->ai_addrlen;
707        freeaddrinfo(res);
708  
709 <      ServerInfo.specific_ipv6_vhost = 1;
709 >      ConfigServerInfo.specific_ipv6_vhost = 1;
710      }
711    }
761 #endif
712   };
713  
714 < serverinfo_max_clients: T_MAX_CLIENTS '=' NUMBER ';'
714 > serverinfo_default_max_clients: DEFAULT_MAX_CLIENTS '=' NUMBER ';'
715   {
716    if (conf_parser_ctx.pass != 2)
717      break;
# Line 772 | Line 722 | serverinfo_max_clients: T_MAX_CLIENTS '=
722  
723      snprintf(buf, sizeof(buf), "MAXCLIENTS too low, setting to %d", MAXCLIENTS_MIN);
724      conf_error_report(buf);
725 <    ServerInfo.max_clients = MAXCLIENTS_MIN;
725 >    ConfigServerInfo.default_max_clients = MAXCLIENTS_MIN;
726    }
727    else if ($3 > MAXCLIENTS_MAX)
728    {
# Line 780 | Line 730 | serverinfo_max_clients: T_MAX_CLIENTS '=
730  
731      snprintf(buf, sizeof(buf), "MAXCLIENTS too high, setting to %d", MAXCLIENTS_MAX);
732      conf_error_report(buf);
733 <    ServerInfo.max_clients = MAXCLIENTS_MAX;
733 >    ConfigServerInfo.default_max_clients = MAXCLIENTS_MAX;
734    }
735    else
736 <    ServerInfo.max_clients = $3;
736 >    ConfigServerInfo.default_max_clients = $3;
737   };
738  
739   serverinfo_max_nick_length: MAX_NICK_LENGTH '=' NUMBER ';'
# Line 794 | Line 744 | serverinfo_max_nick_length: MAX_NICK_LEN
744    if ($3 < 9)
745    {
746      conf_error_report("max_nick_length too low, setting to 9");
747 <    ServerInfo.max_nick_length = 9;
747 >    ConfigServerInfo.max_nick_length = 9;
748    }
749    else if ($3 > NICKLEN)
750    {
# Line 802 | Line 752 | serverinfo_max_nick_length: MAX_NICK_LEN
752  
753      snprintf(buf, sizeof(buf), "max_nick_length too high, setting to %d", NICKLEN);
754      conf_error_report(buf);
755 <    ServerInfo.max_nick_length = NICKLEN;
755 >    ConfigServerInfo.max_nick_length = NICKLEN;
756    }
757    else
758 <    ServerInfo.max_nick_length = $3;
758 >    ConfigServerInfo.max_nick_length = $3;
759   };
760  
761   serverinfo_max_topic_length: MAX_TOPIC_LENGTH '=' NUMBER ';'
# Line 816 | Line 766 | serverinfo_max_topic_length: MAX_TOPIC_L
766    if ($3 < 80)
767    {
768      conf_error_report("max_topic_length too low, setting to 80");
769 <    ServerInfo.max_topic_length = 80;
769 >    ConfigServerInfo.max_topic_length = 80;
770    }
771    else if ($3 > TOPICLEN)
772    {
# Line 824 | Line 774 | serverinfo_max_topic_length: MAX_TOPIC_L
774  
775      snprintf(buf, sizeof(buf), "max_topic_length too high, setting to %d", TOPICLEN);
776      conf_error_report(buf);
777 <    ServerInfo.max_topic_length = TOPICLEN;
777 >    ConfigServerInfo.max_topic_length = TOPICLEN;
778    }
779    else
780 <    ServerInfo.max_topic_length = $3;
780 >    ConfigServerInfo.max_topic_length = $3;
781   };
782  
783   serverinfo_hub: HUB '=' TBOOL ';'
784   {
785    if (conf_parser_ctx.pass == 2)
786 <    ServerInfo.hub = yylval.number;
786 >    ConfigServerInfo.hub = yylval.number;
787   };
788  
789 +
790   /***************************************************************************
791 < * admin section
791 > * admin {} section
792   ***************************************************************************/
793   admin_entry: ADMIN  '{' admin_items '}' ';' ;
794  
# Line 852 | Line 803 | admin_name: NAME '=' QSTRING ';'
803    if (conf_parser_ctx.pass != 2)
804      break;
805  
806 <  MyFree(AdminInfo.name);
807 <  AdminInfo.name = xstrdup(yylval.string);
806 >  xfree(ConfigAdminInfo.name);
807 >  ConfigAdminInfo.name = xstrdup(yylval.string);
808   };
809  
810   admin_email: EMAIL '=' QSTRING ';'
# Line 861 | Line 812 | admin_email: EMAIL '=' QSTRING ';'
812    if (conf_parser_ctx.pass != 2)
813      break;
814  
815 <  MyFree(AdminInfo.email);
816 <  AdminInfo.email = xstrdup(yylval.string);
815 >  xfree(ConfigAdminInfo.email);
816 >  ConfigAdminInfo.email = xstrdup(yylval.string);
817   };
818  
819   admin_description: DESCRIPTION '=' QSTRING ';'
# Line 870 | Line 821 | admin_description: DESCRIPTION '=' QSTRI
821    if (conf_parser_ctx.pass != 2)
822      break;
823  
824 <  MyFree(AdminInfo.description);
825 <  AdminInfo.description = xstrdup(yylval.string);
824 >  xfree(ConfigAdminInfo.description);
825 >  ConfigAdminInfo.description = xstrdup(yylval.string);
826   };
827  
828 +
829   /***************************************************************************
830 < * motd section
830 > * motd {} section
831   ***************************************************************************/
832   motd_entry: MOTD
833   {
# Line 883 | Line 835 | motd_entry: MOTD
835      reset_block_state();
836   } '{' motd_items '}' ';'
837   {
838 <  dlink_node *ptr = NULL;
838 >  dlink_node *node = NULL;
839  
840    if (conf_parser_ctx.pass != 2)
841      break;
# Line 891 | Line 843 | motd_entry: MOTD
843    if (!block_state.file.buf[0])
844      break;
845  
846 <  DLINK_FOREACH(ptr, block_state.mask.list.head)
847 <    motd_add(ptr->data, block_state.file.buf);
846 >  DLINK_FOREACH(node, block_state.mask.list.head)
847 >    motd_add(node->data, block_state.file.buf);
848   };
849  
850   motd_items: motd_items motd_item | motd_item;
# Line 910 | Line 862 | motd_file: T_FILE '=' QSTRING ';'
862      strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf));
863   };
864  
865 +
866   /***************************************************************************
867 < *  section logging
867 > * pseudo {} section
868 > ***************************************************************************/
869 > pseudo_entry: T_PSEUDO
870 > {
871 >  if (conf_parser_ctx.pass == 2)
872 >    reset_block_state();
873 > } '{' pseudo_items '}' ';'
874 > {
875 >  if (conf_parser_ctx.pass != 2)
876 >    break;
877 >
878 >  if (!block_state.command.buf[0] ||
879 >      !block_state.name.buf[0] ||
880 >      !block_state.nick.buf[0] ||
881 >      !block_state.host.buf[0])
882 >    break;
883 >
884 >  pseudo_register(block_state.name.buf, block_state.nick.buf, block_state.host.buf,
885 >                  block_state.prepend.buf, block_state.command.buf);
886 > };
887 >
888 > pseudo_items: pseudo_items pseudo_item | pseudo_item;
889 > pseudo_item:  pseudo_command | pseudo_prepend | pseudo_name | pseudo_target | error ';' ;
890 >
891 > pseudo_command: T_COMMAND '=' QSTRING ';'
892 > {
893 >  if (conf_parser_ctx.pass == 2)
894 >    strlcpy(block_state.command.buf, yylval.string, sizeof(block_state.command.buf));
895 > };
896 >
897 > pseudo_name: NAME '=' QSTRING ';'
898 > {
899 >  if (conf_parser_ctx.pass == 2)
900 >    strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
901 > };
902 >
903 > pseudo_prepend: T_PREPEND '=' QSTRING ';'
904 > {
905 >  if (conf_parser_ctx.pass == 2)
906 >    strlcpy(block_state.prepend.buf, yylval.string, sizeof(block_state.prepend.buf));
907 > };
908 >
909 > pseudo_target: T_TARGET '=' QSTRING ';'
910 > {
911 >  if (conf_parser_ctx.pass == 2)
912 >  {
913 >    struct split_nuh_item nuh;
914 >
915 >    nuh.nuhmask  = yylval.string;
916 >    nuh.nickptr  = NULL;
917 >    nuh.userptr  = block_state.nick.buf;
918 >    nuh.hostptr  = block_state.host.buf;
919 >    nuh.nicksize = 0;
920 >    nuh.usersize = sizeof(block_state.nick.buf);
921 >    nuh.hostsize = sizeof(block_state.host.buf);
922 >
923 >    split_nuh(&nuh);
924 >  }
925 > };
926 >
927 >
928 > /***************************************************************************
929 > * log {} section
930   ***************************************************************************/
931   logging_entry:          T_LOG  '{' logging_items '}' ';' ;
932   logging_items:          logging_items logging_item | logging_item ;
# Line 922 | Line 937 | logging_item:           logging_use_logg
937   logging_use_logging: USE_LOGGING '=' TBOOL ';'
938   {
939    if (conf_parser_ctx.pass == 2)
940 <    ConfigLoggingEntry.use_logging = yylval.number;
940 >    ConfigLog.use_logging = yylval.number;
941   };
942  
943   logging_file_entry:
# Line 976 | Line 991 | logging_file_type_item:  USER
991   {
992    if (conf_parser_ctx.pass == 2)
993      block_state.type.value = LOG_TYPE_OPER;
979 } | GLINE
980 {
981  if (conf_parser_ctx.pass == 2)
982    block_state.type.value = LOG_TYPE_GLINE;
994   } | XLINE
995   {
996    if (conf_parser_ctx.pass == 2)
# Line 1008 | Line 1019 | logging_file_type_item:  USER
1019  
1020  
1021   /***************************************************************************
1022 < * section oper
1022 > * operator {} section
1023   ***************************************************************************/
1024   oper_entry: OPERATOR
1025   {
# Line 1019 | Line 1030 | oper_entry: OPERATOR
1030    block_state.flags.value |= CONF_FLAGS_ENCRYPTED;
1031   } '{' oper_items '}' ';'
1032   {
1033 <  dlink_node *ptr = NULL;
1033 >  dlink_node *node = NULL;
1034  
1035    if (conf_parser_ctx.pass != 2)
1036      break;
1037  
1038    if (!block_state.name.buf[0])
1039      break;
1040 < #ifdef HAVE_LIBCRYPTO
1030 <  if (!block_state.file.buf[0] &&
1031 <      !block_state.rpass.buf[0])
1032 <    break;
1033 < #else
1040 >
1041    if (!block_state.rpass.buf[0])
1042      break;
1036 #endif
1043  
1044 <  DLINK_FOREACH(ptr, block_state.mask.list.head)
1044 >  DLINK_FOREACH(node, block_state.mask.list.head)
1045    {
1046      struct MaskItem *conf = NULL;
1047      struct split_nuh_item nuh;
1048 +    char *s = node->data;
1049 +
1050 +    if (EmptyString(s))
1051 +      continue;
1052  
1053 <    nuh.nuhmask  = ptr->data;
1053 >    nuh.nuhmask  = s;
1054      nuh.nickptr  = NULL;
1055      nuh.userptr  = block_state.user.buf;
1056      nuh.hostptr  = block_state.host.buf;
# Line 1060 | Line 1070 | oper_entry: OPERATOR
1070      if (block_state.rpass.buf[0])
1071        conf->passwd = xstrdup(block_state.rpass.buf);
1072  
1073 +    if (block_state.whois.buf[0])
1074 +      conf->whois = xstrdup(block_state.whois.buf);
1075 +
1076      conf->flags = block_state.flags.value;
1077      conf->modes = block_state.modes.value;
1078      conf->port  = block_state.port.value;
1079      conf->htype = parse_netmask(conf->host, &conf->addr, &conf->bits);
1080  
1081      conf_add_class_to_conf(conf, block_state.class.buf);
1069
1070 #ifdef HAVE_LIBCRYPTO
1071    if (block_state.file.buf[0])
1072    {
1073      BIO *file = NULL;
1074      RSA *pkey = NULL;
1075
1076      if ((file = BIO_new_file(block_state.file.buf, "r")) == NULL)
1077      {
1078        conf_error_report("Ignoring rsa_public_key_file -- file doesn't exist");
1079        break;
1080      }
1081
1082      if ((pkey = PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL)) == NULL)
1083        conf_error_report("Ignoring rsa_public_key_file -- Key invalid; check key syntax.");
1084
1085      conf->rsa_public_key = pkey;
1086      BIO_set_close(file, BIO_CLOSE);
1087      BIO_free(file);
1088    }
1089 #endif /* HAVE_LIBCRYPTO */
1082    }
1083   };
1084  
# Line 1094 | Line 1086 | oper_items:     oper_items oper_item | o
1086   oper_item:      oper_name |
1087                  oper_user |
1088                  oper_password |
1089 +                oper_whois |
1090                  oper_umodes |
1091                  oper_class |
1092                  oper_encrypted |
1100                oper_rsa_public_key_file |
1093                  oper_ssl_certificate_fingerprint |
1094                  oper_ssl_connection_required |
1095                  oper_flags |
# Line 1121 | Line 1113 | oper_password: PASSWORD '=' QSTRING ';'
1113      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
1114   };
1115  
1116 + oper_whois: WHOIS '=' QSTRING ';'
1117 + {
1118 +  if (conf_parser_ctx.pass == 2)
1119 +    strlcpy(block_state.whois.buf, yylval.string, sizeof(block_state.whois.buf));
1120 + };
1121 +
1122   oper_encrypted: ENCRYPTED '=' TBOOL ';'
1123   {
1124    if (conf_parser_ctx.pass != 2)
# Line 1132 | Line 1130 | oper_encrypted: ENCRYPTED '=' TBOOL ';'
1130      block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED;
1131   };
1132  
1135 oper_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
1136 {
1137  if (conf_parser_ctx.pass == 2)
1138    strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf));
1139 };
1140
1133   oper_ssl_certificate_fingerprint: SSL_CERTIFICATE_FINGERPRINT '=' QSTRING ';'
1134   {
1135    if (conf_parser_ctx.pass == 2)
# Line 1292 | Line 1284 | oper_flags_item: KILL ':' REMOTE
1284   } | KLINE
1285   {
1286    if (conf_parser_ctx.pass == 2)
1287 <    block_state.port.value |= OPER_FLAG_K;
1287 >    block_state.port.value |= OPER_FLAG_KLINE;
1288   } | UNKLINE
1289   {
1290    if (conf_parser_ctx.pass == 2)
# Line 1313 | Line 1305 | oper_flags_item: KILL ':' REMOTE
1305   {
1306    if (conf_parser_ctx.pass == 2)
1307      block_state.port.value |= OPER_FLAG_UNXLINE;
1316 } | GLINE
1317 {
1318  if (conf_parser_ctx.pass == 2)
1319    block_state.port.value |= OPER_FLAG_GLINE;
1308   } | DIE
1309   {
1310    if (conf_parser_ctx.pass == 2)
# Line 1325 | Line 1313 | oper_flags_item: KILL ':' REMOTE
1313   {
1314    if (conf_parser_ctx.pass == 2)
1315      block_state.port.value |= OPER_FLAG_RESTART;
1316 + } | REHASH ':' REMOTE
1317 + {
1318 +  if (conf_parser_ctx.pass == 2)
1319 +    block_state.port.value |= OPER_FLAG_REHASH_REMOTE;
1320   } | REHASH
1321   {
1322    if (conf_parser_ctx.pass == 2)
# Line 1357 | Line 1349 | oper_flags_item: KILL ':' REMOTE
1349   {
1350    if (conf_parser_ctx.pass == 2)
1351      block_state.port.value |= OPER_FLAG_MODULE;
1352 + } | T_OPME
1353 + {
1354 +  if (conf_parser_ctx.pass == 2)
1355 +    block_state.port.value |= OPER_FLAG_OPME;
1356 + } | NICK ':' RESV
1357 + {
1358 +  if (conf_parser_ctx.pass == 2)
1359 +    block_state.port.value |= OPER_FLAG_NICK_RESV;
1360 + } | JOIN ':' RESV
1361 + {
1362 +  if (conf_parser_ctx.pass == 2)
1363 +    block_state.port.value |= OPER_FLAG_JOIN_RESV;
1364 + } | RESV
1365 + {
1366 +  if (conf_parser_ctx.pass == 2)
1367 +    block_state.port.value |= OPER_FLAG_RESV;
1368 + } | T_UNRESV
1369 + {
1370 +  if (conf_parser_ctx.pass == 2)
1371 +    block_state.port.value |= OPER_FLAG_UNRESV;
1372 + } | CLOSE
1373 + {
1374 +  if (conf_parser_ctx.pass == 2)
1375 +    block_state.port.value |= OPER_FLAG_CLOSE;
1376   };
1377  
1378  
1379   /***************************************************************************
1380 < *  section class
1380 > * class {} section
1381   ***************************************************************************/
1382   class_entry: CLASS
1383   {
# Line 1389 | Line 1405 | class_entry: CLASS
1405      class = class_make();
1406  
1407    class->active = 1;
1408 <  MyFree(class->name);
1408 >  xfree(class->name);
1409    class->name = xstrdup(block_state.class.buf);
1410    class->ping_freq = block_state.ping_freq.value;
1411    class->max_perip = block_state.max_perip.value;
# Line 1397 | 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;
1400  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 1413 | Line 1428 | class_entry: CLASS
1428    class->min_idle = block_state.min_idle.value;
1429    class->max_idle = block_state.max_idle.value;
1430  
1431 <  if (class->number_per_cidr && block_state.number_per_cidr.value)
1417 <    if ((class->cidr_bitlen_ipv4 && block_state.cidr_bitlen_ipv4.value) ||
1418 <        (class->cidr_bitlen_ipv6 && block_state.cidr_bitlen_ipv6.value))
1419 <      if ((class->cidr_bitlen_ipv4 != block_state.cidr_bitlen_ipv4.value) ||
1420 <          (class->cidr_bitlen_ipv6 != block_state.cidr_bitlen_ipv6.value))
1421 <        rebuild_cidr_list(class);
1431 >  rebuild_cidr_list(class);
1432  
1433    class->cidr_bitlen_ipv4 = block_state.cidr_bitlen_ipv4.value;
1434    class->cidr_bitlen_ipv6 = block_state.cidr_bitlen_ipv6.value;
# Line 1437 | 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 1492 | Line 1502 | class_max_local: MAX_LOCAL '=' NUMBER ';
1502      block_state.max_local.value = $3;
1503   };
1504  
1495 class_max_ident: MAX_IDENT '=' NUMBER ';'
1496 {
1497  if (conf_parser_ctx.pass == 1)
1498    block_state.max_ident.value = $3;
1499 };
1500
1505   class_sendq: SENDQ '=' sizespec ';'
1506   {
1507    if (conf_parser_ctx.pass == 1)
# Line 1566 | Line 1570 | class_flags_item: RANDOM_IDLE
1570  
1571  
1572   /***************************************************************************
1573 < *  section listen
1573 > * listen {} section
1574   ***************************************************************************/
1575   listen_entry: LISTEN
1576   {
# Line 1605 | Line 1609 | port_item: NUMBER
1609   {
1610    if (conf_parser_ctx.pass == 2)
1611    {
1612 + #ifndef HAVE_TLS
1613      if (block_state.flags.value & LISTENER_SSL)
1614 < #ifdef HAVE_LIBCRYPTO
1615 <      if (!ServerInfo.server_ctx)
1614 >    {
1615 >      conf_error_report("TLS not available - port closed");
1616 >      break;
1617 >    }
1618   #endif
1619 <      {
1613 <        conf_error_report("SSL not available - port closed");
1614 <        break;
1615 <      }
1616 <    add_listener($1, block_state.addr.buf, block_state.flags.value);
1619 >    listener_add($1, block_state.addr.buf, block_state.flags.value);
1620    }
1621   } | NUMBER TWODOTS NUMBER
1622   {
1623    if (conf_parser_ctx.pass == 2)
1624    {
1625 + #ifndef HAVE_TLS
1626      if (block_state.flags.value & LISTENER_SSL)
1627 < #ifdef HAVE_LIBCRYPTO
1628 <      if (!ServerInfo.server_ctx)
1627 >    {
1628 >      conf_error_report("TLS not available - port closed");
1629 >      break;
1630 >    }
1631   #endif
1626      {
1627        conf_error_report("SSL not available - port closed");
1628        break;
1629      }
1632  
1633      for (int i = $1; i <= $3; ++i)
1634 <      add_listener(i, block_state.addr.buf, block_state.flags.value);
1634 >      listener_add(i, block_state.addr.buf, block_state.flags.value);
1635    }
1636   };
1637  
# Line 1645 | Line 1647 | listen_host: HOST '=' QSTRING ';'
1647      strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf));
1648   };
1649  
1650 +
1651   /***************************************************************************
1652 < *  section auth
1652 > * auth {} section
1653   ***************************************************************************/
1654   auth_entry: IRCD_AUTH
1655   {
# Line 1654 | Line 1657 | auth_entry: IRCD_AUTH
1657      reset_block_state();
1658   } '{' auth_items '}' ';'
1659   {
1660 <  dlink_node *ptr = NULL;
1660 >  dlink_node *node = NULL;
1661  
1662    if (conf_parser_ctx.pass != 2)
1663      break;
1664  
1665 <  DLINK_FOREACH(ptr, block_state.mask.list.head)
1665 >  DLINK_FOREACH(node, block_state.mask.list.head)
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  = ptr->data;
1674 >    nuh.nuhmask  = s;
1675      nuh.nickptr  = NULL;
1676      nuh.userptr  = block_state.user.buf;
1677      nuh.hostptr  = block_state.host.buf;
# Line 1749 | Line 1756 | auth_flags_item: SPOOF_NOTICE
1756   {
1757    if (conf_parser_ctx.pass == 2)
1758      block_state.flags.value |= CONF_FLAGS_EXEMPTKLINE;
1759 + } | XLINE_EXEMPT
1760 + {
1761 +  if (conf_parser_ctx.pass == 2)
1762 +    block_state.flags.value |= CONF_FLAGS_EXEMPTXLINE;
1763   } | NEED_IDENT
1764   {
1765    if (conf_parser_ctx.pass == 2)
# Line 1761 | Line 1772 | auth_flags_item: SPOOF_NOTICE
1772   {
1773    if (conf_parser_ctx.pass == 2)
1774      block_state.flags.value |= CONF_FLAGS_NO_TILDE;
1764 } | GLINE_EXEMPT
1765 {
1766  if (conf_parser_ctx.pass == 2)
1767    block_state.flags.value |= CONF_FLAGS_EXEMPTGLINE;
1775   } | RESV_EXEMPT
1776   {
1777    if (conf_parser_ctx.pass == 2)
# Line 1813 | Line 1820 | auth_redir_port: REDIRPORT '=' NUMBER ';
1820  
1821  
1822   /***************************************************************************
1823 < *  section resv
1823 > * resv {} section
1824   ***************************************************************************/
1825   resv_entry: RESV
1826   {
# Line 1827 | 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 1853 | Line 1860 | resv_exempt: EXEMPT '=' QSTRING ';'
1860  
1861  
1862   /***************************************************************************
1863 < *  section service
1863 > * service {} section
1864   ***************************************************************************/
1865   service_entry: T_SERVICE '{' service_items '}' ';';
1866  
# Line 1867 | Line 1874 | service_name: NAME '=' QSTRING ';'
1874  
1875    if (valid_servname(yylval.string))
1876    {
1877 <    struct MaskItem *conf = conf_make(CONF_SERVICE);
1878 <    conf->name = xstrdup(yylval.string);
1877 >    struct ServiceItem *service = service_make();
1878 >    service->name = xstrdup(yylval.string);
1879    }
1880   };
1881  
1882 +
1883   /***************************************************************************
1884 < *  section shared, for sharing remote klines etc.
1884 > * shared {} section, for sharing remote klines etc.
1885   ***************************************************************************/
1886   shared_entry: T_SHARED
1887   {
# Line 1888 | Line 1896 | shared_entry: T_SHARED
1896    block_state.flags.value = SHARED_ALL;
1897   } '{' shared_items '}' ';'
1898   {
1891  struct MaskItem *conf = NULL;
1892
1899    if (conf_parser_ctx.pass != 2)
1900      break;
1901  
1902 <  conf = conf_make(CONF_ULINE);
1903 <  conf->flags = block_state.flags.value;
1904 <  conf->name = xstrdup(block_state.name.buf);
1905 <  conf->user = xstrdup(block_state.user.buf);
1906 <  conf->host = xstrdup(block_state.host.buf);
1902 >  struct SharedItem *shared = shared_make();
1903 >  shared->type = block_state.flags.value;
1904 >  shared->server = xstrdup(block_state.name.buf);
1905 >  shared->user = xstrdup(block_state.user.buf);
1906 >  shared->host = xstrdup(block_state.host.buf);
1907   };
1908  
1909   shared_items: shared_items shared_item | shared_item;
# Line 1977 | Line 1983 | shared_type_item: KLINE
1983      block_state.flags.value = SHARED_ALL;
1984   };
1985  
1986 +
1987   /***************************************************************************
1988 < *  section cluster
1988 > * cluster {} section
1989   ***************************************************************************/
1990   cluster_entry: T_CLUSTER
1991   {
# Line 1988 | Line 1995 | cluster_entry: T_CLUSTER
1995    reset_block_state();
1996  
1997    strlcpy(block_state.name.buf, "*", sizeof(block_state.name.buf));
1998 <  block_state.flags.value = SHARED_ALL;
1998 >  block_state.flags.value = CLUSTER_ALL;
1999   } '{' cluster_items '}' ';'
2000   {
1994  struct MaskItem *conf = NULL;
1995
2001    if (conf_parser_ctx.pass != 2)
2002      break;
2003  
2004 <  conf = conf_make(CONF_CLUSTER);
2005 <  conf->flags = block_state.flags.value;
2006 <  conf->name = xstrdup(block_state.name.buf);
2004 >  struct ClusterItem *cluster = cluster_make();
2005 >  cluster->type = block_state.flags.value;
2006 >  cluster->server = xstrdup(block_state.name.buf);
2007   };
2008  
2009   cluster_items:  cluster_items cluster_item | cluster_item;
# Line 2020 | Line 2025 | cluster_types:  cluster_types ',' cluste
2025   cluster_type_item: KLINE
2026   {
2027    if (conf_parser_ctx.pass == 2)
2028 <    block_state.flags.value |= SHARED_KLINE;
2028 >    block_state.flags.value |= CLUSTER_KLINE;
2029   } | UNKLINE
2030   {
2031    if (conf_parser_ctx.pass == 2)
2032 <    block_state.flags.value |= SHARED_UNKLINE;
2032 >    block_state.flags.value |= CLUSTER_UNKLINE;
2033   } | T_DLINE
2034   {
2035    if (conf_parser_ctx.pass == 2)
2036 <    block_state.flags.value |= SHARED_DLINE;
2036 >    block_state.flags.value |= CLUSTER_DLINE;
2037   } | T_UNDLINE
2038   {
2039    if (conf_parser_ctx.pass == 2)
2040 <    block_state.flags.value |= SHARED_UNDLINE;
2040 >    block_state.flags.value |= CLUSTER_UNDLINE;
2041   } | XLINE
2042   {
2043    if (conf_parser_ctx.pass == 2)
2044 <    block_state.flags.value |= SHARED_XLINE;
2044 >    block_state.flags.value |= CLUSTER_XLINE;
2045   } | T_UNXLINE
2046   {
2047    if (conf_parser_ctx.pass == 2)
2048 <    block_state.flags.value |= SHARED_UNXLINE;
2048 >    block_state.flags.value |= CLUSTER_UNXLINE;
2049   } | RESV
2050   {
2051    if (conf_parser_ctx.pass == 2)
2052 <    block_state.flags.value |= SHARED_RESV;
2052 >    block_state.flags.value |= CLUSTER_RESV;
2053   } | T_UNRESV
2054   {
2055    if (conf_parser_ctx.pass == 2)
2056 <    block_state.flags.value |= SHARED_UNRESV;
2056 >    block_state.flags.value |= CLUSTER_UNRESV;
2057   } | T_LOCOPS
2058   {
2059    if (conf_parser_ctx.pass == 2)
2060 <    block_state.flags.value |= SHARED_LOCOPS;
2060 >    block_state.flags.value |= CLUSTER_LOCOPS;
2061   } | T_ALL
2062   {
2063    if (conf_parser_ctx.pass == 2)
2064 <    block_state.flags.value = SHARED_ALL;
2064 >    block_state.flags.value = CLUSTER_ALL;
2065   };
2066  
2067 +
2068   /***************************************************************************
2069 < *  section connect
2069 > * connect {}  section
2070   ***************************************************************************/
2071   connect_entry: CONNECT
2072   {
# Line 2213 | Line 2219 | connect_aftype: AFTYPE '=' T_IPV4 ';'
2219      block_state.aftype.value = AF_INET;
2220   } | AFTYPE '=' T_IPV6 ';'
2221   {
2216 #ifdef IPV6
2222    if (conf_parser_ctx.pass == 2)
2223      block_state.aftype.value = AF_INET6;
2219 #endif
2224   };
2225  
2226   connect_flags: IRCD_FLAGS
# Line 2266 | Line 2270 | connect_class: CLASS '=' QSTRING ';'
2270  
2271   connect_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
2272   {
2273 < #ifdef HAVE_LIBCRYPTO
2273 > #ifdef HAVE_TLS
2274    if (conf_parser_ctx.pass == 2)
2275      strlcpy(block_state.ciph.buf, yylval.string, sizeof(block_state.ciph.buf));
2276   #else
2277    if (conf_parser_ctx.pass == 2)
2278 <    conf_error_report("Ignoring connect::ciphers -- no OpenSSL support");
2278 >    conf_error_report("Ignoring connect::ciphers -- no TLS support");
2279   #endif
2280   };
2281  
2282  
2283   /***************************************************************************
2284 < *  section kill
2284 > * kill {} section
2285   ***************************************************************************/
2286   kill_entry: KILL
2287   {
# Line 2334 | Line 2338 | kill_reason: REASON '=' QSTRING ';'
2338      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2339   };
2340  
2341 +
2342   /***************************************************************************
2343 < *  section deny
2343 > * deny {} section
2344   ***************************************************************************/
2345   deny_entry: DENY
2346   {
# Line 2379 | Line 2384 | deny_reason: REASON '=' QSTRING ';'
2384      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2385   };
2386  
2387 +
2388   /***************************************************************************
2389 < *  section exempt
2389 > * exempt {} section
2390   ***************************************************************************/
2391   exempt_entry: EXEMPT '{' exempt_items '}' ';';
2392  
2393 < exempt_items:     exempt_items exempt_item | exempt_item;
2394 < exempt_item:      exempt_ip | error;
2393 > exempt_items: exempt_items exempt_item | exempt_item;
2394 > exempt_item:  exempt_ip | error;
2395  
2396   exempt_ip: IP '=' QSTRING ';'
2397   {
2398    if (conf_parser_ctx.pass == 2)
2399    {
2400 <    if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
2400 >    if (*yylval.string && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
2401      {
2402        struct MaskItem *conf = conf_make(CONF_EXEMPT);
2403        conf->host = xstrdup(yylval.string);
# Line 2402 | Line 2408 | exempt_ip: IP '=' QSTRING ';'
2408   };
2409  
2410   /***************************************************************************
2411 < *  section gecos
2411 > * gecos {} section
2412   ***************************************************************************/
2413   gecos_entry: GECOS
2414   {
# Line 2410 | Line 2416 | gecos_entry: GECOS
2416      reset_block_state();
2417   } '{' gecos_items '}' ';'
2418   {
2413  struct MaskItem *conf = NULL;
2414
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 2442 | Line 2446 | gecos_reason: REASON '=' QSTRING ';'
2446      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2447   };
2448  
2449 +
2450   /***************************************************************************
2451 < *  section general
2451 > * general {} section
2452   ***************************************************************************/
2453 < general_entry: GENERAL
2449 <  '{' general_items '}' ';';
2453 > general_entry: GENERAL '{' general_items '}' ';';
2454  
2455   general_items:      general_items general_item | general_item;
2456 < general_item:       general_hide_spoof_ips |
2456 > general_item:       general_away_count |
2457 >                    general_away_time |
2458                      general_ignore_bogus_ts |
2459                      general_failed_oper_notice |
2460                      general_anti_nick_flood |
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 2463 | Line 2469 | general_item:       general_hide_spoof_i
2469                      general_invisible_on_connect |
2470                      general_warn_no_connect_block |
2471                      general_dots_in_ident |
2466                    general_stats_o_oper_only |
2467                    general_stats_k_oper_only |
2468                    general_pace_wait |
2472                      general_stats_i_oper_only |
2473 <                    general_pace_wait_simple |
2473 >                    general_stats_k_oper_only |
2474 >                    general_stats_m_oper_only |
2475 >                    general_stats_o_oper_only |
2476                      general_stats_P_oper_only |
2477                      general_stats_u_oper_only |
2478 +                    general_pace_wait |
2479 +                    general_pace_wait_simple |
2480                      general_short_motd |
2481                      general_no_oper_flood |
2475                    general_true_no_oper_flood |
2476                    general_oper_pass_resv |
2482                      general_oper_only_umodes |
2483                      general_max_targets |
2479                    general_use_egd |
2480                    general_egdpool_path |
2484                      general_oper_umodes |
2485                      general_caller_id_wait |
2486                      general_opers_bypass_callerid |
# Line 2486 | Line 2489 | general_item:       general_hide_spoof_i
2489                      general_min_nonwildcard_simple |
2490                      general_throttle_count |
2491                      general_throttle_time |
2489                    general_havent_read_conf |
2492                      general_ping_cookie |
2493                      general_disable_auth |
2494                      general_tkline_expire_notices |
2495 <                    general_gline_enable |
2496 <                    general_gline_duration |
2497 <                    general_gline_request_duration |
2498 <                    general_gline_min_cidr |
2497 <                    general_gline_min_cidr6 |
2495 >                    general_dline_min_cidr |
2496 >                    general_dline_min_cidr6 |
2497 >                    general_kline_min_cidr |
2498 >                    general_kline_min_cidr6 |
2499                      general_stats_e_disabled |
2500                      general_max_watch |
2500                    general_services_name |
2501                      general_cycle_on_host_change |
2502                      error;
2503  
2504  
2505 < general_max_watch: MAX_WATCH '=' NUMBER ';'
2505 > general_away_count: AWAY_COUNT '=' NUMBER ';'
2506   {
2507 <  ConfigFileEntry.max_watch = $3;
2507 >  ConfigGeneral.away_count = $3;
2508   };
2509  
2510 < general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';'
2510 > general_away_time: AWAY_TIME '=' timespec ';'
2511   {
2512 <  if (conf_parser_ctx.pass == 2)
2513 <    ConfigFileEntry.cycle_on_host_change = yylval.number;
2512 >  ConfigGeneral.away_time = $3;
2513   };
2514  
2515 < general_gline_enable: GLINE_ENABLE '=' TBOOL ';'
2515 > general_max_watch: MAX_WATCH '=' NUMBER ';'
2516   {
2517 <  if (conf_parser_ctx.pass == 2)
2519 <    ConfigFileEntry.glines = yylval.number;
2517 >  ConfigGeneral.max_watch = $3;
2518   };
2519  
2520 < general_gline_duration: GLINE_DURATION '=' timespec ';'
2520 > general_whowas_history_length: WHOWAS_HISTORY_LENGTH '=' NUMBER ';'
2521   {
2522 <  if (conf_parser_ctx.pass == 2)
2525 <    ConfigFileEntry.gline_time = $3;
2522 >  ConfigGeneral.whowas_history_length = $3;
2523   };
2524  
2525 < general_gline_request_duration: GLINE_REQUEST_DURATION '=' timespec ';'
2525 > general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';'
2526   {
2527    if (conf_parser_ctx.pass == 2)
2528 <    ConfigFileEntry.gline_request_time = $3;
2528 >    ConfigGeneral.cycle_on_host_change = yylval.number;
2529   };
2530  
2531 < general_gline_min_cidr: GLINE_MIN_CIDR '=' NUMBER ';'
2531 > general_dline_min_cidr: DLINE_MIN_CIDR '=' NUMBER ';'
2532   {
2533 <  ConfigFileEntry.gline_min_cidr = $3;
2533 >  ConfigGeneral.dline_min_cidr = $3;
2534   };
2535  
2536 < general_gline_min_cidr6: GLINE_MIN_CIDR6 '=' NUMBER ';'
2536 > general_dline_min_cidr6: DLINE_MIN_CIDR6 '=' NUMBER ';'
2537   {
2538 <  ConfigFileEntry.gline_min_cidr6 = $3;
2538 >  ConfigGeneral.dline_min_cidr6 = $3;
2539   };
2540  
2541 < general_tkline_expire_notices: TKLINE_EXPIRE_NOTICES '=' TBOOL ';'
2541 > general_kline_min_cidr: KLINE_MIN_CIDR '=' NUMBER ';'
2542   {
2543 <  ConfigFileEntry.tkline_expire_notices = yylval.number;
2543 >  ConfigGeneral.kline_min_cidr = $3;
2544   };
2545  
2546 < general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';'
2546 > general_kline_min_cidr6: KLINE_MIN_CIDR6 '=' NUMBER ';'
2547 > {
2548 >  ConfigGeneral.kline_min_cidr6 = $3;
2549 > };
2550 >
2551 > general_tkline_expire_notices: TKLINE_EXPIRE_NOTICES '=' TBOOL ';'
2552   {
2553 <  ConfigFileEntry.kill_chase_time_limit = $3;
2553 >  ConfigGeneral.tkline_expire_notices = yylval.number;
2554   };
2555  
2556 < general_hide_spoof_ips: HIDE_SPOOF_IPS '=' TBOOL ';'
2556 > general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';'
2557   {
2558 <  ConfigFileEntry.hide_spoof_ips = yylval.number;
2558 >  ConfigGeneral.kill_chase_time_limit = $3;
2559   };
2560  
2561   general_ignore_bogus_ts: IGNORE_BOGUS_TS '=' TBOOL ';'
2562   {
2563 <  ConfigFileEntry.ignore_bogus_ts = yylval.number;
2563 >  ConfigGeneral.ignore_bogus_ts = yylval.number;
2564   };
2565  
2566   general_failed_oper_notice: FAILED_OPER_NOTICE '=' TBOOL ';'
2567   {
2568 <  ConfigFileEntry.failed_oper_notice = yylval.number;
2568 >  ConfigGeneral.failed_oper_notice = yylval.number;
2569   };
2570  
2571   general_anti_nick_flood: ANTI_NICK_FLOOD '=' TBOOL ';'
2572   {
2573 <  ConfigFileEntry.anti_nick_flood = yylval.number;
2573 >  ConfigGeneral.anti_nick_flood = yylval.number;
2574   };
2575  
2576   general_max_nick_time: MAX_NICK_TIME '=' timespec ';'
2577   {
2578 <  ConfigFileEntry.max_nick_time = $3;
2578 >  ConfigGeneral.max_nick_time = $3;
2579   };
2580  
2581   general_max_nick_changes: MAX_NICK_CHANGES '=' NUMBER ';'
2582   {
2583 <  ConfigFileEntry.max_nick_changes = $3;
2583 >  ConfigGeneral.max_nick_changes = $3;
2584   };
2585  
2586   general_max_accept: MAX_ACCEPT '=' NUMBER ';'
2587   {
2588 <  ConfigFileEntry.max_accept = $3;
2588 >  ConfigGeneral.max_accept = $3;
2589   };
2590  
2591   general_anti_spam_exit_message_time: ANTI_SPAM_EXIT_MESSAGE_TIME '=' timespec ';'
2592   {
2593 <  ConfigFileEntry.anti_spam_exit_message_time = $3;
2593 >  ConfigGeneral.anti_spam_exit_message_time = $3;
2594   };
2595  
2596   general_ts_warn_delta: TS_WARN_DELTA '=' timespec ';'
2597   {
2598 <  ConfigFileEntry.ts_warn_delta = $3;
2598 >  ConfigGeneral.ts_warn_delta = $3;
2599   };
2600  
2601   general_ts_max_delta: TS_MAX_DELTA '=' timespec ';'
2602   {
2603    if (conf_parser_ctx.pass == 2)
2604 <    ConfigFileEntry.ts_max_delta = $3;
2603 < };
2604 <
2605 < general_havent_read_conf: HAVENT_READ_CONF '=' NUMBER ';'
2606 < {
2607 <  if (($3 > 0) && conf_parser_ctx.pass == 1)
2608 <  {
2609 <    ilog(LOG_TYPE_IRCD, "You haven't read your config file properly.");
2610 <    ilog(LOG_TYPE_IRCD, "There is a line in the example conf that will kill your server if not removed.");
2611 <    ilog(LOG_TYPE_IRCD, "Consider actually reading/editing the conf file, and removing this line.");
2612 <    exit(0);
2613 <  }
2604 >    ConfigGeneral.ts_max_delta = $3;
2605   };
2606  
2607   general_invisible_on_connect: INVISIBLE_ON_CONNECT '=' TBOOL ';'
2608   {
2609 <  ConfigFileEntry.invisible_on_connect = yylval.number;
2609 >  ConfigGeneral.invisible_on_connect = yylval.number;
2610   };
2611  
2612   general_warn_no_connect_block: WARN_NO_CONNECT_BLOCK '=' TBOOL ';'
2613   {
2614 <  ConfigFileEntry.warn_no_connect_block = yylval.number;
2614 >  ConfigGeneral.warn_no_connect_block = yylval.number;
2615   };
2616  
2617   general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';'
2618   {
2619 <  ConfigFileEntry.stats_e_disabled = yylval.number;
2619 >  ConfigGeneral.stats_e_disabled = yylval.number;
2620 > };
2621 >
2622 > general_stats_m_oper_only: STATS_M_OPER_ONLY '=' TBOOL ';'
2623 > {
2624 >  ConfigGeneral.stats_m_oper_only = yylval.number;
2625   };
2626  
2627   general_stats_o_oper_only: STATS_O_OPER_ONLY '=' TBOOL ';'
2628   {
2629 <  ConfigFileEntry.stats_o_oper_only = yylval.number;
2629 >  ConfigGeneral.stats_o_oper_only = yylval.number;
2630   };
2631  
2632   general_stats_P_oper_only: STATS_P_OPER_ONLY '=' TBOOL ';'
2633   {
2634 <  ConfigFileEntry.stats_P_oper_only = yylval.number;
2634 >  ConfigGeneral.stats_P_oper_only = yylval.number;
2635   };
2636  
2637   general_stats_u_oper_only: STATS_U_OPER_ONLY '=' TBOOL ';'
2638   {
2639 <  ConfigFileEntry.stats_u_oper_only = yylval.number;
2639 >  ConfigGeneral.stats_u_oper_only = yylval.number;
2640   };
2641  
2642   general_stats_k_oper_only: STATS_K_OPER_ONLY '=' TBOOL ';'
2643   {
2644 <  ConfigFileEntry.stats_k_oper_only = 2 * yylval.number;
2644 >  ConfigGeneral.stats_k_oper_only = 2 * yylval.number;
2645   } | STATS_K_OPER_ONLY '=' TMASKED ';'
2646   {
2647 <  ConfigFileEntry.stats_k_oper_only = 1;
2647 >  ConfigGeneral.stats_k_oper_only = 1;
2648   };
2649  
2650   general_stats_i_oper_only: STATS_I_OPER_ONLY '=' TBOOL ';'
2651   {
2652 <  ConfigFileEntry.stats_i_oper_only = 2 * yylval.number;
2652 >  ConfigGeneral.stats_i_oper_only = 2 * yylval.number;
2653   } | STATS_I_OPER_ONLY '=' TMASKED ';'
2654   {
2655 <  ConfigFileEntry.stats_i_oper_only = 1;
2655 >  ConfigGeneral.stats_i_oper_only = 1;
2656   };
2657  
2658   general_pace_wait: PACE_WAIT '=' timespec ';'
2659   {
2660 <  ConfigFileEntry.pace_wait = $3;
2660 >  ConfigGeneral.pace_wait = $3;
2661   };
2662  
2663   general_caller_id_wait: CALLER_ID_WAIT '=' timespec ';'
2664   {
2665 <  ConfigFileEntry.caller_id_wait = $3;
2665 >  ConfigGeneral.caller_id_wait = $3;
2666   };
2667  
2668   general_opers_bypass_callerid: OPERS_BYPASS_CALLERID '=' TBOOL ';'
2669   {
2670 <  ConfigFileEntry.opers_bypass_callerid = yylval.number;
2670 >  ConfigGeneral.opers_bypass_callerid = yylval.number;
2671   };
2672  
2673   general_pace_wait_simple: PACE_WAIT_SIMPLE '=' timespec ';'
2674   {
2675 <  ConfigFileEntry.pace_wait_simple = $3;
2675 >  ConfigGeneral.pace_wait_simple = $3;
2676   };
2677  
2678   general_short_motd: SHORT_MOTD '=' TBOOL ';'
2679   {
2680 <  ConfigFileEntry.short_motd = yylval.number;
2680 >  ConfigGeneral.short_motd = yylval.number;
2681   };
2682  
2683   general_no_oper_flood: NO_OPER_FLOOD '=' TBOOL ';'
2684   {
2685 <  ConfigFileEntry.no_oper_flood = yylval.number;
2690 < };
2691 <
2692 < general_true_no_oper_flood: TRUE_NO_OPER_FLOOD '=' TBOOL ';'
2693 < {
2694 <  ConfigFileEntry.true_no_oper_flood = yylval.number;
2695 < };
2696 <
2697 < general_oper_pass_resv: OPER_PASS_RESV '=' TBOOL ';'
2698 < {
2699 <  ConfigFileEntry.oper_pass_resv = yylval.number;
2685 >  ConfigGeneral.no_oper_flood = yylval.number;
2686   };
2687  
2688   general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';'
2689   {
2690 <  ConfigFileEntry.dots_in_ident = $3;
2690 >  ConfigGeneral.dots_in_ident = $3;
2691   };
2692  
2693   general_max_targets: MAX_TARGETS '=' NUMBER ';'
2694   {
2695 <  ConfigFileEntry.max_targets = $3;
2710 < };
2711 <
2712 < general_use_egd: USE_EGD '=' TBOOL ';'
2713 < {
2714 <  ConfigFileEntry.use_egd = yylval.number;
2715 < };
2716 <
2717 < general_egdpool_path: EGDPOOL_PATH '=' QSTRING ';'
2718 < {
2719 <  if (conf_parser_ctx.pass == 2)
2720 <  {
2721 <    MyFree(ConfigFileEntry.egdpool_path);
2722 <    ConfigFileEntry.egdpool_path = xstrdup(yylval.string);
2723 <  }
2724 < };
2725 <
2726 < general_services_name: T_SERVICES_NAME '=' QSTRING ';'
2727 < {
2728 <  if (conf_parser_ctx.pass == 2 && valid_servname(yylval.string))
2729 <  {
2730 <    MyFree(ConfigFileEntry.service_name);
2731 <    ConfigFileEntry.service_name = xstrdup(yylval.string);
2732 <  }
2695 >  ConfigGeneral.max_targets = $3;
2696   };
2697  
2698   general_ping_cookie: PING_COOKIE '=' TBOOL ';'
2699   {
2700 <  ConfigFileEntry.ping_cookie = yylval.number;
2700 >  ConfigGeneral.ping_cookie = yylval.number;
2701   };
2702  
2703   general_disable_auth: DISABLE_AUTH '=' TBOOL ';'
2704   {
2705 <  ConfigFileEntry.disable_auth = yylval.number;
2705 >  ConfigGeneral.disable_auth = yylval.number;
2706   };
2707  
2708   general_throttle_count: THROTTLE_COUNT '=' NUMBER ';'
2709   {
2710 <  ConfigFileEntry.throttle_count = $3;
2710 >  ConfigGeneral.throttle_count = $3;
2711   };
2712  
2713   general_throttle_time: THROTTLE_TIME '=' timespec ';'
2714   {
2715 <  ConfigFileEntry.throttle_time = $3;
2715 >  ConfigGeneral.throttle_time = $3;
2716   };
2717  
2718   general_oper_umodes: OPER_UMODES
2719   {
2720 <  ConfigFileEntry.oper_umodes = 0;
2720 >  ConfigGeneral.oper_umodes = 0;
2721   } '='  umode_oitems ';' ;
2722  
2723   umode_oitems:    umode_oitems ',' umode_oitem | umode_oitem;
2724   umode_oitem:     T_BOTS
2725   {
2726 <  ConfigFileEntry.oper_umodes |= UMODE_BOTS;
2726 >  ConfigGeneral.oper_umodes |= UMODE_BOTS;
2727   } | T_CCONN
2728   {
2729 <  ConfigFileEntry.oper_umodes |= UMODE_CCONN;
2729 >  ConfigGeneral.oper_umodes |= UMODE_CCONN;
2730   } | T_DEAF
2731   {
2732 <  ConfigFileEntry.oper_umodes |= UMODE_DEAF;
2732 >  ConfigGeneral.oper_umodes |= UMODE_DEAF;
2733   } | T_DEBUG
2734   {
2735 <  ConfigFileEntry.oper_umodes |= UMODE_DEBUG;
2735 >  ConfigGeneral.oper_umodes |= UMODE_DEBUG;
2736   } | T_FULL
2737   {
2738 <  ConfigFileEntry.oper_umodes |= UMODE_FULL;
2738 >  ConfigGeneral.oper_umodes |= UMODE_FULL;
2739   } | HIDDEN
2740   {
2741 <  ConfigFileEntry.oper_umodes |= UMODE_HIDDEN;
2741 >  ConfigGeneral.oper_umodes |= UMODE_HIDDEN;
2742   } | HIDE_CHANS
2743   {
2744 <  ConfigFileEntry.oper_umodes |= UMODE_HIDECHANS;
2744 >  ConfigGeneral.oper_umodes |= UMODE_HIDECHANS;
2745   } | HIDE_IDLE
2746   {
2747 <  ConfigFileEntry.oper_umodes |= UMODE_HIDEIDLE;
2747 >  ConfigGeneral.oper_umodes |= UMODE_HIDEIDLE;
2748   } | T_SKILL
2749   {
2750 <  ConfigFileEntry.oper_umodes |= UMODE_SKILL;
2750 >  ConfigGeneral.oper_umodes |= UMODE_SKILL;
2751   } | T_NCHANGE
2752   {
2753 <  ConfigFileEntry.oper_umodes |= UMODE_NCHANGE;
2753 >  ConfigGeneral.oper_umodes |= UMODE_NCHANGE;
2754   } | T_REJ
2755   {
2756 <  ConfigFileEntry.oper_umodes |= UMODE_REJ;
2756 >  ConfigGeneral.oper_umodes |= UMODE_REJ;
2757   } | T_UNAUTH
2758   {
2759 <  ConfigFileEntry.oper_umodes |= UMODE_UNAUTH;
2759 >  ConfigGeneral.oper_umodes |= UMODE_UNAUTH;
2760   } | T_SPY
2761   {
2762 <  ConfigFileEntry.oper_umodes |= UMODE_SPY;
2762 >  ConfigGeneral.oper_umodes |= UMODE_SPY;
2763   } | T_EXTERNAL
2764   {
2765 <  ConfigFileEntry.oper_umodes |= UMODE_EXTERNAL;
2765 >  ConfigGeneral.oper_umodes |= UMODE_EXTERNAL;
2766   } | T_SERVNOTICE
2767   {
2768 <  ConfigFileEntry.oper_umodes |= UMODE_SERVNOTICE;
2768 >  ConfigGeneral.oper_umodes |= UMODE_SERVNOTICE;
2769   } | T_INVISIBLE
2770   {
2771 <  ConfigFileEntry.oper_umodes |= UMODE_INVISIBLE;
2771 >  ConfigGeneral.oper_umodes |= UMODE_INVISIBLE;
2772   } | T_WALLOP
2773   {
2774 <  ConfigFileEntry.oper_umodes |= UMODE_WALLOP;
2774 >  ConfigGeneral.oper_umodes |= UMODE_WALLOP;
2775   } | T_SOFTCALLERID
2776   {
2777 <  ConfigFileEntry.oper_umodes |= UMODE_SOFTCALLERID;
2777 >  ConfigGeneral.oper_umodes |= UMODE_SOFTCALLERID;
2778   } | T_CALLERID
2779   {
2780 <  ConfigFileEntry.oper_umodes |= UMODE_CALLERID;
2780 >  ConfigGeneral.oper_umodes |= UMODE_CALLERID;
2781   } | T_LOCOPS
2782   {
2783 <  ConfigFileEntry.oper_umodes |= UMODE_LOCOPS;
2783 >  ConfigGeneral.oper_umodes |= UMODE_LOCOPS;
2784   } | T_NONONREG
2785   {
2786 <  ConfigFileEntry.oper_umodes |= UMODE_REGONLY;
2786 >  ConfigGeneral.oper_umodes |= UMODE_REGONLY;
2787   } | T_FARCONNECT
2788   {
2789 <  ConfigFileEntry.oper_umodes |= UMODE_FARCONNECT;
2789 >  ConfigGeneral.oper_umodes |= UMODE_FARCONNECT;
2790   };
2791  
2792   general_oper_only_umodes: OPER_ONLY_UMODES
2793   {
2794 <  ConfigFileEntry.oper_only_umodes = 0;
2794 >  ConfigGeneral.oper_only_umodes = 0;
2795   } '='  umode_items ';' ;
2796  
2797   umode_items:  umode_items ',' umode_item | umode_item;
2798   umode_item:   T_BOTS
2799   {
2800 <  ConfigFileEntry.oper_only_umodes |= UMODE_BOTS;
2800 >  ConfigGeneral.oper_only_umodes |= UMODE_BOTS;
2801   } | T_CCONN
2802   {
2803 <  ConfigFileEntry.oper_only_umodes |= UMODE_CCONN;
2803 >  ConfigGeneral.oper_only_umodes |= UMODE_CCONN;
2804   } | T_DEAF
2805   {
2806 <  ConfigFileEntry.oper_only_umodes |= UMODE_DEAF;
2806 >  ConfigGeneral.oper_only_umodes |= UMODE_DEAF;
2807   } | T_DEBUG
2808   {
2809 <  ConfigFileEntry.oper_only_umodes |= UMODE_DEBUG;
2809 >  ConfigGeneral.oper_only_umodes |= UMODE_DEBUG;
2810   } | T_FULL
2811   {
2812 <  ConfigFileEntry.oper_only_umodes |= UMODE_FULL;
2812 >  ConfigGeneral.oper_only_umodes |= UMODE_FULL;
2813   } | T_SKILL
2814   {
2815 <  ConfigFileEntry.oper_only_umodes |= UMODE_SKILL;
2815 >  ConfigGeneral.oper_only_umodes |= UMODE_SKILL;
2816   } | HIDDEN
2817   {
2818 <  ConfigFileEntry.oper_only_umodes |= UMODE_HIDDEN;
2818 >  ConfigGeneral.oper_only_umodes |= UMODE_HIDDEN;
2819   } | T_NCHANGE
2820   {
2821 <  ConfigFileEntry.oper_only_umodes |= UMODE_NCHANGE;
2821 >  ConfigGeneral.oper_only_umodes |= UMODE_NCHANGE;
2822   } | T_REJ
2823   {
2824 <  ConfigFileEntry.oper_only_umodes |= UMODE_REJ;
2824 >  ConfigGeneral.oper_only_umodes |= UMODE_REJ;
2825   } | T_UNAUTH
2826   {
2827 <  ConfigFileEntry.oper_only_umodes |= UMODE_UNAUTH;
2827 >  ConfigGeneral.oper_only_umodes |= UMODE_UNAUTH;
2828   } | T_SPY
2829   {
2830 <  ConfigFileEntry.oper_only_umodes |= UMODE_SPY;
2830 >  ConfigGeneral.oper_only_umodes |= UMODE_SPY;
2831   } | T_EXTERNAL
2832   {
2833 <  ConfigFileEntry.oper_only_umodes |= UMODE_EXTERNAL;
2833 >  ConfigGeneral.oper_only_umodes |= UMODE_EXTERNAL;
2834   } | T_SERVNOTICE
2835   {
2836 <  ConfigFileEntry.oper_only_umodes |= UMODE_SERVNOTICE;
2836 >  ConfigGeneral.oper_only_umodes |= UMODE_SERVNOTICE;
2837   } | T_INVISIBLE
2838   {
2839 <  ConfigFileEntry.oper_only_umodes |= UMODE_INVISIBLE;
2839 >  ConfigGeneral.oper_only_umodes |= UMODE_INVISIBLE;
2840   } | T_WALLOP
2841   {
2842 <  ConfigFileEntry.oper_only_umodes |= UMODE_WALLOP;
2842 >  ConfigGeneral.oper_only_umodes |= UMODE_WALLOP;
2843   } | T_SOFTCALLERID
2844   {
2845 <  ConfigFileEntry.oper_only_umodes |= UMODE_SOFTCALLERID;
2845 >  ConfigGeneral.oper_only_umodes |= UMODE_SOFTCALLERID;
2846   } | T_CALLERID
2847   {
2848 <  ConfigFileEntry.oper_only_umodes |= UMODE_CALLERID;
2848 >  ConfigGeneral.oper_only_umodes |= UMODE_CALLERID;
2849   } | T_LOCOPS
2850   {
2851 <  ConfigFileEntry.oper_only_umodes |= UMODE_LOCOPS;
2851 >  ConfigGeneral.oper_only_umodes |= UMODE_LOCOPS;
2852   } | T_NONONREG
2853   {
2854 <  ConfigFileEntry.oper_only_umodes |= UMODE_REGONLY;
2854 >  ConfigGeneral.oper_only_umodes |= UMODE_REGONLY;
2855   } | T_FARCONNECT
2856   {
2857 <  ConfigFileEntry.oper_only_umodes |= UMODE_FARCONNECT;
2857 >  ConfigGeneral.oper_only_umodes |= UMODE_FARCONNECT;
2858   };
2859  
2860   general_min_nonwildcard: MIN_NONWILDCARD '=' NUMBER ';'
2861   {
2862 <  ConfigFileEntry.min_nonwildcard = $3;
2862 >  ConfigGeneral.min_nonwildcard = $3;
2863   };
2864  
2865   general_min_nonwildcard_simple: MIN_NONWILDCARD_SIMPLE '=' NUMBER ';'
2866   {
2867 <  ConfigFileEntry.min_nonwildcard_simple = $3;
2867 >  ConfigGeneral.min_nonwildcard_simple = $3;
2868   };
2869  
2870   general_default_floodcount: DEFAULT_FLOODCOUNT '=' NUMBER ';'
2871   {
2872 <  ConfigFileEntry.default_floodcount = $3;
2872 >  ConfigGeneral.default_floodcount = $3;
2873   };
2874  
2875  
2876   /***************************************************************************
2877 < *  section channel
2877 > * channel {} section
2878   ***************************************************************************/
2879 < channel_entry: CHANNEL
2917 <  '{' channel_items '}' ';';
2879 > channel_entry: CHANNEL '{' channel_items '}' ';';
2880  
2881   channel_items:      channel_items channel_item | channel_item;
2882   channel_item:       channel_max_bans |
2883                      channel_invite_client_count |
2884                      channel_invite_client_time |
2885 +                    channel_invite_delay_channel |
2886                      channel_knock_client_count |
2887                      channel_knock_client_time |
2888                      channel_knock_delay_channel |
2889                      channel_max_channels |
2890 <                    channel_default_split_user_count |
2891 <                    channel_default_split_server_count |
2929 <                    channel_no_create_on_split |
2930 <                    channel_no_join_on_split |
2931 <                    channel_jflood_count |
2932 <                    channel_jflood_time |
2890 >                    channel_default_join_flood_count |
2891 >                    channel_default_join_flood_time |
2892                      channel_disable_fake_channels |
2893                      error;
2894  
# Line 2948 | Line 2907 | channel_invite_client_time: INVITE_CLIEN
2907    ConfigChannel.invite_client_time = $3;
2908   };
2909  
2910 + channel_invite_delay_channel: INVITE_DELAY_CHANNEL '=' timespec ';'
2911 + {
2912 +  ConfigChannel.invite_delay_channel = $3;
2913 + };
2914 +
2915   channel_knock_client_count: KNOCK_CLIENT_COUNT '=' NUMBER ';'
2916   {
2917    ConfigChannel.knock_client_count = $3;
# Line 2973 | Line 2937 | channel_max_bans: MAX_BANS '=' NUMBER ';
2937    ConfigChannel.max_bans = $3;
2938   };
2939  
2940 < channel_default_split_user_count: DEFAULT_SPLIT_USER_COUNT '=' NUMBER ';'
2977 < {
2978 <  ConfigChannel.default_split_user_count = $3;
2979 < };
2980 <
2981 < channel_default_split_server_count: DEFAULT_SPLIT_SERVER_COUNT '=' NUMBER ';'
2982 < {
2983 <  ConfigChannel.default_split_server_count = $3;
2984 < };
2985 <
2986 < channel_no_create_on_split: NO_CREATE_ON_SPLIT '=' TBOOL ';'
2987 < {
2988 <  ConfigChannel.no_create_on_split = yylval.number;
2989 < };
2990 <
2991 < channel_no_join_on_split: NO_JOIN_ON_SPLIT '=' TBOOL ';'
2940 > channel_default_join_flood_count: DEFAULT_JOIN_FLOOD_COUNT '=' NUMBER ';'
2941   {
2942 <  ConfigChannel.no_join_on_split = yylval.number;
2942 >  ConfigChannel.default_join_flood_count = yylval.number;
2943   };
2944  
2945 < channel_jflood_count: JOIN_FLOOD_COUNT '=' NUMBER ';'
2945 > channel_default_join_flood_time: DEFAULT_JOIN_FLOOD_TIME '=' timespec ';'
2946   {
2947 <  GlobalSetOptions.joinfloodcount = yylval.number;
2947 >  ConfigChannel.default_join_flood_time = $3;
2948   };
2949  
3001 channel_jflood_time: JOIN_FLOOD_TIME '=' timespec ';'
3002 {
3003  GlobalSetOptions.joinfloodtime = $3;
3004 };
2950  
2951   /***************************************************************************
2952 < *  section serverhide
2952 > * serverhide {} section
2953   ***************************************************************************/
2954 < serverhide_entry: SERVERHIDE
3010 <  '{' serverhide_items '}' ';';
2954 > serverhide_entry: SERVERHIDE '{' serverhide_items '}' ';';
2955  
2956   serverhide_items:   serverhide_items serverhide_item | serverhide_item;
2957   serverhide_item:    serverhide_flatten_links |
2958 +                    serverhide_flatten_links_delay |
2959 +                    serverhide_flatten_links_file |
2960                      serverhide_disable_remote_commands |
2961                      serverhide_hide_servers |
2962                      serverhide_hide_services |
3017                    serverhide_links_delay |
2963                      serverhide_hidden |
2964                      serverhide_hidden_name |
2965                      serverhide_hide_server_ips |
# Line 3026 | Line 2971 | serverhide_flatten_links: FLATTEN_LINKS
2971      ConfigServerHide.flatten_links = yylval.number;
2972   };
2973  
2974 + serverhide_flatten_links_delay: FLATTEN_LINKS_DELAY '=' timespec ';'
2975 + {
2976 +  if (conf_parser_ctx.pass == 2)
2977 +  {
2978 +    if ($3 > 0)
2979 +    {
2980 +      event_write_links_file.when = $3;
2981 +      event_add(&event_write_links_file, NULL);
2982 +    }
2983 +    else
2984 +     event_delete(&event_write_links_file);
2985 +
2986 +    ConfigServerHide.flatten_links_delay = $3;
2987 +  }
2988 + };
2989 +
2990 + serverhide_flatten_links_file: FLATTEN_LINKS_FILE '=' QSTRING ';'
2991 + {
2992 +  if (conf_parser_ctx.pass == 2)
2993 +  {
2994 +    xfree(ConfigServerHide.flatten_links_file);
2995 +    ConfigServerHide.flatten_links_file = xstrdup(yylval.string);
2996 +  }
2997 + };
2998 +
2999   serverhide_disable_remote_commands: DISABLE_REMOTE_COMMANDS '=' TBOOL ';'
3000   {
3001    if (conf_parser_ctx.pass == 2)
# Line 3048 | Line 3018 | serverhide_hidden_name: HIDDEN_NAME '='
3018   {
3019    if (conf_parser_ctx.pass == 2)
3020    {
3021 <    MyFree(ConfigServerHide.hidden_name);
3021 >    xfree(ConfigServerHide.hidden_name);
3022      ConfigServerHide.hidden_name = xstrdup(yylval.string);
3023    }
3024   };
3025  
3056 serverhide_links_delay: LINKS_DELAY '=' timespec ';'
3057 {
3058  if (conf_parser_ctx.pass == 2)
3059  {
3060    if (($3 > 0) && ConfigServerHide.links_disabled == 1)
3061    {
3062      eventAddIsh("write_links_file", write_links_file, NULL, $3);
3063      ConfigServerHide.links_disabled = 0;
3064    }
3065
3066    ConfigServerHide.links_delay = $3;
3067  }
3068 };
3069
3026   serverhide_hidden: HIDDEN '=' TBOOL ';'
3027   {
3028    if (conf_parser_ctx.pass == 2)

Diff Legend

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