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 3435 by michael, Thu May 1 13:57:39 2014 UTC vs.
Revision 6684 by michael, Wed Oct 28 19:55:57 2015 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-2015 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
30   #include <sys/types.h>
31   #include <string.h>
32  
# Line 37 | Line 36
36   #include "list.h"
37   #include "conf.h"
38   #include "conf_class.h"
39 + #include "conf_pseudo.h"
40   #include "event.h"
41 + #include "id.h"
42   #include "log.h"
43 < #include "client.h"     /* for UMODE_ALL only */
43 > #include "client.h"     /* for UMODE_SERVNOTICE only */
44   #include "irc_string.h"
45   #include "memory.h"
46   #include "modules.h"
# Line 65 | Line 66 | int yylex(void);
66  
67   static struct
68   {
69 <  struct {
69 >  struct
70 >  {
71      dlink_list list;
72    } mask,
73      leaf,
74      hub;
75  
76 <  struct {
76 >  struct
77 >  {
78      char buf[IRCD_BUFSIZE];
79    } name,
80 +    nick,
81      user,
82      host,
83      addr,
# Line 83 | Line 87 | static struct
87      cert,
88      rpass,
89      spass,
90 <    class;
90 >    whois,
91 >    class,
92 >    target,
93 >    prepend,
94 >    command;
95  
96 <  struct {
96 >  struct
97 >  {
98      unsigned int value;
99    } flags,
100      modes,
# Line 104 | Line 113 | static struct
113      max_ident,
114      max_sendq,
115      max_recvq,
116 +    max_channels,
117      cidr_bitlen_ipv4,
118      cidr_bitlen_ipv6,
119      number_per_cidr;
# Line 112 | Line 122 | static struct
122   static void
123   reset_block_state(void)
124   {
125 <  dlink_node *ptr = NULL, *ptr_next = NULL;
125 >  dlink_node *node = NULL, *node_next = NULL;
126  
127 <  DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.mask.list.head)
127 >  DLINK_FOREACH_SAFE(node, node_next, block_state.mask.list.head)
128    {
129 <    MyFree(ptr->data);
130 <    dlinkDelete(ptr, &block_state.mask.list);
131 <    free_dlink_node(ptr);
129 >    MyFree(node->data);
130 >    dlinkDelete(node, &block_state.mask.list);
131 >    free_dlink_node(node);
132    }
133  
134 <  DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.leaf.list.head)
134 >  DLINK_FOREACH_SAFE(node, node_next, block_state.leaf.list.head)
135    {
136 <    MyFree(ptr->data);
137 <    dlinkDelete(ptr, &block_state.leaf.list);
138 <    free_dlink_node(ptr);
136 >    MyFree(node->data);
137 >    dlinkDelete(node, &block_state.leaf.list);
138 >    free_dlink_node(node);
139    }
140  
141 <  DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.hub.list.head)
141 >  DLINK_FOREACH_SAFE(node, node_next, block_state.hub.list.head)
142    {
143 <    MyFree(ptr->data);
144 <    dlinkDelete(ptr, &block_state.hub.list);
145 <    free_dlink_node(ptr);
143 >    MyFree(node->data);
144 >    dlinkDelete(node, &block_state.hub.list);
145 >    free_dlink_node(node);
146    }
147  
148    memset(&block_state, 0, sizeof(block_state));
# Line 151 | Line 161 | reset_block_state(void)
161   %token  ANTI_NICK_FLOOD
162   %token  ANTI_SPAM_EXIT_MESSAGE_TIME
163   %token  AUTOCONN
164 + %token  AWAY_COUNT
165 + %token  AWAY_TIME
166   %token  BYTES KBYTES MBYTES
167   %token  CALLER_ID_WAIT
168   %token  CAN_FLOOD
# Line 158 | Line 170 | reset_block_state(void)
170   %token  CIDR_BITLEN_IPV4
171   %token  CIDR_BITLEN_IPV6
172   %token  CLASS
173 + %token  CLOSE
174   %token  CONNECT
175   %token  CONNECTFREQ
176   %token  CYCLE_ON_HOST_CHANGE
177   %token  DEFAULT_FLOODCOUNT
178 < %token  DEFAULT_SPLIT_SERVER_COUNT
179 < %token  DEFAULT_SPLIT_USER_COUNT
178 > %token  DEFAULT_JOIN_FLOOD_COUNT
179 > %token  DEFAULT_JOIN_FLOOD_TIME
180 > %token  DEFAULT_MAX_CLIENTS
181   %token  DENY
182   %token  DESCRIPTION
183   %token  DIE
184   %token  DISABLE_AUTH
185   %token  DISABLE_FAKE_CHANNELS
186   %token  DISABLE_REMOTE_COMMANDS
187 + %token  DLINE_MIN_CIDR
188 + %token  DLINE_MIN_CIDR6
189   %token  DOTS_IN_IDENT
174 %token  EGDPOOL_PATH
190   %token  EMAIL
191   %token  ENCRYPTED
192   %token  EXCEED_LIMIT
193   %token  EXEMPT
194   %token  FAILED_OPER_NOTICE
195   %token  FLATTEN_LINKS
196 + %token  FLATTEN_LINKS_DELAY
197 + %token  FLATTEN_LINKS_FILE
198   %token  GECOS
199   %token  GENERAL
183 %token  GLINE
184 %token  GLINE_DURATION
185 %token  GLINE_ENABLE
186 %token  GLINE_EXEMPT
187 %token  GLINE_MIN_CIDR
188 %token  GLINE_MIN_CIDR6
189 %token  GLINE_REQUEST_DURATION
190 %token  GLOBAL_KILL
191 %token  HAVENT_READ_CONF
200   %token  HIDDEN
201   %token  HIDDEN_NAME
202 + %token  HIDE_CHANS
203 + %token  HIDE_IDLE
204   %token  HIDE_IDLE_FROM_OPERS
205   %token  HIDE_SERVER_IPS
206   %token  HIDE_SERVERS
207   %token  HIDE_SERVICES
198 %token  HIDE_SPOOF_IPS
208   %token  HOST
209   %token  HUB
210   %token  HUB_MASK
211   %token  IGNORE_BOGUS_TS
212   %token  INVISIBLE_ON_CONNECT
213 + %token  INVITE_CLIENT_COUNT
214 + %token  INVITE_CLIENT_TIME
215   %token  IP
216   %token  IRCD_AUTH
217   %token  IRCD_FLAGS
218   %token  IRCD_SID
219 < %token  JOIN_FLOOD_COUNT
209 < %token  JOIN_FLOOD_TIME
219 > %token  JOIN
220   %token  KILL
221   %token  KILL_CHASE_TIME_LIMIT
222   %token  KLINE
223   %token  KLINE_EXEMPT
224 < %token  KNOCK_DELAY
224 > %token  KLINE_MIN_CIDR
225 > %token  KLINE_MIN_CIDR6
226 > %token  KNOCK_CLIENT_COUNT
227 > %token  KNOCK_CLIENT_TIME
228   %token  KNOCK_DELAY_CHANNEL
229   %token  LEAF_MASK
217 %token  LINKS_DELAY
230   %token  LISTEN
231   %token  MASK
232   %token  MAX_ACCEPT
233   %token  MAX_BANS
234 < %token  MAX_CHANS_PER_OPER
223 < %token  MAX_CHANS_PER_USER
234 > %token  MAX_CHANNELS
235   %token  MAX_GLOBAL
236   %token  MAX_IDENT
237   %token  MAX_IDLE
# Line 244 | Line 255 | reset_block_state(void)
255   %token  NETWORK_DESC
256   %token  NETWORK_NAME
257   %token  NICK
247 %token  NO_CREATE_ON_SPLIT
248 %token  NO_JOIN_ON_SPLIT
258   %token  NO_OPER_FLOOD
259   %token  NO_TILDE
260   %token  NUMBER
261   %token  NUMBER_PER_CIDR
262   %token  NUMBER_PER_IP
263   %token  OPER_ONLY_UMODES
255 %token  OPER_PASS_RESV
264   %token  OPER_UMODES
265   %token  OPERATOR
266   %token  OPERS_BYPASS_CALLERID
# Line 274 | Line 282 | reset_block_state(void)
282   %token  RESV
283   %token  RESV_EXEMPT
284   %token  RSA_PRIVATE_KEY_FILE
277 %token  RSA_PUBLIC_KEY_FILE
285   %token  SECONDS MINUTES HOURS DAYS WEEKS MONTHS YEARS
286   %token  SEND_PASSWORD
287   %token  SENDQ
# Line 287 | Line 294 | reset_block_state(void)
294   %token  SSL_CERTIFICATE_FILE
295   %token  SSL_CERTIFICATE_FINGERPRINT
296   %token  SSL_CONNECTION_REQUIRED
297 + %token  SSL_DH_ELLIPTIC_CURVE
298   %token  SSL_DH_PARAM_FILE
299 + %token  SSL_MESSAGE_DIGEST_ALGORITHM
300   %token  STATS_E_DISABLED
301   %token  STATS_I_OPER_ONLY
302   %token  STATS_K_OPER_ONLY
303 + %token  STATS_M_OPER_ONLY
304   %token  STATS_O_OPER_ONLY
305   %token  STATS_P_OPER_ONLY
306   %token  STATS_U_OPER_ONLY
# Line 298 | Line 308 | reset_block_state(void)
308   %token  T_BOTS
309   %token  T_CALLERID
310   %token  T_CCONN
311 + %token  T_COMMAND
312   %token  T_CLUSTER
313   %token  T_DEAF
314   %token  T_DEBUG
# Line 312 | Line 323 | reset_block_state(void)
323   %token  T_IPV6
324   %token  T_LOCOPS
325   %token  T_LOG
315 %token  T_MAX_CLIENTS
326   %token  T_NCHANGE
327   %token  T_NONONREG
328 < %token  T_OPERWALL
328 > %token  T_OPME
329 > %token  T_PREPEND
330 > %token  T_PSEUDO
331   %token  T_RECVQ
332   %token  T_REJ
333   %token  T_RESTART
334   %token  T_SERVER
335   %token  T_SERVICE
324 %token  T_SERVICES_NAME
336   %token  T_SERVNOTICE
337   %token  T_SET
338   %token  T_SHARED
# Line 331 | Line 342 | reset_block_state(void)
342   %token  T_SPY
343   %token  T_SSL
344   %token  T_SSL_CIPHER_LIST
345 < %token  T_SSL_CLIENT_METHOD
335 < %token  T_SSL_SERVER_METHOD
336 < %token  T_SSLV3
337 < %token  T_TLSV1
345 > %token  T_TARGET
346   %token  T_UMODES
347   %token  T_UNAUTH
348   %token  T_UNDLINE
# Line 345 | Line 353 | reset_block_state(void)
353   %token  T_WALLOPS
354   %token  T_WEBIRC
355   %token  TBOOL
356 + %token  THROTTLE_COUNT
357   %token  THROTTLE_TIME
358   %token  TKLINE_EXPIRE_NOTICES
359   %token  TMASKED
351 %token  TRUE_NO_OPER_FLOOD
360   %token  TS_MAX_DELTA
361   %token  TS_WARN_DELTA
362   %token  TWODOTS
363   %token  TYPE
364   %token  UNKLINE
357 %token  USE_EGD
365   %token  USE_LOGGING
366   %token  USER
367   %token  VHOST
368   %token  VHOST6
369 < %token  WARN_NO_NLINE
369 > %token  WARN_NO_CONNECT_BLOCK
370 > %token  WHOIS
371   %token  XLINE
372 + %token  XLINE_EXEMPT
373  
374   %type  <string> QSTRING
375   %type  <number> NUMBER
# Line 377 | Line 386 | conf:
386   conf_item:        admin_entry
387                  | logging_entry
388                  | oper_entry
389 <                | channel_entry
389 >                | channel_entry
390                  | class_entry
391                  | listen_entry
392                  | auth_entry
393                  | serverinfo_entry
394 <                | serverhide_entry
394 >                | serverhide_entry
395                  | resv_entry
396                  | service_entry
397                  | shared_entry
398 <                | cluster_entry
398 >                | cluster_entry
399                  | connect_entry
400                  | kill_entry
401                  | deny_entry
402 <                | exempt_entry
403 <                | general_entry
402 >                | exempt_entry
403 >                | general_entry
404                  | gecos_entry
405                  | modules_entry
406                  | motd_entry
407 +                | pseudo_entry
408                  | error ';'
409                  | error '}'
410          ;
411  
412  
413   timespec_: { $$ = 0; } | timespec;
414 < timespec:       NUMBER timespec_
415 <                {
416 <                        $$ = $1 + $2;
417 <                }
418 <                | NUMBER SECONDS timespec_
419 <                {
420 <                        $$ = $1 + $3;
421 <                }
422 <                | NUMBER MINUTES timespec_
423 <                {
424 <                        $$ = $1 * 60 + $3;
425 <                }
426 <                | NUMBER HOURS timespec_
427 <                {
428 <                        $$ = $1 * 60 * 60 + $3;
429 <                }
420 <                | NUMBER DAYS timespec_
421 <                {
422 <                        $$ = $1 * 60 * 60 * 24 + $3;
423 <                }
424 <                | NUMBER WEEKS timespec_
425 <                {
426 <                        $$ = $1 * 60 * 60 * 24 * 7 + $3;
427 <                }
428 <                | NUMBER MONTHS timespec_
429 <                {
430 <                        $$ = $1 * 60 * 60 * 24 * 7 * 4 + $3;
431 <                }
432 <                | NUMBER YEARS timespec_
433 <                {
434 <                        $$ = $1 * 60 * 60 * 24 * 365 + $3;
435 <                }
436 <                ;
437 <
438 < sizespec_:      { $$ = 0; } | sizespec;
439 < sizespec:       NUMBER sizespec_ { $$ = $1 + $2; }
440 <                | NUMBER BYTES sizespec_ { $$ = $1 + $3; }
441 <                | NUMBER KBYTES sizespec_ { $$ = $1 * 1024 + $3; }
442 <                | NUMBER MBYTES sizespec_ { $$ = $1 * 1024 * 1024 + $3; }
443 <                ;
414 > timespec:  NUMBER timespec_         { $$ = $1 + $2; } |
415 >           NUMBER SECONDS timespec_ { $$ = $1 + $3; } |
416 >           NUMBER MINUTES timespec_ { $$ = $1 * 60 + $3; } |
417 >           NUMBER HOURS timespec_   { $$ = $1 * 60 * 60 + $3; } |
418 >           NUMBER DAYS timespec_    { $$ = $1 * 60 * 60 * 24 + $3; } |
419 >           NUMBER WEEKS timespec_   { $$ = $1 * 60 * 60 * 24 * 7 + $3; } |
420 >           NUMBER MONTHS timespec_  { $$ = $1 * 60 * 60 * 24 * 7 * 4 + $3; } |
421 >           NUMBER YEARS timespec_   { $$ = $1 * 60 * 60 * 24 * 365 + $3; }
422 >           ;
423 >
424 > sizespec_:  { $$ = 0; } | sizespec;
425 > sizespec:   NUMBER sizespec_ { $$ = $1 + $2; } |
426 >            NUMBER BYTES sizespec_ { $$ = $1 + $3; } |
427 >            NUMBER KBYTES sizespec_ { $$ = $1 * 1024 + $3; } |
428 >            NUMBER MBYTES sizespec_ { $$ = $1 * 1024 * 1024 + $3; }
429 >            ;
430  
431  
432   /***************************************************************************
433 < *  section modules
433 > * modules {} section
434   ***************************************************************************/
435 < modules_entry: MODULES
450 <  '{' modules_items '}' ';';
435 > modules_entry: MODULES '{' modules_items '}' ';';
436  
437   modules_items:  modules_items modules_item | modules_item;
438   modules_item:   modules_module | modules_path | error ';' ;
# Line 465 | Line 450 | modules_path: PATH '=' QSTRING ';'
450   };
451  
452  
453 + /***************************************************************************
454 + * serverinfo {}  section
455 + ***************************************************************************/
456   serverinfo_entry: SERVERINFO '{' serverinfo_items '}' ';';
457  
458   serverinfo_items:       serverinfo_items serverinfo_item | serverinfo_item ;
459 < serverinfo_item:        serverinfo_name | serverinfo_vhost |
460 <                        serverinfo_hub | serverinfo_description |
461 <                        serverinfo_network_name | serverinfo_network_desc |
462 <                        serverinfo_max_clients | serverinfo_max_nick_length |
463 <                        serverinfo_max_topic_length | serverinfo_ssl_dh_param_file |
464 <                        serverinfo_rsa_private_key_file | serverinfo_vhost6 |
465 <                        serverinfo_sid | serverinfo_ssl_certificate_file |
466 <                        serverinfo_ssl_client_method | serverinfo_ssl_server_method |
459 > serverinfo_item:        serverinfo_name |
460 >                        serverinfo_vhost |
461 >                        serverinfo_hub |
462 >                        serverinfo_description |
463 >                        serverinfo_network_name |
464 >                        serverinfo_network_desc |
465 >                        serverinfo_default_max_clients |
466 >                        serverinfo_max_nick_length |
467 >                        serverinfo_max_topic_length |
468 >                        serverinfo_ssl_dh_param_file |
469 >                        serverinfo_ssl_dh_elliptic_curve |
470 >                        serverinfo_rsa_private_key_file |
471 >                        serverinfo_vhost6 |
472 >                        serverinfo_sid |
473 >                        serverinfo_ssl_certificate_file |
474                          serverinfo_ssl_cipher_list |
475 <                        error ';' ;
475 >                        serverinfo_ssl_message_digest_algorithm |
476 >                        error ';' ;
477  
478  
483 serverinfo_ssl_client_method: T_SSL_CLIENT_METHOD '=' client_method_types ';' ;
484 serverinfo_ssl_server_method: T_SSL_SERVER_METHOD '=' server_method_types ';' ;
485
486 client_method_types: client_method_types ',' client_method_type_item | client_method_type_item;
487 client_method_type_item: T_SSLV3
488 {
489 #ifdef HAVE_LIBCRYPTO
490  if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx)
491    SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_SSLv3);
492 #endif
493 } | T_TLSV1
494 {
495 #ifdef HAVE_LIBCRYPTO
496  if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx)
497    SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_TLSv1);
498 #endif
499 };
500
501 server_method_types: server_method_types ',' server_method_type_item | server_method_type_item;
502 server_method_type_item: T_SSLV3
503 {
504 #ifdef HAVE_LIBCRYPTO
505  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
506    SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3);
507 #endif
508 } | T_TLSV1
509 {
510 #ifdef HAVE_LIBCRYPTO
511  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
512    SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1);
513 #endif
514 };
515
479   serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';'
480   {
481   #ifdef HAVE_LIBCRYPTO
482 <  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
482 >  if (conf_parser_ctx.pass == 2)
483    {
484 <    if (!ServerInfo.rsa_private_key_file)
484 >    if (!ConfigServerInfo.rsa_private_key_file)
485      {
486        conf_error_report("No rsa_private_key_file specified, SSL disabled");
487        break;
488      }
489  
490 <    if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string,
491 <                                     SSL_FILETYPE_PEM) <= 0 ||
529 <        SSL_CTX_use_certificate_file(ServerInfo.client_ctx, yylval.string,
530 <                                     SSL_FILETYPE_PEM) <= 0)
490 >    if (SSL_CTX_use_certificate_chain_file(ConfigServerInfo.server_ctx, yylval.string) <= 0 ||
491 >        SSL_CTX_use_certificate_chain_file(ConfigServerInfo.client_ctx, yylval.string) <= 0)
492      {
493        report_crypto_errors();
494        conf_error_report("Could not open/read certificate file");
495        break;
496      }
497  
498 <    if (SSL_CTX_use_PrivateKey_file(ServerInfo.server_ctx, ServerInfo.rsa_private_key_file,
498 >    if (SSL_CTX_use_PrivateKey_file(ConfigServerInfo.server_ctx, ConfigServerInfo.rsa_private_key_file,
499                                      SSL_FILETYPE_PEM) <= 0 ||
500 <        SSL_CTX_use_PrivateKey_file(ServerInfo.client_ctx, ServerInfo.rsa_private_key_file,
500 >        SSL_CTX_use_PrivateKey_file(ConfigServerInfo.client_ctx, ConfigServerInfo.rsa_private_key_file,
501                                      SSL_FILETYPE_PEM) <= 0)
502      {
503        report_crypto_errors();
# Line 544 | Line 505 | serverinfo_ssl_certificate_file: SSL_CER
505        break;
506      }
507  
508 <    if (!SSL_CTX_check_private_key(ServerInfo.server_ctx) ||
509 <        !SSL_CTX_check_private_key(ServerInfo.client_ctx))
508 >    if (!SSL_CTX_check_private_key(ConfigServerInfo.server_ctx) ||
509 >        !SSL_CTX_check_private_key(ConfigServerInfo.client_ctx))
510      {
511        report_crypto_errors();
512        conf_error_report("Could not read RSA private key");
# Line 563 | Line 524 | serverinfo_rsa_private_key_file: RSA_PRI
524    if (conf_parser_ctx.pass != 1)
525      break;
526  
527 <  if (ServerInfo.rsa_private_key)
527 >  if (ConfigServerInfo.rsa_private_key)
528    {
529 <    RSA_free(ServerInfo.rsa_private_key);
530 <    ServerInfo.rsa_private_key = NULL;
529 >    RSA_free(ConfigServerInfo.rsa_private_key);
530 >    ConfigServerInfo.rsa_private_key = NULL;
531    }
532  
533 <  if (ServerInfo.rsa_private_key_file)
533 >  if (ConfigServerInfo.rsa_private_key_file)
534    {
535 <    MyFree(ServerInfo.rsa_private_key_file);
536 <    ServerInfo.rsa_private_key_file = NULL;
535 >    MyFree(ConfigServerInfo.rsa_private_key_file);
536 >    ConfigServerInfo.rsa_private_key_file = NULL;
537    }
538  
539 <  ServerInfo.rsa_private_key_file = xstrdup(yylval.string);
539 >  ConfigServerInfo.rsa_private_key_file = xstrdup(yylval.string);
540  
541    if ((file = BIO_new_file(yylval.string, "r")) == NULL)
542    {
# Line 583 | Line 544 | serverinfo_rsa_private_key_file: RSA_PRI
544      break;
545    }
546  
547 <  ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
547 >  ConfigServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
548  
549    BIO_set_close(file, BIO_CLOSE);
550    BIO_free(file);
551  
552 <  if (ServerInfo.rsa_private_key == NULL)
552 >  if (ConfigServerInfo.rsa_private_key == NULL)
553    {
554      conf_error_report("Couldn't extract key, ignoring");
555      break;
556    }
557  
558 <  if (!RSA_check_key(ServerInfo.rsa_private_key))
558 >  if (!RSA_check_key(ConfigServerInfo.rsa_private_key))
559    {
560 <    RSA_free(ServerInfo.rsa_private_key);
561 <    ServerInfo.rsa_private_key = NULL;
560 >    RSA_free(ConfigServerInfo.rsa_private_key);
561 >    ConfigServerInfo.rsa_private_key = NULL;
562  
563      conf_error_report("Invalid key, ignoring");
564      break;
565    }
566  
567 <  if (RSA_size(ServerInfo.rsa_private_key) < 128)
567 >  if (RSA_size(ConfigServerInfo.rsa_private_key) < 256)
568    {
569 <    RSA_free(ServerInfo.rsa_private_key);
570 <    ServerInfo.rsa_private_key = NULL;
569 >    RSA_free(ConfigServerInfo.rsa_private_key);
570 >    ConfigServerInfo.rsa_private_key = NULL;
571  
572 <    conf_error_report("Ignoring serverinfo::rsa_private_key_file -- need at least a 1024 bit key size");
572 >    conf_error_report("Ignoring serverinfo::rsa_private_key_file -- need at least a 2048 bit key size");
573    }
574   #endif
575   };
576  
577   serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';'
578   {
618 /* TBD - XXX: error reporting */
579   #ifdef HAVE_LIBCRYPTO
580 <  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
580 >  if (conf_parser_ctx.pass == 2)
581    {
582      BIO *file = BIO_new_file(yylval.string, "r");
583  
# Line 629 | Line 589 | serverinfo_ssl_dh_param_file: SSL_DH_PAR
589  
590        if (dh)
591        {
592 <        if (DH_size(dh) < 128)
593 <          conf_error_report("Ignoring serverinfo::ssl_dh_param_file -- need at least a 1024 bit DH prime size");
592 >        if (DH_size(dh) < 256)
593 >          conf_error_report("Ignoring serverinfo::ssl_dh_param_file -- need at least a 2048 bit DH prime size");
594          else
595 <          SSL_CTX_set_tmp_dh(ServerInfo.server_ctx, dh);
595 >          SSL_CTX_set_tmp_dh(ConfigServerInfo.server_ctx, dh);
596  
597          DH_free(dh);
598        }
599      }
600 +    else
601 +      conf_error_report("Ignoring serverinfo::ssl_dh_param_file -- could not open/read Diffie-Hellman parameter file");
602    }
603   #endif
604   };
# Line 644 | Line 606 | serverinfo_ssl_dh_param_file: SSL_DH_PAR
606   serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
607   {
608   #ifdef HAVE_LIBCRYPTO
609 <  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
610 <    SSL_CTX_set_cipher_list(ServerInfo.server_ctx, yylval.string);
609 >  if (conf_parser_ctx.pass == 2)
610 >    SSL_CTX_set_cipher_list(ConfigServerInfo.server_ctx, yylval.string);
611 > #endif
612 > };
613 >
614 > serverinfo_ssl_message_digest_algorithm: SSL_MESSAGE_DIGEST_ALGORITHM '=' QSTRING ';'
615 > {
616 > #ifdef HAVE_LIBCRYPTO
617 >  if (conf_parser_ctx.pass == 2)
618 >  {
619 >    if ((ConfigServerInfo.message_digest_algorithm = EVP_get_digestbyname(yylval.string)) == NULL)
620 >    {
621 >      ConfigServerInfo.message_digest_algorithm = EVP_sha256();
622 >      conf_error_report("Ignoring serverinfo::ssl_message_digest_algorithm -- unknown message digest algorithm");
623 >    }
624 >  }
625 > #endif
626 > }
627 >
628 > serverinfo_ssl_dh_elliptic_curve: SSL_DH_ELLIPTIC_CURVE '=' QSTRING ';'
629 > {
630 > #ifdef HAVE_LIBCRYPTO
631 > #if OPENSSL_VERSION_NUMBER >= 0x009080FFL && !defined(OPENSSL_NO_ECDH)
632 >  int nid = 0;
633 >  EC_KEY *key = NULL;
634 >
635 >  if (conf_parser_ctx.pass == 2)
636 >  {
637 >    if ((nid = OBJ_sn2nid(yylval.string)) == 0)
638 >    {
639 >        conf_error_report("Ignoring serverinfo::ssl_dh_elliptic_curve -- unknown curve name");
640 >        break;
641 >    }
642 >
643 >    if ((key = EC_KEY_new_by_curve_name(nid)) == NULL)
644 >    {
645 >      conf_error_report("Ignoring serverinfo::ssl_dh_elliptic_curve -- could not create curve");
646 >      break;
647 >    }
648 >
649 >    SSL_CTX_set_tmp_ecdh(ConfigServerInfo.server_ctx, key);
650 >    EC_KEY_free(key);
651 >  }
652 > #endif
653   #endif
654   };
655  
656   serverinfo_name: NAME '=' QSTRING ';'
657   {
658 <  /* this isn't rehashable */
659 <  if (conf_parser_ctx.pass == 2 && !ServerInfo.name)
658 >  /* This isn't rehashable */
659 >  if (conf_parser_ctx.pass == 2 && !ConfigServerInfo.name)
660    {
661      if (valid_servname(yylval.string))
662 <      ServerInfo.name = xstrdup(yylval.string);
662 >      ConfigServerInfo.name = xstrdup(yylval.string);
663      else
664      {
665        conf_error_report("Ignoring serverinfo::name -- invalid name. Aborting.");
666 <      exit(0);
666 >      exit(EXIT_FAILURE);
667      }
668    }
669   };
670  
671   serverinfo_sid: IRCD_SID '=' QSTRING ';'
672   {
673 <  /* this isn't rehashable */
674 <  if (conf_parser_ctx.pass == 2 && !ServerInfo.sid)
673 >  /* This isn't rehashable */
674 >  if (conf_parser_ctx.pass == 2 && !ConfigServerInfo.sid)
675    {
676      if (valid_sid(yylval.string))
677 <      ServerInfo.sid = xstrdup(yylval.string);
677 >      ConfigServerInfo.sid = xstrdup(yylval.string);
678      else
679      {
680        conf_error_report("Ignoring serverinfo::sid -- invalid SID. Aborting.");
681 <      exit(0);
681 >      exit(EXIT_FAILURE);
682      }
683    }
684   };
# Line 683 | Line 687 | serverinfo_description: DESCRIPTION '='
687   {
688    if (conf_parser_ctx.pass == 2)
689    {
690 <    MyFree(ServerInfo.description);
691 <    ServerInfo.description = xstrdup(yylval.string);
690 >    MyFree(ConfigServerInfo.description);
691 >    ConfigServerInfo.description = xstrdup(yylval.string);
692 >    strlcpy(me.info, ConfigServerInfo.description, sizeof(me.info));
693    }
694   };
695  
# Line 694 | Line 699 | serverinfo_network_name: NETWORK_NAME '=
699    {
700      char *p;
701  
702 <    if ((p = strchr(yylval.string, ' ')) != NULL)
703 <      p = '\0';
702 >    if ((p = strchr(yylval.string, ' ')))
703 >      *p = '\0';
704  
705 <    MyFree(ServerInfo.network_name);
706 <    ServerInfo.network_name = xstrdup(yylval.string);
705 >    MyFree(ConfigServerInfo.network_name);
706 >    ConfigServerInfo.network_name = xstrdup(yylval.string);
707    }
708   };
709  
# Line 707 | Line 712 | serverinfo_network_desc: NETWORK_DESC '=
712    if (conf_parser_ctx.pass != 2)
713      break;
714  
715 <  MyFree(ServerInfo.network_desc);
716 <  ServerInfo.network_desc = xstrdup(yylval.string);
715 >  MyFree(ConfigServerInfo.network_desc);
716 >  ConfigServerInfo.network_desc = xstrdup(yylval.string);
717   };
718  
719   serverinfo_vhost: VHOST '=' QSTRING ';'
# Line 727 | Line 732 | serverinfo_vhost: VHOST '=' QSTRING ';'
732        ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string);
733      else
734      {
735 <      assert(res != NULL);
735 >      assert(res);
736  
737 <      memcpy(&ServerInfo.ip, res->ai_addr, res->ai_addrlen);
738 <      ServerInfo.ip.ss.ss_family = res->ai_family;
739 <      ServerInfo.ip.ss_len = res->ai_addrlen;
737 >      memcpy(&ConfigServerInfo.ip, res->ai_addr, res->ai_addrlen);
738 >      ConfigServerInfo.ip.ss.ss_family = res->ai_family;
739 >      ConfigServerInfo.ip.ss_len = res->ai_addrlen;
740        freeaddrinfo(res);
741  
742 <      ServerInfo.specific_ipv4_vhost = 1;
742 >      ConfigServerInfo.specific_ipv4_vhost = 1;
743      }
744    }
745   };
746  
747   serverinfo_vhost6: VHOST6 '=' QSTRING ';'
748   {
744 #ifdef IPV6
749    if (conf_parser_ctx.pass == 2 && *yylval.string != '*')
750    {
751      struct addrinfo hints, *res;
# Line 756 | Line 760 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
760        ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost6(%s)", yylval.string);
761      else
762      {
763 <      assert(res != NULL);
763 >      assert(res);
764  
765 <      memcpy(&ServerInfo.ip6, res->ai_addr, res->ai_addrlen);
766 <      ServerInfo.ip6.ss.ss_family = res->ai_family;
767 <      ServerInfo.ip6.ss_len = res->ai_addrlen;
765 >      memcpy(&ConfigServerInfo.ip6, res->ai_addr, res->ai_addrlen);
766 >      ConfigServerInfo.ip6.ss.ss_family = res->ai_family;
767 >      ConfigServerInfo.ip6.ss_len = res->ai_addrlen;
768        freeaddrinfo(res);
769  
770 <      ServerInfo.specific_ipv6_vhost = 1;
770 >      ConfigServerInfo.specific_ipv6_vhost = 1;
771      }
772    }
769 #endif
773   };
774  
775 < serverinfo_max_clients: T_MAX_CLIENTS '=' NUMBER ';'
775 > serverinfo_default_max_clients: DEFAULT_MAX_CLIENTS '=' NUMBER ';'
776   {
777    if (conf_parser_ctx.pass != 2)
778      break;
779  
780    if ($3 < MAXCLIENTS_MIN)
781    {
782 <    char buf[IRCD_BUFSIZE];
782 >    char buf[IRCD_BUFSIZE] = "";
783  
784      snprintf(buf, sizeof(buf), "MAXCLIENTS too low, setting to %d", MAXCLIENTS_MIN);
785      conf_error_report(buf);
786 <    ServerInfo.max_clients = MAXCLIENTS_MIN;
786 >    ConfigServerInfo.default_max_clients = MAXCLIENTS_MIN;
787    }
788    else if ($3 > MAXCLIENTS_MAX)
789    {
790 <    char buf[IRCD_BUFSIZE];
790 >    char buf[IRCD_BUFSIZE] = "";
791  
792      snprintf(buf, sizeof(buf), "MAXCLIENTS too high, setting to %d", MAXCLIENTS_MAX);
793      conf_error_report(buf);
794 <    ServerInfo.max_clients = MAXCLIENTS_MAX;
794 >    ConfigServerInfo.default_max_clients = MAXCLIENTS_MAX;
795    }
796    else
797 <    ServerInfo.max_clients = $3;
797 >    ConfigServerInfo.default_max_clients = $3;
798   };
799  
800   serverinfo_max_nick_length: MAX_NICK_LENGTH '=' NUMBER ';'
# Line 802 | Line 805 | serverinfo_max_nick_length: MAX_NICK_LEN
805    if ($3 < 9)
806    {
807      conf_error_report("max_nick_length too low, setting to 9");
808 <    ServerInfo.max_nick_length = 9;
808 >    ConfigServerInfo.max_nick_length = 9;
809    }
810    else if ($3 > NICKLEN)
811    {
812 <    char buf[IRCD_BUFSIZE];
812 >    char buf[IRCD_BUFSIZE] = "";
813  
814      snprintf(buf, sizeof(buf), "max_nick_length too high, setting to %d", NICKLEN);
815      conf_error_report(buf);
816 <    ServerInfo.max_nick_length = NICKLEN;
816 >    ConfigServerInfo.max_nick_length = NICKLEN;
817    }
818    else
819 <    ServerInfo.max_nick_length = $3;
819 >    ConfigServerInfo.max_nick_length = $3;
820   };
821  
822   serverinfo_max_topic_length: MAX_TOPIC_LENGTH '=' NUMBER ';'
# Line 824 | Line 827 | serverinfo_max_topic_length: MAX_TOPIC_L
827    if ($3 < 80)
828    {
829      conf_error_report("max_topic_length too low, setting to 80");
830 <    ServerInfo.max_topic_length = 80;
830 >    ConfigServerInfo.max_topic_length = 80;
831    }
832    else if ($3 > TOPICLEN)
833    {
834 <    char buf[IRCD_BUFSIZE];
834 >    char buf[IRCD_BUFSIZE] = "";
835  
836      snprintf(buf, sizeof(buf), "max_topic_length too high, setting to %d", TOPICLEN);
837      conf_error_report(buf);
838 <    ServerInfo.max_topic_length = TOPICLEN;
838 >    ConfigServerInfo.max_topic_length = TOPICLEN;
839    }
840    else
841 <    ServerInfo.max_topic_length = $3;
841 >    ConfigServerInfo.max_topic_length = $3;
842   };
843  
844   serverinfo_hub: HUB '=' TBOOL ';'
845   {
846    if (conf_parser_ctx.pass == 2)
847 <    ServerInfo.hub = yylval.number;
847 >    ConfigServerInfo.hub = yylval.number;
848   };
849  
850 +
851   /***************************************************************************
852 < * admin section
852 > * admin {} section
853   ***************************************************************************/
854   admin_entry: ADMIN  '{' admin_items '}' ';' ;
855  
856   admin_items: admin_items admin_item | admin_item;
857 < admin_item:  admin_name | admin_description |
858 <             admin_email | error ';' ;
857 > admin_item:  admin_name |
858 >             admin_description |
859 >             admin_email |
860 >             error ';' ;
861  
862   admin_name: NAME '=' QSTRING ';'
863   {
864    if (conf_parser_ctx.pass != 2)
865      break;
866  
867 <  MyFree(AdminInfo.name);
868 <  AdminInfo.name = xstrdup(yylval.string);
867 >  MyFree(ConfigAdminInfo.name);
868 >  ConfigAdminInfo.name = xstrdup(yylval.string);
869   };
870  
871   admin_email: EMAIL '=' QSTRING ';'
# Line 867 | Line 873 | admin_email: EMAIL '=' QSTRING ';'
873    if (conf_parser_ctx.pass != 2)
874      break;
875  
876 <  MyFree(AdminInfo.email);
877 <  AdminInfo.email = xstrdup(yylval.string);
876 >  MyFree(ConfigAdminInfo.email);
877 >  ConfigAdminInfo.email = xstrdup(yylval.string);
878   };
879  
880   admin_description: DESCRIPTION '=' QSTRING ';'
# Line 876 | Line 882 | admin_description: DESCRIPTION '=' QSTRI
882    if (conf_parser_ctx.pass != 2)
883      break;
884  
885 <  MyFree(AdminInfo.description);
886 <  AdminInfo.description = xstrdup(yylval.string);
885 >  MyFree(ConfigAdminInfo.description);
886 >  ConfigAdminInfo.description = xstrdup(yylval.string);
887   };
888  
889 +
890   /***************************************************************************
891 < * motd section
891 > * motd {} section
892   ***************************************************************************/
893   motd_entry: MOTD
894   {
# Line 889 | Line 896 | motd_entry: MOTD
896      reset_block_state();
897   } '{' motd_items '}' ';'
898   {
899 <  dlink_node *ptr = NULL;
899 >  dlink_node *node = NULL;
900  
901    if (conf_parser_ctx.pass != 2)
902      break;
# Line 897 | Line 904 | motd_entry: MOTD
904    if (!block_state.file.buf[0])
905      break;
906  
907 <  DLINK_FOREACH(ptr, block_state.mask.list.head)
908 <    motd_add(ptr->data, block_state.file.buf);
907 >  DLINK_FOREACH(node, block_state.mask.list.head)
908 >    motd_add(node->data, block_state.file.buf);
909   };
910  
911   motd_items: motd_items motd_item | motd_item;
# Line 916 | Line 923 | motd_file: T_FILE '=' QSTRING ';'
923      strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf));
924   };
925  
926 +
927 + /***************************************************************************
928 + * pseudo {} section
929 + ***************************************************************************/
930 + pseudo_entry: T_PSEUDO
931 + {
932 +  if (conf_parser_ctx.pass == 2)
933 +    reset_block_state();
934 + } '{' pseudo_items '}' ';'
935 + {
936 +  if (conf_parser_ctx.pass != 2)
937 +    break;
938 +
939 +  if (!block_state.command.buf[0] ||
940 +      !block_state.name.buf[0] ||
941 +      !block_state.nick.buf[0] ||
942 +      !block_state.host.buf[0])
943 +    break;
944 +
945 +  pseudo_register(block_state.name.buf, block_state.nick.buf, block_state.host.buf,
946 +                  block_state.prepend.buf, block_state.command.buf);
947 + };
948 +
949 + pseudo_items: pseudo_items pseudo_item | pseudo_item;
950 + pseudo_item:  pseudo_command | pseudo_prepend | pseudo_name | pseudo_target | error ';' ;
951 +
952 + pseudo_command: T_COMMAND '=' QSTRING ';'
953 + {
954 +  if (conf_parser_ctx.pass == 2)
955 +    strlcpy(block_state.command.buf, yylval.string, sizeof(block_state.command.buf));
956 + };
957 +
958 + pseudo_name: NAME '=' QSTRING ';'
959 + {
960 +  if (conf_parser_ctx.pass == 2)
961 +    strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
962 + };
963 +
964 + pseudo_prepend: T_PREPEND '=' QSTRING ';'
965 + {
966 +  if (conf_parser_ctx.pass == 2)
967 +    strlcpy(block_state.prepend.buf, yylval.string, sizeof(block_state.prepend.buf));
968 + };
969 +
970 + pseudo_target: T_TARGET '=' QSTRING ';'
971 + {
972 +  if (conf_parser_ctx.pass == 2)
973 +  {
974 +    struct split_nuh_item nuh;
975 +
976 +    nuh.nuhmask  = yylval.string;
977 +    nuh.nickptr  = NULL;
978 +    nuh.userptr  = block_state.nick.buf;
979 +    nuh.hostptr  = block_state.host.buf;
980 +    nuh.nicksize = 0;
981 +    nuh.usersize = sizeof(block_state.nick.buf);
982 +    nuh.hostsize = sizeof(block_state.host.buf);
983 +
984 +    split_nuh(&nuh);
985 +  }
986 + };
987 +
988 +
989   /***************************************************************************
990 < *  section logging
990 > * log {} section
991   ***************************************************************************/
992   logging_entry:          T_LOG  '{' logging_items '}' ';' ;
993   logging_items:          logging_items logging_item | logging_item ;
994  
995 < logging_item:           logging_use_logging | logging_file_entry |
996 <                        error ';' ;
995 > logging_item:           logging_use_logging | logging_file_entry |
996 >                        error ';' ;
997  
998   logging_use_logging: USE_LOGGING '=' TBOOL ';'
999   {
1000    if (conf_parser_ctx.pass == 2)
1001 <    ConfigLoggingEntry.use_logging = yylval.number;
1001 >    ConfigLog.use_logging = yylval.number;
1002   };
1003  
1004   logging_file_entry:
# Line 982 | Line 1052 | logging_file_type_item:  USER
1052   {
1053    if (conf_parser_ctx.pass == 2)
1054      block_state.type.value = LOG_TYPE_OPER;
985 } | GLINE
986 {
987  if (conf_parser_ctx.pass == 2)
988    block_state.type.value = LOG_TYPE_GLINE;
1055   } | XLINE
1056   {
1057    if (conf_parser_ctx.pass == 2)
# Line 1014 | Line 1080 | logging_file_type_item:  USER
1080  
1081  
1082   /***************************************************************************
1083 < * section oper
1083 > * operator {} section
1084   ***************************************************************************/
1085   oper_entry: OPERATOR
1086   {
# Line 1025 | Line 1091 | oper_entry: OPERATOR
1091    block_state.flags.value |= CONF_FLAGS_ENCRYPTED;
1092   } '{' oper_items '}' ';'
1093   {
1094 <  dlink_node *ptr = NULL;
1094 >  dlink_node *node = NULL;
1095  
1096    if (conf_parser_ctx.pass != 2)
1097      break;
1098  
1099    if (!block_state.name.buf[0])
1100      break;
1101 < #ifdef HAVE_LIBCRYPTO
1036 <  if (!block_state.file.buf[0] &&
1037 <      !block_state.rpass.buf[0])
1038 <    break;
1039 < #else
1101 >
1102    if (!block_state.rpass.buf[0])
1103      break;
1042 #endif
1104  
1105 <  DLINK_FOREACH(ptr, block_state.mask.list.head)
1105 >  DLINK_FOREACH(node, block_state.mask.list.head)
1106    {
1107      struct MaskItem *conf = NULL;
1108      struct split_nuh_item nuh;
1109  
1110 <    nuh.nuhmask  = ptr->data;
1110 >    nuh.nuhmask  = node->data;
1111      nuh.nickptr  = NULL;
1112      nuh.userptr  = block_state.user.buf;
1113      nuh.hostptr  = block_state.host.buf;
# Line 1066 | Line 1127 | oper_entry: OPERATOR
1127      if (block_state.rpass.buf[0])
1128        conf->passwd = xstrdup(block_state.rpass.buf);
1129  
1130 +    if (block_state.whois.buf[0])
1131 +      conf->whois = xstrdup(block_state.whois.buf);
1132 +
1133      conf->flags = block_state.flags.value;
1134      conf->modes = block_state.modes.value;
1135      conf->port  = block_state.port.value;
1136      conf->htype = parse_netmask(conf->host, &conf->addr, &conf->bits);
1137  
1138      conf_add_class_to_conf(conf, block_state.class.buf);
1075
1076 #ifdef HAVE_LIBCRYPTO
1077    if (block_state.file.buf[0])
1078    {
1079      BIO *file = NULL;
1080      RSA *pkey = NULL;
1081
1082      if ((file = BIO_new_file(block_state.file.buf, "r")) == NULL)
1083      {
1084        conf_error_report("Ignoring rsa_public_key_file -- file doesn't exist");
1085        break;
1086      }
1087
1088      if ((pkey = PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL)) == NULL)
1089        conf_error_report("Ignoring rsa_public_key_file -- Key invalid; check key syntax.");
1090
1091      conf->rsa_public_key = pkey;
1092      BIO_set_close(file, BIO_CLOSE);
1093      BIO_free(file);
1094    }
1095 #endif /* HAVE_LIBCRYPTO */
1139    }
1140   };
1141  
1142   oper_items:     oper_items oper_item | oper_item;
1143 < oper_item:      oper_name | oper_user | oper_password |
1144 <                oper_umodes | oper_class | oper_encrypted |
1145 <                oper_rsa_public_key_file | oper_ssl_certificate_fingerprint |
1146 <                oper_ssl_connection_required |
1147 <                oper_flags | error ';' ;
1143 > oper_item:      oper_name |
1144 >                oper_user |
1145 >                oper_password |
1146 >                oper_whois |
1147 >                oper_umodes |
1148 >                oper_class |
1149 >                oper_encrypted |
1150 >                oper_ssl_certificate_fingerprint |
1151 >                oper_ssl_connection_required |
1152 >                oper_flags |
1153 >                error ';' ;
1154  
1155   oper_name: NAME '=' QSTRING ';'
1156   {
# Line 1121 | Line 1170 | oper_password: PASSWORD '=' QSTRING ';'
1170      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
1171   };
1172  
1173 + oper_whois: WHOIS '=' QSTRING ';'
1174 + {
1175 +  if (conf_parser_ctx.pass == 2)
1176 +    strlcpy(block_state.whois.buf, yylval.string, sizeof(block_state.whois.buf));
1177 + };
1178 +
1179   oper_encrypted: ENCRYPTED '=' TBOOL ';'
1180   {
1181    if (conf_parser_ctx.pass != 2)
# Line 1132 | Line 1187 | oper_encrypted: ENCRYPTED '=' TBOOL ';'
1187      block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED;
1188   };
1189  
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
1190   oper_ssl_certificate_fingerprint: SSL_CERTIFICATE_FINGERPRINT '=' QSTRING ';'
1191   {
1192    if (conf_parser_ctx.pass == 2)
# Line 1192 | Line 1241 | oper_umodes_item:  T_BOTS
1241   {
1242    if (conf_parser_ctx.pass == 2)
1243      block_state.modes.value |= UMODE_HIDDEN;
1244 + } | HIDE_CHANS
1245 + {
1246 +  if (conf_parser_ctx.pass == 2)
1247 +    block_state.modes.value |= UMODE_HIDECHANS;
1248 + } | HIDE_IDLE
1249 + {
1250 +  if (conf_parser_ctx.pass == 2)
1251 +    block_state.modes.value |= UMODE_HIDEIDLE;
1252   } | T_SKILL
1253   {
1254    if (conf_parser_ctx.pass == 2)
# Line 1216 | Line 1273 | oper_umodes_item:  T_BOTS
1273   {
1274    if (conf_parser_ctx.pass == 2)
1275      block_state.modes.value |= UMODE_EXTERNAL;
1219 } | T_OPERWALL
1220 {
1221  if (conf_parser_ctx.pass == 2)
1222    block_state.modes.value |= UMODE_OPERWALL;
1276   } | T_SERVNOTICE
1277   {
1278    if (conf_parser_ctx.pass == 2)
# Line 1288 | Line 1341 | oper_flags_item: KILL ':' REMOTE
1341   } | KLINE
1342   {
1343    if (conf_parser_ctx.pass == 2)
1344 <    block_state.port.value |= OPER_FLAG_K;
1344 >    block_state.port.value |= OPER_FLAG_KLINE;
1345   } | UNKLINE
1346   {
1347    if (conf_parser_ctx.pass == 2)
# Line 1309 | Line 1362 | oper_flags_item: KILL ':' REMOTE
1362   {
1363    if (conf_parser_ctx.pass == 2)
1364      block_state.port.value |= OPER_FLAG_UNXLINE;
1312 } | GLINE
1313 {
1314  if (conf_parser_ctx.pass == 2)
1315    block_state.port.value |= OPER_FLAG_GLINE;
1365   } | DIE
1366   {
1367    if (conf_parser_ctx.pass == 2)
# Line 1329 | Line 1378 | oper_flags_item: KILL ':' REMOTE
1378   {
1379    if (conf_parser_ctx.pass == 2)
1380      block_state.port.value |= OPER_FLAG_ADMIN;
1332 } | T_OPERWALL
1333 {
1334  if (conf_parser_ctx.pass == 2)
1335    block_state.port.value |= OPER_FLAG_OPERWALL;
1381   } | T_GLOBOPS
1382   {
1383    if (conf_parser_ctx.pass == 2)
# Line 1357 | Line 1402 | oper_flags_item: KILL ':' REMOTE
1402   {
1403    if (conf_parser_ctx.pass == 2)
1404      block_state.port.value |= OPER_FLAG_MODULE;
1405 + } | T_OPME
1406 + {
1407 +  if (conf_parser_ctx.pass == 2)
1408 +    block_state.port.value |= OPER_FLAG_OPME;
1409 + } | NICK ':' RESV
1410 + {
1411 +  if (conf_parser_ctx.pass == 2)
1412 +    block_state.port.value |= OPER_FLAG_NICK_RESV;
1413 + } | JOIN ':' RESV
1414 + {
1415 +  if (conf_parser_ctx.pass == 2)
1416 +    block_state.port.value |= OPER_FLAG_JOIN_RESV;
1417 + } | RESV
1418 + {
1419 +  if (conf_parser_ctx.pass == 2)
1420 +    block_state.port.value |= OPER_FLAG_RESV;
1421 + } | T_UNRESV
1422 + {
1423 +  if (conf_parser_ctx.pass == 2)
1424 +    block_state.port.value |= OPER_FLAG_UNRESV;
1425 + } | CLOSE
1426 + {
1427 +  if (conf_parser_ctx.pass == 2)
1428 +    block_state.port.value |= OPER_FLAG_CLOSE;
1429   };
1430  
1431  
1432   /***************************************************************************
1433 < *  section class
1433 > * class {} section
1434   ***************************************************************************/
1435   class_entry: CLASS
1436   {
# Line 1400 | Line 1469 | class_entry: CLASS
1469    class->max_ident = block_state.max_ident.value;
1470    class->max_sendq = block_state.max_sendq.value;
1471    class->max_recvq = block_state.max_recvq.value;
1472 +  class->max_channels = block_state.max_channels.value;
1473  
1474    if (block_state.min_idle.value > block_state.max_idle.value)
1475    {
# Line 1412 | Line 1482 | class_entry: CLASS
1482    class->min_idle = block_state.min_idle.value;
1483    class->max_idle = block_state.max_idle.value;
1484  
1485 <  if (class->number_per_cidr && block_state.number_per_cidr.value)
1416 <    if ((class->cidr_bitlen_ipv4 && block_state.cidr_bitlen_ipv4.value) ||
1417 <        (class->cidr_bitlen_ipv6 && block_state.cidr_bitlen_ipv6.value))
1418 <      if ((class->cidr_bitlen_ipv4 != block_state.cidr_bitlen_ipv4.value) ||
1419 <          (class->cidr_bitlen_ipv6 != block_state.cidr_bitlen_ipv6.value))
1420 <        rebuild_cidr_list(class);
1485 >  rebuild_cidr_list(class);
1486  
1487    class->cidr_bitlen_ipv4 = block_state.cidr_bitlen_ipv4.value;
1488    class->cidr_bitlen_ipv6 = block_state.cidr_bitlen_ipv6.value;
# Line 1426 | Line 1491 | class_entry: CLASS
1491  
1492   class_items:    class_items class_item | class_item;
1493   class_item:     class_name |
1494 <                class_cidr_bitlen_ipv4 | class_cidr_bitlen_ipv6 |
1494 >                class_cidr_bitlen_ipv4 |
1495 >                class_cidr_bitlen_ipv6 |
1496                  class_ping_time |
1497 <                class_number_per_cidr |
1497 >                class_number_per_cidr |
1498                  class_number_per_ip |
1499                  class_connectfreq |
1500 +                class_max_channels |
1501                  class_max_number |
1502 <                class_max_global |
1503 <                class_max_local |
1504 <                class_max_ident |
1502 >                class_max_global |
1503 >                class_max_local |
1504 >                class_max_ident |
1505                  class_sendq | class_recvq |
1506                  class_min_idle |
1507                  class_max_idle |
1508                  class_flags |
1509 <                error ';' ;
1509 >                error ';' ;
1510  
1511   class_name: NAME '=' QSTRING ';'
1512   {
# Line 1465 | Line 1532 | class_connectfreq: CONNECTFREQ '=' times
1532      block_state.con_freq.value = $3;
1533   };
1534  
1535 + class_max_channels: MAX_CHANNELS '=' NUMBER ';'
1536 + {
1537 +  if (conf_parser_ctx.pass == 1)
1538 +    block_state.max_channels.value = $3;
1539 + };
1540 +
1541   class_max_number: MAX_NUMBER '=' NUMBER ';'
1542   {
1543    if (conf_parser_ctx.pass == 1)
# Line 1557 | Line 1630 | class_flags_item: RANDOM_IDLE
1630  
1631  
1632   /***************************************************************************
1633 < *  section listen
1633 > * listen {} section
1634   ***************************************************************************/
1635   listen_entry: LISTEN
1636   {
# Line 1596 | Line 1669 | port_item: NUMBER
1669   {
1670    if (conf_parser_ctx.pass == 2)
1671    {
1672 + #ifndef HAVE_LIBCRYPTO
1673      if (block_state.flags.value & LISTENER_SSL)
1674 < #ifdef HAVE_LIBCRYPTO
1675 <      if (!ServerInfo.server_ctx)
1674 >    {
1675 >      conf_error_report("SSL not available - port closed");
1676 >      break;
1677 >    }
1678   #endif
1679 <      {
1604 <        conf_error_report("SSL not available - port closed");
1605 <        break;
1606 <      }
1607 <    add_listener($1, block_state.addr.buf, block_state.flags.value);
1679 >    listener_add($1, block_state.addr.buf, block_state.flags.value);
1680    }
1681   } | NUMBER TWODOTS NUMBER
1682   {
1683    if (conf_parser_ctx.pass == 2)
1684    {
1685 <    int i;
1614 <
1685 > #ifndef HAVE_LIBCRYPTO
1686      if (block_state.flags.value & LISTENER_SSL)
1687 < #ifdef HAVE_LIBCRYPTO
1688 <      if (!ServerInfo.server_ctx)
1687 >    {
1688 >      conf_error_report("SSL not available - port closed");
1689 >      break;
1690 >    }
1691   #endif
1619      {
1620        conf_error_report("SSL not available - port closed");
1621        break;
1622      }
1692  
1693 <    for (i = $1; i <= $3; ++i)
1694 <      add_listener(i, block_state.addr.buf, block_state.flags.value);
1693 >    for (int i = $1; i <= $3; ++i)
1694 >      listener_add(i, block_state.addr.buf, block_state.flags.value);
1695    }
1696   };
1697  
# Line 1638 | Line 1707 | listen_host: HOST '=' QSTRING ';'
1707      strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf));
1708   };
1709  
1710 +
1711   /***************************************************************************
1712 < *  section auth
1712 > * auth {} section
1713   ***************************************************************************/
1714   auth_entry: IRCD_AUTH
1715   {
# Line 1647 | Line 1717 | auth_entry: IRCD_AUTH
1717      reset_block_state();
1718   } '{' auth_items '}' ';'
1719   {
1720 <  dlink_node *ptr = NULL;
1720 >  dlink_node *node = NULL;
1721  
1722    if (conf_parser_ctx.pass != 2)
1723      break;
1724  
1725 <  DLINK_FOREACH(ptr, block_state.mask.list.head)
1725 >  DLINK_FOREACH(node, block_state.mask.list.head)
1726    {
1727      struct MaskItem *conf = NULL;
1728      struct split_nuh_item nuh;
1729  
1730 <    nuh.nuhmask  = ptr->data;
1730 >    nuh.nuhmask  = node->data;
1731      nuh.nickptr  = NULL;
1732      nuh.userptr  = block_state.user.buf;
1733      nuh.hostptr  = block_state.host.buf;
# Line 1684 | Line 1754 | auth_entry: IRCD_AUTH
1754   };
1755  
1756   auth_items:     auth_items auth_item | auth_item;
1757 < auth_item:      auth_user | auth_passwd | auth_class | auth_flags |
1758 <                auth_spoof | auth_redir_serv | auth_redir_port |
1759 <                auth_encrypted | error ';' ;
1757 > auth_item:      auth_user |
1758 >                auth_passwd |
1759 >                auth_class |
1760 >                auth_flags |
1761 >                auth_spoof |
1762 >                auth_redir_serv |
1763 >                auth_redir_port |
1764 >                auth_encrypted |
1765 >                error ';' ;
1766  
1767   auth_user: USER '=' QSTRING ';'
1768   {
# Line 1736 | Line 1812 | auth_flags_item: SPOOF_NOTICE
1812   {
1813    if (conf_parser_ctx.pass == 2)
1814      block_state.flags.value |= CONF_FLAGS_EXEMPTKLINE;
1815 + } | XLINE_EXEMPT
1816 + {
1817 +  if (conf_parser_ctx.pass == 2)
1818 +    block_state.flags.value |= CONF_FLAGS_EXEMPTXLINE;
1819   } | NEED_IDENT
1820   {
1821    if (conf_parser_ctx.pass == 2)
# Line 1748 | Line 1828 | auth_flags_item: SPOOF_NOTICE
1828   {
1829    if (conf_parser_ctx.pass == 2)
1830      block_state.flags.value |= CONF_FLAGS_NO_TILDE;
1751 } | GLINE_EXEMPT
1752 {
1753  if (conf_parser_ctx.pass == 2)
1754    block_state.flags.value |= CONF_FLAGS_EXEMPTGLINE;
1831   } | RESV_EXEMPT
1832   {
1833    if (conf_parser_ctx.pass == 2)
# Line 1771 | Line 1847 | auth_spoof: SPOOF '=' QSTRING ';'
1847    if (conf_parser_ctx.pass != 2)
1848      break;
1849  
1850 <  if (strlen(yylval.string) <= HOSTLEN && valid_hostname(yylval.string))
1850 >  if (valid_hostname(yylval.string))
1851    {
1852      strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
1853      block_state.flags.value |= CONF_FLAGS_SPOOF_IP;
# Line 1800 | Line 1876 | auth_redir_port: REDIRPORT '=' NUMBER ';
1876  
1877  
1878   /***************************************************************************
1879 < *  section resv
1879 > * resv {} section
1880   ***************************************************************************/
1881   resv_entry: RESV
1882   {
# Line 1817 | Line 1893 | resv_entry: RESV
1893    create_resv(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list);
1894   };
1895  
1896 < resv_items:     resv_items resv_item | resv_item;
1897 < resv_item:      resv_mask | resv_reason | resv_exempt | error ';' ;
1896 > resv_items:     resv_items resv_item | resv_item;
1897 > resv_item:      resv_mask | resv_reason | resv_exempt | error ';' ;
1898  
1899   resv_mask: MASK '=' QSTRING ';'
1900   {
# Line 1840 | Line 1916 | resv_exempt: EXEMPT '=' QSTRING ';'
1916  
1917  
1918   /***************************************************************************
1919 < *  section service
1919 > * service {} section
1920   ***************************************************************************/
1921   service_entry: T_SERVICE '{' service_items '}' ';';
1922  
# Line 1859 | Line 1935 | service_name: NAME '=' QSTRING ';'
1935    }
1936   };
1937  
1938 +
1939   /***************************************************************************
1940 < *  section shared, for sharing remote klines etc.
1940 > * shared {} section, for sharing remote klines etc.
1941   ***************************************************************************/
1942   shared_entry: T_SHARED
1943   {
# Line 1880 | Line 1957 | shared_entry: T_SHARED
1957    if (conf_parser_ctx.pass != 2)
1958      break;
1959  
1960 <  conf = conf_make(CONF_ULINE);
1960 >  conf = conf_make(CONF_SHARED);
1961    conf->flags = block_state.flags.value;
1962    conf->name = xstrdup(block_state.name.buf);
1963    conf->user = xstrdup(block_state.user.buf);
# Line 1964 | Line 2041 | shared_type_item: KLINE
2041      block_state.flags.value = SHARED_ALL;
2042   };
2043  
2044 +
2045   /***************************************************************************
2046 < *  section cluster
2046 > * cluster {} section
2047   ***************************************************************************/
2048   cluster_entry: T_CLUSTER
2049   {
# Line 1988 | Line 2066 | cluster_entry: T_CLUSTER
2066    conf->name = xstrdup(block_state.name.buf);
2067   };
2068  
2069 < cluster_items:  cluster_items cluster_item | cluster_item;
2070 < cluster_item:   cluster_name | cluster_type | error ';' ;
2069 > cluster_items:  cluster_items cluster_item | cluster_item;
2070 > cluster_item:   cluster_name | cluster_type | error ';' ;
2071  
2072   cluster_name: NAME '=' QSTRING ';'
2073   {
# Line 2003 | Line 2081 | cluster_type: TYPE
2081      block_state.flags.value = 0;
2082   } '=' cluster_types ';' ;
2083  
2084 < cluster_types:  cluster_types ',' cluster_type_item | cluster_type_item;
2084 > cluster_types:  cluster_types ',' cluster_type_item | cluster_type_item;
2085   cluster_type_item: KLINE
2086   {
2087    if (conf_parser_ctx.pass == 2)
# Line 2046 | Line 2124 | cluster_type_item: KLINE
2124      block_state.flags.value = SHARED_ALL;
2125   };
2126  
2127 +
2128   /***************************************************************************
2129 < *  section connect
2129 > * connect {}  section
2130   ***************************************************************************/
2131   connect_entry: CONNECT
2132   {
# Line 2108 | Line 2187 | connect_entry: CONNECT
2187        ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", block_state.bind.buf);
2188      else
2189      {
2190 <      assert(res != NULL);
2190 >      assert(res);
2191  
2192        memcpy(&conf->bind, res->ai_addr, res->ai_addrlen);
2193        conf->bind.ss.ss_family = res->ai_family;
# Line 2122 | Line 2201 | connect_entry: CONNECT
2201   };
2202  
2203   connect_items:  connect_items connect_item | connect_item;
2204 < connect_item:   connect_name | connect_host | connect_vhost |
2205 <                connect_send_password | connect_accept_password |
2206 <                connect_ssl_certificate_fingerprint |
2207 <                connect_aftype | connect_port | connect_ssl_cipher_list |
2208 <                connect_flags | connect_hub_mask | connect_leaf_mask |
2209 <                connect_class | connect_encrypted |
2204 > connect_item:   connect_name |
2205 >                connect_host |
2206 >                connect_vhost |
2207 >                connect_send_password |
2208 >                connect_accept_password |
2209 >                connect_ssl_certificate_fingerprint |
2210 >                connect_aftype |
2211 >                connect_port |
2212 >                connect_ssl_cipher_list |
2213 >                connect_flags |
2214 >                connect_hub_mask |
2215 >                connect_leaf_mask |
2216 >                connect_class |
2217 >                connect_encrypted |
2218                  error ';' ;
2219  
2220   connect_name: NAME '=' QSTRING ';'
# Line 2155 | Line 2242 | connect_send_password: SEND_PASSWORD '='
2242  
2243    if ($3[0] == ':')
2244      conf_error_report("Server passwords cannot begin with a colon");
2245 <  else if (strchr($3, ' ') != NULL)
2245 >  else if (strchr($3, ' '))
2246      conf_error_report("Server passwords cannot contain spaces");
2247    else
2248      strlcpy(block_state.spass.buf, yylval.string, sizeof(block_state.spass.buf));
# Line 2168 | Line 2255 | connect_accept_password: ACCEPT_PASSWORD
2255  
2256    if ($3[0] == ':')
2257      conf_error_report("Server passwords cannot begin with a colon");
2258 <  else if (strchr($3, ' ') != NULL)
2258 >  else if (strchr($3, ' '))
2259      conf_error_report("Server passwords cannot contain spaces");
2260    else
2261      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
# Line 2192 | Line 2279 | connect_aftype: AFTYPE '=' T_IPV4 ';'
2279      block_state.aftype.value = AF_INET;
2280   } | AFTYPE '=' T_IPV6 ';'
2281   {
2195 #ifdef IPV6
2282    if (conf_parser_ctx.pass == 2)
2283      block_state.aftype.value = AF_INET6;
2198 #endif
2284   };
2285  
2286   connect_flags: IRCD_FLAGS
# Line 2256 | Line 2341 | connect_ssl_cipher_list: T_SSL_CIPHER_LI
2341  
2342  
2343   /***************************************************************************
2344 < *  section kill
2344 > * kill {} section
2345   ***************************************************************************/
2346   kill_entry: KILL
2347   {
# Line 2313 | Line 2398 | kill_reason: REASON '=' QSTRING ';'
2398      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2399   };
2400  
2401 +
2402   /***************************************************************************
2403 < *  section deny
2403 > * deny {} section
2404   ***************************************************************************/
2405   deny_entry: DENY
2406   {
# Line 2358 | Line 2444 | deny_reason: REASON '=' QSTRING ';'
2444      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2445   };
2446  
2447 +
2448   /***************************************************************************
2449 < *  section exempt
2449 > * exempt {} section
2450   ***************************************************************************/
2451   exempt_entry: EXEMPT '{' exempt_items '}' ';';
2452  
2453 < exempt_items:     exempt_items exempt_item | exempt_item;
2454 < exempt_item:      exempt_ip | error;
2453 > exempt_items: exempt_items exempt_item | exempt_item;
2454 > exempt_item:  exempt_ip | error;
2455  
2456   exempt_ip: IP '=' QSTRING ';'
2457   {
2458    if (conf_parser_ctx.pass == 2)
2459    {
2460 <    if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
2460 >    if (*yylval.string && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
2461      {
2462        struct MaskItem *conf = conf_make(CONF_EXEMPT);
2463        conf->host = xstrdup(yylval.string);
# Line 2381 | Line 2468 | exempt_ip: IP '=' QSTRING ';'
2468   };
2469  
2470   /***************************************************************************
2471 < *  section gecos
2471 > * gecos {} section
2472   ***************************************************************************/
2473   gecos_entry: GECOS
2474   {
# Line 2421 | Line 2508 | gecos_reason: REASON '=' QSTRING ';'
2508      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2509   };
2510  
2511 +
2512   /***************************************************************************
2513 < *  section general
2513 > * general {} section
2514   ***************************************************************************/
2515 < general_entry: GENERAL
2428 <  '{' general_items '}' ';';
2515 > general_entry: GENERAL '{' general_items '}' ';';
2516  
2517   general_items:      general_items general_item | general_item;
2518 < general_item:       general_hide_spoof_ips | general_ignore_bogus_ts |
2519 <                    general_failed_oper_notice | general_anti_nick_flood |
2520 <                    general_max_nick_time | general_max_nick_changes |
2521 <                    general_max_accept | general_anti_spam_exit_message_time |
2522 <                    general_ts_warn_delta | general_ts_max_delta |
2518 > general_item:       general_away_count |
2519 >                    general_away_time |
2520 >                    general_ignore_bogus_ts |
2521 >                    general_failed_oper_notice |
2522 >                    general_anti_nick_flood |
2523 >                    general_max_nick_time |
2524 >                    general_max_nick_changes |
2525 >                    general_max_accept |
2526 >                    general_anti_spam_exit_message_time |
2527 >                    general_ts_warn_delta |
2528 >                    general_ts_max_delta |
2529                      general_kill_chase_time_limit |
2530                      general_invisible_on_connect |
2531 <                    general_warn_no_nline | general_dots_in_ident |
2532 <                    general_stats_o_oper_only | general_stats_k_oper_only |
2533 <                    general_pace_wait | general_stats_i_oper_only |
2534 <                    general_pace_wait_simple | general_stats_P_oper_only |
2531 >                    general_warn_no_connect_block |
2532 >                    general_dots_in_ident |
2533 >                    general_stats_i_oper_only |
2534 >                    general_stats_k_oper_only |
2535 >                    general_stats_m_oper_only |
2536 >                    general_stats_o_oper_only |
2537 >                    general_stats_P_oper_only |
2538                      general_stats_u_oper_only |
2539 <                    general_short_motd | general_no_oper_flood |
2540 <                    general_true_no_oper_flood | general_oper_pass_resv |
2541 <                    general_oper_only_umodes | general_max_targets |
2542 <                    general_use_egd | general_egdpool_path |
2543 <                    general_oper_umodes | general_caller_id_wait |
2544 <                    general_opers_bypass_callerid | general_default_floodcount |
2545 <                    general_min_nonwildcard | general_min_nonwildcard_simple |
2546 <                    general_throttle_time | general_havent_read_conf |
2539 >                    general_pace_wait |
2540 >                    general_pace_wait_simple |
2541 >                    general_short_motd |
2542 >                    general_no_oper_flood |
2543 >                    general_oper_only_umodes |
2544 >                    general_max_targets |
2545 >                    general_oper_umodes |
2546 >                    general_caller_id_wait |
2547 >                    general_opers_bypass_callerid |
2548 >                    general_default_floodcount |
2549 >                    general_min_nonwildcard |
2550 >                    general_min_nonwildcard_simple |
2551 >                    general_throttle_count |
2552 >                    general_throttle_time |
2553                      general_ping_cookie |
2554                      general_disable_auth |
2555 <                    general_tkline_expire_notices | general_gline_enable |
2556 <                    general_gline_duration | general_gline_request_duration |
2557 <                    general_gline_min_cidr |
2558 <                    general_gline_min_cidr6 |
2559 <                    general_stats_e_disabled |
2560 <                    general_max_watch | general_services_name |
2561 <                    general_cycle_on_host_change |
2562 <                    error;
2555 >                    general_tkline_expire_notices |
2556 >                    general_dline_min_cidr |
2557 >                    general_dline_min_cidr6 |
2558 >                    general_kline_min_cidr |
2559 >                    general_kline_min_cidr6 |
2560 >                    general_stats_e_disabled |
2561 >                    general_max_watch |
2562 >                    general_cycle_on_host_change |
2563 >                    error;
2564  
2565  
2566 < general_max_watch: MAX_WATCH '=' NUMBER ';'
2566 > general_away_count: AWAY_COUNT '=' NUMBER ';'
2567   {
2568 <  ConfigFileEntry.max_watch = $3;
2568 >  ConfigGeneral.away_count = $3;
2569   };
2570  
2571 < general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';'
2571 > general_away_time: AWAY_TIME '=' timespec ';'
2572   {
2573 <  if (conf_parser_ctx.pass == 2)
2471 <    ConfigFileEntry.cycle_on_host_change = yylval.number;
2573 >  ConfigGeneral.away_time = $3;
2574   };
2575  
2576 < general_gline_enable: GLINE_ENABLE '=' TBOOL ';'
2576 > general_max_watch: MAX_WATCH '=' NUMBER ';'
2577   {
2578 <  if (conf_parser_ctx.pass == 2)
2477 <    ConfigFileEntry.glines = yylval.number;
2578 >  ConfigGeneral.max_watch = $3;
2579   };
2580  
2581 < general_gline_duration: GLINE_DURATION '=' timespec ';'
2581 > general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';'
2582   {
2583    if (conf_parser_ctx.pass == 2)
2584 <    ConfigFileEntry.gline_time = $3;
2584 >    ConfigGeneral.cycle_on_host_change = yylval.number;
2585   };
2586  
2587 < general_gline_request_duration: GLINE_REQUEST_DURATION '=' timespec ';'
2587 > general_dline_min_cidr: DLINE_MIN_CIDR '=' NUMBER ';'
2588   {
2589 <  if (conf_parser_ctx.pass == 2)
2489 <    ConfigFileEntry.gline_request_time = $3;
2589 >  ConfigGeneral.dline_min_cidr = $3;
2590   };
2591  
2592 < general_gline_min_cidr: GLINE_MIN_CIDR '=' NUMBER ';'
2592 > general_dline_min_cidr6: DLINE_MIN_CIDR6 '=' NUMBER ';'
2593   {
2594 <  ConfigFileEntry.gline_min_cidr = $3;
2594 >  ConfigGeneral.dline_min_cidr6 = $3;
2595   };
2596  
2597 < general_gline_min_cidr6: GLINE_MIN_CIDR6 '=' NUMBER ';'
2597 > general_kline_min_cidr: KLINE_MIN_CIDR '=' NUMBER ';'
2598   {
2599 <  ConfigFileEntry.gline_min_cidr6 = $3;
2599 >  ConfigGeneral.kline_min_cidr = $3;
2600   };
2601  
2602 < general_tkline_expire_notices: TKLINE_EXPIRE_NOTICES '=' TBOOL ';'
2602 > general_kline_min_cidr6: KLINE_MIN_CIDR6 '=' NUMBER ';'
2603   {
2604 <  ConfigFileEntry.tkline_expire_notices = yylval.number;
2604 >  ConfigGeneral.kline_min_cidr6 = $3;
2605   };
2606  
2607 < general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';'
2607 > general_tkline_expire_notices: TKLINE_EXPIRE_NOTICES '=' TBOOL ';'
2608   {
2609 <  ConfigFileEntry.kill_chase_time_limit = $3;
2609 >  ConfigGeneral.tkline_expire_notices = yylval.number;
2610   };
2611  
2612 < general_hide_spoof_ips: HIDE_SPOOF_IPS '=' TBOOL ';'
2612 > general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';'
2613   {
2614 <  ConfigFileEntry.hide_spoof_ips = yylval.number;
2614 >  ConfigGeneral.kill_chase_time_limit = $3;
2615   };
2616  
2617   general_ignore_bogus_ts: IGNORE_BOGUS_TS '=' TBOOL ';'
2618   {
2619 <  ConfigFileEntry.ignore_bogus_ts = yylval.number;
2619 >  ConfigGeneral.ignore_bogus_ts = yylval.number;
2620   };
2621  
2622   general_failed_oper_notice: FAILED_OPER_NOTICE '=' TBOOL ';'
2623   {
2624 <  ConfigFileEntry.failed_oper_notice = yylval.number;
2624 >  ConfigGeneral.failed_oper_notice = yylval.number;
2625   };
2626  
2627   general_anti_nick_flood: ANTI_NICK_FLOOD '=' TBOOL ';'
2628   {
2629 <  ConfigFileEntry.anti_nick_flood = yylval.number;
2629 >  ConfigGeneral.anti_nick_flood = yylval.number;
2630   };
2631  
2632   general_max_nick_time: MAX_NICK_TIME '=' timespec ';'
2633   {
2634 <  ConfigFileEntry.max_nick_time = $3;
2634 >  ConfigGeneral.max_nick_time = $3;
2635   };
2636  
2637   general_max_nick_changes: MAX_NICK_CHANGES '=' NUMBER ';'
2638   {
2639 <  ConfigFileEntry.max_nick_changes = $3;
2639 >  ConfigGeneral.max_nick_changes = $3;
2640   };
2641  
2642   general_max_accept: MAX_ACCEPT '=' NUMBER ';'
2643   {
2644 <  ConfigFileEntry.max_accept = $3;
2644 >  ConfigGeneral.max_accept = $3;
2645   };
2646  
2647   general_anti_spam_exit_message_time: ANTI_SPAM_EXIT_MESSAGE_TIME '=' timespec ';'
2648   {
2649 <  ConfigFileEntry.anti_spam_exit_message_time = $3;
2649 >  ConfigGeneral.anti_spam_exit_message_time = $3;
2650   };
2651  
2652   general_ts_warn_delta: TS_WARN_DELTA '=' timespec ';'
2653   {
2654 <  ConfigFileEntry.ts_warn_delta = $3;
2654 >  ConfigGeneral.ts_warn_delta = $3;
2655   };
2656  
2657   general_ts_max_delta: TS_MAX_DELTA '=' timespec ';'
2658   {
2659    if (conf_parser_ctx.pass == 2)
2660 <    ConfigFileEntry.ts_max_delta = $3;
2660 >    ConfigGeneral.ts_max_delta = $3;
2661   };
2662  
2663 < general_havent_read_conf: HAVENT_READ_CONF '=' NUMBER ';'
2663 > general_invisible_on_connect: INVISIBLE_ON_CONNECT '=' TBOOL ';'
2664   {
2665 <  if (($3 > 0) && conf_parser_ctx.pass == 1)
2566 <  {
2567 <    ilog(LOG_TYPE_IRCD, "You haven't read your config file properly.");
2568 <    ilog(LOG_TYPE_IRCD, "There is a line in the example conf that will kill your server if not removed.");
2569 <    ilog(LOG_TYPE_IRCD, "Consider actually reading/editing the conf file, and removing this line.");
2570 <    exit(0);
2571 <  }
2665 >  ConfigGeneral.invisible_on_connect = yylval.number;
2666   };
2667  
2668 < general_invisible_on_connect: INVISIBLE_ON_CONNECT '=' TBOOL ';'
2668 > general_warn_no_connect_block: WARN_NO_CONNECT_BLOCK '=' TBOOL ';'
2669   {
2670 <  ConfigFileEntry.invisible_on_connect = yylval.number;
2670 >  ConfigGeneral.warn_no_connect_block = yylval.number;
2671   };
2672  
2673 < general_warn_no_nline: WARN_NO_NLINE '=' TBOOL ';'
2673 > general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';'
2674   {
2675 <  ConfigFileEntry.warn_no_nline = yylval.number;
2675 >  ConfigGeneral.stats_e_disabled = yylval.number;
2676   };
2677  
2678 < general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';'
2678 > general_stats_m_oper_only: STATS_M_OPER_ONLY '=' TBOOL ';'
2679   {
2680 <  ConfigFileEntry.stats_e_disabled = yylval.number;
2680 >  ConfigGeneral.stats_m_oper_only = yylval.number;
2681   };
2682  
2683   general_stats_o_oper_only: STATS_O_OPER_ONLY '=' TBOOL ';'
2684   {
2685 <  ConfigFileEntry.stats_o_oper_only = yylval.number;
2685 >  ConfigGeneral.stats_o_oper_only = yylval.number;
2686   };
2687  
2688   general_stats_P_oper_only: STATS_P_OPER_ONLY '=' TBOOL ';'
2689   {
2690 <  ConfigFileEntry.stats_P_oper_only = yylval.number;
2690 >  ConfigGeneral.stats_P_oper_only = yylval.number;
2691   };
2692  
2693   general_stats_u_oper_only: STATS_U_OPER_ONLY '=' TBOOL ';'
2694   {
2695 <  ConfigFileEntry.stats_u_oper_only = yylval.number;
2695 >  ConfigGeneral.stats_u_oper_only = yylval.number;
2696   };
2697  
2698   general_stats_k_oper_only: STATS_K_OPER_ONLY '=' TBOOL ';'
2699   {
2700 <  ConfigFileEntry.stats_k_oper_only = 2 * yylval.number;
2700 >  ConfigGeneral.stats_k_oper_only = 2 * yylval.number;
2701   } | STATS_K_OPER_ONLY '=' TMASKED ';'
2702   {
2703 <  ConfigFileEntry.stats_k_oper_only = 1;
2703 >  ConfigGeneral.stats_k_oper_only = 1;
2704   };
2705  
2706   general_stats_i_oper_only: STATS_I_OPER_ONLY '=' TBOOL ';'
2707   {
2708 <  ConfigFileEntry.stats_i_oper_only = 2 * yylval.number;
2708 >  ConfigGeneral.stats_i_oper_only = 2 * yylval.number;
2709   } | STATS_I_OPER_ONLY '=' TMASKED ';'
2710   {
2711 <  ConfigFileEntry.stats_i_oper_only = 1;
2711 >  ConfigGeneral.stats_i_oper_only = 1;
2712   };
2713  
2714   general_pace_wait: PACE_WAIT '=' timespec ';'
2715   {
2716 <  ConfigFileEntry.pace_wait = $3;
2716 >  ConfigGeneral.pace_wait = $3;
2717   };
2718  
2719   general_caller_id_wait: CALLER_ID_WAIT '=' timespec ';'
2720   {
2721 <  ConfigFileEntry.caller_id_wait = $3;
2721 >  ConfigGeneral.caller_id_wait = $3;
2722   };
2723  
2724   general_opers_bypass_callerid: OPERS_BYPASS_CALLERID '=' TBOOL ';'
2725   {
2726 <  ConfigFileEntry.opers_bypass_callerid = yylval.number;
2726 >  ConfigGeneral.opers_bypass_callerid = yylval.number;
2727   };
2728  
2729   general_pace_wait_simple: PACE_WAIT_SIMPLE '=' timespec ';'
2730   {
2731 <  ConfigFileEntry.pace_wait_simple = $3;
2731 >  ConfigGeneral.pace_wait_simple = $3;
2732   };
2733  
2734   general_short_motd: SHORT_MOTD '=' TBOOL ';'
2735   {
2736 <  ConfigFileEntry.short_motd = yylval.number;
2736 >  ConfigGeneral.short_motd = yylval.number;
2737   };
2738  
2739   general_no_oper_flood: NO_OPER_FLOOD '=' TBOOL ';'
2740   {
2741 <  ConfigFileEntry.no_oper_flood = yylval.number;
2648 < };
2649 <
2650 < general_true_no_oper_flood: TRUE_NO_OPER_FLOOD '=' TBOOL ';'
2651 < {
2652 <  ConfigFileEntry.true_no_oper_flood = yylval.number;
2653 < };
2654 <
2655 < general_oper_pass_resv: OPER_PASS_RESV '=' TBOOL ';'
2656 < {
2657 <  ConfigFileEntry.oper_pass_resv = yylval.number;
2741 >  ConfigGeneral.no_oper_flood = yylval.number;
2742   };
2743  
2744   general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';'
2745   {
2746 <  ConfigFileEntry.dots_in_ident = $3;
2746 >  ConfigGeneral.dots_in_ident = $3;
2747   };
2748  
2749   general_max_targets: MAX_TARGETS '=' NUMBER ';'
2750   {
2751 <  ConfigFileEntry.max_targets = $3;
2668 < };
2669 <
2670 < general_use_egd: USE_EGD '=' TBOOL ';'
2671 < {
2672 <  ConfigFileEntry.use_egd = yylval.number;
2673 < };
2674 <
2675 < general_egdpool_path: EGDPOOL_PATH '=' QSTRING ';'
2676 < {
2677 <  if (conf_parser_ctx.pass == 2)
2678 <  {
2679 <    MyFree(ConfigFileEntry.egdpool_path);
2680 <    ConfigFileEntry.egdpool_path = xstrdup(yylval.string);
2681 <  }
2751 >  ConfigGeneral.max_targets = $3;
2752   };
2753  
2754 < general_services_name: T_SERVICES_NAME '=' QSTRING ';'
2754 > general_ping_cookie: PING_COOKIE '=' TBOOL ';'
2755   {
2756 <  if (conf_parser_ctx.pass == 2 && valid_servname(yylval.string))
2687 <  {
2688 <    MyFree(ConfigFileEntry.service_name);
2689 <    ConfigFileEntry.service_name = xstrdup(yylval.string);
2690 <  }
2756 >  ConfigGeneral.ping_cookie = yylval.number;
2757   };
2758  
2759 < general_ping_cookie: PING_COOKIE '=' TBOOL ';'
2759 > general_disable_auth: DISABLE_AUTH '=' TBOOL ';'
2760   {
2761 <  ConfigFileEntry.ping_cookie = yylval.number;
2761 >  ConfigGeneral.disable_auth = yylval.number;
2762   };
2763  
2764 < general_disable_auth: DISABLE_AUTH '=' TBOOL ';'
2764 > general_throttle_count: THROTTLE_COUNT '=' NUMBER ';'
2765   {
2766 <  ConfigFileEntry.disable_auth = yylval.number;
2766 >  ConfigGeneral.throttle_count = $3;
2767   };
2768  
2769   general_throttle_time: THROTTLE_TIME '=' timespec ';'
2770   {
2771 <  ConfigFileEntry.throttle_time = $3;
2771 >  ConfigGeneral.throttle_time = $3;
2772   };
2773  
2774   general_oper_umodes: OPER_UMODES
2775   {
2776 <  ConfigFileEntry.oper_umodes = 0;
2776 >  ConfigGeneral.oper_umodes = 0;
2777   } '='  umode_oitems ';' ;
2778  
2779   umode_oitems:    umode_oitems ',' umode_oitem | umode_oitem;
2780   umode_oitem:     T_BOTS
2781   {
2782 <  ConfigFileEntry.oper_umodes |= UMODE_BOTS;
2782 >  ConfigGeneral.oper_umodes |= UMODE_BOTS;
2783   } | T_CCONN
2784   {
2785 <  ConfigFileEntry.oper_umodes |= UMODE_CCONN;
2785 >  ConfigGeneral.oper_umodes |= UMODE_CCONN;
2786   } | T_DEAF
2787   {
2788 <  ConfigFileEntry.oper_umodes |= UMODE_DEAF;
2788 >  ConfigGeneral.oper_umodes |= UMODE_DEAF;
2789   } | T_DEBUG
2790   {
2791 <  ConfigFileEntry.oper_umodes |= UMODE_DEBUG;
2791 >  ConfigGeneral.oper_umodes |= UMODE_DEBUG;
2792   } | T_FULL
2793   {
2794 <  ConfigFileEntry.oper_umodes |= UMODE_FULL;
2794 >  ConfigGeneral.oper_umodes |= UMODE_FULL;
2795   } | HIDDEN
2796   {
2797 <  ConfigFileEntry.oper_umodes |= UMODE_HIDDEN;
2797 >  ConfigGeneral.oper_umodes |= UMODE_HIDDEN;
2798 > } | HIDE_CHANS
2799 > {
2800 >  ConfigGeneral.oper_umodes |= UMODE_HIDECHANS;
2801 > } | HIDE_IDLE
2802 > {
2803 >  ConfigGeneral.oper_umodes |= UMODE_HIDEIDLE;
2804   } | T_SKILL
2805   {
2806 <  ConfigFileEntry.oper_umodes |= UMODE_SKILL;
2806 >  ConfigGeneral.oper_umodes |= UMODE_SKILL;
2807   } | T_NCHANGE
2808   {
2809 <  ConfigFileEntry.oper_umodes |= UMODE_NCHANGE;
2809 >  ConfigGeneral.oper_umodes |= UMODE_NCHANGE;
2810   } | T_REJ
2811   {
2812 <  ConfigFileEntry.oper_umodes |= UMODE_REJ;
2812 >  ConfigGeneral.oper_umodes |= UMODE_REJ;
2813   } | T_UNAUTH
2814   {
2815 <  ConfigFileEntry.oper_umodes |= UMODE_UNAUTH;
2815 >  ConfigGeneral.oper_umodes |= UMODE_UNAUTH;
2816   } | T_SPY
2817   {
2818 <  ConfigFileEntry.oper_umodes |= UMODE_SPY;
2818 >  ConfigGeneral.oper_umodes |= UMODE_SPY;
2819   } | T_EXTERNAL
2820   {
2821 <  ConfigFileEntry.oper_umodes |= UMODE_EXTERNAL;
2750 < } | T_OPERWALL
2751 < {
2752 <  ConfigFileEntry.oper_umodes |= UMODE_OPERWALL;
2821 >  ConfigGeneral.oper_umodes |= UMODE_EXTERNAL;
2822   } | T_SERVNOTICE
2823   {
2824 <  ConfigFileEntry.oper_umodes |= UMODE_SERVNOTICE;
2824 >  ConfigGeneral.oper_umodes |= UMODE_SERVNOTICE;
2825   } | T_INVISIBLE
2826   {
2827 <  ConfigFileEntry.oper_umodes |= UMODE_INVISIBLE;
2827 >  ConfigGeneral.oper_umodes |= UMODE_INVISIBLE;
2828   } | T_WALLOP
2829   {
2830 <  ConfigFileEntry.oper_umodes |= UMODE_WALLOP;
2830 >  ConfigGeneral.oper_umodes |= UMODE_WALLOP;
2831   } | T_SOFTCALLERID
2832   {
2833 <  ConfigFileEntry.oper_umodes |= UMODE_SOFTCALLERID;
2833 >  ConfigGeneral.oper_umodes |= UMODE_SOFTCALLERID;
2834   } | T_CALLERID
2835   {
2836 <  ConfigFileEntry.oper_umodes |= UMODE_CALLERID;
2836 >  ConfigGeneral.oper_umodes |= UMODE_CALLERID;
2837   } | T_LOCOPS
2838   {
2839 <  ConfigFileEntry.oper_umodes |= UMODE_LOCOPS;
2839 >  ConfigGeneral.oper_umodes |= UMODE_LOCOPS;
2840   } | T_NONONREG
2841   {
2842 <  ConfigFileEntry.oper_umodes |= UMODE_REGONLY;
2842 >  ConfigGeneral.oper_umodes |= UMODE_REGONLY;
2843   } | T_FARCONNECT
2844   {
2845 <  ConfigFileEntry.oper_umodes |= UMODE_FARCONNECT;
2845 >  ConfigGeneral.oper_umodes |= UMODE_FARCONNECT;
2846   };
2847  
2848   general_oper_only_umodes: OPER_ONLY_UMODES
2849   {
2850 <  ConfigFileEntry.oper_only_umodes = 0;
2850 >  ConfigGeneral.oper_only_umodes = 0;
2851   } '='  umode_items ';' ;
2852  
2853 < umode_items:    umode_items ',' umode_item | umode_item;
2854 < umode_item:     T_BOTS
2853 > umode_items:  umode_items ',' umode_item | umode_item;
2854 > umode_item:   T_BOTS
2855   {
2856 <  ConfigFileEntry.oper_only_umodes |= UMODE_BOTS;
2856 >  ConfigGeneral.oper_only_umodes |= UMODE_BOTS;
2857   } | T_CCONN
2858   {
2859 <  ConfigFileEntry.oper_only_umodes |= UMODE_CCONN;
2859 >  ConfigGeneral.oper_only_umodes |= UMODE_CCONN;
2860   } | T_DEAF
2861   {
2862 <  ConfigFileEntry.oper_only_umodes |= UMODE_DEAF;
2862 >  ConfigGeneral.oper_only_umodes |= UMODE_DEAF;
2863   } | T_DEBUG
2864   {
2865 <  ConfigFileEntry.oper_only_umodes |= UMODE_DEBUG;
2865 >  ConfigGeneral.oper_only_umodes |= UMODE_DEBUG;
2866   } | T_FULL
2867   {
2868 <  ConfigFileEntry.oper_only_umodes |= UMODE_FULL;
2868 >  ConfigGeneral.oper_only_umodes |= UMODE_FULL;
2869   } | T_SKILL
2870   {
2871 <  ConfigFileEntry.oper_only_umodes |= UMODE_SKILL;
2871 >  ConfigGeneral.oper_only_umodes |= UMODE_SKILL;
2872   } | HIDDEN
2873   {
2874 <  ConfigFileEntry.oper_only_umodes |= UMODE_HIDDEN;
2874 >  ConfigGeneral.oper_only_umodes |= UMODE_HIDDEN;
2875   } | T_NCHANGE
2876   {
2877 <  ConfigFileEntry.oper_only_umodes |= UMODE_NCHANGE;
2877 >  ConfigGeneral.oper_only_umodes |= UMODE_NCHANGE;
2878   } | T_REJ
2879   {
2880 <  ConfigFileEntry.oper_only_umodes |= UMODE_REJ;
2880 >  ConfigGeneral.oper_only_umodes |= UMODE_REJ;
2881   } | T_UNAUTH
2882   {
2883 <  ConfigFileEntry.oper_only_umodes |= UMODE_UNAUTH;
2883 >  ConfigGeneral.oper_only_umodes |= UMODE_UNAUTH;
2884   } | T_SPY
2885   {
2886 <  ConfigFileEntry.oper_only_umodes |= UMODE_SPY;
2886 >  ConfigGeneral.oper_only_umodes |= UMODE_SPY;
2887   } | T_EXTERNAL
2888   {
2889 <  ConfigFileEntry.oper_only_umodes |= UMODE_EXTERNAL;
2821 < } | T_OPERWALL
2822 < {
2823 <  ConfigFileEntry.oper_only_umodes |= UMODE_OPERWALL;
2889 >  ConfigGeneral.oper_only_umodes |= UMODE_EXTERNAL;
2890   } | T_SERVNOTICE
2891   {
2892 <  ConfigFileEntry.oper_only_umodes |= UMODE_SERVNOTICE;
2892 >  ConfigGeneral.oper_only_umodes |= UMODE_SERVNOTICE;
2893   } | T_INVISIBLE
2894   {
2895 <  ConfigFileEntry.oper_only_umodes |= UMODE_INVISIBLE;
2895 >  ConfigGeneral.oper_only_umodes |= UMODE_INVISIBLE;
2896   } | T_WALLOP
2897   {
2898 <  ConfigFileEntry.oper_only_umodes |= UMODE_WALLOP;
2898 >  ConfigGeneral.oper_only_umodes |= UMODE_WALLOP;
2899   } | T_SOFTCALLERID
2900   {
2901 <  ConfigFileEntry.oper_only_umodes |= UMODE_SOFTCALLERID;
2901 >  ConfigGeneral.oper_only_umodes |= UMODE_SOFTCALLERID;
2902   } | T_CALLERID
2903   {
2904 <  ConfigFileEntry.oper_only_umodes |= UMODE_CALLERID;
2904 >  ConfigGeneral.oper_only_umodes |= UMODE_CALLERID;
2905   } | T_LOCOPS
2906   {
2907 <  ConfigFileEntry.oper_only_umodes |= UMODE_LOCOPS;
2907 >  ConfigGeneral.oper_only_umodes |= UMODE_LOCOPS;
2908   } | T_NONONREG
2909   {
2910 <  ConfigFileEntry.oper_only_umodes |= UMODE_REGONLY;
2910 >  ConfigGeneral.oper_only_umodes |= UMODE_REGONLY;
2911   } | T_FARCONNECT
2912   {
2913 <  ConfigFileEntry.oper_only_umodes |= UMODE_FARCONNECT;
2913 >  ConfigGeneral.oper_only_umodes |= UMODE_FARCONNECT;
2914   };
2915  
2916   general_min_nonwildcard: MIN_NONWILDCARD '=' NUMBER ';'
2917   {
2918 <  ConfigFileEntry.min_nonwildcard = $3;
2918 >  ConfigGeneral.min_nonwildcard = $3;
2919   };
2920  
2921   general_min_nonwildcard_simple: MIN_NONWILDCARD_SIMPLE '=' NUMBER ';'
2922   {
2923 <  ConfigFileEntry.min_nonwildcard_simple = $3;
2923 >  ConfigGeneral.min_nonwildcard_simple = $3;
2924   };
2925  
2926   general_default_floodcount: DEFAULT_FLOODCOUNT '=' NUMBER ';'
2927   {
2928 <  ConfigFileEntry.default_floodcount = $3;
2928 >  ConfigGeneral.default_floodcount = $3;
2929   };
2930  
2931  
2932   /***************************************************************************
2933 < *  section channel
2933 > * channel {} section
2934   ***************************************************************************/
2935 < channel_entry: CHANNEL
2870 <  '{' channel_items '}' ';';
2935 > channel_entry: CHANNEL '{' channel_items '}' ';';
2936  
2937   channel_items:      channel_items channel_item | channel_item;
2938   channel_item:       channel_max_bans |
2939 <                    channel_knock_delay | channel_knock_delay_channel |
2940 <                    channel_max_chans_per_user | channel_max_chans_per_oper |
2941 <                    channel_default_split_user_count |
2942 <                    channel_default_split_server_count |
2943 <                    channel_no_create_on_split |
2944 <                    channel_no_join_on_split |
2945 <                    channel_jflood_count | channel_jflood_time |
2946 <                    channel_disable_fake_channels | error;
2939 >                    channel_invite_client_count |
2940 >                    channel_invite_client_time |
2941 >                    channel_knock_client_count |
2942 >                    channel_knock_client_time |
2943 >                    channel_knock_delay_channel |
2944 >                    channel_max_channels |
2945 >                    channel_default_join_flood_count |
2946 >                    channel_default_join_flood_time |
2947 >                    channel_disable_fake_channels |
2948 >                    error;
2949  
2950   channel_disable_fake_channels: DISABLE_FAKE_CHANNELS '=' TBOOL ';'
2951   {
2952    ConfigChannel.disable_fake_channels = yylval.number;
2953   };
2954  
2955 < channel_knock_delay: KNOCK_DELAY '=' timespec ';'
2889 < {
2890 <  ConfigChannel.knock_delay = $3;
2891 < };
2892 <
2893 < channel_knock_delay_channel: KNOCK_DELAY_CHANNEL '=' timespec ';'
2955 > channel_invite_client_count: INVITE_CLIENT_COUNT '=' NUMBER ';'
2956   {
2957 <  ConfigChannel.knock_delay_channel = $3;
2957 >  ConfigChannel.invite_client_count = $3;
2958   };
2959  
2960 < channel_max_chans_per_user: MAX_CHANS_PER_USER '=' NUMBER ';'
2960 > channel_invite_client_time: INVITE_CLIENT_TIME '=' timespec ';'
2961   {
2962 <  ConfigChannel.max_chans_per_user = $3;
2962 >  ConfigChannel.invite_client_time = $3;
2963   };
2964  
2965 < channel_max_chans_per_oper: MAX_CHANS_PER_OPER '=' NUMBER ';'
2965 > channel_knock_client_count: KNOCK_CLIENT_COUNT '=' NUMBER ';'
2966   {
2967 <  ConfigChannel.max_chans_per_oper = $3;
2967 >  ConfigChannel.knock_client_count = $3;
2968   };
2969  
2970 < channel_max_bans: MAX_BANS '=' NUMBER ';'
2970 > channel_knock_client_time: KNOCK_CLIENT_TIME '=' timespec ';'
2971   {
2972 <  ConfigChannel.max_bans = $3;
2972 >  ConfigChannel.knock_client_time = $3;
2973   };
2974  
2975 < channel_default_split_user_count: DEFAULT_SPLIT_USER_COUNT '=' NUMBER ';'
2975 > channel_knock_delay_channel: KNOCK_DELAY_CHANNEL '=' timespec ';'
2976   {
2977 <  ConfigChannel.default_split_user_count = $3;
2977 >  ConfigChannel.knock_delay_channel = $3;
2978   };
2979  
2980 < channel_default_split_server_count: DEFAULT_SPLIT_SERVER_COUNT '=' NUMBER ';'
2980 > channel_max_channels: MAX_CHANNELS '=' NUMBER ';'
2981   {
2982 <  ConfigChannel.default_split_server_count = $3;
2982 >  ConfigChannel.max_channels = $3;
2983   };
2984  
2985 < channel_no_create_on_split: NO_CREATE_ON_SPLIT '=' TBOOL ';'
2985 > channel_max_bans: MAX_BANS '=' NUMBER ';'
2986   {
2987 <  ConfigChannel.no_create_on_split = yylval.number;
2987 >  ConfigChannel.max_bans = $3;
2988   };
2989  
2990 < channel_no_join_on_split: NO_JOIN_ON_SPLIT '=' TBOOL ';'
2990 > channel_default_join_flood_count: DEFAULT_JOIN_FLOOD_COUNT '=' NUMBER ';'
2991   {
2992 <  ConfigChannel.no_join_on_split = yylval.number;
2992 >  ConfigChannel.default_join_flood_count = yylval.number;
2993   };
2994  
2995 < channel_jflood_count: JOIN_FLOOD_COUNT '=' NUMBER ';'
2995 > channel_default_join_flood_time: DEFAULT_JOIN_FLOOD_TIME '=' timespec ';'
2996   {
2997 <  GlobalSetOptions.joinfloodcount = yylval.number;
2997 >  ConfigChannel.default_join_flood_time = $3;
2998   };
2999  
2938 channel_jflood_time: JOIN_FLOOD_TIME '=' timespec ';'
2939 {
2940  GlobalSetOptions.joinfloodtime = $3;
2941 };
3000  
3001   /***************************************************************************
3002 < *  section serverhide
3002 > * serverhide {} section
3003   ***************************************************************************/
3004 < serverhide_entry: SERVERHIDE
2947 <  '{' serverhide_items '}' ';';
3004 > serverhide_entry: SERVERHIDE '{' serverhide_items '}' ';';
3005  
3006   serverhide_items:   serverhide_items serverhide_item | serverhide_item;
3007 < serverhide_item:    serverhide_flatten_links | serverhide_disable_remote_commands |
3007 > serverhide_item:    serverhide_flatten_links |
3008 >                    serverhide_flatten_links_delay |
3009 >                    serverhide_flatten_links_file |
3010 >                    serverhide_disable_remote_commands |
3011                      serverhide_hide_servers |
3012 <                    serverhide_hide_services |
3013 <                    serverhide_links_delay |
3014 <                    serverhide_hidden | serverhide_hidden_name |
3015 <                    serverhide_hide_server_ips |
3012 >                    serverhide_hide_services |
3013 >                    serverhide_hidden |
3014 >                    serverhide_hidden_name |
3015 >                    serverhide_hide_server_ips |
3016                      error;
3017  
3018   serverhide_flatten_links: FLATTEN_LINKS '=' TBOOL ';'
# Line 2961 | Line 3021 | serverhide_flatten_links: FLATTEN_LINKS
3021      ConfigServerHide.flatten_links = yylval.number;
3022   };
3023  
3024 + serverhide_flatten_links_delay: FLATTEN_LINKS_DELAY '=' timespec ';'
3025 + {
3026 +  if (conf_parser_ctx.pass == 2)
3027 +  {
3028 +    if ($3 > 0)
3029 +    {
3030 +      event_write_links_file.when = $3;
3031 +      event_add(&event_write_links_file, NULL);
3032 +    }
3033 +    else
3034 +     event_delete(&event_write_links_file);
3035 +
3036 +    ConfigServerHide.flatten_links_delay = $3;
3037 +  }
3038 + };
3039 +
3040 + serverhide_flatten_links_file: FLATTEN_LINKS_FILE '=' QSTRING ';'
3041 + {
3042 +  if (conf_parser_ctx.pass == 2)
3043 +  {
3044 +    MyFree(ConfigServerHide.flatten_links_file);
3045 +    ConfigServerHide.flatten_links_file = xstrdup(yylval.string);
3046 +  }
3047 + };
3048 +
3049   serverhide_disable_remote_commands: DISABLE_REMOTE_COMMANDS '=' TBOOL ';'
3050   {
3051    if (conf_parser_ctx.pass == 2)
# Line 2988 | Line 3073 | serverhide_hidden_name: HIDDEN_NAME '='
3073    }
3074   };
3075  
2991 serverhide_links_delay: LINKS_DELAY '=' timespec ';'
2992 {
2993  if (conf_parser_ctx.pass == 2)
2994  {
2995    if (($3 > 0) && ConfigServerHide.links_disabled == 1)
2996    {
2997      eventAddIsh("write_links_file", write_links_file, NULL, $3);
2998      ConfigServerHide.links_disabled = 0;
2999    }
3000
3001    ConfigServerHide.links_delay = $3;
3002  }
3003 };
3004
3076   serverhide_hidden: HIDDEN '=' TBOOL ';'
3077   {
3078    if (conf_parser_ctx.pass == 2)

Diff Legend

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