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 2336 by michael, Wed Jul 3 12:58:28 2013 UTC vs.
Revision 8046 by michael, Sat Mar 18 18:07:45 2017 UTC

# Line 1 | Line 1
1   /*
2 < *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3 < *  conf_parser.y: Parses the ircd configuration file.
2 > *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3   *
4 < *  Copyright (C) 2005 by the past and present ircd coders, and others.
4 > *  Copyright (c) 2000-2017 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 16 | 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
21 *
22 *  $Id$
20   */
21  
22 < %{
22 > /*! \file conf_parser.y
23 > * \brief Parses the ircd configuration file.
24 > * \version $Id$
25 > */
26  
27 < #define YY_NO_UNPUT
28 < #include <sys/types.h>
29 < #include <string.h>
27 >
28 > %{
29  
30   #include "config.h"
31   #include "stdinc.h"
# Line 34 | Line 33
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"
39 #include "client.h"     /* for UMODE_ALL only */
45   #include "irc_string.h"
46   #include "memory.h"
47   #include "modules.h"
48 < #include "s_serv.h"
48 > #include "server.h"
49   #include "hostmask.h"
45 #include "send.h"
50   #include "listener.h"
51 < #include "resv.h"
48 < #include "numeric.h"
49 < #include "s_user.h"
51 > #include "user.h"
52   #include "motd.h"
53  
52 #ifdef HAVE_LIBCRYPTO
53 #include <openssl/rsa.h>
54 #include <openssl/bio.h>
55 #include <openssl/pem.h>
56 #include <openssl/dh.h>
57 #endif
58
59 #include "rsa.h"
60
54   int yylex(void);
55  
56   static struct
57   {
58 <  struct {
58 >  struct
59 >  {
60      dlink_list list;
61    } mask,
62      leaf,
63      hub;
64  
65 <  struct {
65 >  struct
66 >  {
67      char buf[IRCD_BUFSIZE];
68    } name,
69 +    nick,
70      user,
71      host,
72      addr,
# Line 80 | 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 {
85 >  struct
86 >  {
87      unsigned int value;
88    } flags,
89      modes,
# Line 98 | Line 99 | static struct
99      max_total,
100      max_global,
101      max_local,
101    max_ident,
102      max_sendq,
103      max_recvq,
104 +    max_channels,
105      cidr_bitlen_ipv4,
106      cidr_bitlen_ipv6,
107      number_per_cidr;
# Line 109 | 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 148 | 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_FLOODTIME
168 > %token  DEFAULT_JOIN_FLOOD_COUNT
169 > %token  DEFAULT_JOIN_FLOOD_TIME
170 > %token  DEFAULT_MAX_CLIENTS
171   %token  DENY
172   %token  DESCRIPTION
173   %token  DIE
174   %token  DISABLE_AUTH
175   %token  DISABLE_FAKE_CHANNELS
176   %token  DISABLE_REMOTE_COMMANDS
177 + %token  DLINE_MIN_CIDR
178 + %token  DLINE_MIN_CIDR6
179   %token  DOTS_IN_IDENT
171 %token  EGDPOOL_PATH
180   %token  EMAIL
181   %token  ENCRYPTED
182   %token  EXCEED_LIMIT
183   %token  EXEMPT
184   %token  FAILED_OPER_NOTICE
185   %token  FLATTEN_LINKS
186 + %token  FLATTEN_LINKS_DELAY
187 + %token  FLATTEN_LINKS_FILE
188   %token  GECOS
189   %token  GENERAL
180 %token  GLINE
181 %token  GLINE_DURATION
182 %token  GLINE_ENABLE
183 %token  GLINE_EXEMPT
184 %token  GLINE_MIN_CIDR
185 %token  GLINE_MIN_CIDR6
186 %token  GLINE_REQUEST_DURATION
187 %token  GLOBAL_KILL
188 %token  HAVENT_READ_CONF
190   %token  HIDDEN
191   %token  HIDDEN_NAME
192 + %token  HIDE_CHANS
193 + %token  HIDE_IDLE
194   %token  HIDE_IDLE_FROM_OPERS
195   %token  HIDE_SERVER_IPS
196   %token  HIDE_SERVERS
197   %token  HIDE_SERVICES
195 %token  HIDE_SPOOF_IPS
198   %token  HOST
199   %token  HUB
200   %token  HUB_MASK
201   %token  IGNORE_BOGUS_TS
202   %token  INVISIBLE_ON_CONNECT
203 + %token  INVITE_CLIENT_COUNT
204 + %token  INVITE_CLIENT_TIME
205 + %token  INVITE_DELAY_CHANNEL
206 + %token  INVITE_EXPIRE_TIME
207   %token  IP
208   %token  IRCD_AUTH
209   %token  IRCD_FLAGS
210   %token  IRCD_SID
211 < %token  JOIN_FLOOD_COUNT
206 < %token  JOIN_FLOOD_TIME
211 > %token  JOIN
212   %token  KILL
213   %token  KILL_CHASE_TIME_LIMIT
214   %token  KLINE
215   %token  KLINE_EXEMPT
216 < %token  KNOCK_DELAY
216 > %token  KLINE_MIN_CIDR
217 > %token  KLINE_MIN_CIDR6
218 > %token  KNOCK_CLIENT_COUNT
219 > %token  KNOCK_CLIENT_TIME
220   %token  KNOCK_DELAY_CHANNEL
221   %token  LEAF_MASK
222 < %token  LINKS_DELAY
222 > %token  LIBGEOIP_DATABASE_OPTIONS
223 > %token  LIBGEOIP_IPV4_DATABASE_FILE
224 > %token  LIBGEOIP_IPV6_DATABASE_FILE
225   %token  LISTEN
226   %token  MASK
227   %token  MAX_ACCEPT
228   %token  MAX_BANS
229 < %token  MAX_CHANS_PER_OPER
230 < %token  MAX_CHANS_PER_USER
229 > %token  MAX_BANS_LARGE
230 > %token  MAX_CHANNELS
231   %token  MAX_GLOBAL
222 %token  MAX_IDENT
232   %token  MAX_IDLE
233 + %token  MAX_INVITES
234   %token  MAX_LOCAL
235   %token  MAX_NICK_CHANGES
236   %token  MAX_NICK_LENGTH
# Line 229 | Line 239 | reset_block_state(void)
239   %token  MAX_TARGETS
240   %token  MAX_TOPIC_LENGTH
241   %token  MAX_WATCH
242 + %token  MEMORY_CACHE
243   %token  MIN_IDLE
244   %token  MIN_NONWILDCARD
245   %token  MIN_NONWILDCARD_SIMPLE
246 + %token  MMAP_CACHE
247   %token  MODULE
248   %token  MODULES
249   %token  MOTD
# Line 241 | Line 253 | reset_block_state(void)
253   %token  NETWORK_DESC
254   %token  NETWORK_NAME
255   %token  NICK
244 %token  NO_CREATE_ON_SPLIT
245 %token  NO_JOIN_ON_SPLIT
256   %token  NO_OPER_FLOOD
257   %token  NO_TILDE
258   %token  NUMBER
259   %token  NUMBER_PER_CIDR
260   %token  NUMBER_PER_IP
261   %token  OPER_ONLY_UMODES
252 %token  OPER_PASS_RESV
262   %token  OPER_UMODES
263   %token  OPERATOR
264   %token  OPERS_BYPASS_CALLERID
# Line 271 | Line 280 | reset_block_state(void)
280   %token  RESV
281   %token  RESV_EXEMPT
282   %token  RSA_PRIVATE_KEY_FILE
274 %token  RSA_PUBLIC_KEY_FILE
283   %token  SECONDS MINUTES HOURS DAYS WEEKS MONTHS YEARS
284   %token  SEND_PASSWORD
285   %token  SENDQ
# Line 284 | Line 292 | reset_block_state(void)
292   %token  SSL_CERTIFICATE_FILE
293   %token  SSL_CERTIFICATE_FINGERPRINT
294   %token  SSL_CONNECTION_REQUIRED
295 + %token  SSL_DH_ELLIPTIC_CURVE
296   %token  SSL_DH_PARAM_FILE
297 + %token  SSL_MESSAGE_DIGEST_ALGORITHM
298 + %token  STANDARD
299   %token  STATS_E_DISABLED
300   %token  STATS_I_OPER_ONLY
301   %token  STATS_K_OPER_ONLY
302 + %token  STATS_M_OPER_ONLY
303   %token  STATS_O_OPER_ONLY
304   %token  STATS_P_OPER_ONLY
305   %token  STATS_U_OPER_ONLY
# Line 295 | Line 307 | reset_block_state(void)
307   %token  T_BOTS
308   %token  T_CALLERID
309   %token  T_CCONN
310 + %token  T_COMMAND
311   %token  T_CLUSTER
312   %token  T_DEAF
313   %token  T_DEBUG
# Line 309 | Line 322 | reset_block_state(void)
322   %token  T_IPV6
323   %token  T_LOCOPS
324   %token  T_LOG
312 %token  T_MAX_CLIENTS
325   %token  T_NCHANGE
326   %token  T_NONONREG
327 < %token  T_OPERWALL
327 > %token  T_OPME
328 > %token  T_PREPEND
329 > %token  T_PSEUDO
330   %token  T_RECVQ
331   %token  T_REJ
332   %token  T_RESTART
333   %token  T_SERVER
334   %token  T_SERVICE
321 %token  T_SERVICES_NAME
335   %token  T_SERVNOTICE
336   %token  T_SET
337   %token  T_SHARED
# Line 328 | Line 341 | reset_block_state(void)
341   %token  T_SPY
342   %token  T_SSL
343   %token  T_SSL_CIPHER_LIST
344 < %token  T_SSL_CLIENT_METHOD
332 < %token  T_SSL_SERVER_METHOD
333 < %token  T_SSLV3
334 < %token  T_TLSV1
344 > %token  T_TARGET
345   %token  T_UMODES
346   %token  T_UNAUTH
347   %token  T_UNDLINE
# Line 342 | Line 352 | reset_block_state(void)
352   %token  T_WALLOPS
353   %token  T_WEBIRC
354   %token  TBOOL
355 + %token  THROTTLE_COUNT
356   %token  THROTTLE_TIME
357   %token  TKLINE_EXPIRE_NOTICES
358   %token  TMASKED
348 %token  TRUE_NO_OPER_FLOOD
359   %token  TS_MAX_DELTA
360   %token  TS_WARN_DELTA
361   %token  TWODOTS
362   %token  TYPE
363   %token  UNKLINE
354 %token  USE_EGD
364   %token  USE_LOGGING
365   %token  USER
366   %token  VHOST
367   %token  VHOST6
368 < %token  WARN_NO_NLINE
368 > %token  WARN_NO_CONNECT_BLOCK
369 > %token  WHOIS
370 > %token  WHOWAS_HISTORY_LENGTH
371   %token  XLINE
372 + %token  XLINE_EXEMPT
373  
374   %type  <string> QSTRING
375   %type  <number> NUMBER
# Line 367 | Line 379 | reset_block_state(void)
379   %type  <number> sizespec_
380  
381   %%
382 < conf:  
382 > conf:
383          | conf conf_item
384          ;
385  
386   conf_item:        admin_entry
387                  | logging_entry
388                  | oper_entry
389 <                | channel_entry
390 <                | class_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 <                }
417 <                | NUMBER DAYS timespec_
418 <                {
419 <                        $$ = $1 * 60 * 60 * 24 + $3;
420 <                }
421 <                | NUMBER WEEKS timespec_
422 <                {
423 <                        $$ = $1 * 60 * 60 * 24 * 7 + $3;
424 <                }
425 <                | NUMBER MONTHS timespec_
426 <                {
427 <                        $$ = $1 * 60 * 60 * 24 * 7 * 4 + $3;
428 <                }
429 <                | NUMBER YEARS timespec_
430 <                {
431 <                        $$ = $1 * 60 * 60 * 24 * 365 + $3;
432 <                }
433 <                ;
434 <
435 < sizespec_:      { $$ = 0; } | sizespec;
436 < sizespec:       NUMBER sizespec_ { $$ = $1 + $2; }
437 <                | NUMBER BYTES sizespec_ { $$ = $1 + $3; }
438 <                | NUMBER KBYTES sizespec_ { $$ = $1 * 1024 + $3; }
439 <                | NUMBER MBYTES sizespec_ { $$ = $1 * 1024 * 1024 + $3; }
440 <                ;
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
447 <  '{' 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 462 | 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 ';' ;
476 <
475 >                        serverinfo_ssl_message_digest_algorithm |
476 >                        serverinfo_libgeoip_database_options |
477 >                        serverinfo_libgeoip_ipv4_database_file |
478 >                        serverinfo_libgeoip_ipv6_database_file |
479 >                        error ';' ;
480  
480 serverinfo_ssl_client_method: T_SSL_CLIENT_METHOD '=' client_method_types ';' ;
481 serverinfo_ssl_server_method: T_SSL_SERVER_METHOD '=' server_method_types ';' ;
482
483 client_method_types: client_method_types ',' client_method_type_item | client_method_type_item;
484 client_method_type_item: T_SSLV3
485 {
486 #ifdef HAVE_LIBCRYPTO
487  if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx)
488    SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_SSLv3);
489 #endif
490 } | T_TLSV1
491 {
492 #ifdef HAVE_LIBCRYPTO
493  if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx)
494    SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_TLSv1);
495 #endif
496 };
497
498 server_method_types: server_method_types ',' server_method_type_item | server_method_type_item;
499 server_method_type_item: T_SSLV3
500 {
501 #ifdef HAVE_LIBCRYPTO
502  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
503    SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3);
504 #endif
505 } | T_TLSV1
506 {
507 #ifdef HAVE_LIBCRYPTO
508  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
509    SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1);
510 #endif
511 };
481  
482   serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';'
483   {
484 < #ifdef HAVE_LIBCRYPTO
516 <  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
484 >  if (conf_parser_ctx.pass == 2)
485    {
486 <    if (!ServerInfo.rsa_private_key_file)
487 <    {
520 <      conf_error_report("No rsa_private_key_file specified, SSL disabled");
521 <      break;
522 <    }
523 <
524 <    if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string,
525 <                                     SSL_FILETYPE_PEM) <= 0 ||
526 <        SSL_CTX_use_certificate_file(ServerInfo.client_ctx, yylval.string,
527 <                                     SSL_FILETYPE_PEM) <= 0)
528 <    {
529 <      report_crypto_errors();
530 <      conf_error_report("Could not open/read certificate file");
531 <      break;
532 <    }
533 <
534 <    if (SSL_CTX_use_PrivateKey_file(ServerInfo.server_ctx, ServerInfo.rsa_private_key_file,
535 <                                    SSL_FILETYPE_PEM) <= 0 ||
536 <        SSL_CTX_use_PrivateKey_file(ServerInfo.client_ctx, ServerInfo.rsa_private_key_file,
537 <                                    SSL_FILETYPE_PEM) <= 0)
538 <    {
539 <      report_crypto_errors();
540 <      conf_error_report("Could not read RSA private key");
541 <      break;
542 <    }
543 <
544 <    if (!SSL_CTX_check_private_key(ServerInfo.server_ctx) ||
545 <        !SSL_CTX_check_private_key(ServerInfo.client_ctx))
546 <    {
547 <      report_crypto_errors();
548 <      conf_error_report("Could not read RSA private key");
549 <      break;
550 <    }
486 >    xfree(ConfigServerInfo.ssl_certificate_file);
487 >    ConfigServerInfo.ssl_certificate_file = xstrdup(yylval.string);
488    }
552 #endif
489   };
490  
491   serverinfo_rsa_private_key_file: RSA_PRIVATE_KEY_FILE '=' QSTRING ';'
492   {
493 < #ifdef HAVE_LIBCRYPTO
558 <  BIO *file = NULL;
559 <
560 <  if (conf_parser_ctx.pass != 1)
561 <    break;
562 <
563 <  if (ServerInfo.rsa_private_key)
493 >  if (conf_parser_ctx.pass == 2)
494    {
495 <    RSA_free(ServerInfo.rsa_private_key);
496 <    ServerInfo.rsa_private_key = NULL;
495 >    xfree(ConfigServerInfo.rsa_private_key_file);
496 >    ConfigServerInfo.rsa_private_key_file = xstrdup(yylval.string);
497    }
498 + };
499  
500 <  if (ServerInfo.rsa_private_key_file)
500 > serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';'
501 > {
502 >  if (conf_parser_ctx.pass == 2)
503    {
504 <    MyFree(ServerInfo.rsa_private_key_file);
505 <    ServerInfo.rsa_private_key_file = NULL;
504 >    xfree(ConfigServerInfo.ssl_dh_param_file);
505 >    ConfigServerInfo.ssl_dh_param_file = xstrdup(yylval.string);
506    }
507 + };
508  
509 <  ServerInfo.rsa_private_key_file = xstrdup(yylval.string);
510 <
511 <  if ((file = BIO_new_file(yylval.string, "r")) == NULL)
509 > serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
510 > {
511 >  if (conf_parser_ctx.pass == 2)
512    {
513 <    conf_error_report("File open failed, ignoring");
514 <    break;
513 >    xfree(ConfigServerInfo.ssl_cipher_list);
514 >    ConfigServerInfo.ssl_cipher_list = xstrdup(yylval.string);
515    }
516 + };
517  
518 <  ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
519 <
520 <  BIO_set_close(file, BIO_CLOSE);
586 <  BIO_free(file);
587 <
588 <  if (ServerInfo.rsa_private_key == NULL)
518 > serverinfo_ssl_message_digest_algorithm: SSL_MESSAGE_DIGEST_ALGORITHM '=' QSTRING ';'
519 > {
520 >  if (conf_parser_ctx.pass == 2)
521    {
522 <    conf_error_report("Couldn't extract key, ignoring");
523 <    break;
522 >    xfree(ConfigServerInfo.ssl_message_digest_algorithm);
523 >    ConfigServerInfo.ssl_message_digest_algorithm = xstrdup(yylval.string);
524    }
525 + }
526  
527 <  if (!RSA_check_key(ServerInfo.rsa_private_key))
527 > serverinfo_ssl_dh_elliptic_curve: SSL_DH_ELLIPTIC_CURVE '=' QSTRING ';'
528 > {
529 >  if (conf_parser_ctx.pass == 2)
530    {
531 <    RSA_free(ServerInfo.rsa_private_key);
532 <    ServerInfo.rsa_private_key = NULL;
598 <
599 <    conf_error_report("Invalid key, ignoring");
600 <    break;
531 >    xfree(ConfigServerInfo.ssl_dh_elliptic_curve);
532 >    ConfigServerInfo.ssl_dh_elliptic_curve = xstrdup(yylval.string);
533    }
534 + };
535  
536 <  /* require 2048 bit (256 byte) key */
537 <  if (RSA_size(ServerInfo.rsa_private_key) != 256)
538 <  {
539 <    RSA_free(ServerInfo.rsa_private_key);
540 <    ServerInfo.rsa_private_key = NULL;
536 > serverinfo_libgeoip_database_options: LIBGEOIP_DATABASE_OPTIONS
537 > {
538 >  if (conf_parser_ctx.pass == 1)
539 >    ConfigServerInfo.libgeoip_database_options = 0;
540 > } '='  options_items ';';
541  
542 <    conf_error_report("Not a 2048 bit key, ignoring");
543 <  }
542 > options_items: options_items ',' options_item | options_item;
543 > options_item: STANDARD
544 > {
545 > #ifdef HAVE_LIBGEOIP
546 >  if (conf_parser_ctx.pass == 1)
547 >    ConfigServerInfo.libgeoip_database_options |= GEOIP_STANDARD;
548 > #endif
549 > } | MEMORY_CACHE
550 > {
551 > #ifdef HAVE_LIBGEOIP
552 >  if (conf_parser_ctx.pass == 1)
553 >    ConfigServerInfo.libgeoip_database_options |= GEOIP_MEMORY_CACHE;
554 > #endif
555 > } | MMAP_CACHE
556 > {
557 > #ifdef HAVE_LIBGEOIP
558 >  if (conf_parser_ctx.pass == 1)
559 >    ConfigServerInfo.libgeoip_database_options |= GEOIP_MMAP_CACHE;
560 > #endif
561 > } | CHECK_CACHE
562 > {
563 > #ifdef HAVE_LIBGEOIP
564 >  if (conf_parser_ctx.pass == 1)
565 >    ConfigServerInfo.libgeoip_database_options |= GEOIP_CHECK_CACHE;
566   #endif
567   };
568  
569 < serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';'
569 > serverinfo_libgeoip_ipv4_database_file:  LIBGEOIP_IPV4_DATABASE_FILE '=' QSTRING ';'
570   {
571 < /* TBD - XXX: error reporting */
617 < #ifdef HAVE_LIBCRYPTO
618 <  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
571 >  if (conf_parser_ctx.pass == 2)
572    {
573 <    BIO *file = BIO_new_file(yylval.string, "r");
573 >    xfree(ConfigServerInfo.libgeoip_ipv4_database_file);
574 >    ConfigServerInfo.libgeoip_ipv4_database_file = xstrdup(yylval.string);
575  
576 <    if (file)
577 <    {
578 <      DH *dh = PEM_read_bio_DHparams(file, NULL, NULL, NULL);
579 <
626 <      BIO_free(file);
627 <
628 <      if (dh)
629 <      {
630 <        if (DH_size(dh) < 128)
631 <          conf_error_report("Ignoring serverinfo::ssl_dh_param_file -- need at least a 1024 bit DH prime size");
632 <        else
633 <          SSL_CTX_set_tmp_dh(ServerInfo.server_ctx, dh);
634 <
635 <        DH_free(dh);
636 <      }
637 <    }
638 <  }
576 > #ifdef HAVE_LIBGEOIP
577 >    if (GeoIPv4_ctx)
578 >      GeoIP_delete(GeoIPv4_ctx);
579 >    GeoIPv4_ctx = GeoIP_open(yylval.string, ConfigServerInfo.libgeoip_database_options);
580   #endif
581 +  }
582   };
583  
584 < serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
584 > serverinfo_libgeoip_ipv6_database_file:  LIBGEOIP_IPV6_DATABASE_FILE '=' QSTRING ';'
585   {
586 < #ifdef HAVE_LIBCRYPTO
587 <  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
588 <    SSL_CTX_set_cipher_list(ServerInfo.server_ctx, yylval.string);
586 >  if (conf_parser_ctx.pass == 2)
587 >  {
588 >    xfree(ConfigServerInfo.libgeoip_ipv6_database_file);
589 >    ConfigServerInfo.libgeoip_ipv6_database_file = xstrdup(yylval.string);
590 >
591 > #ifdef HAVE_LIBGEOIP
592 >    if (GeoIPv6_ctx)
593 >      GeoIP_delete(GeoIPv6_ctx);
594 >    GeoIPv6_ctx = GeoIP_open(yylval.string, ConfigServerInfo.libgeoip_database_options);
595   #endif
596 +  }
597   };
598  
599 < serverinfo_name: NAME '=' QSTRING ';'
599 > serverinfo_name: NAME '=' QSTRING ';'
600   {
601 <  /* this isn't rehashable */
602 <  if (conf_parser_ctx.pass == 2 && !ServerInfo.name)
601 >  /* This isn't rehashable */
602 >  if (conf_parser_ctx.pass == 2 && !ConfigServerInfo.name)
603    {
604      if (valid_servname(yylval.string))
605 <      ServerInfo.name = xstrdup(yylval.string);
605 >      ConfigServerInfo.name = xstrdup(yylval.string);
606      else
607      {
608        conf_error_report("Ignoring serverinfo::name -- invalid name. Aborting.");
609 <      exit(0);
609 >      exit(EXIT_FAILURE);
610      }
611    }
612   };
613  
614 < serverinfo_sid: IRCD_SID '=' QSTRING ';'
614 > serverinfo_sid: IRCD_SID '=' QSTRING ';'
615   {
616 <  /* this isn't rehashable */
617 <  if (conf_parser_ctx.pass == 2 && !ServerInfo.sid)
616 >  /* This isn't rehashable */
617 >  if (conf_parser_ctx.pass == 2 && !ConfigServerInfo.sid)
618    {
619      if (valid_sid(yylval.string))
620 <      ServerInfo.sid = xstrdup(yylval.string);
620 >      ConfigServerInfo.sid = xstrdup(yylval.string);
621      else
622      {
623        conf_error_report("Ignoring serverinfo::sid -- invalid SID. Aborting.");
624 <      exit(0);
624 >      exit(EXIT_FAILURE);
625      }
626    }
627   };
# Line 681 | Line 630 | serverinfo_description: DESCRIPTION '='
630   {
631    if (conf_parser_ctx.pass == 2)
632    {
633 <    MyFree(ServerInfo.description);
634 <    ServerInfo.description = xstrdup(yylval.string);
633 >    xfree(ConfigServerInfo.description);
634 >    ConfigServerInfo.description = xstrdup(yylval.string);
635 >    strlcpy(me.info, ConfigServerInfo.description, sizeof(me.info));
636    }
637   };
638  
# Line 692 | Line 642 | serverinfo_network_name: NETWORK_NAME '=
642    {
643      char *p;
644  
645 <    if ((p = strchr(yylval.string, ' ')) != NULL)
646 <      p = '\0';
645 >    if ((p = strchr(yylval.string, ' ')))
646 >      *p = '\0';
647  
648 <    MyFree(ServerInfo.network_name);
649 <    ServerInfo.network_name = xstrdup(yylval.string);
648 >    xfree(ConfigServerInfo.network_name);
649 >    ConfigServerInfo.network_name = xstrdup(yylval.string);
650    }
651   };
652  
# Line 705 | Line 655 | serverinfo_network_desc: NETWORK_DESC '=
655    if (conf_parser_ctx.pass != 2)
656      break;
657  
658 <  MyFree(ServerInfo.network_desc);
659 <  ServerInfo.network_desc = xstrdup(yylval.string);
658 >  xfree(ConfigServerInfo.network_desc);
659 >  ConfigServerInfo.network_desc = xstrdup(yylval.string);
660   };
661  
662   serverinfo_vhost: VHOST '=' QSTRING ';'
# Line 725 | Line 675 | serverinfo_vhost: VHOST '=' QSTRING ';'
675        ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string);
676      else
677      {
678 <      assert(res != NULL);
678 >      assert(res);
679  
680 <      memcpy(&ServerInfo.ip, res->ai_addr, res->ai_addrlen);
681 <      ServerInfo.ip.ss.ss_family = res->ai_family;
682 <      ServerInfo.ip.ss_len = res->ai_addrlen;
680 >      memcpy(&ConfigServerInfo.ip, res->ai_addr, res->ai_addrlen);
681 >      ConfigServerInfo.ip.ss.ss_family = res->ai_family;
682 >      ConfigServerInfo.ip.ss_len = res->ai_addrlen;
683        freeaddrinfo(res);
684  
685 <      ServerInfo.specific_ipv4_vhost = 1;
685 >      ConfigServerInfo.specific_ipv4_vhost = 1;
686      }
687    }
688   };
689  
690   serverinfo_vhost6: VHOST6 '=' QSTRING ';'
691   {
742 #ifdef IPV6
692    if (conf_parser_ctx.pass == 2 && *yylval.string != '*')
693    {
694      struct addrinfo hints, *res;
# Line 754 | Line 703 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
703        ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost6(%s)", yylval.string);
704      else
705      {
706 <      assert(res != NULL);
706 >      assert(res);
707  
708 <      memcpy(&ServerInfo.ip6, res->ai_addr, res->ai_addrlen);
709 <      ServerInfo.ip6.ss.ss_family = res->ai_family;
710 <      ServerInfo.ip6.ss_len = res->ai_addrlen;
708 >      memcpy(&ConfigServerInfo.ip6, res->ai_addr, res->ai_addrlen);
709 >      ConfigServerInfo.ip6.ss.ss_family = res->ai_family;
710 >      ConfigServerInfo.ip6.ss_len = res->ai_addrlen;
711        freeaddrinfo(res);
712  
713 <      ServerInfo.specific_ipv6_vhost = 1;
713 >      ConfigServerInfo.specific_ipv6_vhost = 1;
714      }
715    }
767 #endif
716   };
717  
718 < serverinfo_max_clients: T_MAX_CLIENTS '=' NUMBER ';'
718 > serverinfo_default_max_clients: DEFAULT_MAX_CLIENTS '=' NUMBER ';'
719   {
720    if (conf_parser_ctx.pass != 2)
721      break;
722  
723    if ($3 < MAXCLIENTS_MIN)
724    {
725 <    char buf[IRCD_BUFSIZE];
725 >    char buf[IRCD_BUFSIZE] = "";
726  
727      snprintf(buf, sizeof(buf), "MAXCLIENTS too low, setting to %d", MAXCLIENTS_MIN);
728      conf_error_report(buf);
729 <    ServerInfo.max_clients = MAXCLIENTS_MIN;
729 >    ConfigServerInfo.default_max_clients = MAXCLIENTS_MIN;
730    }
731    else if ($3 > MAXCLIENTS_MAX)
732    {
733 <    char buf[IRCD_BUFSIZE];
733 >    char buf[IRCD_BUFSIZE] = "";
734  
735      snprintf(buf, sizeof(buf), "MAXCLIENTS too high, setting to %d", MAXCLIENTS_MAX);
736      conf_error_report(buf);
737 <    ServerInfo.max_clients = MAXCLIENTS_MAX;
737 >    ConfigServerInfo.default_max_clients = MAXCLIENTS_MAX;
738    }
739    else
740 <    ServerInfo.max_clients = $3;
740 >    ConfigServerInfo.default_max_clients = $3;
741   };
742  
743   serverinfo_max_nick_length: MAX_NICK_LENGTH '=' NUMBER ';'
# Line 800 | Line 748 | serverinfo_max_nick_length: MAX_NICK_LEN
748    if ($3 < 9)
749    {
750      conf_error_report("max_nick_length too low, setting to 9");
751 <    ServerInfo.max_nick_length = 9;
751 >    ConfigServerInfo.max_nick_length = 9;
752    }
753    else if ($3 > NICKLEN)
754    {
755 <    char buf[IRCD_BUFSIZE];
755 >    char buf[IRCD_BUFSIZE] = "";
756  
757      snprintf(buf, sizeof(buf), "max_nick_length too high, setting to %d", NICKLEN);
758      conf_error_report(buf);
759 <    ServerInfo.max_nick_length = NICKLEN;
759 >    ConfigServerInfo.max_nick_length = NICKLEN;
760    }
761    else
762 <    ServerInfo.max_nick_length = $3;
762 >    ConfigServerInfo.max_nick_length = $3;
763   };
764  
765   serverinfo_max_topic_length: MAX_TOPIC_LENGTH '=' NUMBER ';'
# Line 822 | Line 770 | serverinfo_max_topic_length: MAX_TOPIC_L
770    if ($3 < 80)
771    {
772      conf_error_report("max_topic_length too low, setting to 80");
773 <    ServerInfo.max_topic_length = 80;
773 >    ConfigServerInfo.max_topic_length = 80;
774    }
775    else if ($3 > TOPICLEN)
776    {
777 <    char buf[IRCD_BUFSIZE];
777 >    char buf[IRCD_BUFSIZE] = "";
778  
779      snprintf(buf, sizeof(buf), "max_topic_length too high, setting to %d", TOPICLEN);
780      conf_error_report(buf);
781 <    ServerInfo.max_topic_length = TOPICLEN;
781 >    ConfigServerInfo.max_topic_length = TOPICLEN;
782    }
783    else
784 <    ServerInfo.max_topic_length = $3;
784 >    ConfigServerInfo.max_topic_length = $3;
785   };
786  
787 < serverinfo_hub: HUB '=' TBOOL ';'
787 > serverinfo_hub: HUB '=' TBOOL ';'
788   {
789    if (conf_parser_ctx.pass == 2)
790 <    ServerInfo.hub = yylval.number;
790 >    ConfigServerInfo.hub = yylval.number;
791   };
792  
793 +
794   /***************************************************************************
795 < * admin section
795 > * admin {} section
796   ***************************************************************************/
797   admin_entry: ADMIN  '{' admin_items '}' ';' ;
798  
799   admin_items: admin_items admin_item | admin_item;
800 < admin_item:  admin_name | admin_description |
801 <             admin_email | error ';' ;
800 > admin_item:  admin_name |
801 >             admin_description |
802 >             admin_email |
803 >             error ';' ;
804  
805 < admin_name: NAME '=' QSTRING ';'
805 > admin_name: NAME '=' QSTRING ';'
806   {
807    if (conf_parser_ctx.pass != 2)
808      break;
809  
810 <  MyFree(AdminInfo.name);
811 <  AdminInfo.name = xstrdup(yylval.string);
810 >  xfree(ConfigAdminInfo.name);
811 >  ConfigAdminInfo.name = xstrdup(yylval.string);
812   };
813  
814   admin_email: EMAIL '=' QSTRING ';'
# Line 865 | Line 816 | admin_email: EMAIL '=' QSTRING ';'
816    if (conf_parser_ctx.pass != 2)
817      break;
818  
819 <  MyFree(AdminInfo.email);
820 <  AdminInfo.email = xstrdup(yylval.string);
819 >  xfree(ConfigAdminInfo.email);
820 >  ConfigAdminInfo.email = xstrdup(yylval.string);
821   };
822  
823   admin_description: DESCRIPTION '=' QSTRING ';'
# Line 874 | Line 825 | admin_description: DESCRIPTION '=' QSTRI
825    if (conf_parser_ctx.pass != 2)
826      break;
827  
828 <  MyFree(AdminInfo.description);
829 <  AdminInfo.description = xstrdup(yylval.string);
828 >  xfree(ConfigAdminInfo.description);
829 >  ConfigAdminInfo.description = xstrdup(yylval.string);
830   };
831  
832 +
833   /***************************************************************************
834 < * motd section
834 > * motd {} section
835   ***************************************************************************/
836 < motd_entry: MOTD
836 > motd_entry: MOTD
837   {
838    if (conf_parser_ctx.pass == 2)
839      reset_block_state();
840   } '{' motd_items '}' ';'
841   {
842 <  dlink_node *ptr = NULL;
842 >  dlink_node *node = NULL;
843  
844    if (conf_parser_ctx.pass != 2)
845      break;
# Line 895 | Line 847 | motd_entry: MOTD
847    if (!block_state.file.buf[0])
848      break;
849  
850 <  DLINK_FOREACH(ptr, block_state.mask.list.head)
851 <    motd_add(ptr->data, block_state.file.buf);
850 >  DLINK_FOREACH(node, block_state.mask.list.head)
851 >    motd_add(node->data, block_state.file.buf);
852   };
853  
854   motd_items: motd_items motd_item | motd_item;
855   motd_item:  motd_mask | motd_file | error ';' ;
856  
857 < motd_mask: MASK '=' QSTRING ';'
857 > motd_mask: MASK '=' QSTRING ';'
858   {
859    if (conf_parser_ctx.pass == 2)
860      dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list);
# Line 914 | Line 866 | motd_file: T_FILE '=' QSTRING ';'
866      strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf));
867   };
868  
869 +
870   /***************************************************************************
871 < *  section logging
871 > * pseudo {} section
872 > ***************************************************************************/
873 > pseudo_entry: T_PSEUDO
874 > {
875 >  if (conf_parser_ctx.pass == 2)
876 >    reset_block_state();
877 > } '{' pseudo_items '}' ';'
878 > {
879 >  if (conf_parser_ctx.pass != 2)
880 >    break;
881 >
882 >  if (!block_state.command.buf[0] ||
883 >      !block_state.name.buf[0] ||
884 >      !block_state.nick.buf[0] ||
885 >      !block_state.host.buf[0])
886 >    break;
887 >
888 >  pseudo_register(block_state.name.buf, block_state.nick.buf, block_state.host.buf,
889 >                  block_state.prepend.buf, block_state.command.buf);
890 > };
891 >
892 > pseudo_items: pseudo_items pseudo_item | pseudo_item;
893 > pseudo_item:  pseudo_command | pseudo_prepend | pseudo_name | pseudo_target | error ';' ;
894 >
895 > pseudo_command: T_COMMAND '=' QSTRING ';'
896 > {
897 >  if (conf_parser_ctx.pass == 2)
898 >    strlcpy(block_state.command.buf, yylval.string, sizeof(block_state.command.buf));
899 > };
900 >
901 > pseudo_name: NAME '=' QSTRING ';'
902 > {
903 >  if (conf_parser_ctx.pass == 2)
904 >    strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
905 > };
906 >
907 > pseudo_prepend: T_PREPEND '=' QSTRING ';'
908 > {
909 >  if (conf_parser_ctx.pass == 2)
910 >    strlcpy(block_state.prepend.buf, yylval.string, sizeof(block_state.prepend.buf));
911 > };
912 >
913 > pseudo_target: T_TARGET '=' QSTRING ';'
914 > {
915 >  if (conf_parser_ctx.pass == 2)
916 >  {
917 >    struct split_nuh_item nuh;
918 >
919 >    nuh.nuhmask  = yylval.string;
920 >    nuh.nickptr  = NULL;
921 >    nuh.userptr  = block_state.nick.buf;
922 >    nuh.hostptr  = block_state.host.buf;
923 >    nuh.nicksize = 0;
924 >    nuh.usersize = sizeof(block_state.nick.buf);
925 >    nuh.hostsize = sizeof(block_state.host.buf);
926 >
927 >    split_nuh(&nuh);
928 >  }
929 > };
930 >
931 >
932 > /***************************************************************************
933 > * log {} section
934   ***************************************************************************/
935   logging_entry:          T_LOG  '{' logging_items '}' ';' ;
936   logging_items:          logging_items logging_item | logging_item ;
937  
938 < logging_item:           logging_use_logging | logging_file_entry |
939 <                        error ';' ;
938 > logging_item:           logging_use_logging | logging_file_entry |
939 >                        error ';' ;
940  
941   logging_use_logging: USE_LOGGING '=' TBOOL ';'
942   {
943    if (conf_parser_ctx.pass == 2)
944 <    ConfigLoggingEntry.use_logging = yylval.number;
944 >    ConfigLog.use_logging = yylval.number;
945   };
946  
947   logging_file_entry:
# Line 980 | Line 995 | logging_file_type_item:  USER
995   {
996    if (conf_parser_ctx.pass == 2)
997      block_state.type.value = LOG_TYPE_OPER;
983 } | GLINE
984 {
985  if (conf_parser_ctx.pass == 2)
986    block_state.type.value = LOG_TYPE_GLINE;
998   } | XLINE
999   {
1000    if (conf_parser_ctx.pass == 2)
# Line 1012 | Line 1023 | logging_file_type_item:  USER
1023  
1024  
1025   /***************************************************************************
1026 < * section oper
1026 > * operator {} section
1027   ***************************************************************************/
1028 < oper_entry: OPERATOR
1028 > oper_entry: OPERATOR
1029   {
1030    if (conf_parser_ctx.pass != 2)
1031      break;
# Line 1023 | Line 1034 | oper_entry: OPERATOR
1034    block_state.flags.value |= CONF_FLAGS_ENCRYPTED;
1035   } '{' oper_items '}' ';'
1036   {
1037 <  dlink_node *ptr = NULL;
1037 >  dlink_node *node = NULL;
1038  
1039    if (conf_parser_ctx.pass != 2)
1040      break;
1041  
1042    if (!block_state.name.buf[0])
1043      break;
1044 < #ifdef HAVE_LIBCRYPTO
1034 <  if (!block_state.file.buf[0] &&
1035 <      !block_state.rpass.buf[0])
1036 <    break;
1037 < #else
1044 >
1045    if (!block_state.rpass.buf[0])
1046      break;
1040 #endif
1047  
1048 <  DLINK_FOREACH(ptr, block_state.mask.list.head)
1048 >  DLINK_FOREACH(node, block_state.mask.list.head)
1049    {
1050      struct MaskItem *conf = NULL;
1051      struct split_nuh_item nuh;
1052 +    char *s = node->data;
1053  
1054 <    nuh.nuhmask  = ptr->data;
1054 >    if (EmptyString(s))
1055 >      continue;
1056 >
1057 >    nuh.nuhmask  = s;
1058      nuh.nickptr  = NULL;
1059      nuh.userptr  = block_state.user.buf;
1060      nuh.hostptr  = block_state.host.buf;
# Line 1064 | Line 1074 | oper_entry: OPERATOR
1074      if (block_state.rpass.buf[0])
1075        conf->passwd = xstrdup(block_state.rpass.buf);
1076  
1077 +    if (block_state.whois.buf[0])
1078 +      conf->whois = xstrdup(block_state.whois.buf);
1079 +
1080      conf->flags = block_state.flags.value;
1081      conf->modes = block_state.modes.value;
1082      conf->port  = block_state.port.value;
1083      conf->htype = parse_netmask(conf->host, &conf->addr, &conf->bits);
1084  
1085      conf_add_class_to_conf(conf, block_state.class.buf);
1073
1074 #ifdef HAVE_LIBCRYPTO
1075    if (block_state.file.buf[0])
1076    {
1077      BIO *file = NULL;
1078      RSA *pkey = NULL;
1079
1080      if ((file = BIO_new_file(block_state.file.buf, "r")) == NULL)
1081      {
1082        conf_error_report("Ignoring rsa_public_key_file -- file doesn't exist");
1083        break;
1084      }
1085
1086      if ((pkey = PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL)) == NULL)
1087        conf_error_report("Ignoring rsa_public_key_file -- Key invalid; check key syntax.");
1088
1089      conf->rsa_public_key = pkey;
1090      BIO_set_close(file, BIO_CLOSE);
1091      BIO_free(file);
1092    }
1093 #endif /* HAVE_LIBCRYPTO */
1086    }
1087   };
1088  
1089   oper_items:     oper_items oper_item | oper_item;
1090 < oper_item:      oper_name | oper_user | oper_password |
1091 <                oper_umodes | oper_class | oper_encrypted |
1092 <                oper_rsa_public_key_file | oper_ssl_certificate_fingerprint |
1093 <                oper_ssl_connection_required |
1094 <                oper_flags | error ';' ;
1090 > oper_item:      oper_name |
1091 >                oper_user |
1092 >                oper_password |
1093 >                oper_whois |
1094 >                oper_umodes |
1095 >                oper_class |
1096 >                oper_encrypted |
1097 >                oper_ssl_certificate_fingerprint |
1098 >                oper_ssl_connection_required |
1099 >                oper_flags |
1100 >                error ';' ;
1101  
1102   oper_name: NAME '=' QSTRING ';'
1103   {
# Line 1119 | Line 1117 | oper_password: PASSWORD '=' QSTRING ';'
1117      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
1118   };
1119  
1120 + oper_whois: WHOIS '=' QSTRING ';'
1121 + {
1122 +  if (conf_parser_ctx.pass == 2)
1123 +    strlcpy(block_state.whois.buf, yylval.string, sizeof(block_state.whois.buf));
1124 + };
1125 +
1126   oper_encrypted: ENCRYPTED '=' TBOOL ';'
1127   {
1128    if (conf_parser_ctx.pass != 2)
# Line 1130 | Line 1134 | oper_encrypted: ENCRYPTED '=' TBOOL ';'
1134      block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED;
1135   };
1136  
1133 oper_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
1134 {
1135  if (conf_parser_ctx.pass == 2)
1136    strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf));
1137 };
1138
1137   oper_ssl_certificate_fingerprint: SSL_CERTIFICATE_FINGERPRINT '=' QSTRING ';'
1138   {
1139    if (conf_parser_ctx.pass == 2)
# Line 1190 | Line 1188 | oper_umodes_item:  T_BOTS
1188   {
1189    if (conf_parser_ctx.pass == 2)
1190      block_state.modes.value |= UMODE_HIDDEN;
1191 + } | HIDE_CHANS
1192 + {
1193 +  if (conf_parser_ctx.pass == 2)
1194 +    block_state.modes.value |= UMODE_HIDECHANS;
1195 + } | HIDE_IDLE
1196 + {
1197 +  if (conf_parser_ctx.pass == 2)
1198 +    block_state.modes.value |= UMODE_HIDEIDLE;
1199   } | T_SKILL
1200   {
1201    if (conf_parser_ctx.pass == 2)
# Line 1214 | Line 1220 | oper_umodes_item:  T_BOTS
1220   {
1221    if (conf_parser_ctx.pass == 2)
1222      block_state.modes.value |= UMODE_EXTERNAL;
1217 } | T_OPERWALL
1218 {
1219  if (conf_parser_ctx.pass == 2)
1220    block_state.modes.value |= UMODE_OPERWALL;
1223   } | T_SERVNOTICE
1224   {
1225    if (conf_parser_ctx.pass == 2)
# Line 1286 | Line 1288 | oper_flags_item: KILL ':' REMOTE
1288   } | KLINE
1289   {
1290    if (conf_parser_ctx.pass == 2)
1291 <    block_state.port.value |= OPER_FLAG_K;
1291 >    block_state.port.value |= OPER_FLAG_KLINE;
1292   } | UNKLINE
1293   {
1294    if (conf_parser_ctx.pass == 2)
# Line 1302 | Line 1304 | oper_flags_item: KILL ':' REMOTE
1304   } | XLINE
1305   {
1306    if (conf_parser_ctx.pass == 2)
1307 <    block_state.port.value |= OPER_FLAG_X;
1308 < } | GLINE
1307 >    block_state.port.value |= OPER_FLAG_XLINE;
1308 > } | T_UNXLINE
1309   {
1310    if (conf_parser_ctx.pass == 2)
1311 <    block_state.port.value |= OPER_FLAG_GLINE;
1311 >    block_state.port.value |= OPER_FLAG_UNXLINE;
1312   } | DIE
1313   {
1314    if (conf_parser_ctx.pass == 2)
# Line 1315 | Line 1317 | oper_flags_item: KILL ':' REMOTE
1317   {
1318    if (conf_parser_ctx.pass == 2)
1319      block_state.port.value |= OPER_FLAG_RESTART;
1320 + } | REHASH ':' REMOTE
1321 + {
1322 +  if (conf_parser_ctx.pass == 2)
1323 +    block_state.port.value |= OPER_FLAG_REHASH_REMOTE;
1324   } | REHASH
1325   {
1326    if (conf_parser_ctx.pass == 2)
# Line 1323 | Line 1329 | oper_flags_item: KILL ':' REMOTE
1329   {
1330    if (conf_parser_ctx.pass == 2)
1331      block_state.port.value |= OPER_FLAG_ADMIN;
1326 } | T_OPERWALL
1327 {
1328  if (conf_parser_ctx.pass == 2)
1329    block_state.port.value |= OPER_FLAG_OPERWALL;
1332   } | T_GLOBOPS
1333   {
1334    if (conf_parser_ctx.pass == 2)
# Line 1351 | Line 1353 | oper_flags_item: KILL ':' REMOTE
1353   {
1354    if (conf_parser_ctx.pass == 2)
1355      block_state.port.value |= OPER_FLAG_MODULE;
1356 + } | T_OPME
1357 + {
1358 +  if (conf_parser_ctx.pass == 2)
1359 +    block_state.port.value |= OPER_FLAG_OPME;
1360 + } | NICK ':' RESV
1361 + {
1362 +  if (conf_parser_ctx.pass == 2)
1363 +    block_state.port.value |= OPER_FLAG_NICK_RESV;
1364 + } | JOIN ':' RESV
1365 + {
1366 +  if (conf_parser_ctx.pass == 2)
1367 +    block_state.port.value |= OPER_FLAG_JOIN_RESV;
1368 + } | RESV
1369 + {
1370 +  if (conf_parser_ctx.pass == 2)
1371 +    block_state.port.value |= OPER_FLAG_RESV;
1372 + } | T_UNRESV
1373 + {
1374 +  if (conf_parser_ctx.pass == 2)
1375 +    block_state.port.value |= OPER_FLAG_UNRESV;
1376 + } | CLOSE
1377 + {
1378 +  if (conf_parser_ctx.pass == 2)
1379 +    block_state.port.value |= OPER_FLAG_CLOSE;
1380   };
1381  
1382  
1383   /***************************************************************************
1384 < *  section class
1384 > * class {} section
1385   ***************************************************************************/
1386   class_entry: CLASS
1387   {
# Line 1383 | Line 1409 | class_entry: CLASS
1409      class = class_make();
1410  
1411    class->active = 1;
1412 <  MyFree(class->name);
1412 >  xfree(class->name);
1413    class->name = xstrdup(block_state.class.buf);
1414    class->ping_freq = block_state.ping_freq.value;
1415    class->max_perip = block_state.max_perip.value;
# Line 1391 | Line 1417 | class_entry: CLASS
1417    class->max_total = block_state.max_total.value;
1418    class->max_global = block_state.max_global.value;
1419    class->max_local = block_state.max_local.value;
1394  class->max_ident = block_state.max_ident.value;
1420    class->max_sendq = block_state.max_sendq.value;
1421    class->max_recvq = block_state.max_recvq.value;
1422 +  class->max_channels = block_state.max_channels.value;
1423  
1424    if (block_state.min_idle.value > block_state.max_idle.value)
1425    {
# Line 1406 | Line 1432 | class_entry: CLASS
1432    class->min_idle = block_state.min_idle.value;
1433    class->max_idle = block_state.max_idle.value;
1434  
1435 <  if (class->number_per_cidr && block_state.number_per_cidr.value)
1410 <    if ((class->cidr_bitlen_ipv4 && block_state.cidr_bitlen_ipv4.value) ||
1411 <        (class->cidr_bitlen_ipv6 && block_state.cidr_bitlen_ipv6.value))
1412 <      if ((class->cidr_bitlen_ipv4 != block_state.cidr_bitlen_ipv4.value) ||
1413 <          (class->cidr_bitlen_ipv6 != block_state.cidr_bitlen_ipv6.value))
1414 <        rebuild_cidr_list(class);
1435 >  rebuild_cidr_list(class);
1436  
1437    class->cidr_bitlen_ipv4 = block_state.cidr_bitlen_ipv4.value;
1438    class->cidr_bitlen_ipv6 = block_state.cidr_bitlen_ipv6.value;
# Line 1420 | Line 1441 | class_entry: CLASS
1441  
1442   class_items:    class_items class_item | class_item;
1443   class_item:     class_name |
1444 <                class_cidr_bitlen_ipv4 | class_cidr_bitlen_ipv6 |
1444 >                class_cidr_bitlen_ipv4 |
1445 >                class_cidr_bitlen_ipv6 |
1446                  class_ping_time |
1447 <                class_number_per_cidr |
1447 >                class_number_per_cidr |
1448                  class_number_per_ip |
1449                  class_connectfreq |
1450 +                class_max_channels |
1451                  class_max_number |
1452 <                class_max_global |
1453 <                class_max_local |
1454 <                class_max_ident |
1455 <                class_sendq | class_recvq |
1452 >                class_max_global |
1453 >                class_max_local |
1454 >                class_sendq |
1455 >                class_recvq |
1456                  class_min_idle |
1457                  class_max_idle |
1458                  class_flags |
1459 <                error ';' ;
1459 >                error ';' ;
1460  
1461 < class_name: NAME '=' QSTRING ';'
1461 > class_name: NAME '=' QSTRING ';'
1462   {
1463    if (conf_parser_ctx.pass == 1)
1464      strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf));
# Line 1459 | Line 1482 | class_connectfreq: CONNECTFREQ '=' times
1482      block_state.con_freq.value = $3;
1483   };
1484  
1485 + class_max_channels: MAX_CHANNELS '=' NUMBER ';'
1486 + {
1487 +  if (conf_parser_ctx.pass == 1)
1488 +    block_state.max_channels.value = $3;
1489 + };
1490 +
1491   class_max_number: MAX_NUMBER '=' NUMBER ';'
1492   {
1493    if (conf_parser_ctx.pass == 1)
# Line 1477 | Line 1506 | class_max_local: MAX_LOCAL '=' NUMBER ';
1506      block_state.max_local.value = $3;
1507   };
1508  
1480 class_max_ident: MAX_IDENT '=' NUMBER ';'
1481 {
1482  if (conf_parser_ctx.pass == 1)
1483    block_state.max_ident.value = $3;
1484 };
1485
1509   class_sendq: SENDQ '=' sizespec ';'
1510   {
1511    if (conf_parser_ctx.pass == 1)
# Line 1551 | Line 1574 | class_flags_item: RANDOM_IDLE
1574  
1575  
1576   /***************************************************************************
1577 < *  section listen
1577 > * listen {} section
1578   ***************************************************************************/
1579   listen_entry: LISTEN
1580   {
# Line 1590 | Line 1613 | port_item: NUMBER
1613   {
1614    if (conf_parser_ctx.pass == 2)
1615    {
1616 + #ifndef HAVE_TLS
1617      if (block_state.flags.value & LISTENER_SSL)
1618 < #ifdef HAVE_LIBCRYPTO
1619 <      if (!ServerInfo.server_ctx)
1618 >    {
1619 >      conf_error_report("TLS not available - port closed");
1620 >      break;
1621 >    }
1622   #endif
1623 <      {
1598 <        conf_error_report("SSL not available - port closed");
1599 <        break;
1600 <      }
1601 <    add_listener($1, block_state.addr.buf, block_state.flags.value);
1623 >    listener_add($1, block_state.addr.buf, block_state.flags.value);
1624    }
1625   } | NUMBER TWODOTS NUMBER
1626   {
1627    if (conf_parser_ctx.pass == 2)
1628    {
1629 <    int i;
1608 <
1629 > #ifndef HAVE_TLS
1630      if (block_state.flags.value & LISTENER_SSL)
1631 < #ifdef HAVE_LIBCRYPTO
1632 <      if (!ServerInfo.server_ctx)
1631 >    {
1632 >      conf_error_report("TLS not available - port closed");
1633 >      break;
1634 >    }
1635   #endif
1613      {
1614        conf_error_report("SSL not available - port closed");
1615        break;
1616      }
1636  
1637 <    for (i = $1; i <= $3; ++i)
1638 <      add_listener(i, block_state.addr.buf, block_state.flags.value);
1637 >    for (int i = $1; i <= $3; ++i)
1638 >      listener_add(i, block_state.addr.buf, block_state.flags.value);
1639    }
1640   };
1641  
# Line 1632 | Line 1651 | listen_host: HOST '=' QSTRING ';'
1651      strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf));
1652   };
1653  
1654 +
1655   /***************************************************************************
1656 < *  section auth
1656 > * auth {} section
1657   ***************************************************************************/
1658   auth_entry: IRCD_AUTH
1659   {
# Line 1641 | Line 1661 | auth_entry: IRCD_AUTH
1661      reset_block_state();
1662   } '{' auth_items '}' ';'
1663   {
1664 <  dlink_node *ptr = NULL;
1664 >  dlink_node *node = NULL;
1665  
1666    if (conf_parser_ctx.pass != 2)
1667      break;
1668  
1669 <  DLINK_FOREACH(ptr, block_state.mask.list.head)
1669 >  DLINK_FOREACH(node, block_state.mask.list.head)
1670    {
1671      struct MaskItem *conf = NULL;
1672      struct split_nuh_item nuh;
1673 +    char *s = node->data;
1674 +
1675 +    if (EmptyString(s))
1676 +      continue;
1677  
1678 <    nuh.nuhmask  = ptr->data;
1678 >    nuh.nuhmask  = s;
1679      nuh.nickptr  = NULL;
1680      nuh.userptr  = block_state.user.buf;
1681      nuh.hostptr  = block_state.host.buf;
# Line 1675 | Line 1699 | auth_entry: IRCD_AUTH
1699      conf_add_class_to_conf(conf, block_state.class.buf);
1700      add_conf_by_address(CONF_CLIENT, conf);
1701    }
1702 < };
1702 > };
1703  
1704   auth_items:     auth_items auth_item | auth_item;
1705 < auth_item:      auth_user | auth_passwd | auth_class | auth_flags |
1706 <                auth_spoof | auth_redir_serv | auth_redir_port |
1707 <                auth_encrypted | error ';' ;
1705 > auth_item:      auth_user |
1706 >                auth_passwd |
1707 >                auth_class |
1708 >                auth_flags |
1709 >                auth_spoof |
1710 >                auth_redir_serv |
1711 >                auth_redir_port |
1712 >                auth_encrypted |
1713 >                error ';' ;
1714  
1715   auth_user: USER '=' QSTRING ';'
1716   {
# Line 1730 | Line 1760 | auth_flags_item: SPOOF_NOTICE
1760   {
1761    if (conf_parser_ctx.pass == 2)
1762      block_state.flags.value |= CONF_FLAGS_EXEMPTKLINE;
1763 + } | XLINE_EXEMPT
1764 + {
1765 +  if (conf_parser_ctx.pass == 2)
1766 +    block_state.flags.value |= CONF_FLAGS_EXEMPTXLINE;
1767   } | NEED_IDENT
1768   {
1769    if (conf_parser_ctx.pass == 2)
# Line 1742 | Line 1776 | auth_flags_item: SPOOF_NOTICE
1776   {
1777    if (conf_parser_ctx.pass == 2)
1778      block_state.flags.value |= CONF_FLAGS_NO_TILDE;
1745 } | GLINE_EXEMPT
1746 {
1747  if (conf_parser_ctx.pass == 2)
1748    block_state.flags.value |= CONF_FLAGS_EXEMPTGLINE;
1779   } | RESV_EXEMPT
1780   {
1781    if (conf_parser_ctx.pass == 2)
# Line 1760 | Line 1790 | auth_flags_item: SPOOF_NOTICE
1790      block_state.flags.value |= CONF_FLAGS_NEED_PASSWORD;
1791   };
1792  
1793 < auth_spoof: SPOOF '=' QSTRING ';'
1793 > auth_spoof: SPOOF '=' QSTRING ';'
1794   {
1795    if (conf_parser_ctx.pass != 2)
1796      break;
1797  
1798 <  if (strlen(yylval.string) <= HOSTLEN && valid_hostname(yylval.string))
1798 >  if (valid_hostname(yylval.string))
1799    {
1800      strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
1801      block_state.flags.value |= CONF_FLAGS_SPOOF_IP;
# Line 1794 | Line 1824 | auth_redir_port: REDIRPORT '=' NUMBER ';
1824  
1825  
1826   /***************************************************************************
1827 < *  section resv
1827 > * resv {} section
1828   ***************************************************************************/
1829   resv_entry: RESV
1830   {
# Line 1808 | Line 1838 | resv_entry: RESV
1838    if (conf_parser_ctx.pass != 2)
1839      break;
1840  
1841 <  create_resv(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list);
1841 >  resv_make(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list);
1842   };
1843  
1844 < resv_items:     resv_items resv_item | resv_item;
1845 < resv_item:      resv_mask | resv_reason | resv_exempt | error ';' ;
1844 > resv_items:     resv_items resv_item | resv_item;
1845 > resv_item:      resv_mask | resv_reason | resv_exempt | error ';' ;
1846  
1847   resv_mask: MASK '=' QSTRING ';'
1848   {
# Line 1834 | Line 1864 | resv_exempt: EXEMPT '=' QSTRING ';'
1864  
1865  
1866   /***************************************************************************
1867 < *  section service
1867 > * service {} section
1868   ***************************************************************************/
1869   service_entry: T_SERVICE '{' service_items '}' ';';
1870  
# Line 1848 | Line 1878 | service_name: NAME '=' QSTRING ';'
1878  
1879    if (valid_servname(yylval.string))
1880    {
1881 <    struct MaskItem *conf = conf_make(CONF_SERVICE);
1882 <    conf->name = xstrdup(yylval.string);
1881 >    struct ServiceItem *service = service_make();
1882 >    service->name = xstrdup(yylval.string);
1883    }
1884   };
1885  
1886 +
1887   /***************************************************************************
1888 < *  section shared, for sharing remote klines etc.
1888 > * shared {} section, for sharing remote klines etc.
1889   ***************************************************************************/
1890   shared_entry: T_SHARED
1891   {
# Line 1869 | Line 1900 | shared_entry: T_SHARED
1900    block_state.flags.value = SHARED_ALL;
1901   } '{' shared_items '}' ';'
1902   {
1872  struct MaskItem *conf = NULL;
1873
1903    if (conf_parser_ctx.pass != 2)
1904      break;
1905  
1906 <  conf = conf_make(CONF_ULINE);
1907 <  conf->flags = block_state.flags.value;
1908 <  conf->name = xstrdup(block_state.name.buf);
1909 <  conf->user = xstrdup(block_state.user.buf);
1910 <  conf->host = xstrdup(block_state.host.buf);
1906 >  struct SharedItem *shared = shared_make();
1907 >  shared->type = block_state.flags.value;
1908 >  shared->server = xstrdup(block_state.name.buf);
1909 >  shared->user = xstrdup(block_state.user.buf);
1910 >  shared->host = xstrdup(block_state.host.buf);
1911   };
1912  
1913   shared_items: shared_items shared_item | shared_item;
# Line 1958 | Line 1987 | shared_type_item: KLINE
1987      block_state.flags.value = SHARED_ALL;
1988   };
1989  
1990 +
1991   /***************************************************************************
1992 < *  section cluster
1992 > * cluster {} section
1993   ***************************************************************************/
1994   cluster_entry: T_CLUSTER
1995   {
# Line 1969 | Line 1999 | cluster_entry: T_CLUSTER
1999    reset_block_state();
2000  
2001    strlcpy(block_state.name.buf, "*", sizeof(block_state.name.buf));
2002 <  block_state.flags.value = SHARED_ALL;
2002 >  block_state.flags.value = CLUSTER_ALL;
2003   } '{' cluster_items '}' ';'
2004   {
1975  struct MaskItem *conf = NULL;
1976
2005    if (conf_parser_ctx.pass != 2)
2006      break;
2007  
2008 <  conf = conf_make(CONF_CLUSTER);
2009 <  conf->flags = block_state.flags.value;
2010 <  conf->name = xstrdup(block_state.name.buf);
2008 >  struct ClusterItem *cluster = cluster_make();
2009 >  cluster->type = block_state.flags.value;
2010 >  cluster->server = xstrdup(block_state.name.buf);
2011   };
2012  
2013 < cluster_items:  cluster_items cluster_item | cluster_item;
2014 < cluster_item:   cluster_name | cluster_type | error ';' ;
2013 > cluster_items:  cluster_items cluster_item | cluster_item;
2014 > cluster_item:   cluster_name | cluster_type | error ';' ;
2015  
2016   cluster_name: NAME '=' QSTRING ';'
2017   {
# Line 1997 | Line 2025 | cluster_type: TYPE
2025      block_state.flags.value = 0;
2026   } '=' cluster_types ';' ;
2027  
2028 < cluster_types:  cluster_types ',' cluster_type_item | cluster_type_item;
2028 > cluster_types:  cluster_types ',' cluster_type_item | cluster_type_item;
2029   cluster_type_item: KLINE
2030   {
2031    if (conf_parser_ctx.pass == 2)
2032 <    block_state.flags.value |= SHARED_KLINE;
2032 >    block_state.flags.value |= CLUSTER_KLINE;
2033   } | UNKLINE
2034   {
2035    if (conf_parser_ctx.pass == 2)
2036 <    block_state.flags.value |= SHARED_UNKLINE;
2036 >    block_state.flags.value |= CLUSTER_UNKLINE;
2037   } | T_DLINE
2038   {
2039    if (conf_parser_ctx.pass == 2)
2040 <    block_state.flags.value |= SHARED_DLINE;
2040 >    block_state.flags.value |= CLUSTER_DLINE;
2041   } | T_UNDLINE
2042   {
2043    if (conf_parser_ctx.pass == 2)
2044 <    block_state.flags.value |= SHARED_UNDLINE;
2044 >    block_state.flags.value |= CLUSTER_UNDLINE;
2045   } | XLINE
2046   {
2047    if (conf_parser_ctx.pass == 2)
2048 <    block_state.flags.value |= SHARED_XLINE;
2048 >    block_state.flags.value |= CLUSTER_XLINE;
2049   } | T_UNXLINE
2050   {
2051    if (conf_parser_ctx.pass == 2)
2052 <    block_state.flags.value |= SHARED_UNXLINE;
2052 >    block_state.flags.value |= CLUSTER_UNXLINE;
2053   } | RESV
2054   {
2055    if (conf_parser_ctx.pass == 2)
2056 <    block_state.flags.value |= SHARED_RESV;
2056 >    block_state.flags.value |= CLUSTER_RESV;
2057   } | T_UNRESV
2058   {
2059    if (conf_parser_ctx.pass == 2)
2060 <    block_state.flags.value |= SHARED_UNRESV;
2060 >    block_state.flags.value |= CLUSTER_UNRESV;
2061   } | T_LOCOPS
2062   {
2063    if (conf_parser_ctx.pass == 2)
2064 <    block_state.flags.value |= SHARED_LOCOPS;
2064 >    block_state.flags.value |= CLUSTER_LOCOPS;
2065   } | T_ALL
2066   {
2067    if (conf_parser_ctx.pass == 2)
2068 <    block_state.flags.value = SHARED_ALL;
2068 >    block_state.flags.value = CLUSTER_ALL;
2069   };
2070  
2071 +
2072   /***************************************************************************
2073 < *  section connect
2073 > * connect {}  section
2074   ***************************************************************************/
2075 < connect_entry: CONNECT  
2075 > connect_entry: CONNECT
2076   {
2077  
2078    if (conf_parser_ctx.pass != 2)
2079      break;
2080  
2081    reset_block_state();
2082 +  block_state.aftype.value = AF_INET;
2083    block_state.port.value = PORTNUM;
2084   } '{' connect_items '}' ';'
2085   {
# Line 2101 | Line 2131 | connect_entry: CONNECT
2131        ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", block_state.bind.buf);
2132      else
2133      {
2134 <      assert(res != NULL);
2134 >      assert(res);
2135  
2136        memcpy(&conf->bind, res->ai_addr, res->ai_addrlen);
2137        conf->bind.ss.ss_family = res->ai_family;
# Line 2115 | Line 2145 | connect_entry: CONNECT
2145   };
2146  
2147   connect_items:  connect_items connect_item | connect_item;
2148 < connect_item:   connect_name | connect_host | connect_vhost |
2149 <                connect_send_password | connect_accept_password |
2150 <                connect_ssl_certificate_fingerprint |
2151 <                connect_aftype | connect_port | connect_ssl_cipher_list |
2152 <                connect_flags | connect_hub_mask | connect_leaf_mask |
2153 <                connect_class | connect_encrypted |
2148 > connect_item:   connect_name |
2149 >                connect_host |
2150 >                connect_vhost |
2151 >                connect_send_password |
2152 >                connect_accept_password |
2153 >                connect_ssl_certificate_fingerprint |
2154 >                connect_aftype |
2155 >                connect_port |
2156 >                connect_ssl_cipher_list |
2157 >                connect_flags |
2158 >                connect_hub_mask |
2159 >                connect_leaf_mask |
2160 >                connect_class |
2161 >                connect_encrypted |
2162                  error ';' ;
2163  
2164   connect_name: NAME '=' QSTRING ';'
# Line 2129 | Line 2167 | connect_name: NAME '=' QSTRING ';'
2167      strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
2168   };
2169  
2170 < connect_host: HOST '=' QSTRING ';'
2170 > connect_host: HOST '=' QSTRING ';'
2171   {
2172    if (conf_parser_ctx.pass == 2)
2173      strlcpy(block_state.host.buf, yylval.string, sizeof(block_state.host.buf));
2174   };
2175  
2176 < connect_vhost: VHOST '=' QSTRING ';'
2176 > connect_vhost: VHOST '=' QSTRING ';'
2177   {
2178    if (conf_parser_ctx.pass == 2)
2179      strlcpy(block_state.bind.buf, yylval.string, sizeof(block_state.bind.buf));
2180   };
2181 <
2181 >
2182   connect_send_password: SEND_PASSWORD '=' QSTRING ';'
2183   {
2184    if (conf_parser_ctx.pass != 2)
# Line 2148 | Line 2186 | connect_send_password: SEND_PASSWORD '='
2186  
2187    if ($3[0] == ':')
2188      conf_error_report("Server passwords cannot begin with a colon");
2189 <  else if (strchr($3, ' ') != NULL)
2189 >  else if (strchr($3, ' '))
2190      conf_error_report("Server passwords cannot contain spaces");
2191    else
2192      strlcpy(block_state.spass.buf, yylval.string, sizeof(block_state.spass.buf));
# Line 2161 | Line 2199 | connect_accept_password: ACCEPT_PASSWORD
2199  
2200    if ($3[0] == ':')
2201      conf_error_report("Server passwords cannot begin with a colon");
2202 <  else if (strchr($3, ' ') != NULL)
2202 >  else if (strchr($3, ' '))
2203      conf_error_report("Server passwords cannot contain spaces");
2204    else
2205      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
# Line 2185 | Line 2223 | connect_aftype: AFTYPE '=' T_IPV4 ';'
2223      block_state.aftype.value = AF_INET;
2224   } | AFTYPE '=' T_IPV6 ';'
2225   {
2188 #ifdef IPV6
2226    if (conf_parser_ctx.pass == 2)
2227      block_state.aftype.value = AF_INET6;
2191 #endif
2228   };
2229  
2230   connect_flags: IRCD_FLAGS
# Line 2218 | Line 2254 | connect_encrypted: ENCRYPTED '=' TBOOL '
2254    }
2255   };
2256  
2257 < connect_hub_mask: HUB_MASK '=' QSTRING ';'
2257 > connect_hub_mask: HUB_MASK '=' QSTRING ';'
2258   {
2259    if (conf_parser_ctx.pass == 2)
2260      dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.hub.list);
2261   };
2262  
2263 < connect_leaf_mask: LEAF_MASK '=' QSTRING ';'
2263 > connect_leaf_mask: LEAF_MASK '=' QSTRING ';'
2264   {
2265    if (conf_parser_ctx.pass == 2)
2266      dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.leaf.list);
# Line 2238 | Line 2274 | connect_class: CLASS '=' QSTRING ';'
2274  
2275   connect_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
2276   {
2277 < #ifdef HAVE_LIBCRYPTO
2277 > #ifdef HAVE_TLS
2278    if (conf_parser_ctx.pass == 2)
2279      strlcpy(block_state.ciph.buf, yylval.string, sizeof(block_state.ciph.buf));
2280   #else
2281    if (conf_parser_ctx.pass == 2)
2282 <    conf_error_report("Ignoring connect::ciphers -- no OpenSSL support");
2282 >    conf_error_report("Ignoring connect::ciphers -- no TLS support");
2283   #endif
2284   };
2285  
2286  
2287   /***************************************************************************
2288 < *  section kill
2288 > * kill {} section
2289   ***************************************************************************/
2290   kill_entry: KILL
2291   {
# Line 2275 | Line 2311 | kill_entry: KILL
2311    else
2312      conf->reason = xstrdup(CONF_NOREASON);
2313    add_conf_by_address(CONF_KLINE, conf);
2314 < };
2314 > };
2315  
2316   kill_items:     kill_items kill_item | kill_item;
2317   kill_item:      kill_user | kill_reason | error;
# Line 2300 | Line 2336 | kill_user: USER '=' QSTRING ';'
2336    }
2337   };
2338  
2339 < kill_reason: REASON '=' QSTRING ';'
2339 > kill_reason: REASON '=' QSTRING ';'
2340   {
2341    if (conf_parser_ctx.pass == 2)
2342      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2343   };
2344  
2345 +
2346   /***************************************************************************
2347 < *  section deny
2347 > * deny {} section
2348   ***************************************************************************/
2349 < deny_entry: DENY
2349 > deny_entry: DENY
2350   {
2351    if (conf_parser_ctx.pass == 2)
2352      reset_block_state();
# Line 2334 | Line 2371 | deny_entry: DENY
2371        conf->reason = xstrdup(CONF_NOREASON);
2372      add_conf_by_address(CONF_DLINE, conf);
2373    }
2374 < };
2374 > };
2375  
2376   deny_items:     deny_items deny_item | deny_item;
2377   deny_item:      deny_ip | deny_reason | error;
# Line 2345 | Line 2382 | deny_ip: IP '=' QSTRING ';'
2382      strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf));
2383   };
2384  
2385 < deny_reason: REASON '=' QSTRING ';'
2385 > deny_reason: REASON '=' QSTRING ';'
2386   {
2387    if (conf_parser_ctx.pass == 2)
2388      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2389   };
2390  
2391 +
2392   /***************************************************************************
2393 < *  section exempt
2393 > * exempt {} section
2394   ***************************************************************************/
2395   exempt_entry: EXEMPT '{' exempt_items '}' ';';
2396  
2397 < exempt_items:     exempt_items exempt_item | exempt_item;
2398 < exempt_item:      exempt_ip | error;
2397 > exempt_items: exempt_items exempt_item | exempt_item;
2398 > exempt_item:  exempt_ip | error;
2399  
2400   exempt_ip: IP '=' QSTRING ';'
2401   {
2402    if (conf_parser_ctx.pass == 2)
2403    {
2404 <    if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
2404 >    if (*yylval.string && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
2405      {
2406        struct MaskItem *conf = conf_make(CONF_EXEMPT);
2407        conf->host = xstrdup(yylval.string);
# Line 2374 | Line 2412 | exempt_ip: IP '=' QSTRING ';'
2412   };
2413  
2414   /***************************************************************************
2415 < *  section gecos
2415 > * gecos {} section
2416   ***************************************************************************/
2417   gecos_entry: GECOS
2418   {
# Line 2382 | Line 2420 | gecos_entry: GECOS
2420      reset_block_state();
2421   } '{' gecos_items '}' ';'
2422   {
2385  struct MaskItem *conf = NULL;
2386
2423    if (conf_parser_ctx.pass != 2)
2424      break;
2425  
2426    if (!block_state.name.buf[0])
2427      break;
2428  
2429 <  conf = conf_make(CONF_XLINE);
2430 <  conf->name = xstrdup(block_state.name.buf);
2429 >  struct GecosItem *gecos = gecos_make();
2430 >  gecos->mask = xstrdup(block_state.name.buf);
2431  
2432    if (block_state.rpass.buf[0])
2433 <    conf->reason = xstrdup(block_state.rpass.buf);
2433 >    gecos->reason = xstrdup(block_state.rpass.buf);
2434    else
2435 <    conf->reason = xstrdup(CONF_NOREASON);
2435 >    gecos->reason = xstrdup(CONF_NOREASON);
2436   };
2437  
2438   gecos_items: gecos_items gecos_item | gecos_item;
2439   gecos_item:  gecos_name | gecos_reason | error;
2440  
2441 < gecos_name: NAME '=' QSTRING ';'
2441 > gecos_name: NAME '=' QSTRING ';'
2442   {
2443    if (conf_parser_ctx.pass == 2)
2444      strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
2445   };
2446  
2447 < gecos_reason: REASON '=' QSTRING ';'
2447 > gecos_reason: REASON '=' QSTRING ';'
2448   {
2449    if (conf_parser_ctx.pass == 2)
2450      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2451   };
2452  
2453 +
2454   /***************************************************************************
2455 < *  section general
2455 > * general {} section
2456   ***************************************************************************/
2457 < general_entry: GENERAL
2421 <  '{' general_items '}' ';';
2457 > general_entry: GENERAL '{' general_items '}' ';';
2458  
2459   general_items:      general_items general_item | general_item;
2460 < general_item:       general_hide_spoof_ips | general_ignore_bogus_ts |
2461 <                    general_failed_oper_notice | general_anti_nick_flood |
2462 <                    general_max_nick_time | general_max_nick_changes |
2463 <                    general_max_accept | general_anti_spam_exit_message_time |
2464 <                    general_ts_warn_delta | general_ts_max_delta |
2460 > general_item:       general_away_count |
2461 >                    general_away_time |
2462 >                    general_ignore_bogus_ts |
2463 >                    general_failed_oper_notice |
2464 >                    general_anti_nick_flood |
2465 >                    general_max_nick_time |
2466 >                    general_max_nick_changes |
2467 >                    general_max_accept |
2468 >                    general_whowas_history_length |
2469 >                    general_anti_spam_exit_message_time |
2470 >                    general_ts_warn_delta |
2471 >                    general_ts_max_delta |
2472                      general_kill_chase_time_limit |
2473                      general_invisible_on_connect |
2474 <                    general_warn_no_nline | general_dots_in_ident |
2475 <                    general_stats_o_oper_only | general_stats_k_oper_only |
2476 <                    general_pace_wait | general_stats_i_oper_only |
2477 <                    general_pace_wait_simple | general_stats_P_oper_only |
2474 >                    general_warn_no_connect_block |
2475 >                    general_dots_in_ident |
2476 >                    general_stats_i_oper_only |
2477 >                    general_stats_k_oper_only |
2478 >                    general_stats_m_oper_only |
2479 >                    general_stats_o_oper_only |
2480 >                    general_stats_P_oper_only |
2481                      general_stats_u_oper_only |
2482 <                    general_short_motd | general_no_oper_flood |
2483 <                    general_true_no_oper_flood | general_oper_pass_resv |
2484 <                    general_oper_only_umodes | general_max_targets |
2485 <                    general_use_egd | general_egdpool_path |
2486 <                    general_oper_umodes | general_caller_id_wait |
2487 <                    general_opers_bypass_callerid | general_default_floodcount |
2488 <                    general_min_nonwildcard | general_min_nonwildcard_simple |
2489 <                    general_throttle_time | general_havent_read_conf |
2482 >                    general_pace_wait |
2483 >                    general_pace_wait_simple |
2484 >                    general_short_motd |
2485 >                    general_no_oper_flood |
2486 >                    general_oper_only_umodes |
2487 >                    general_max_targets |
2488 >                    general_oper_umodes |
2489 >                    general_caller_id_wait |
2490 >                    general_opers_bypass_callerid |
2491 >                    general_default_floodcount |
2492 >                    general_default_floodtime |
2493 >                    general_min_nonwildcard |
2494 >                    general_min_nonwildcard_simple |
2495 >                    general_throttle_count |
2496 >                    general_throttle_time |
2497                      general_ping_cookie |
2498 <                    general_disable_auth |
2499 <                    general_tkline_expire_notices | general_gline_enable |
2500 <                    general_gline_duration | general_gline_request_duration |
2501 <                    general_gline_min_cidr |
2502 <                    general_gline_min_cidr6 |
2503 <                    general_stats_e_disabled |
2504 <                    general_max_watch | general_services_name |
2505 <                    general_cycle_on_host_change |
2506 <                    error;
2498 >                    general_disable_auth |
2499 >                    general_tkline_expire_notices |
2500 >                    general_dline_min_cidr |
2501 >                    general_dline_min_cidr6 |
2502 >                    general_kline_min_cidr |
2503 >                    general_kline_min_cidr6 |
2504 >                    general_stats_e_disabled |
2505 >                    general_max_watch |
2506 >                    general_cycle_on_host_change |
2507 >                    error;
2508  
2509  
2510 < general_max_watch: MAX_WATCH '=' NUMBER ';'
2510 > general_away_count: AWAY_COUNT '=' NUMBER ';'
2511   {
2512 <  ConfigFileEntry.max_watch = $3;
2512 >  ConfigGeneral.away_count = $3;
2513   };
2514  
2515 < general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';'
2515 > general_away_time: AWAY_TIME '=' timespec ';'
2516   {
2517 <  if (conf_parser_ctx.pass == 2)
2464 <    ConfigFileEntry.cycle_on_host_change = yylval.number;
2517 >  ConfigGeneral.away_time = $3;
2518   };
2519  
2520 < general_gline_enable: GLINE_ENABLE '=' TBOOL ';'
2520 > general_max_watch: MAX_WATCH '=' NUMBER ';'
2521   {
2522 <  if (conf_parser_ctx.pass == 2)
2470 <    ConfigFileEntry.glines = yylval.number;
2522 >  ConfigGeneral.max_watch = $3;
2523   };
2524  
2525 < general_gline_duration: GLINE_DURATION '=' timespec ';'
2525 > general_whowas_history_length: WHOWAS_HISTORY_LENGTH '=' NUMBER ';'
2526   {
2527 <  if (conf_parser_ctx.pass == 2)
2476 <    ConfigFileEntry.gline_time = $3;
2527 >  ConfigGeneral.whowas_history_length = $3;
2528   };
2529  
2530 < general_gline_request_duration: GLINE_REQUEST_DURATION '=' timespec ';'
2530 > general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';'
2531   {
2532    if (conf_parser_ctx.pass == 2)
2533 <    ConfigFileEntry.gline_request_time = $3;
2533 >    ConfigGeneral.cycle_on_host_change = yylval.number;
2534   };
2535  
2536 < general_gline_min_cidr: GLINE_MIN_CIDR '=' NUMBER ';'
2536 > general_dline_min_cidr: DLINE_MIN_CIDR '=' NUMBER ';'
2537   {
2538 <  ConfigFileEntry.gline_min_cidr = $3;
2538 >  ConfigGeneral.dline_min_cidr = $3;
2539   };
2540  
2541 < general_gline_min_cidr6: GLINE_MIN_CIDR6 '=' NUMBER ';'
2541 > general_dline_min_cidr6: DLINE_MIN_CIDR6 '=' NUMBER ';'
2542   {
2543 <  ConfigFileEntry.gline_min_cidr6 = $3;
2543 >  ConfigGeneral.dline_min_cidr6 = $3;
2544   };
2545  
2546 < general_tkline_expire_notices: TKLINE_EXPIRE_NOTICES '=' TBOOL ';'
2546 > general_kline_min_cidr: KLINE_MIN_CIDR '=' NUMBER ';'
2547   {
2548 <  ConfigFileEntry.tkline_expire_notices = yylval.number;
2548 >  ConfigGeneral.kline_min_cidr = $3;
2549   };
2550  
2551 < general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';'
2551 > general_kline_min_cidr6: KLINE_MIN_CIDR6 '=' NUMBER ';'
2552   {
2553 <  ConfigFileEntry.kill_chase_time_limit = $3;
2553 >  ConfigGeneral.kline_min_cidr6 = $3;
2554   };
2555  
2556 < general_hide_spoof_ips: HIDE_SPOOF_IPS '=' TBOOL ';'
2556 > general_tkline_expire_notices: TKLINE_EXPIRE_NOTICES '=' TBOOL ';'
2557   {
2558 <  ConfigFileEntry.hide_spoof_ips = yylval.number;
2558 >  ConfigGeneral.tkline_expire_notices = yylval.number;
2559 > };
2560 >
2561 > general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';'
2562 > {
2563 >  ConfigGeneral.kill_chase_time_limit = $3;
2564   };
2565  
2566   general_ignore_bogus_ts: IGNORE_BOGUS_TS '=' TBOOL ';'
2567   {
2568 <  ConfigFileEntry.ignore_bogus_ts = yylval.number;
2568 >  ConfigGeneral.ignore_bogus_ts = yylval.number;
2569   };
2570  
2571   general_failed_oper_notice: FAILED_OPER_NOTICE '=' TBOOL ';'
2572   {
2573 <  ConfigFileEntry.failed_oper_notice = yylval.number;
2573 >  ConfigGeneral.failed_oper_notice = yylval.number;
2574   };
2575  
2576   general_anti_nick_flood: ANTI_NICK_FLOOD '=' TBOOL ';'
2577   {
2578 <  ConfigFileEntry.anti_nick_flood = yylval.number;
2578 >  ConfigGeneral.anti_nick_flood = yylval.number;
2579   };
2580  
2581   general_max_nick_time: MAX_NICK_TIME '=' timespec ';'
2582   {
2583 <  ConfigFileEntry.max_nick_time = $3;
2583 >  ConfigGeneral.max_nick_time = $3;
2584   };
2585  
2586   general_max_nick_changes: MAX_NICK_CHANGES '=' NUMBER ';'
2587   {
2588 <  ConfigFileEntry.max_nick_changes = $3;
2588 >  ConfigGeneral.max_nick_changes = $3;
2589   };
2590  
2591   general_max_accept: MAX_ACCEPT '=' NUMBER ';'
2592   {
2593 <  ConfigFileEntry.max_accept = $3;
2593 >  ConfigGeneral.max_accept = $3;
2594   };
2595  
2596   general_anti_spam_exit_message_time: ANTI_SPAM_EXIT_MESSAGE_TIME '=' timespec ';'
2597   {
2598 <  ConfigFileEntry.anti_spam_exit_message_time = $3;
2598 >  ConfigGeneral.anti_spam_exit_message_time = $3;
2599   };
2600  
2601   general_ts_warn_delta: TS_WARN_DELTA '=' timespec ';'
2602   {
2603 <  ConfigFileEntry.ts_warn_delta = $3;
2603 >  ConfigGeneral.ts_warn_delta = $3;
2604   };
2605  
2606   general_ts_max_delta: TS_MAX_DELTA '=' timespec ';'
2607   {
2608    if (conf_parser_ctx.pass == 2)
2609 <    ConfigFileEntry.ts_max_delta = $3;
2609 >    ConfigGeneral.ts_max_delta = $3;
2610   };
2611  
2612 < general_havent_read_conf: HAVENT_READ_CONF '=' NUMBER ';'
2612 > general_invisible_on_connect: INVISIBLE_ON_CONNECT '=' TBOOL ';'
2613   {
2614 <  if (($3 > 0) && conf_parser_ctx.pass == 1)
2559 <  {
2560 <    ilog(LOG_TYPE_IRCD, "You haven't read your config file properly.");
2561 <    ilog(LOG_TYPE_IRCD, "There is a line in the example conf that will kill your server if not removed.");
2562 <    ilog(LOG_TYPE_IRCD, "Consider actually reading/editing the conf file, and removing this line.");
2563 <    exit(0);
2564 <  }
2614 >  ConfigGeneral.invisible_on_connect = yylval.number;
2615   };
2616  
2617 < general_invisible_on_connect: INVISIBLE_ON_CONNECT '=' TBOOL ';'
2617 > general_warn_no_connect_block: WARN_NO_CONNECT_BLOCK '=' TBOOL ';'
2618   {
2619 <  ConfigFileEntry.invisible_on_connect = yylval.number;
2619 >  ConfigGeneral.warn_no_connect_block = yylval.number;
2620   };
2621  
2622 < general_warn_no_nline: WARN_NO_NLINE '=' TBOOL ';'
2622 > general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';'
2623   {
2624 <  ConfigFileEntry.warn_no_nline = yylval.number;
2624 >  ConfigGeneral.stats_e_disabled = yylval.number;
2625   };
2626  
2627 < general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';'
2627 > general_stats_m_oper_only: STATS_M_OPER_ONLY '=' TBOOL ';'
2628   {
2629 <  ConfigFileEntry.stats_e_disabled = yylval.number;
2629 >  ConfigGeneral.stats_m_oper_only = yylval.number;
2630   };
2631  
2632   general_stats_o_oper_only: STATS_O_OPER_ONLY '=' TBOOL ';'
2633   {
2634 <  ConfigFileEntry.stats_o_oper_only = yylval.number;
2634 >  ConfigGeneral.stats_o_oper_only = yylval.number;
2635   };
2636  
2637   general_stats_P_oper_only: STATS_P_OPER_ONLY '=' TBOOL ';'
2638   {
2639 <  ConfigFileEntry.stats_P_oper_only = yylval.number;
2639 >  ConfigGeneral.stats_P_oper_only = yylval.number;
2640   };
2641  
2642   general_stats_u_oper_only: STATS_U_OPER_ONLY '=' TBOOL ';'
2643   {
2644 <  ConfigFileEntry.stats_u_oper_only = yylval.number;
2644 >  ConfigGeneral.stats_u_oper_only = yylval.number;
2645   };
2646  
2647   general_stats_k_oper_only: STATS_K_OPER_ONLY '=' TBOOL ';'
2648   {
2649 <  ConfigFileEntry.stats_k_oper_only = 2 * yylval.number;
2649 >  ConfigGeneral.stats_k_oper_only = 2 * yylval.number;
2650   } | STATS_K_OPER_ONLY '=' TMASKED ';'
2651   {
2652 <  ConfigFileEntry.stats_k_oper_only = 1;
2652 >  ConfigGeneral.stats_k_oper_only = 1;
2653   };
2654  
2655   general_stats_i_oper_only: STATS_I_OPER_ONLY '=' TBOOL ';'
2656   {
2657 <  ConfigFileEntry.stats_i_oper_only = 2 * yylval.number;
2657 >  ConfigGeneral.stats_i_oper_only = 2 * yylval.number;
2658   } | STATS_I_OPER_ONLY '=' TMASKED ';'
2659   {
2660 <  ConfigFileEntry.stats_i_oper_only = 1;
2660 >  ConfigGeneral.stats_i_oper_only = 1;
2661   };
2662  
2663   general_pace_wait: PACE_WAIT '=' timespec ';'
2664   {
2665 <  ConfigFileEntry.pace_wait = $3;
2665 >  ConfigGeneral.pace_wait = $3;
2666   };
2667  
2668   general_caller_id_wait: CALLER_ID_WAIT '=' timespec ';'
2669   {
2670 <  ConfigFileEntry.caller_id_wait = $3;
2670 >  ConfigGeneral.caller_id_wait = $3;
2671   };
2672  
2673   general_opers_bypass_callerid: OPERS_BYPASS_CALLERID '=' TBOOL ';'
2674   {
2675 <  ConfigFileEntry.opers_bypass_callerid = yylval.number;
2675 >  ConfigGeneral.opers_bypass_callerid = yylval.number;
2676   };
2677  
2678   general_pace_wait_simple: PACE_WAIT_SIMPLE '=' timespec ';'
2679   {
2680 <  ConfigFileEntry.pace_wait_simple = $3;
2680 >  ConfigGeneral.pace_wait_simple = $3;
2681   };
2682  
2683   general_short_motd: SHORT_MOTD '=' TBOOL ';'
2684   {
2685 <  ConfigFileEntry.short_motd = yylval.number;
2636 < };
2637 <  
2638 < general_no_oper_flood: NO_OPER_FLOOD '=' TBOOL ';'
2639 < {
2640 <  ConfigFileEntry.no_oper_flood = yylval.number;
2641 < };
2642 <
2643 < general_true_no_oper_flood: TRUE_NO_OPER_FLOOD '=' TBOOL ';'
2644 < {
2645 <  ConfigFileEntry.true_no_oper_flood = yylval.number;
2685 >  ConfigGeneral.short_motd = yylval.number;
2686   };
2687  
2688 < general_oper_pass_resv: OPER_PASS_RESV '=' TBOOL ';'
2688 > general_no_oper_flood: NO_OPER_FLOOD '=' TBOOL ';'
2689   {
2690 <  ConfigFileEntry.oper_pass_resv = yylval.number;
2690 >  ConfigGeneral.no_oper_flood = yylval.number;
2691   };
2692  
2693   general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';'
2694   {
2695 <  ConfigFileEntry.dots_in_ident = $3;
2695 >  ConfigGeneral.dots_in_ident = $3;
2696   };
2697  
2698   general_max_targets: MAX_TARGETS '=' NUMBER ';'
2699   {
2700 <  ConfigFileEntry.max_targets = $3;
2661 < };
2662 <
2663 < general_use_egd: USE_EGD '=' TBOOL ';'
2664 < {
2665 <  ConfigFileEntry.use_egd = yylval.number;
2700 >  ConfigGeneral.max_targets = $3;
2701   };
2702  
2703 < general_egdpool_path: EGDPOOL_PATH '=' QSTRING ';'
2669 < {
2670 <  if (conf_parser_ctx.pass == 2)
2671 <  {
2672 <    MyFree(ConfigFileEntry.egdpool_path);
2673 <    ConfigFileEntry.egdpool_path = xstrdup(yylval.string);
2674 <  }
2675 < };
2676 <
2677 < general_services_name: T_SERVICES_NAME '=' QSTRING ';'
2703 > general_ping_cookie: PING_COOKIE '=' TBOOL ';'
2704   {
2705 <  if (conf_parser_ctx.pass == 2 && valid_servname(yylval.string))
2680 <  {
2681 <    MyFree(ConfigFileEntry.service_name);
2682 <    ConfigFileEntry.service_name = xstrdup(yylval.string);
2683 <  }
2705 >  ConfigGeneral.ping_cookie = yylval.number;
2706   };
2707  
2708 < general_ping_cookie: PING_COOKIE '=' TBOOL ';'
2708 > general_disable_auth: DISABLE_AUTH '=' TBOOL ';'
2709   {
2710 <  ConfigFileEntry.ping_cookie = yylval.number;
2710 >  ConfigGeneral.disable_auth = yylval.number;
2711   };
2712  
2713 < general_disable_auth: DISABLE_AUTH '=' TBOOL ';'
2713 > general_throttle_count: THROTTLE_COUNT '=' NUMBER ';'
2714   {
2715 <  ConfigFileEntry.disable_auth = yylval.number;
2715 >  ConfigGeneral.throttle_count = $3;
2716   };
2717  
2718   general_throttle_time: THROTTLE_TIME '=' timespec ';'
2719   {
2720 <  ConfigFileEntry.throttle_time = yylval.number;
2720 >  ConfigGeneral.throttle_time = $3;
2721   };
2722  
2723   general_oper_umodes: OPER_UMODES
2724   {
2725 <  ConfigFileEntry.oper_umodes = 0;
2725 >  ConfigGeneral.oper_umodes = 0;
2726   } '='  umode_oitems ';' ;
2727  
2728   umode_oitems:    umode_oitems ',' umode_oitem | umode_oitem;
2729   umode_oitem:     T_BOTS
2730   {
2731 <  ConfigFileEntry.oper_umodes |= UMODE_BOTS;
2731 >  ConfigGeneral.oper_umodes |= UMODE_BOTS;
2732   } | T_CCONN
2733   {
2734 <  ConfigFileEntry.oper_umodes |= UMODE_CCONN;
2734 >  ConfigGeneral.oper_umodes |= UMODE_CCONN;
2735   } | T_DEAF
2736   {
2737 <  ConfigFileEntry.oper_umodes |= UMODE_DEAF;
2737 >  ConfigGeneral.oper_umodes |= UMODE_DEAF;
2738   } | T_DEBUG
2739   {
2740 <  ConfigFileEntry.oper_umodes |= UMODE_DEBUG;
2740 >  ConfigGeneral.oper_umodes |= UMODE_DEBUG;
2741   } | T_FULL
2742   {
2743 <  ConfigFileEntry.oper_umodes |= UMODE_FULL;
2743 >  ConfigGeneral.oper_umodes |= UMODE_FULL;
2744   } | HIDDEN
2745   {
2746 <  ConfigFileEntry.oper_umodes |= UMODE_HIDDEN;
2746 >  ConfigGeneral.oper_umodes |= UMODE_HIDDEN;
2747 > } | HIDE_CHANS
2748 > {
2749 >  ConfigGeneral.oper_umodes |= UMODE_HIDECHANS;
2750 > } | HIDE_IDLE
2751 > {
2752 >  ConfigGeneral.oper_umodes |= UMODE_HIDEIDLE;
2753   } | T_SKILL
2754   {
2755 <  ConfigFileEntry.oper_umodes |= UMODE_SKILL;
2755 >  ConfigGeneral.oper_umodes |= UMODE_SKILL;
2756   } | T_NCHANGE
2757   {
2758 <  ConfigFileEntry.oper_umodes |= UMODE_NCHANGE;
2758 >  ConfigGeneral.oper_umodes |= UMODE_NCHANGE;
2759   } | T_REJ
2760   {
2761 <  ConfigFileEntry.oper_umodes |= UMODE_REJ;
2761 >  ConfigGeneral.oper_umodes |= UMODE_REJ;
2762   } | T_UNAUTH
2763   {
2764 <  ConfigFileEntry.oper_umodes |= UMODE_UNAUTH;
2764 >  ConfigGeneral.oper_umodes |= UMODE_UNAUTH;
2765   } | T_SPY
2766   {
2767 <  ConfigFileEntry.oper_umodes |= UMODE_SPY;
2767 >  ConfigGeneral.oper_umodes |= UMODE_SPY;
2768   } | T_EXTERNAL
2769   {
2770 <  ConfigFileEntry.oper_umodes |= UMODE_EXTERNAL;
2743 < } | T_OPERWALL
2744 < {
2745 <  ConfigFileEntry.oper_umodes |= UMODE_OPERWALL;
2770 >  ConfigGeneral.oper_umodes |= UMODE_EXTERNAL;
2771   } | T_SERVNOTICE
2772   {
2773 <  ConfigFileEntry.oper_umodes |= UMODE_SERVNOTICE;
2773 >  ConfigGeneral.oper_umodes |= UMODE_SERVNOTICE;
2774   } | T_INVISIBLE
2775   {
2776 <  ConfigFileEntry.oper_umodes |= UMODE_INVISIBLE;
2776 >  ConfigGeneral.oper_umodes |= UMODE_INVISIBLE;
2777   } | T_WALLOP
2778   {
2779 <  ConfigFileEntry.oper_umodes |= UMODE_WALLOP;
2779 >  ConfigGeneral.oper_umodes |= UMODE_WALLOP;
2780   } | T_SOFTCALLERID
2781   {
2782 <  ConfigFileEntry.oper_umodes |= UMODE_SOFTCALLERID;
2782 >  ConfigGeneral.oper_umodes |= UMODE_SOFTCALLERID;
2783   } | T_CALLERID
2784   {
2785 <  ConfigFileEntry.oper_umodes |= UMODE_CALLERID;
2785 >  ConfigGeneral.oper_umodes |= UMODE_CALLERID;
2786   } | T_LOCOPS
2787   {
2788 <  ConfigFileEntry.oper_umodes |= UMODE_LOCOPS;
2788 >  ConfigGeneral.oper_umodes |= UMODE_LOCOPS;
2789   } | T_NONONREG
2790   {
2791 <  ConfigFileEntry.oper_umodes |= UMODE_REGONLY;
2791 >  ConfigGeneral.oper_umodes |= UMODE_REGONLY;
2792   } | T_FARCONNECT
2793   {
2794 <  ConfigFileEntry.oper_umodes |= UMODE_FARCONNECT;
2794 >  ConfigGeneral.oper_umodes |= UMODE_FARCONNECT;
2795   };
2796  
2797 < general_oper_only_umodes: OPER_ONLY_UMODES
2797 > general_oper_only_umodes: OPER_ONLY_UMODES
2798   {
2799 <  ConfigFileEntry.oper_only_umodes = 0;
2799 >  ConfigGeneral.oper_only_umodes = 0;
2800   } '='  umode_items ';' ;
2801  
2802 < umode_items:    umode_items ',' umode_item | umode_item;
2803 < umode_item:     T_BOTS
2802 > umode_items:  umode_items ',' umode_item | umode_item;
2803 > umode_item:   T_BOTS
2804   {
2805 <  ConfigFileEntry.oper_only_umodes |= UMODE_BOTS;
2805 >  ConfigGeneral.oper_only_umodes |= UMODE_BOTS;
2806   } | T_CCONN
2807   {
2808 <  ConfigFileEntry.oper_only_umodes |= UMODE_CCONN;
2808 >  ConfigGeneral.oper_only_umodes |= UMODE_CCONN;
2809   } | T_DEAF
2810   {
2811 <  ConfigFileEntry.oper_only_umodes |= UMODE_DEAF;
2811 >  ConfigGeneral.oper_only_umodes |= UMODE_DEAF;
2812   } | T_DEBUG
2813   {
2814 <  ConfigFileEntry.oper_only_umodes |= UMODE_DEBUG;
2814 >  ConfigGeneral.oper_only_umodes |= UMODE_DEBUG;
2815   } | T_FULL
2816 < {
2817 <  ConfigFileEntry.oper_only_umodes |= UMODE_FULL;
2816 > {
2817 >  ConfigGeneral.oper_only_umodes |= UMODE_FULL;
2818   } | T_SKILL
2819   {
2820 <  ConfigFileEntry.oper_only_umodes |= UMODE_SKILL;
2820 >  ConfigGeneral.oper_only_umodes |= UMODE_SKILL;
2821   } | HIDDEN
2822   {
2823 <  ConfigFileEntry.oper_only_umodes |= UMODE_HIDDEN;
2823 >  ConfigGeneral.oper_only_umodes |= UMODE_HIDDEN;
2824   } | T_NCHANGE
2825   {
2826 <  ConfigFileEntry.oper_only_umodes |= UMODE_NCHANGE;
2826 >  ConfigGeneral.oper_only_umodes |= UMODE_NCHANGE;
2827   } | T_REJ
2828   {
2829 <  ConfigFileEntry.oper_only_umodes |= UMODE_REJ;
2829 >  ConfigGeneral.oper_only_umodes |= UMODE_REJ;
2830   } | T_UNAUTH
2831   {
2832 <  ConfigFileEntry.oper_only_umodes |= UMODE_UNAUTH;
2832 >  ConfigGeneral.oper_only_umodes |= UMODE_UNAUTH;
2833   } | T_SPY
2834   {
2835 <  ConfigFileEntry.oper_only_umodes |= UMODE_SPY;
2835 >  ConfigGeneral.oper_only_umodes |= UMODE_SPY;
2836   } | T_EXTERNAL
2837   {
2838 <  ConfigFileEntry.oper_only_umodes |= UMODE_EXTERNAL;
2814 < } | T_OPERWALL
2815 < {
2816 <  ConfigFileEntry.oper_only_umodes |= UMODE_OPERWALL;
2838 >  ConfigGeneral.oper_only_umodes |= UMODE_EXTERNAL;
2839   } | T_SERVNOTICE
2840   {
2841 <  ConfigFileEntry.oper_only_umodes |= UMODE_SERVNOTICE;
2841 >  ConfigGeneral.oper_only_umodes |= UMODE_SERVNOTICE;
2842   } | T_INVISIBLE
2843   {
2844 <  ConfigFileEntry.oper_only_umodes |= UMODE_INVISIBLE;
2844 >  ConfigGeneral.oper_only_umodes |= UMODE_INVISIBLE;
2845   } | T_WALLOP
2846   {
2847 <  ConfigFileEntry.oper_only_umodes |= UMODE_WALLOP;
2847 >  ConfigGeneral.oper_only_umodes |= UMODE_WALLOP;
2848   } | T_SOFTCALLERID
2849   {
2850 <  ConfigFileEntry.oper_only_umodes |= UMODE_SOFTCALLERID;
2850 >  ConfigGeneral.oper_only_umodes |= UMODE_SOFTCALLERID;
2851   } | T_CALLERID
2852   {
2853 <  ConfigFileEntry.oper_only_umodes |= UMODE_CALLERID;
2853 >  ConfigGeneral.oper_only_umodes |= UMODE_CALLERID;
2854   } | T_LOCOPS
2855   {
2856 <  ConfigFileEntry.oper_only_umodes |= UMODE_LOCOPS;
2856 >  ConfigGeneral.oper_only_umodes |= UMODE_LOCOPS;
2857   } | T_NONONREG
2858   {
2859 <  ConfigFileEntry.oper_only_umodes |= UMODE_REGONLY;
2859 >  ConfigGeneral.oper_only_umodes |= UMODE_REGONLY;
2860   } | T_FARCONNECT
2861   {
2862 <  ConfigFileEntry.oper_only_umodes |= UMODE_FARCONNECT;
2862 >  ConfigGeneral.oper_only_umodes |= UMODE_FARCONNECT;
2863   };
2864  
2865   general_min_nonwildcard: MIN_NONWILDCARD '=' NUMBER ';'
2866   {
2867 <  ConfigFileEntry.min_nonwildcard = $3;
2867 >  ConfigGeneral.min_nonwildcard = $3;
2868   };
2869  
2870   general_min_nonwildcard_simple: MIN_NONWILDCARD_SIMPLE '=' NUMBER ';'
2871   {
2872 <  ConfigFileEntry.min_nonwildcard_simple = $3;
2872 >  ConfigGeneral.min_nonwildcard_simple = $3;
2873   };
2874  
2875   general_default_floodcount: DEFAULT_FLOODCOUNT '=' NUMBER ';'
2876   {
2877 <  ConfigFileEntry.default_floodcount = $3;
2877 >  ConfigGeneral.default_floodcount = $3;
2878 > };
2879 >
2880 > general_default_floodtime: DEFAULT_FLOODTIME '=' timespec ';'
2881 > {
2882 >  ConfigGeneral.default_floodtime = $3;
2883   };
2884  
2885  
2886   /***************************************************************************
2887 < *  section channel
2887 > * channel {} section
2888   ***************************************************************************/
2889 < channel_entry: CHANNEL
2863 <  '{' channel_items '}' ';';
2889 > channel_entry: CHANNEL '{' channel_items '}' ';';
2890  
2891   channel_items:      channel_items channel_item | channel_item;
2892   channel_item:       channel_max_bans |
2893 <                    channel_knock_delay | channel_knock_delay_channel |
2894 <                    channel_max_chans_per_user | channel_max_chans_per_oper |
2895 <                    channel_default_split_user_count |
2896 <                    channel_default_split_server_count |
2897 <                    channel_no_create_on_split |
2898 <                    channel_no_join_on_split |
2899 <                    channel_jflood_count | channel_jflood_time |
2900 <                    channel_disable_fake_channels | error;
2893 >                    channel_max_bans_large |
2894 >                    channel_invite_client_count |
2895 >                    channel_invite_client_time |
2896 >                    channel_invite_delay_channel |
2897 >                    channel_invite_expire_time |
2898 >                    channel_knock_client_count |
2899 >                    channel_knock_client_time |
2900 >                    channel_knock_delay_channel |
2901 >                    channel_max_channels |
2902 >                    channel_max_invites |
2903 >                    channel_default_join_flood_count |
2904 >                    channel_default_join_flood_time |
2905 >                    channel_disable_fake_channels |
2906 >                    error;
2907  
2908   channel_disable_fake_channels: DISABLE_FAKE_CHANNELS '=' TBOOL ';'
2909   {
2910    ConfigChannel.disable_fake_channels = yylval.number;
2911   };
2912  
2913 < channel_knock_delay: KNOCK_DELAY '=' timespec ';'
2913 > channel_invite_client_count: INVITE_CLIENT_COUNT '=' NUMBER ';'
2914   {
2915 <  ConfigChannel.knock_delay = $3;
2915 >  ConfigChannel.invite_client_count = $3;
2916   };
2917  
2918 < channel_knock_delay_channel: KNOCK_DELAY_CHANNEL '=' timespec ';'
2918 > channel_invite_client_time: INVITE_CLIENT_TIME '=' timespec ';'
2919   {
2920 <  ConfigChannel.knock_delay_channel = $3;
2920 >  ConfigChannel.invite_client_time = $3;
2921   };
2922  
2923 < channel_max_chans_per_user: MAX_CHANS_PER_USER '=' NUMBER ';'
2923 > channel_invite_delay_channel: INVITE_DELAY_CHANNEL '=' timespec ';'
2924   {
2925 <  ConfigChannel.max_chans_per_user = $3;
2925 >  ConfigChannel.invite_delay_channel = $3;
2926   };
2927  
2928 < channel_max_chans_per_oper: MAX_CHANS_PER_OPER '=' NUMBER ';'
2928 > channel_invite_expire_time: INVITE_EXPIRE_TIME '=' timespec ';'
2929   {
2930 <  ConfigChannel.max_chans_per_oper = $3;
2930 >  ConfigChannel.invite_expire_time = $3;
2931   };
2932  
2933 < channel_max_bans: MAX_BANS '=' NUMBER ';'
2933 > channel_knock_client_count: KNOCK_CLIENT_COUNT '=' NUMBER ';'
2934   {
2935 <  ConfigChannel.max_bans = $3;
2935 >  ConfigChannel.knock_client_count = $3;
2936 > };
2937 >
2938 > channel_knock_client_time: KNOCK_CLIENT_TIME '=' timespec ';'
2939 > {
2940 >  ConfigChannel.knock_client_time = $3;
2941 > };
2942 >
2943 > channel_knock_delay_channel: KNOCK_DELAY_CHANNEL '=' timespec ';'
2944 > {
2945 >  ConfigChannel.knock_delay_channel = $3;
2946   };
2947  
2948 < channel_default_split_user_count: DEFAULT_SPLIT_USER_COUNT '=' NUMBER ';'
2948 > channel_max_channels: MAX_CHANNELS '=' NUMBER ';'
2949   {
2950 <  ConfigChannel.default_split_user_count = $3;
2950 >  ConfigChannel.max_channels = $3;
2951   };
2952  
2953 < channel_default_split_server_count: DEFAULT_SPLIT_SERVER_COUNT '=' NUMBER ';'
2953 > channel_max_invites: MAX_INVITES '=' NUMBER ';'
2954   {
2955 <  ConfigChannel.default_split_server_count = $3;
2955 >  ConfigChannel.max_invites = $3;
2956   };
2957  
2958 < channel_no_create_on_split: NO_CREATE_ON_SPLIT '=' TBOOL ';'
2958 > channel_max_bans: MAX_BANS '=' NUMBER ';'
2959   {
2960 <  ConfigChannel.no_create_on_split = yylval.number;
2960 >  ConfigChannel.max_bans = $3;
2961   };
2962  
2963 < channel_no_join_on_split: NO_JOIN_ON_SPLIT '=' TBOOL ';'
2963 > channel_max_bans_large: MAX_BANS_LARGE '=' NUMBER ';'
2964   {
2965 <  ConfigChannel.no_join_on_split = yylval.number;
2965 >  ConfigChannel.max_bans_large = $3;
2966   };
2967  
2968 < channel_jflood_count: JOIN_FLOOD_COUNT '=' NUMBER ';'
2968 > channel_default_join_flood_count: DEFAULT_JOIN_FLOOD_COUNT '=' NUMBER ';'
2969   {
2970 <  GlobalSetOptions.joinfloodcount = yylval.number;
2970 >  ConfigChannel.default_join_flood_count = yylval.number;
2971   };
2972  
2973 < channel_jflood_time: JOIN_FLOOD_TIME '=' timespec ';'
2973 > channel_default_join_flood_time: DEFAULT_JOIN_FLOOD_TIME '=' timespec ';'
2974   {
2975 <  GlobalSetOptions.joinfloodtime = yylval.number;
2975 >  ConfigChannel.default_join_flood_time = $3;
2976   };
2977  
2978 +
2979   /***************************************************************************
2980 < *  section serverhide
2980 > * serverhide {} section
2981   ***************************************************************************/
2982 < serverhide_entry: SERVERHIDE
2940 <  '{' serverhide_items '}' ';';
2982 > serverhide_entry: SERVERHIDE '{' serverhide_items '}' ';';
2983  
2984   serverhide_items:   serverhide_items serverhide_item | serverhide_item;
2985 < serverhide_item:    serverhide_flatten_links | serverhide_disable_remote_commands |
2985 > serverhide_item:    serverhide_flatten_links |
2986 >                    serverhide_flatten_links_delay |
2987 >                    serverhide_flatten_links_file |
2988 >                    serverhide_disable_remote_commands |
2989                      serverhide_hide_servers |
2990 <                    serverhide_hide_services |
2991 <                    serverhide_links_delay |
2992 <                    serverhide_hidden | serverhide_hidden_name |
2993 <                    serverhide_hide_server_ips |
2990 >                    serverhide_hide_services |
2991 >                    serverhide_hidden |
2992 >                    serverhide_hidden_name |
2993 >                    serverhide_hide_server_ips |
2994                      error;
2995  
2996   serverhide_flatten_links: FLATTEN_LINKS '=' TBOOL ';'
# Line 2954 | Line 2999 | serverhide_flatten_links: FLATTEN_LINKS
2999      ConfigServerHide.flatten_links = yylval.number;
3000   };
3001  
3002 + serverhide_flatten_links_delay: FLATTEN_LINKS_DELAY '=' timespec ';'
3003 + {
3004 +  if (conf_parser_ctx.pass == 2)
3005 +  {
3006 +    if ($3 > 0)
3007 +    {
3008 +      event_write_links_file.when = $3;
3009 +      event_add(&event_write_links_file, NULL);
3010 +    }
3011 +    else
3012 +     event_delete(&event_write_links_file);
3013 +
3014 +    ConfigServerHide.flatten_links_delay = $3;
3015 +  }
3016 + };
3017 +
3018 + serverhide_flatten_links_file: FLATTEN_LINKS_FILE '=' QSTRING ';'
3019 + {
3020 +  if (conf_parser_ctx.pass == 2)
3021 +  {
3022 +    xfree(ConfigServerHide.flatten_links_file);
3023 +    ConfigServerHide.flatten_links_file = xstrdup(yylval.string);
3024 +  }
3025 + };
3026 +
3027   serverhide_disable_remote_commands: DISABLE_REMOTE_COMMANDS '=' TBOOL ';'
3028   {
3029    if (conf_parser_ctx.pass == 2)
# Line 2976 | Line 3046 | serverhide_hidden_name: HIDDEN_NAME '='
3046   {
3047    if (conf_parser_ctx.pass == 2)
3048    {
3049 <    MyFree(ConfigServerHide.hidden_name);
3049 >    xfree(ConfigServerHide.hidden_name);
3050      ConfigServerHide.hidden_name = xstrdup(yylval.string);
3051    }
3052   };
3053  
2984 serverhide_links_delay: LINKS_DELAY '=' timespec ';'
2985 {
2986  if (conf_parser_ctx.pass == 2)
2987  {
2988    if (($3 > 0) && ConfigServerHide.links_disabled == 1)
2989    {
2990      eventAddIsh("write_links_file", write_links_file, NULL, $3);
2991      ConfigServerHide.links_disabled = 0;
2992    }
2993
2994    ConfigServerHide.links_delay = $3;
2995  }
2996 };
2997
3054   serverhide_hidden: HIDDEN '=' TBOOL ';'
3055   {
3056    if (conf_parser_ctx.pass == 2)

Comparing ircd-hybrid/trunk/src/conf_parser.y (property svn:keywords):
Revision 2336 by michael, Wed Jul 3 12:58:28 2013 UTC vs.
Revision 8046 by michael, Sat Mar 18 18:07:45 2017 UTC

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

Diff Legend

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