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 2252 by michael, Sun Jun 16 13:29:13 2013 UTC vs.
Revision 8458 by michael, Sat Mar 31 15:34:53 2018 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-2018 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"
32   #include "ircd.h"
33   #include "list.h"
34 + #include "parse.h"
35   #include "conf.h"
36   #include "conf_class.h"
37 + #include "conf_cluster.h"
38 + #include "conf_gecos.h"
39 + #include "conf_pseudo.h"
40 + #include "conf_resv.h"
41 + #include "conf_service.h"
42 + #include "conf_shared.h"
43   #include "event.h"
44 + #include "id.h"
45   #include "log.h"
39 #include "client.h"     /* for UMODE_ALL only */
46   #include "irc_string.h"
47   #include "memory.h"
48   #include "modules.h"
49 < #include "s_serv.h"
49 > #include "server.h"
50   #include "hostmask.h"
45 #include "send.h"
51   #include "listener.h"
52 < #include "resv.h"
48 < #include "numeric.h"
49 < #include "s_user.h"
52 > #include "user.h"
53   #include "motd.h"
54  
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
55   int yylex(void);
56  
57   static struct
58   {
59 <  struct {
59 >  struct
60 >  {
61      dlink_list list;
62    } mask,
63      leaf,
64      hub;
65  
66 <  struct {
66 >  struct
67 >  {
68      char buf[IRCD_BUFSIZE];
69    } name,
70 +    nick,
71      user,
72      host,
73      addr,
# Line 80 | Line 77 | static struct
77      cert,
78      rpass,
79      spass,
80 <    class;
80 >    whois,
81 >    class,
82 >    target,
83 >    prepend,
84 >    command;
85  
86 <  struct {
86 >  struct
87 >  {
88      unsigned int value;
89    } flags,
90      modes,
# Line 98 | Line 100 | static struct
100      max_total,
101      max_global,
102      max_local,
101    max_ident,
103      max_sendq,
104      max_recvq,
105 +    max_channels,
106      cidr_bitlen_ipv4,
107      cidr_bitlen_ipv6,
108      number_per_cidr;
# Line 109 | Line 111 | static struct
111   static void
112   reset_block_state(void)
113   {
114 <  dlink_node *ptr = NULL, *ptr_next = NULL;
114 >  dlink_node *node = NULL, *node_next = NULL;
115  
116 <  DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.mask.list.head)
116 >  DLINK_FOREACH_SAFE(node, node_next, block_state.mask.list.head)
117    {
118 <    MyFree(ptr->data);
119 <    dlinkDelete(ptr, &block_state.mask.list);
120 <    free_dlink_node(ptr);
118 >    xfree(node->data);
119 >    dlinkDelete(node, &block_state.mask.list);
120 >    free_dlink_node(node);
121    }
122  
123 <  DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.leaf.list.head)
123 >  DLINK_FOREACH_SAFE(node, node_next, block_state.leaf.list.head)
124    {
125 <    MyFree(ptr->data);
126 <    dlinkDelete(ptr, &block_state.leaf.list);
127 <    free_dlink_node(ptr);
125 >    xfree(node->data);
126 >    dlinkDelete(node, &block_state.leaf.list);
127 >    free_dlink_node(node);
128    }
129  
130 <  DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.hub.list.head)
130 >  DLINK_FOREACH_SAFE(node, node_next, block_state.hub.list.head)
131    {
132 <    MyFree(ptr->data);
133 <    dlinkDelete(ptr, &block_state.hub.list);
134 <    free_dlink_node(ptr);
132 >    xfree(node->data);
133 >    dlinkDelete(node, &block_state.hub.list);
134 >    free_dlink_node(node);
135    }
136  
137    memset(&block_state, 0, sizeof(block_state));
# Line 148 | Line 150 | reset_block_state(void)
150   %token  ANTI_NICK_FLOOD
151   %token  ANTI_SPAM_EXIT_MESSAGE_TIME
152   %token  AUTOCONN
153 + %token  AWAY_COUNT
154 + %token  AWAY_TIME
155   %token  BYTES KBYTES MBYTES
156   %token  CALLER_ID_WAIT
157   %token  CAN_FLOOD
# Line 155 | Line 159 | reset_block_state(void)
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
170 %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
179 %token  GLINE
180 %token  GLINE_DURATION
181 %token  GLINE_ENABLE
182 %token  GLINE_EXEMPT
183 %token  GLINE_MIN_CIDR
184 %token  GLINE_MIN_CIDR6
185 %token  GLINE_REQUEST_DURATION
186 %token  GLOBAL_KILL
187 %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
194 %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
205 < %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
213 %token  LINKS_DELAY
222   %token  LISTEN
223   %token  MASK
224   %token  MAX_ACCEPT
225   %token  MAX_BANS
226 < %token  MAX_CHANS_PER_OPER
227 < %token  MAX_CHANS_PER_USER
226 > %token  MAX_BANS_LARGE
227 > %token  MAX_CHANNELS
228   %token  MAX_GLOBAL
221 %token  MAX_IDENT
229   %token  MAX_IDLE
230 + %token  MAX_INVITES
231   %token  MAX_LOCAL
232   %token  MAX_NICK_CHANGES
233   %token  MAX_NICK_LENGTH
# Line 240 | Line 248 | reset_block_state(void)
248   %token  NETWORK_DESC
249   %token  NETWORK_NAME
250   %token  NICK
243 %token  NO_CREATE_ON_SPLIT
244 %token  NO_JOIN_ON_SPLIT
251   %token  NO_OPER_FLOOD
252   %token  NO_TILDE
253   %token  NUMBER
254   %token  NUMBER_PER_CIDR
255   %token  NUMBER_PER_IP
256   %token  OPER_ONLY_UMODES
251 %token  OPER_PASS_RESV
257   %token  OPER_UMODES
258   %token  OPERATOR
259   %token  OPERS_BYPASS_CALLERID
# Line 270 | Line 275 | reset_block_state(void)
275   %token  RESV
276   %token  RESV_EXEMPT
277   %token  RSA_PRIVATE_KEY_FILE
273 %token  RSA_PUBLIC_KEY_FILE
278   %token  SECONDS MINUTES HOURS DAYS WEEKS MONTHS YEARS
279   %token  SEND_PASSWORD
280   %token  SENDQ
# Line 283 | Line 287 | reset_block_state(void)
287   %token  SSL_CERTIFICATE_FILE
288   %token  SSL_CERTIFICATE_FINGERPRINT
289   %token  SSL_CONNECTION_REQUIRED
290 + %token  SSL_DH_ELLIPTIC_CURVE
291   %token  SSL_DH_PARAM_FILE
292 + %token  SSL_MESSAGE_DIGEST_ALGORITHM
293   %token  STATS_E_DISABLED
294   %token  STATS_I_OPER_ONLY
295   %token  STATS_K_OPER_ONLY
296 + %token  STATS_M_OPER_ONLY
297   %token  STATS_O_OPER_ONLY
298   %token  STATS_P_OPER_ONLY
299 + %token  STATS_U_OPER_ONLY
300   %token  T_ALL
301   %token  T_BOTS
302   %token  T_CALLERID
303   %token  T_CCONN
304 + %token  T_COMMAND
305   %token  T_CLUSTER
306   %token  T_DEAF
307   %token  T_DEBUG
# Line 307 | Line 316 | reset_block_state(void)
316   %token  T_IPV6
317   %token  T_LOCOPS
318   %token  T_LOG
310 %token  T_MAX_CLIENTS
319   %token  T_NCHANGE
320   %token  T_NONONREG
321 < %token  T_OPERWALL
321 > %token  T_OPME
322 > %token  T_PREPEND
323 > %token  T_PSEUDO
324   %token  T_RECVQ
325   %token  T_REJ
326   %token  T_RESTART
327   %token  T_SERVER
328   %token  T_SERVICE
319 %token  T_SERVICES_NAME
329   %token  T_SERVNOTICE
330   %token  T_SET
331   %token  T_SHARED
# Line 326 | Line 335 | reset_block_state(void)
335   %token  T_SPY
336   %token  T_SSL
337   %token  T_SSL_CIPHER_LIST
338 < %token  T_SSL_CLIENT_METHOD
330 < %token  T_SSL_SERVER_METHOD
331 < %token  T_SSLV3
332 < %token  T_TLSV1
338 > %token  T_TARGET
339   %token  T_UMODES
340   %token  T_UNAUTH
341   %token  T_UNDLINE
# Line 340 | Line 346 | reset_block_state(void)
346   %token  T_WALLOPS
347   %token  T_WEBIRC
348   %token  TBOOL
349 + %token  THROTTLE_COUNT
350   %token  THROTTLE_TIME
351   %token  TKLINE_EXPIRE_NOTICES
352   %token  TMASKED
346 %token  TRUE_NO_OPER_FLOOD
353   %token  TS_MAX_DELTA
354   %token  TS_WARN_DELTA
355   %token  TWODOTS
356   %token  TYPE
357   %token  UNKLINE
352 %token  USE_EGD
358   %token  USE_LOGGING
359   %token  USER
360   %token  VHOST
361   %token  VHOST6
362 < %token  WARN_NO_NLINE
362 > %token  WARN_NO_CONNECT_BLOCK
363 > %token  WHOIS
364 > %token  WHOWAS_HISTORY_LENGTH
365   %token  XLINE
366 + %token  XLINE_EXEMPT
367  
368   %type  <string> QSTRING
369   %type  <number> NUMBER
# Line 365 | Line 373 | reset_block_state(void)
373   %type  <number> sizespec_
374  
375   %%
376 < conf:  
376 > conf:
377          | conf conf_item
378          ;
379  
380   conf_item:        admin_entry
381                  | logging_entry
382                  | oper_entry
383 <                | channel_entry
384 <                | class_entry
383 >                | channel_entry
384 >                | class_entry
385                  | listen_entry
386                  | auth_entry
387                  | serverinfo_entry
388 <                | serverhide_entry
388 >                | serverhide_entry
389                  | resv_entry
390                  | service_entry
391                  | shared_entry
392 <                | cluster_entry
392 >                | cluster_entry
393                  | connect_entry
394                  | kill_entry
395                  | deny_entry
396 <                | exempt_entry
397 <                | general_entry
396 >                | exempt_entry
397 >                | general_entry
398                  | gecos_entry
399                  | modules_entry
400                  | motd_entry
401 +                | pseudo_entry
402                  | error ';'
403                  | error '}'
404          ;
405  
406  
407   timespec_: { $$ = 0; } | timespec;
408 < timespec:       NUMBER timespec_
409 <                {
410 <                        $$ = $1 + $2;
411 <                }
412 <                | NUMBER SECONDS timespec_
413 <                {
414 <                        $$ = $1 + $3;
415 <                }
416 <                | NUMBER MINUTES timespec_
417 <                {
418 <                        $$ = $1 * 60 + $3;
419 <                }
420 <                | NUMBER HOURS timespec_
421 <                {
422 <                        $$ = $1 * 60 * 60 + $3;
423 <                }
415 <                | NUMBER DAYS timespec_
416 <                {
417 <                        $$ = $1 * 60 * 60 * 24 + $3;
418 <                }
419 <                | NUMBER WEEKS timespec_
420 <                {
421 <                        $$ = $1 * 60 * 60 * 24 * 7 + $3;
422 <                }
423 <                | NUMBER MONTHS timespec_
424 <                {
425 <                        $$ = $1 * 60 * 60 * 24 * 7 * 4 + $3;
426 <                }
427 <                | NUMBER YEARS timespec_
428 <                {
429 <                        $$ = $1 * 60 * 60 * 24 * 365 + $3;
430 <                }
431 <                ;
432 <
433 < sizespec_:      { $$ = 0; } | sizespec;
434 < sizespec:       NUMBER sizespec_ { $$ = $1 + $2; }
435 <                | NUMBER BYTES sizespec_ { $$ = $1 + $3; }
436 <                | NUMBER KBYTES sizespec_ { $$ = $1 * 1024 + $3; }
437 <                | NUMBER MBYTES sizespec_ { $$ = $1 * 1024 * 1024 + $3; }
438 <                ;
408 > timespec:  NUMBER timespec_         { $$ = $1 + $2; } |
409 >           NUMBER SECONDS timespec_ { $$ = $1 + $3; } |
410 >           NUMBER MINUTES timespec_ { $$ = $1 * 60 + $3; } |
411 >           NUMBER HOURS timespec_   { $$ = $1 * 60 * 60 + $3; } |
412 >           NUMBER DAYS timespec_    { $$ = $1 * 60 * 60 * 24 + $3; } |
413 >           NUMBER WEEKS timespec_   { $$ = $1 * 60 * 60 * 24 * 7 + $3; } |
414 >           NUMBER MONTHS timespec_  { $$ = $1 * 60 * 60 * 24 * 7 * 4 + $3; } |
415 >           NUMBER YEARS timespec_   { $$ = $1 * 60 * 60 * 24 * 365 + $3; }
416 >           ;
417 >
418 > sizespec_:  { $$ = 0; } | sizespec;
419 > sizespec:   NUMBER sizespec_ { $$ = $1 + $2; } |
420 >            NUMBER BYTES sizespec_ { $$ = $1 + $3; } |
421 >            NUMBER KBYTES sizespec_ { $$ = $1 * 1024 + $3; } |
422 >            NUMBER MBYTES sizespec_ { $$ = $1 * 1024 * 1024 + $3; }
423 >            ;
424  
425  
426   /***************************************************************************
427 < *  section modules
427 > * modules {} section
428   ***************************************************************************/
429 < modules_entry: MODULES
445 <  '{' modules_items '}' ';';
429 > modules_entry: MODULES '{' modules_items '}' ';';
430  
431   modules_items:  modules_items modules_item | modules_item;
432   modules_item:   modules_module | modules_path | error ';' ;
# Line 460 | Line 444 | modules_path: PATH '=' QSTRING ';'
444   };
445  
446  
447 + /***************************************************************************
448 + * serverinfo {}  section
449 + ***************************************************************************/
450   serverinfo_entry: SERVERINFO '{' serverinfo_items '}' ';';
451  
452   serverinfo_items:       serverinfo_items serverinfo_item | serverinfo_item ;
453 < serverinfo_item:        serverinfo_name | serverinfo_vhost |
454 <                        serverinfo_hub | serverinfo_description |
455 <                        serverinfo_network_name | serverinfo_network_desc |
456 <                        serverinfo_max_clients | serverinfo_max_nick_length |
457 <                        serverinfo_max_topic_length | serverinfo_ssl_dh_param_file |
458 <                        serverinfo_rsa_private_key_file | serverinfo_vhost6 |
459 <                        serverinfo_sid | serverinfo_ssl_certificate_file |
460 <                        serverinfo_ssl_client_method | serverinfo_ssl_server_method |
453 > serverinfo_item:        serverinfo_name |
454 >                        serverinfo_vhost |
455 >                        serverinfo_hub |
456 >                        serverinfo_description |
457 >                        serverinfo_network_name |
458 >                        serverinfo_network_desc |
459 >                        serverinfo_default_max_clients |
460 >                        serverinfo_max_nick_length |
461 >                        serverinfo_max_topic_length |
462 >                        serverinfo_ssl_dh_param_file |
463 >                        serverinfo_ssl_dh_elliptic_curve |
464 >                        serverinfo_rsa_private_key_file |
465 >                        serverinfo_vhost6 |
466 >                        serverinfo_sid |
467 >                        serverinfo_ssl_certificate_file |
468                          serverinfo_ssl_cipher_list |
469 <                        error ';' ;
470 <
469 >                        serverinfo_ssl_message_digest_algorithm |
470 >                        error ';' ;
471  
478 serverinfo_ssl_client_method: T_SSL_CLIENT_METHOD '=' client_method_types ';' ;
479 serverinfo_ssl_server_method: T_SSL_SERVER_METHOD '=' server_method_types ';' ;
480
481 client_method_types: client_method_types ',' client_method_type_item | client_method_type_item;
482 client_method_type_item: T_SSLV3
483 {
484 #ifdef HAVE_LIBCRYPTO
485  if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx)
486    SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_SSLv3);
487 #endif
488 } | T_TLSV1
489 {
490 #ifdef HAVE_LIBCRYPTO
491  if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx)
492    SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_TLSv1);
493 #endif
494 };
495
496 server_method_types: server_method_types ',' server_method_type_item | server_method_type_item;
497 server_method_type_item: T_SSLV3
498 {
499 #ifdef HAVE_LIBCRYPTO
500  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
501    SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3);
502 #endif
503 } | T_TLSV1
504 {
505 #ifdef HAVE_LIBCRYPTO
506  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
507    SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1);
508 #endif
509 };
472  
473   serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';'
474   {
475 < #ifdef HAVE_LIBCRYPTO
514 <  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
475 >  if (conf_parser_ctx.pass == 2)
476    {
477 <    if (!ServerInfo.rsa_private_key_file)
478 <    {
518 <      conf_error_report("No rsa_private_key_file specified, SSL disabled");
519 <      break;
520 <    }
521 <
522 <    if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string,
523 <                                     SSL_FILETYPE_PEM) <= 0 ||
524 <        SSL_CTX_use_certificate_file(ServerInfo.client_ctx, yylval.string,
525 <                                     SSL_FILETYPE_PEM) <= 0)
526 <    {
527 <      report_crypto_errors();
528 <      conf_error_report("Could not open/read certificate file");
529 <      break;
530 <    }
531 <
532 <    if (SSL_CTX_use_PrivateKey_file(ServerInfo.server_ctx, ServerInfo.rsa_private_key_file,
533 <                                    SSL_FILETYPE_PEM) <= 0 ||
534 <        SSL_CTX_use_PrivateKey_file(ServerInfo.client_ctx, ServerInfo.rsa_private_key_file,
535 <                                    SSL_FILETYPE_PEM) <= 0)
536 <    {
537 <      report_crypto_errors();
538 <      conf_error_report("Could not read RSA private key");
539 <      break;
540 <    }
541 <
542 <    if (!SSL_CTX_check_private_key(ServerInfo.server_ctx) ||
543 <        !SSL_CTX_check_private_key(ServerInfo.client_ctx))
544 <    {
545 <      report_crypto_errors();
546 <      conf_error_report("Could not read RSA private key");
547 <      break;
548 <    }
477 >    xfree(ConfigServerInfo.ssl_certificate_file);
478 >    ConfigServerInfo.ssl_certificate_file = xstrdup(yylval.string);
479    }
550 #endif
480   };
481  
482   serverinfo_rsa_private_key_file: RSA_PRIVATE_KEY_FILE '=' QSTRING ';'
483   {
484 < #ifdef HAVE_LIBCRYPTO
556 <  BIO *file = NULL;
557 <
558 <  if (conf_parser_ctx.pass != 1)
559 <    break;
560 <
561 <  if (ServerInfo.rsa_private_key)
562 <  {
563 <    RSA_free(ServerInfo.rsa_private_key);
564 <    ServerInfo.rsa_private_key = NULL;
565 <  }
566 <
567 <  if (ServerInfo.rsa_private_key_file)
568 <  {
569 <    MyFree(ServerInfo.rsa_private_key_file);
570 <    ServerInfo.rsa_private_key_file = NULL;
571 <  }
572 <
573 <  ServerInfo.rsa_private_key_file = xstrdup(yylval.string);
574 <
575 <  if ((file = BIO_new_file(yylval.string, "r")) == NULL)
576 <  {
577 <    conf_error_report("File open failed, ignoring");
578 <    break;
579 <  }
580 <
581 <  ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
582 <
583 <  BIO_set_close(file, BIO_CLOSE);
584 <  BIO_free(file);
585 <
586 <  if (ServerInfo.rsa_private_key == NULL)
484 >  if (conf_parser_ctx.pass == 2)
485    {
486 <    conf_error_report("Couldn't extract key, ignoring");
487 <    break;
486 >    xfree(ConfigServerInfo.rsa_private_key_file);
487 >    ConfigServerInfo.rsa_private_key_file = xstrdup(yylval.string);
488    }
489 + };
490  
491 <  if (!RSA_check_key(ServerInfo.rsa_private_key))
491 > serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';'
492 > {
493 >  if (conf_parser_ctx.pass == 2)
494    {
495 <    RSA_free(ServerInfo.rsa_private_key);
496 <    ServerInfo.rsa_private_key = NULL;
596 <
597 <    conf_error_report("Invalid key, ignoring");
598 <    break;
495 >    xfree(ConfigServerInfo.ssl_dh_param_file);
496 >    ConfigServerInfo.ssl_dh_param_file = xstrdup(yylval.string);
497    }
498 + };
499  
500 <  /* require 2048 bit (256 byte) key */
501 <  if (RSA_size(ServerInfo.rsa_private_key) != 256)
500 > serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
501 > {
502 >  if (conf_parser_ctx.pass == 2)
503    {
504 <    RSA_free(ServerInfo.rsa_private_key);
505 <    ServerInfo.rsa_private_key = NULL;
606 <
607 <    conf_error_report("Not a 2048 bit key, ignoring");
504 >    xfree(ConfigServerInfo.ssl_cipher_list);
505 >    ConfigServerInfo.ssl_cipher_list = xstrdup(yylval.string);
506    }
609 #endif
507   };
508  
509 < serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';'
509 > serverinfo_ssl_message_digest_algorithm: SSL_MESSAGE_DIGEST_ALGORITHM '=' QSTRING ';'
510   {
511 < /* TBD - XXX: error reporting */
615 < #ifdef HAVE_LIBCRYPTO
616 <  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
511 >  if (conf_parser_ctx.pass == 2)
512    {
513 <    BIO *file = BIO_new_file(yylval.string, "r");
514 <
620 <    if (file)
621 <    {
622 <      DH *dh = PEM_read_bio_DHparams(file, NULL, NULL, NULL);
623 <
624 <      BIO_free(file);
625 <
626 <      if (dh)
627 <      {
628 <        if (DH_size(dh) < 128)
629 <          conf_error_report("Ignoring serverinfo::ssl_dh_param_file -- need at least a 1024 bit DH prime size");
630 <        else
631 <          SSL_CTX_set_tmp_dh(ServerInfo.server_ctx, dh);
632 <
633 <        DH_free(dh);
634 <      }
635 <    }
513 >    xfree(ConfigServerInfo.ssl_message_digest_algorithm);
514 >    ConfigServerInfo.ssl_message_digest_algorithm = xstrdup(yylval.string);
515    }
516 < #endif
638 < };
516 > }
517  
518 < serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
518 > serverinfo_ssl_dh_elliptic_curve: SSL_DH_ELLIPTIC_CURVE '=' QSTRING ';'
519   {
520 < #ifdef HAVE_LIBCRYPTO
521 <  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
522 <    SSL_CTX_set_cipher_list(ServerInfo.server_ctx, yylval.string);
523 < #endif
520 >  if (conf_parser_ctx.pass == 2)
521 >  {
522 >    xfree(ConfigServerInfo.ssl_dh_elliptic_curve);
523 >    ConfigServerInfo.ssl_dh_elliptic_curve = xstrdup(yylval.string);
524 >  }
525   };
526  
527 < serverinfo_name: NAME '=' QSTRING ';'
527 > serverinfo_name: NAME '=' QSTRING ';'
528   {
529 <  /* this isn't rehashable */
530 <  if (conf_parser_ctx.pass == 2 && !ServerInfo.name)
529 >  /* This isn't rehashable */
530 >  if (conf_parser_ctx.pass == 2 && !ConfigServerInfo.name)
531    {
532 <    if (valid_servname(yylval.string))
533 <      ServerInfo.name = xstrdup(yylval.string);
532 >    if (server_valid_name(yylval.string))
533 >      ConfigServerInfo.name = xstrdup(yylval.string);
534      else
535      {
536        conf_error_report("Ignoring serverinfo::name -- invalid name. Aborting.");
537 <      exit(0);
537 >      exit(EXIT_FAILURE);
538      }
539    }
540   };
541  
542 < serverinfo_sid: IRCD_SID '=' QSTRING ';'
542 > serverinfo_sid: IRCD_SID '=' QSTRING ';'
543   {
544 <  /* this isn't rehashable */
545 <  if (conf_parser_ctx.pass == 2 && !ServerInfo.sid)
544 >  /* This isn't rehashable */
545 >  if (conf_parser_ctx.pass == 2 && !ConfigServerInfo.sid)
546    {
547      if (valid_sid(yylval.string))
548 <      ServerInfo.sid = xstrdup(yylval.string);
548 >      ConfigServerInfo.sid = xstrdup(yylval.string);
549      else
550      {
551        conf_error_report("Ignoring serverinfo::sid -- invalid SID. Aborting.");
552 <      exit(0);
552 >      exit(EXIT_FAILURE);
553      }
554    }
555   };
# Line 679 | Line 558 | serverinfo_description: DESCRIPTION '='
558   {
559    if (conf_parser_ctx.pass == 2)
560    {
561 <    MyFree(ServerInfo.description);
562 <    ServerInfo.description = xstrdup(yylval.string);
561 >    xfree(ConfigServerInfo.description);
562 >    ConfigServerInfo.description = xstrdup(yylval.string);
563 >    strlcpy(me.info, ConfigServerInfo.description, sizeof(me.info));
564    }
565   };
566  
# Line 690 | Line 570 | serverinfo_network_name: NETWORK_NAME '=
570    {
571      char *p;
572  
573 <    if ((p = strchr(yylval.string, ' ')) != NULL)
574 <      p = '\0';
573 >    if ((p = strchr(yylval.string, ' ')))
574 >      *p = '\0';
575  
576 <    MyFree(ServerInfo.network_name);
577 <    ServerInfo.network_name = xstrdup(yylval.string);
576 >    xfree(ConfigServerInfo.network_name);
577 >    ConfigServerInfo.network_name = xstrdup(yylval.string);
578    }
579   };
580  
# Line 703 | Line 583 | serverinfo_network_desc: NETWORK_DESC '=
583    if (conf_parser_ctx.pass != 2)
584      break;
585  
586 <  MyFree(ServerInfo.network_desc);
587 <  ServerInfo.network_desc = xstrdup(yylval.string);
586 >  xfree(ConfigServerInfo.network_desc);
587 >  ConfigServerInfo.network_desc = xstrdup(yylval.string);
588   };
589  
590   serverinfo_vhost: VHOST '=' QSTRING ';'
# Line 723 | Line 603 | serverinfo_vhost: VHOST '=' QSTRING ';'
603        ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string);
604      else
605      {
606 <      assert(res != NULL);
606 >      assert(res);
607  
608 <      memcpy(&ServerInfo.ip, res->ai_addr, res->ai_addrlen);
609 <      ServerInfo.ip.ss.ss_family = res->ai_family;
610 <      ServerInfo.ip.ss_len = res->ai_addrlen;
608 >      memcpy(&ConfigServerInfo.ip, res->ai_addr, res->ai_addrlen);
609 >      ConfigServerInfo.ip.ss.ss_family = res->ai_family;
610 >      ConfigServerInfo.ip.ss_len = res->ai_addrlen;
611        freeaddrinfo(res);
612  
613 <      ServerInfo.specific_ipv4_vhost = 1;
613 >      ConfigServerInfo.specific_ipv4_vhost = 1;
614      }
615    }
616   };
617  
618   serverinfo_vhost6: VHOST6 '=' QSTRING ';'
619   {
740 #ifdef IPV6
620    if (conf_parser_ctx.pass == 2 && *yylval.string != '*')
621    {
622      struct addrinfo hints, *res;
# Line 752 | Line 631 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
631        ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost6(%s)", yylval.string);
632      else
633      {
634 <      assert(res != NULL);
634 >      assert(res);
635  
636 <      memcpy(&ServerInfo.ip6, res->ai_addr, res->ai_addrlen);
637 <      ServerInfo.ip6.ss.ss_family = res->ai_family;
638 <      ServerInfo.ip6.ss_len = res->ai_addrlen;
636 >      memcpy(&ConfigServerInfo.ip6, res->ai_addr, res->ai_addrlen);
637 >      ConfigServerInfo.ip6.ss.ss_family = res->ai_family;
638 >      ConfigServerInfo.ip6.ss_len = res->ai_addrlen;
639        freeaddrinfo(res);
640  
641 <      ServerInfo.specific_ipv6_vhost = 1;
641 >      ConfigServerInfo.specific_ipv6_vhost = 1;
642      }
643    }
765 #endif
644   };
645  
646 < serverinfo_max_clients: T_MAX_CLIENTS '=' NUMBER ';'
646 > serverinfo_default_max_clients: DEFAULT_MAX_CLIENTS '=' NUMBER ';'
647   {
648    if (conf_parser_ctx.pass != 2)
649      break;
650  
651    if ($3 < MAXCLIENTS_MIN)
652    {
653 <    char buf[IRCD_BUFSIZE];
653 >    char buf[IRCD_BUFSIZE] = "";
654  
655      snprintf(buf, sizeof(buf), "MAXCLIENTS too low, setting to %d", MAXCLIENTS_MIN);
656      conf_error_report(buf);
657 <    ServerInfo.max_clients = MAXCLIENTS_MIN;
657 >    ConfigServerInfo.default_max_clients = MAXCLIENTS_MIN;
658    }
659    else if ($3 > MAXCLIENTS_MAX)
660    {
661 <    char buf[IRCD_BUFSIZE];
661 >    char buf[IRCD_BUFSIZE] = "";
662  
663      snprintf(buf, sizeof(buf), "MAXCLIENTS too high, setting to %d", MAXCLIENTS_MAX);
664      conf_error_report(buf);
665 <    ServerInfo.max_clients = MAXCLIENTS_MAX;
665 >    ConfigServerInfo.default_max_clients = MAXCLIENTS_MAX;
666    }
667    else
668 <    ServerInfo.max_clients = $3;
668 >    ConfigServerInfo.default_max_clients = $3;
669   };
670  
671   serverinfo_max_nick_length: MAX_NICK_LENGTH '=' NUMBER ';'
# Line 798 | Line 676 | serverinfo_max_nick_length: MAX_NICK_LEN
676    if ($3 < 9)
677    {
678      conf_error_report("max_nick_length too low, setting to 9");
679 <    ServerInfo.max_nick_length = 9;
679 >    ConfigServerInfo.max_nick_length = 9;
680    }
681    else if ($3 > NICKLEN)
682    {
683 <    char buf[IRCD_BUFSIZE];
683 >    char buf[IRCD_BUFSIZE] = "";
684  
685      snprintf(buf, sizeof(buf), "max_nick_length too high, setting to %d", NICKLEN);
686      conf_error_report(buf);
687 <    ServerInfo.max_nick_length = NICKLEN;
687 >    ConfigServerInfo.max_nick_length = NICKLEN;
688    }
689    else
690 <    ServerInfo.max_nick_length = $3;
690 >    ConfigServerInfo.max_nick_length = $3;
691   };
692  
693   serverinfo_max_topic_length: MAX_TOPIC_LENGTH '=' NUMBER ';'
# Line 820 | Line 698 | serverinfo_max_topic_length: MAX_TOPIC_L
698    if ($3 < 80)
699    {
700      conf_error_report("max_topic_length too low, setting to 80");
701 <    ServerInfo.max_topic_length = 80;
701 >    ConfigServerInfo.max_topic_length = 80;
702    }
703    else if ($3 > TOPICLEN)
704    {
705 <    char buf[IRCD_BUFSIZE];
705 >    char buf[IRCD_BUFSIZE] = "";
706  
707      snprintf(buf, sizeof(buf), "max_topic_length too high, setting to %d", TOPICLEN);
708      conf_error_report(buf);
709 <    ServerInfo.max_topic_length = TOPICLEN;
709 >    ConfigServerInfo.max_topic_length = TOPICLEN;
710    }
711    else
712 <    ServerInfo.max_topic_length = $3;
712 >    ConfigServerInfo.max_topic_length = $3;
713   };
714  
715 < serverinfo_hub: HUB '=' TBOOL ';'
715 > serverinfo_hub: HUB '=' TBOOL ';'
716   {
717    if (conf_parser_ctx.pass == 2)
718 <    ServerInfo.hub = yylval.number;
718 >    ConfigServerInfo.hub = yylval.number;
719   };
720  
721 +
722   /***************************************************************************
723 < * admin section
723 > * admin {} section
724   ***************************************************************************/
725   admin_entry: ADMIN  '{' admin_items '}' ';' ;
726  
727   admin_items: admin_items admin_item | admin_item;
728 < admin_item:  admin_name | admin_description |
729 <             admin_email | error ';' ;
728 > admin_item:  admin_name |
729 >             admin_description |
730 >             admin_email |
731 >             error ';' ;
732  
733 < admin_name: NAME '=' QSTRING ';'
733 > admin_name: NAME '=' QSTRING ';'
734   {
735    if (conf_parser_ctx.pass != 2)
736      break;
737  
738 <  MyFree(AdminInfo.name);
739 <  AdminInfo.name = xstrdup(yylval.string);
738 >  xfree(ConfigAdminInfo.name);
739 >  ConfigAdminInfo.name = xstrdup(yylval.string);
740   };
741  
742   admin_email: EMAIL '=' QSTRING ';'
# Line 863 | Line 744 | admin_email: EMAIL '=' QSTRING ';'
744    if (conf_parser_ctx.pass != 2)
745      break;
746  
747 <  MyFree(AdminInfo.email);
748 <  AdminInfo.email = xstrdup(yylval.string);
747 >  xfree(ConfigAdminInfo.email);
748 >  ConfigAdminInfo.email = xstrdup(yylval.string);
749   };
750  
751   admin_description: DESCRIPTION '=' QSTRING ';'
# Line 872 | Line 753 | admin_description: DESCRIPTION '=' QSTRI
753    if (conf_parser_ctx.pass != 2)
754      break;
755  
756 <  MyFree(AdminInfo.description);
757 <  AdminInfo.description = xstrdup(yylval.string);
756 >  xfree(ConfigAdminInfo.description);
757 >  ConfigAdminInfo.description = xstrdup(yylval.string);
758   };
759  
760 +
761   /***************************************************************************
762 < * motd section
762 > * motd {} section
763   ***************************************************************************/
764 < motd_entry: MOTD
764 > motd_entry: MOTD
765   {
766    if (conf_parser_ctx.pass == 2)
767      reset_block_state();
768   } '{' motd_items '}' ';'
769   {
770 <  dlink_node *ptr = NULL;
770 >  dlink_node *node = NULL;
771  
772    if (conf_parser_ctx.pass != 2)
773      break;
# Line 893 | Line 775 | motd_entry: MOTD
775    if (!block_state.file.buf[0])
776      break;
777  
778 <  DLINK_FOREACH(ptr, block_state.mask.list.head)
779 <    motd_add(ptr->data, block_state.file.buf);
778 >  DLINK_FOREACH(node, block_state.mask.list.head)
779 >    motd_add(node->data, block_state.file.buf);
780   };
781  
782   motd_items: motd_items motd_item | motd_item;
783   motd_item:  motd_mask | motd_file | error ';' ;
784  
785 < motd_mask: MASK '=' QSTRING ';'
785 > motd_mask: MASK '=' QSTRING ';'
786   {
787    if (conf_parser_ctx.pass == 2)
788      dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list);
# Line 912 | Line 794 | motd_file: T_FILE '=' QSTRING ';'
794      strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf));
795   };
796  
797 +
798 + /***************************************************************************
799 + * pseudo {} section
800 + ***************************************************************************/
801 + pseudo_entry: T_PSEUDO
802 + {
803 +  if (conf_parser_ctx.pass == 2)
804 +    reset_block_state();
805 + } '{' pseudo_items '}' ';'
806 + {
807 +  if (conf_parser_ctx.pass != 2)
808 +    break;
809 +
810 +  if (!block_state.command.buf[0] ||
811 +      !block_state.name.buf[0] ||
812 +      !block_state.nick.buf[0] ||
813 +      !block_state.host.buf[0])
814 +    break;
815 +
816 +  pseudo_register(block_state.name.buf, block_state.nick.buf, block_state.host.buf,
817 +                  block_state.prepend.buf, block_state.command.buf);
818 + };
819 +
820 + pseudo_items: pseudo_items pseudo_item | pseudo_item;
821 + pseudo_item:  pseudo_command | pseudo_prepend | pseudo_name | pseudo_target | error ';' ;
822 +
823 + pseudo_command: T_COMMAND '=' QSTRING ';'
824 + {
825 +  if (conf_parser_ctx.pass == 2)
826 +    strlcpy(block_state.command.buf, yylval.string, sizeof(block_state.command.buf));
827 + };
828 +
829 + pseudo_name: NAME '=' QSTRING ';'
830 + {
831 +  if (conf_parser_ctx.pass == 2)
832 +    strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
833 + };
834 +
835 + pseudo_prepend: T_PREPEND '=' QSTRING ';'
836 + {
837 +  if (conf_parser_ctx.pass == 2)
838 +    strlcpy(block_state.prepend.buf, yylval.string, sizeof(block_state.prepend.buf));
839 + };
840 +
841 + pseudo_target: T_TARGET '=' QSTRING ';'
842 + {
843 +  if (conf_parser_ctx.pass == 2)
844 +  {
845 +    struct split_nuh_item nuh;
846 +
847 +    nuh.nuhmask  = yylval.string;
848 +    nuh.nickptr  = NULL;
849 +    nuh.userptr  = block_state.nick.buf;
850 +    nuh.hostptr  = block_state.host.buf;
851 +    nuh.nicksize = 0;
852 +    nuh.usersize = sizeof(block_state.nick.buf);
853 +    nuh.hostsize = sizeof(block_state.host.buf);
854 +
855 +    split_nuh(&nuh);
856 +  }
857 + };
858 +
859 +
860   /***************************************************************************
861 < *  section logging
861 > * log {} section
862   ***************************************************************************/
863   logging_entry:          T_LOG  '{' logging_items '}' ';' ;
864   logging_items:          logging_items logging_item | logging_item ;
865  
866 < logging_item:           logging_use_logging | logging_file_entry |
867 <                        error ';' ;
866 > logging_item:           logging_use_logging | logging_file_entry |
867 >                        error ';' ;
868  
869   logging_use_logging: USE_LOGGING '=' TBOOL ';'
870   {
871    if (conf_parser_ctx.pass == 2)
872 <    ConfigLoggingEntry.use_logging = yylval.number;
872 >    ConfigLog.use_logging = yylval.number;
873   };
874  
875   logging_file_entry:
# Line 978 | Line 923 | logging_file_type_item:  USER
923   {
924    if (conf_parser_ctx.pass == 2)
925      block_state.type.value = LOG_TYPE_OPER;
926 < } | GLINE
926 > } | XLINE
927 > {
928 >  if (conf_parser_ctx.pass == 2)
929 >    block_state.type.value = LOG_TYPE_XLINE;
930 > } | RESV
931   {
932    if (conf_parser_ctx.pass == 2)
933 <    block_state.type.value = LOG_TYPE_GLINE;
933 >    block_state.type.value = LOG_TYPE_RESV;
934   } | T_DLINE
935   {
936    if (conf_parser_ctx.pass == 2)
# Line 1002 | Line 951 | logging_file_type_item:  USER
951  
952  
953   /***************************************************************************
954 < * section oper
954 > * operator {} section
955   ***************************************************************************/
956 < oper_entry: OPERATOR
956 > oper_entry: OPERATOR
957   {
958    if (conf_parser_ctx.pass != 2)
959      break;
# Line 1013 | Line 962 | oper_entry: OPERATOR
962    block_state.flags.value |= CONF_FLAGS_ENCRYPTED;
963   } '{' oper_items '}' ';'
964   {
965 <  dlink_node *ptr = NULL;
965 >  dlink_node *node = NULL;
966  
967    if (conf_parser_ctx.pass != 2)
968      break;
969  
970    if (!block_state.name.buf[0])
971      break;
972 < #ifdef HAVE_LIBCRYPTO
1024 <  if (!block_state.file.buf[0] &&
1025 <      !block_state.rpass.buf[0])
1026 <    break;
1027 < #else
972 >
973    if (!block_state.rpass.buf[0])
974      break;
1030 #endif
975  
976 <  DLINK_FOREACH(ptr, block_state.mask.list.head)
976 >  DLINK_FOREACH(node, block_state.mask.list.head)
977    {
978      struct MaskItem *conf = NULL;
979      struct split_nuh_item nuh;
980 +    char *s = node->data;
981 +
982 +    if (EmptyString(s))
983 +      continue;
984  
985 <    nuh.nuhmask  = ptr->data;
985 >    nuh.nuhmask  = s;
986      nuh.nickptr  = NULL;
987      nuh.userptr  = block_state.user.buf;
988      nuh.hostptr  = block_state.host.buf;
# Line 1054 | Line 1002 | oper_entry: OPERATOR
1002      if (block_state.rpass.buf[0])
1003        conf->passwd = xstrdup(block_state.rpass.buf);
1004  
1005 +    if (block_state.whois.buf[0])
1006 +      conf->whois = xstrdup(block_state.whois.buf);
1007 +
1008      conf->flags = block_state.flags.value;
1009      conf->modes = block_state.modes.value;
1010      conf->port  = block_state.port.value;
1011      conf->htype = parse_netmask(conf->host, &conf->addr, &conf->bits);
1012  
1013      conf_add_class_to_conf(conf, block_state.class.buf);
1063
1064 #ifdef HAVE_LIBCRYPTO
1065    if (block_state.file.buf[0])
1066    {
1067      BIO *file = NULL;
1068      RSA *pkey = NULL;
1069
1070      if ((file = BIO_new_file(block_state.file.buf, "r")) == NULL)
1071      {
1072        conf_error_report("Ignoring rsa_public_key_file -- file doesn't exist");
1073        break;
1074      }
1075
1076      if ((pkey = PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL)) == NULL)
1077        conf_error_report("Ignoring rsa_public_key_file -- Key invalid; check key syntax.");
1078
1079      conf->rsa_public_key = pkey;
1080      BIO_set_close(file, BIO_CLOSE);
1081      BIO_free(file);
1082    }
1083 #endif /* HAVE_LIBCRYPTO */
1014    }
1015   };
1016  
1017   oper_items:     oper_items oper_item | oper_item;
1018 < oper_item:      oper_name | oper_user | oper_password |
1019 <                oper_umodes | oper_class | oper_encrypted |
1020 <                oper_rsa_public_key_file | oper_ssl_certificate_fingerprint |
1021 <                oper_ssl_connection_required |
1022 <                oper_flags | error ';' ;
1018 > oper_item:      oper_name |
1019 >                oper_user |
1020 >                oper_password |
1021 >                oper_whois |
1022 >                oper_umodes |
1023 >                oper_class |
1024 >                oper_encrypted |
1025 >                oper_ssl_certificate_fingerprint |
1026 >                oper_ssl_connection_required |
1027 >                oper_flags |
1028 >                error ';' ;
1029  
1030   oper_name: NAME '=' QSTRING ';'
1031   {
# Line 1109 | Line 1045 | oper_password: PASSWORD '=' QSTRING ';'
1045      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
1046   };
1047  
1048 + oper_whois: WHOIS '=' QSTRING ';'
1049 + {
1050 +  if (conf_parser_ctx.pass == 2)
1051 +    strlcpy(block_state.whois.buf, yylval.string, sizeof(block_state.whois.buf));
1052 + };
1053 +
1054   oper_encrypted: ENCRYPTED '=' TBOOL ';'
1055   {
1056    if (conf_parser_ctx.pass != 2)
# Line 1120 | Line 1062 | oper_encrypted: ENCRYPTED '=' TBOOL ';'
1062      block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED;
1063   };
1064  
1123 oper_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
1124 {
1125  if (conf_parser_ctx.pass == 2)
1126    strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf));
1127 };
1128
1065   oper_ssl_certificate_fingerprint: SSL_CERTIFICATE_FINGERPRINT '=' QSTRING ';'
1066   {
1067    if (conf_parser_ctx.pass == 2)
# Line 1180 | Line 1116 | oper_umodes_item:  T_BOTS
1116   {
1117    if (conf_parser_ctx.pass == 2)
1118      block_state.modes.value |= UMODE_HIDDEN;
1119 + } | HIDE_CHANS
1120 + {
1121 +  if (conf_parser_ctx.pass == 2)
1122 +    block_state.modes.value |= UMODE_HIDECHANS;
1123 + } | HIDE_IDLE
1124 + {
1125 +  if (conf_parser_ctx.pass == 2)
1126 +    block_state.modes.value |= UMODE_HIDEIDLE;
1127   } | T_SKILL
1128   {
1129    if (conf_parser_ctx.pass == 2)
# Line 1204 | Line 1148 | oper_umodes_item:  T_BOTS
1148   {
1149    if (conf_parser_ctx.pass == 2)
1150      block_state.modes.value |= UMODE_EXTERNAL;
1207 } | T_OPERWALL
1208 {
1209  if (conf_parser_ctx.pass == 2)
1210    block_state.modes.value |= UMODE_OPERWALL;
1151   } | T_SERVNOTICE
1152   {
1153    if (conf_parser_ctx.pass == 2)
# Line 1276 | Line 1216 | oper_flags_item: KILL ':' REMOTE
1216   } | KLINE
1217   {
1218    if (conf_parser_ctx.pass == 2)
1219 <    block_state.port.value |= OPER_FLAG_K;
1219 >    block_state.port.value |= OPER_FLAG_KLINE;
1220   } | UNKLINE
1221   {
1222    if (conf_parser_ctx.pass == 2)
# Line 1292 | Line 1232 | oper_flags_item: KILL ':' REMOTE
1232   } | XLINE
1233   {
1234    if (conf_parser_ctx.pass == 2)
1235 <    block_state.port.value |= OPER_FLAG_X;
1236 < } | GLINE
1235 >    block_state.port.value |= OPER_FLAG_XLINE;
1236 > } | T_UNXLINE
1237   {
1238    if (conf_parser_ctx.pass == 2)
1239 <    block_state.port.value |= OPER_FLAG_GLINE;
1239 >    block_state.port.value |= OPER_FLAG_UNXLINE;
1240   } | DIE
1241   {
1242    if (conf_parser_ctx.pass == 2)
# Line 1305 | Line 1245 | oper_flags_item: KILL ':' REMOTE
1245   {
1246    if (conf_parser_ctx.pass == 2)
1247      block_state.port.value |= OPER_FLAG_RESTART;
1248 + } | REHASH ':' REMOTE
1249 + {
1250 +  if (conf_parser_ctx.pass == 2)
1251 +    block_state.port.value |= OPER_FLAG_REHASH_REMOTE;
1252   } | REHASH
1253   {
1254    if (conf_parser_ctx.pass == 2)
# Line 1313 | Line 1257 | oper_flags_item: KILL ':' REMOTE
1257   {
1258    if (conf_parser_ctx.pass == 2)
1259      block_state.port.value |= OPER_FLAG_ADMIN;
1316 } | T_OPERWALL
1317 {
1318  if (conf_parser_ctx.pass == 2)
1319    block_state.port.value |= OPER_FLAG_OPERWALL;
1260   } | T_GLOBOPS
1261   {
1262    if (conf_parser_ctx.pass == 2)
# Line 1341 | Line 1281 | oper_flags_item: KILL ':' REMOTE
1281   {
1282    if (conf_parser_ctx.pass == 2)
1283      block_state.port.value |= OPER_FLAG_MODULE;
1284 + } | T_OPME
1285 + {
1286 +  if (conf_parser_ctx.pass == 2)
1287 +    block_state.port.value |= OPER_FLAG_OPME;
1288 + } | NICK ':' RESV
1289 + {
1290 +  if (conf_parser_ctx.pass == 2)
1291 +    block_state.port.value |= OPER_FLAG_NICK_RESV;
1292 + } | JOIN ':' RESV
1293 + {
1294 +  if (conf_parser_ctx.pass == 2)
1295 +    block_state.port.value |= OPER_FLAG_JOIN_RESV;
1296 + } | RESV
1297 + {
1298 +  if (conf_parser_ctx.pass == 2)
1299 +    block_state.port.value |= OPER_FLAG_RESV;
1300 + } | T_UNRESV
1301 + {
1302 +  if (conf_parser_ctx.pass == 2)
1303 +    block_state.port.value |= OPER_FLAG_UNRESV;
1304 + } | CLOSE
1305 + {
1306 +  if (conf_parser_ctx.pass == 2)
1307 +    block_state.port.value |= OPER_FLAG_CLOSE;
1308   };
1309  
1310  
1311   /***************************************************************************
1312 < *  section class
1312 > * class {} section
1313   ***************************************************************************/
1314   class_entry: CLASS
1315   {
# Line 1373 | Line 1337 | class_entry: CLASS
1337      class = class_make();
1338  
1339    class->active = 1;
1340 <  MyFree(class->name);
1340 >  xfree(class->name);
1341    class->name = xstrdup(block_state.class.buf);
1342    class->ping_freq = block_state.ping_freq.value;
1343    class->max_perip = block_state.max_perip.value;
# Line 1381 | Line 1345 | class_entry: CLASS
1345    class->max_total = block_state.max_total.value;
1346    class->max_global = block_state.max_global.value;
1347    class->max_local = block_state.max_local.value;
1384  class->max_ident = block_state.max_ident.value;
1348    class->max_sendq = block_state.max_sendq.value;
1349    class->max_recvq = block_state.max_recvq.value;
1350 +  class->max_channels = block_state.max_channels.value;
1351  
1352    if (block_state.min_idle.value > block_state.max_idle.value)
1353    {
# Line 1396 | Line 1360 | class_entry: CLASS
1360    class->min_idle = block_state.min_idle.value;
1361    class->max_idle = block_state.max_idle.value;
1362  
1363 <  if (class->number_per_cidr && block_state.number_per_cidr.value)
1400 <    if ((class->cidr_bitlen_ipv4 && block_state.cidr_bitlen_ipv4.value) ||
1401 <        (class->cidr_bitlen_ipv6 && block_state.cidr_bitlen_ipv6.value))
1402 <      if ((class->cidr_bitlen_ipv4 != block_state.cidr_bitlen_ipv4.value) ||
1403 <          (class->cidr_bitlen_ipv6 != block_state.cidr_bitlen_ipv6.value))
1404 <        rebuild_cidr_list(class);
1363 >  rebuild_cidr_list(class);
1364  
1365    class->cidr_bitlen_ipv4 = block_state.cidr_bitlen_ipv4.value;
1366    class->cidr_bitlen_ipv6 = block_state.cidr_bitlen_ipv6.value;
# Line 1410 | Line 1369 | class_entry: CLASS
1369  
1370   class_items:    class_items class_item | class_item;
1371   class_item:     class_name |
1372 <                class_cidr_bitlen_ipv4 | class_cidr_bitlen_ipv6 |
1372 >                class_cidr_bitlen_ipv4 |
1373 >                class_cidr_bitlen_ipv6 |
1374                  class_ping_time |
1375 <                class_number_per_cidr |
1375 >                class_number_per_cidr |
1376                  class_number_per_ip |
1377                  class_connectfreq |
1378 +                class_max_channels |
1379                  class_max_number |
1380 <                class_max_global |
1381 <                class_max_local |
1382 <                class_max_ident |
1383 <                class_sendq | class_recvq |
1380 >                class_max_global |
1381 >                class_max_local |
1382 >                class_sendq |
1383 >                class_recvq |
1384                  class_min_idle |
1385                  class_max_idle |
1386                  class_flags |
1387 <                error ';' ;
1387 >                error ';' ;
1388  
1389 < class_name: NAME '=' QSTRING ';'
1389 > class_name: NAME '=' QSTRING ';'
1390   {
1391    if (conf_parser_ctx.pass == 1)
1392      strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf));
# Line 1449 | Line 1410 | class_connectfreq: CONNECTFREQ '=' times
1410      block_state.con_freq.value = $3;
1411   };
1412  
1413 + class_max_channels: MAX_CHANNELS '=' NUMBER ';'
1414 + {
1415 +  if (conf_parser_ctx.pass == 1)
1416 +    block_state.max_channels.value = $3;
1417 + };
1418 +
1419   class_max_number: MAX_NUMBER '=' NUMBER ';'
1420   {
1421    if (conf_parser_ctx.pass == 1)
# Line 1467 | Line 1434 | class_max_local: MAX_LOCAL '=' NUMBER ';
1434      block_state.max_local.value = $3;
1435   };
1436  
1470 class_max_ident: MAX_IDENT '=' NUMBER ';'
1471 {
1472  if (conf_parser_ctx.pass == 1)
1473    block_state.max_ident.value = $3;
1474 };
1475
1437   class_sendq: SENDQ '=' sizespec ';'
1438   {
1439    if (conf_parser_ctx.pass == 1)
# Line 1541 | Line 1502 | class_flags_item: RANDOM_IDLE
1502  
1503  
1504   /***************************************************************************
1505 < *  section listen
1505 > * listen {} section
1506   ***************************************************************************/
1507   listen_entry: LISTEN
1508   {
# Line 1580 | Line 1541 | port_item: NUMBER
1541   {
1542    if (conf_parser_ctx.pass == 2)
1543    {
1544 + #ifndef HAVE_TLS
1545      if (block_state.flags.value & LISTENER_SSL)
1546 < #ifdef HAVE_LIBCRYPTO
1547 <      if (!ServerInfo.server_ctx)
1546 >    {
1547 >      conf_error_report("TLS not available - port closed");
1548 >      break;
1549 >    }
1550   #endif
1551 <      {
1588 <        conf_error_report("SSL not available - port closed");
1589 <        break;
1590 <      }
1591 <    add_listener($1, block_state.addr.buf, block_state.flags.value);
1551 >    listener_add($1, block_state.addr.buf, block_state.flags.value);
1552    }
1553   } | NUMBER TWODOTS NUMBER
1554   {
1555    if (conf_parser_ctx.pass == 2)
1556    {
1557 <    int i;
1598 <
1557 > #ifndef HAVE_TLS
1558      if (block_state.flags.value & LISTENER_SSL)
1559 < #ifdef HAVE_LIBCRYPTO
1560 <      if (!ServerInfo.server_ctx)
1559 >    {
1560 >      conf_error_report("TLS not available - port closed");
1561 >      break;
1562 >    }
1563   #endif
1603      {
1604        conf_error_report("SSL not available - port closed");
1605        break;
1606      }
1564  
1565 <    for (i = $1; i <= $3; ++i)
1566 <      add_listener(i, block_state.addr.buf, block_state.flags.value);
1565 >    for (int i = $1; i <= $3; ++i)
1566 >      listener_add(i, block_state.addr.buf, block_state.flags.value);
1567    }
1568   };
1569  
# Line 1622 | Line 1579 | listen_host: HOST '=' QSTRING ';'
1579      strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf));
1580   };
1581  
1582 +
1583   /***************************************************************************
1584 < *  section auth
1584 > * auth {} section
1585   ***************************************************************************/
1586   auth_entry: IRCD_AUTH
1587   {
# Line 1631 | Line 1589 | auth_entry: IRCD_AUTH
1589      reset_block_state();
1590   } '{' auth_items '}' ';'
1591   {
1592 <  dlink_node *ptr = NULL;
1592 >  dlink_node *node = NULL;
1593  
1594    if (conf_parser_ctx.pass != 2)
1595      break;
1596  
1597 <  DLINK_FOREACH(ptr, block_state.mask.list.head)
1597 >  DLINK_FOREACH(node, block_state.mask.list.head)
1598    {
1599      struct MaskItem *conf = NULL;
1600      struct split_nuh_item nuh;
1601 +    char *s = node->data;
1602  
1603 <    nuh.nuhmask  = ptr->data;
1603 >    if (EmptyString(s))
1604 >      continue;
1605 >
1606 >    nuh.nuhmask  = s;
1607      nuh.nickptr  = NULL;
1608      nuh.userptr  = block_state.user.buf;
1609      nuh.hostptr  = block_state.host.buf;
# Line 1665 | Line 1627 | auth_entry: IRCD_AUTH
1627      conf_add_class_to_conf(conf, block_state.class.buf);
1628      add_conf_by_address(CONF_CLIENT, conf);
1629    }
1630 < };
1630 > };
1631  
1632   auth_items:     auth_items auth_item | auth_item;
1633 < auth_item:      auth_user | auth_passwd | auth_class | auth_flags |
1634 <                auth_spoof | auth_redir_serv | auth_redir_port |
1635 <                auth_encrypted | error ';' ;
1633 > auth_item:      auth_user |
1634 >                auth_passwd |
1635 >                auth_class |
1636 >                auth_flags |
1637 >                auth_spoof |
1638 >                auth_redir_serv |
1639 >                auth_redir_port |
1640 >                auth_encrypted |
1641 >                error ';' ;
1642  
1643   auth_user: USER '=' QSTRING ';'
1644   {
# Line 1720 | Line 1688 | auth_flags_item: SPOOF_NOTICE
1688   {
1689    if (conf_parser_ctx.pass == 2)
1690      block_state.flags.value |= CONF_FLAGS_EXEMPTKLINE;
1691 + } | XLINE_EXEMPT
1692 + {
1693 +  if (conf_parser_ctx.pass == 2)
1694 +    block_state.flags.value |= CONF_FLAGS_EXEMPTXLINE;
1695   } | NEED_IDENT
1696   {
1697    if (conf_parser_ctx.pass == 2)
# Line 1732 | Line 1704 | auth_flags_item: SPOOF_NOTICE
1704   {
1705    if (conf_parser_ctx.pass == 2)
1706      block_state.flags.value |= CONF_FLAGS_NO_TILDE;
1735 } | GLINE_EXEMPT
1736 {
1737  if (conf_parser_ctx.pass == 2)
1738    block_state.flags.value |= CONF_FLAGS_EXEMPTGLINE;
1707   } | RESV_EXEMPT
1708   {
1709    if (conf_parser_ctx.pass == 2)
# Line 1750 | Line 1718 | auth_flags_item: SPOOF_NOTICE
1718      block_state.flags.value |= CONF_FLAGS_NEED_PASSWORD;
1719   };
1720  
1721 < auth_spoof: SPOOF '=' QSTRING ';'
1721 > auth_spoof: SPOOF '=' QSTRING ';'
1722   {
1723    if (conf_parser_ctx.pass != 2)
1724      break;
1725  
1726 <  if (strlen(yylval.string) <= HOSTLEN && valid_hostname(yylval.string))
1726 >  if (valid_hostname(yylval.string))
1727    {
1728      strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
1729      block_state.flags.value |= CONF_FLAGS_SPOOF_IP;
# Line 1784 | Line 1752 | auth_redir_port: REDIRPORT '=' NUMBER ';
1752  
1753  
1754   /***************************************************************************
1755 < *  section resv
1755 > * resv {} section
1756   ***************************************************************************/
1757   resv_entry: RESV
1758   {
# Line 1798 | Line 1766 | resv_entry: RESV
1766    if (conf_parser_ctx.pass != 2)
1767      break;
1768  
1769 <  create_resv(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list);
1769 >  resv_make(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list);
1770   };
1771  
1772 < resv_items:     resv_items resv_item | resv_item;
1773 < resv_item:      resv_mask | resv_reason | resv_exempt | error ';' ;
1772 > resv_items:     resv_items resv_item | resv_item;
1773 > resv_item:      resv_mask | resv_reason | resv_exempt | error ';' ;
1774  
1775   resv_mask: MASK '=' QSTRING ';'
1776   {
# Line 1824 | Line 1792 | resv_exempt: EXEMPT '=' QSTRING ';'
1792  
1793  
1794   /***************************************************************************
1795 < *  section service
1795 > * service {} section
1796   ***************************************************************************/
1797   service_entry: T_SERVICE '{' service_items '}' ';';
1798  
# Line 1836 | Line 1804 | service_name: NAME '=' QSTRING ';'
1804    if (conf_parser_ctx.pass != 2)
1805      break;
1806  
1807 <  if (valid_servname(yylval.string))
1807 >  if (server_valid_name(yylval.string))
1808    {
1809 <    struct MaskItem *conf = conf_make(CONF_SERVICE);
1810 <    conf->name = xstrdup(yylval.string);
1809 >    struct ServiceItem *service = service_make();
1810 >    service->name = xstrdup(yylval.string);
1811    }
1812   };
1813  
1814 +
1815   /***************************************************************************
1816 < *  section shared, for sharing remote klines etc.
1816 > * shared {} section, for sharing remote klines etc.
1817   ***************************************************************************/
1818   shared_entry: T_SHARED
1819   {
# Line 1859 | Line 1828 | shared_entry: T_SHARED
1828    block_state.flags.value = SHARED_ALL;
1829   } '{' shared_items '}' ';'
1830   {
1862  struct MaskItem *conf = NULL;
1863
1831    if (conf_parser_ctx.pass != 2)
1832      break;
1833  
1834 <  conf = conf_make(CONF_ULINE);
1835 <  conf->flags = block_state.flags.value;
1836 <  conf->name = xstrdup(block_state.name.buf);
1837 <  conf->user = xstrdup(block_state.user.buf);
1838 <  conf->host = xstrdup(block_state.host.buf);
1834 >  struct SharedItem *shared = shared_make();
1835 >  shared->type = block_state.flags.value;
1836 >  shared->server = xstrdup(block_state.name.buf);
1837 >  shared->user = xstrdup(block_state.user.buf);
1838 >  shared->host = xstrdup(block_state.host.buf);
1839   };
1840  
1841   shared_items: shared_items shared_item | shared_item;
# Line 1948 | Line 1915 | shared_type_item: KLINE
1915      block_state.flags.value = SHARED_ALL;
1916   };
1917  
1918 +
1919   /***************************************************************************
1920 < *  section cluster
1920 > * cluster {} section
1921   ***************************************************************************/
1922   cluster_entry: T_CLUSTER
1923   {
# Line 1959 | Line 1927 | cluster_entry: T_CLUSTER
1927    reset_block_state();
1928  
1929    strlcpy(block_state.name.buf, "*", sizeof(block_state.name.buf));
1930 <  block_state.flags.value = SHARED_ALL;
1930 >  block_state.flags.value = CLUSTER_ALL;
1931   } '{' cluster_items '}' ';'
1932   {
1965  struct MaskItem *conf = NULL;
1966
1933    if (conf_parser_ctx.pass != 2)
1934      break;
1935  
1936 <  conf = conf_make(CONF_CLUSTER);
1937 <  conf->flags = block_state.flags.value;
1938 <  conf->name = xstrdup(block_state.name.buf);
1936 >  struct ClusterItem *cluster = cluster_make();
1937 >  cluster->type = block_state.flags.value;
1938 >  cluster->server = xstrdup(block_state.name.buf);
1939   };
1940  
1941 < cluster_items:  cluster_items cluster_item | cluster_item;
1942 < cluster_item:   cluster_name | cluster_type | error ';' ;
1941 > cluster_items:  cluster_items cluster_item | cluster_item;
1942 > cluster_item:   cluster_name | cluster_type | error ';' ;
1943  
1944   cluster_name: NAME '=' QSTRING ';'
1945   {
# Line 1987 | Line 1953 | cluster_type: TYPE
1953      block_state.flags.value = 0;
1954   } '=' cluster_types ';' ;
1955  
1956 < cluster_types:  cluster_types ',' cluster_type_item | cluster_type_item;
1956 > cluster_types:  cluster_types ',' cluster_type_item | cluster_type_item;
1957   cluster_type_item: KLINE
1958   {
1959    if (conf_parser_ctx.pass == 2)
1960 <    block_state.flags.value |= SHARED_KLINE;
1960 >    block_state.flags.value |= CLUSTER_KLINE;
1961   } | UNKLINE
1962   {
1963    if (conf_parser_ctx.pass == 2)
1964 <    block_state.flags.value |= SHARED_UNKLINE;
1964 >    block_state.flags.value |= CLUSTER_UNKLINE;
1965   } | T_DLINE
1966   {
1967    if (conf_parser_ctx.pass == 2)
1968 <    block_state.flags.value |= SHARED_DLINE;
1968 >    block_state.flags.value |= CLUSTER_DLINE;
1969   } | T_UNDLINE
1970   {
1971    if (conf_parser_ctx.pass == 2)
1972 <    block_state.flags.value |= SHARED_UNDLINE;
1972 >    block_state.flags.value |= CLUSTER_UNDLINE;
1973   } | XLINE
1974   {
1975    if (conf_parser_ctx.pass == 2)
1976 <    block_state.flags.value |= SHARED_XLINE;
1976 >    block_state.flags.value |= CLUSTER_XLINE;
1977   } | T_UNXLINE
1978   {
1979    if (conf_parser_ctx.pass == 2)
1980 <    block_state.flags.value |= SHARED_UNXLINE;
1980 >    block_state.flags.value |= CLUSTER_UNXLINE;
1981   } | RESV
1982   {
1983    if (conf_parser_ctx.pass == 2)
1984 <    block_state.flags.value |= SHARED_RESV;
1984 >    block_state.flags.value |= CLUSTER_RESV;
1985   } | T_UNRESV
1986   {
1987    if (conf_parser_ctx.pass == 2)
1988 <    block_state.flags.value |= SHARED_UNRESV;
1988 >    block_state.flags.value |= CLUSTER_UNRESV;
1989   } | T_LOCOPS
1990   {
1991    if (conf_parser_ctx.pass == 2)
1992 <    block_state.flags.value |= SHARED_LOCOPS;
1992 >    block_state.flags.value |= CLUSTER_LOCOPS;
1993   } | T_ALL
1994   {
1995    if (conf_parser_ctx.pass == 2)
1996 <    block_state.flags.value = SHARED_ALL;
1996 >    block_state.flags.value = CLUSTER_ALL;
1997   };
1998  
1999 +
2000   /***************************************************************************
2001 < *  section connect
2001 > * connect {}  section
2002   ***************************************************************************/
2003 < connect_entry: CONNECT  
2003 > connect_entry: CONNECT
2004   {
2005  
2006    if (conf_parser_ctx.pass != 2)
2007      break;
2008  
2009    reset_block_state();
2010 +  block_state.aftype.value = AF_INET;
2011    block_state.port.value = PORTNUM;
2012   } '{' connect_items '}' ';'
2013   {
# Line 2091 | Line 2059 | connect_entry: CONNECT
2059        ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", block_state.bind.buf);
2060      else
2061      {
2062 <      assert(res != NULL);
2062 >      assert(res);
2063  
2064        memcpy(&conf->bind, res->ai_addr, res->ai_addrlen);
2065        conf->bind.ss.ss_family = res->ai_family;
# Line 2105 | Line 2073 | connect_entry: CONNECT
2073   };
2074  
2075   connect_items:  connect_items connect_item | connect_item;
2076 < connect_item:   connect_name | connect_host | connect_vhost |
2077 <                connect_send_password | connect_accept_password |
2078 <                connect_ssl_certificate_fingerprint |
2079 <                connect_aftype | connect_port | connect_ssl_cipher_list |
2080 <                connect_flags | connect_hub_mask | connect_leaf_mask |
2081 <                connect_class | connect_encrypted |
2076 > connect_item:   connect_name |
2077 >                connect_host |
2078 >                connect_vhost |
2079 >                connect_send_password |
2080 >                connect_accept_password |
2081 >                connect_ssl_certificate_fingerprint |
2082 >                connect_aftype |
2083 >                connect_port |
2084 >                connect_ssl_cipher_list |
2085 >                connect_flags |
2086 >                connect_hub_mask |
2087 >                connect_leaf_mask |
2088 >                connect_class |
2089 >                connect_encrypted |
2090                  error ';' ;
2091  
2092   connect_name: NAME '=' QSTRING ';'
# Line 2119 | Line 2095 | connect_name: NAME '=' QSTRING ';'
2095      strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
2096   };
2097  
2098 < connect_host: HOST '=' QSTRING ';'
2098 > connect_host: HOST '=' QSTRING ';'
2099   {
2100    if (conf_parser_ctx.pass == 2)
2101      strlcpy(block_state.host.buf, yylval.string, sizeof(block_state.host.buf));
2102   };
2103  
2104 < connect_vhost: VHOST '=' QSTRING ';'
2104 > connect_vhost: VHOST '=' QSTRING ';'
2105   {
2106    if (conf_parser_ctx.pass == 2)
2107      strlcpy(block_state.bind.buf, yylval.string, sizeof(block_state.bind.buf));
2108   };
2109 <
2109 >
2110   connect_send_password: SEND_PASSWORD '=' QSTRING ';'
2111   {
2112    if (conf_parser_ctx.pass != 2)
# Line 2138 | Line 2114 | connect_send_password: SEND_PASSWORD '='
2114  
2115    if ($3[0] == ':')
2116      conf_error_report("Server passwords cannot begin with a colon");
2117 <  else if (strchr($3, ' ') != NULL)
2117 >  else if (strchr($3, ' '))
2118      conf_error_report("Server passwords cannot contain spaces");
2119    else
2120      strlcpy(block_state.spass.buf, yylval.string, sizeof(block_state.spass.buf));
# Line 2151 | Line 2127 | connect_accept_password: ACCEPT_PASSWORD
2127  
2128    if ($3[0] == ':')
2129      conf_error_report("Server passwords cannot begin with a colon");
2130 <  else if (strchr($3, ' ') != NULL)
2130 >  else if (strchr($3, ' '))
2131      conf_error_report("Server passwords cannot contain spaces");
2132    else
2133      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
# Line 2175 | Line 2151 | connect_aftype: AFTYPE '=' T_IPV4 ';'
2151      block_state.aftype.value = AF_INET;
2152   } | AFTYPE '=' T_IPV6 ';'
2153   {
2178 #ifdef IPV6
2154    if (conf_parser_ctx.pass == 2)
2155      block_state.aftype.value = AF_INET6;
2181 #endif
2156   };
2157  
2158   connect_flags: IRCD_FLAGS
# Line 2208 | Line 2182 | connect_encrypted: ENCRYPTED '=' TBOOL '
2182    }
2183   };
2184  
2185 < connect_hub_mask: HUB_MASK '=' QSTRING ';'
2185 > connect_hub_mask: HUB_MASK '=' QSTRING ';'
2186   {
2187    if (conf_parser_ctx.pass == 2)
2188      dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.hub.list);
2189   };
2190  
2191 < connect_leaf_mask: LEAF_MASK '=' QSTRING ';'
2191 > connect_leaf_mask: LEAF_MASK '=' QSTRING ';'
2192   {
2193    if (conf_parser_ctx.pass == 2)
2194      dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.leaf.list);
# Line 2228 | Line 2202 | connect_class: CLASS '=' QSTRING ';'
2202  
2203   connect_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
2204   {
2205 < #ifdef HAVE_LIBCRYPTO
2205 > #ifdef HAVE_TLS
2206    if (conf_parser_ctx.pass == 2)
2207      strlcpy(block_state.ciph.buf, yylval.string, sizeof(block_state.ciph.buf));
2208   #else
2209    if (conf_parser_ctx.pass == 2)
2210 <    conf_error_report("Ignoring connect::ciphers -- no OpenSSL support");
2210 >    conf_error_report("Ignoring connect::ciphers -- no TLS support");
2211   #endif
2212   };
2213  
2214  
2215   /***************************************************************************
2216 < *  section kill
2216 > * kill {} section
2217   ***************************************************************************/
2218   kill_entry: KILL
2219   {
# Line 2265 | Line 2239 | kill_entry: KILL
2239    else
2240      conf->reason = xstrdup(CONF_NOREASON);
2241    add_conf_by_address(CONF_KLINE, conf);
2242 < };
2242 > };
2243  
2244   kill_items:     kill_items kill_item | kill_item;
2245   kill_item:      kill_user | kill_reason | error;
# Line 2290 | Line 2264 | kill_user: USER '=' QSTRING ';'
2264    }
2265   };
2266  
2267 < kill_reason: REASON '=' QSTRING ';'
2267 > kill_reason: REASON '=' QSTRING ';'
2268   {
2269    if (conf_parser_ctx.pass == 2)
2270      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2271   };
2272  
2273 +
2274   /***************************************************************************
2275 < *  section deny
2275 > * deny {} section
2276   ***************************************************************************/
2277 < deny_entry: DENY
2277 > deny_entry: DENY
2278   {
2279    if (conf_parser_ctx.pass == 2)
2280      reset_block_state();
# Line 2324 | Line 2299 | deny_entry: DENY
2299        conf->reason = xstrdup(CONF_NOREASON);
2300      add_conf_by_address(CONF_DLINE, conf);
2301    }
2302 < };
2302 > };
2303  
2304   deny_items:     deny_items deny_item | deny_item;
2305   deny_item:      deny_ip | deny_reason | error;
# Line 2335 | Line 2310 | deny_ip: IP '=' QSTRING ';'
2310      strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf));
2311   };
2312  
2313 < deny_reason: REASON '=' QSTRING ';'
2313 > deny_reason: REASON '=' QSTRING ';'
2314   {
2315    if (conf_parser_ctx.pass == 2)
2316      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2317   };
2318  
2319 +
2320   /***************************************************************************
2321 < *  section exempt
2321 > * exempt {} section
2322   ***************************************************************************/
2323   exempt_entry: EXEMPT '{' exempt_items '}' ';';
2324  
2325 < exempt_items:     exempt_items exempt_item | exempt_item;
2326 < exempt_item:      exempt_ip | error;
2325 > exempt_items: exempt_items exempt_item | exempt_item;
2326 > exempt_item:  exempt_ip | error;
2327  
2328   exempt_ip: IP '=' QSTRING ';'
2329   {
2330    if (conf_parser_ctx.pass == 2)
2331    {
2332 <    if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
2332 >    if (*yylval.string && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
2333      {
2334        struct MaskItem *conf = conf_make(CONF_EXEMPT);
2335        conf->host = xstrdup(yylval.string);
# Line 2364 | Line 2340 | exempt_ip: IP '=' QSTRING ';'
2340   };
2341  
2342   /***************************************************************************
2343 < *  section gecos
2343 > * gecos {} section
2344   ***************************************************************************/
2345   gecos_entry: GECOS
2346   {
# Line 2372 | Line 2348 | gecos_entry: GECOS
2348      reset_block_state();
2349   } '{' gecos_items '}' ';'
2350   {
2375  struct MaskItem *conf = NULL;
2376
2351    if (conf_parser_ctx.pass != 2)
2352      break;
2353  
2354    if (!block_state.name.buf[0])
2355      break;
2356  
2357 <  conf = conf_make(CONF_XLINE);
2358 <  conf->name = xstrdup(block_state.name.buf);
2357 >  struct GecosItem *gecos = gecos_make();
2358 >  gecos->mask = xstrdup(block_state.name.buf);
2359  
2360    if (block_state.rpass.buf[0])
2361 <    conf->reason = xstrdup(block_state.rpass.buf);
2361 >    gecos->reason = xstrdup(block_state.rpass.buf);
2362    else
2363 <    conf->reason = xstrdup(CONF_NOREASON);
2363 >    gecos->reason = xstrdup(CONF_NOREASON);
2364   };
2365  
2366   gecos_items: gecos_items gecos_item | gecos_item;
2367   gecos_item:  gecos_name | gecos_reason | error;
2368  
2369 < gecos_name: NAME '=' QSTRING ';'
2369 > gecos_name: NAME '=' QSTRING ';'
2370   {
2371    if (conf_parser_ctx.pass == 2)
2372      strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf));
2373   };
2374  
2375 < gecos_reason: REASON '=' QSTRING ';'
2375 > gecos_reason: REASON '=' QSTRING ';'
2376   {
2377    if (conf_parser_ctx.pass == 2)
2378      strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf));
2379   };
2380  
2381 +
2382   /***************************************************************************
2383 < *  section general
2383 > * general {} section
2384   ***************************************************************************/
2385 < general_entry: GENERAL
2411 <  '{' general_items '}' ';';
2385 > general_entry: GENERAL '{' general_items '}' ';';
2386  
2387   general_items:      general_items general_item | general_item;
2388 < general_item:       general_hide_spoof_ips | general_ignore_bogus_ts |
2389 <                    general_failed_oper_notice | general_anti_nick_flood |
2390 <                    general_max_nick_time | general_max_nick_changes |
2391 <                    general_max_accept | general_anti_spam_exit_message_time |
2392 <                    general_ts_warn_delta | general_ts_max_delta |
2388 > general_item:       general_away_count |
2389 >                    general_away_time |
2390 >                    general_ignore_bogus_ts |
2391 >                    general_failed_oper_notice |
2392 >                    general_anti_nick_flood |
2393 >                    general_max_nick_time |
2394 >                    general_max_nick_changes |
2395 >                    general_max_accept |
2396 >                    general_whowas_history_length |
2397 >                    general_anti_spam_exit_message_time |
2398 >                    general_ts_warn_delta |
2399 >                    general_ts_max_delta |
2400                      general_kill_chase_time_limit |
2401                      general_invisible_on_connect |
2402 <                    general_warn_no_nline | general_dots_in_ident |
2403 <                    general_stats_o_oper_only | general_stats_k_oper_only |
2404 <                    general_pace_wait | general_stats_i_oper_only |
2405 <                    general_pace_wait_simple | general_stats_P_oper_only |
2406 <                    general_short_motd | general_no_oper_flood |
2407 <                    general_true_no_oper_flood | general_oper_pass_resv |
2408 <                    general_oper_only_umodes | general_max_targets |
2409 <                    general_use_egd | general_egdpool_path |
2410 <                    general_oper_umodes | general_caller_id_wait |
2411 <                    general_opers_bypass_callerid | general_default_floodcount |
2412 <                    general_min_nonwildcard | general_min_nonwildcard_simple |
2413 <                    general_throttle_time | general_havent_read_conf |
2402 >                    general_warn_no_connect_block |
2403 >                    general_dots_in_ident |
2404 >                    general_stats_i_oper_only |
2405 >                    general_stats_k_oper_only |
2406 >                    general_stats_m_oper_only |
2407 >                    general_stats_o_oper_only |
2408 >                    general_stats_P_oper_only |
2409 >                    general_stats_u_oper_only |
2410 >                    general_pace_wait |
2411 >                    general_pace_wait_simple |
2412 >                    general_short_motd |
2413 >                    general_no_oper_flood |
2414 >                    general_oper_only_umodes |
2415 >                    general_max_targets |
2416 >                    general_oper_umodes |
2417 >                    general_caller_id_wait |
2418 >                    general_opers_bypass_callerid |
2419 >                    general_default_floodcount |
2420 >                    general_default_floodtime |
2421 >                    general_min_nonwildcard |
2422 >                    general_min_nonwildcard_simple |
2423 >                    general_throttle_count |
2424 >                    general_throttle_time |
2425                      general_ping_cookie |
2426 <                    general_disable_auth |
2427 <                    general_tkline_expire_notices | general_gline_enable |
2428 <                    general_gline_duration | general_gline_request_duration |
2429 <                    general_gline_min_cidr |
2430 <                    general_gline_min_cidr6 |
2431 <                    general_stats_e_disabled |
2432 <                    general_max_watch | general_services_name |
2433 <                    error;
2426 >                    general_disable_auth |
2427 >                    general_tkline_expire_notices |
2428 >                    general_dline_min_cidr |
2429 >                    general_dline_min_cidr6 |
2430 >                    general_kline_min_cidr |
2431 >                    general_kline_min_cidr6 |
2432 >                    general_stats_e_disabled |
2433 >                    general_max_watch |
2434 >                    general_cycle_on_host_change |
2435 >                    error;
2436 >
2437  
2438 + general_away_count: AWAY_COUNT '=' NUMBER ';'
2439 + {
2440 +  ConfigGeneral.away_count = $3;
2441 + };
2442 +
2443 + general_away_time: AWAY_TIME '=' timespec ';'
2444 + {
2445 +  ConfigGeneral.away_time = $3;
2446 + };
2447  
2448   general_max_watch: MAX_WATCH '=' NUMBER ';'
2449   {
2450 <  ConfigFileEntry.max_watch = $3;
2450 >  ConfigGeneral.max_watch = $3;
2451   };
2452  
2453 < general_gline_enable: GLINE_ENABLE '=' TBOOL ';'
2453 > general_whowas_history_length: WHOWAS_HISTORY_LENGTH '=' NUMBER ';'
2454   {
2455 <  if (conf_parser_ctx.pass == 2)
2452 <    ConfigFileEntry.glines = yylval.number;
2455 >  ConfigGeneral.whowas_history_length = $3;
2456   };
2457  
2458 < general_gline_duration: GLINE_DURATION '=' timespec ';'
2458 > general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';'
2459   {
2460    if (conf_parser_ctx.pass == 2)
2461 <    ConfigFileEntry.gline_time = $3;
2461 >    ConfigGeneral.cycle_on_host_change = yylval.number;
2462   };
2463  
2464 < general_gline_request_duration: GLINE_REQUEST_DURATION '=' timespec ';'
2464 > general_dline_min_cidr: DLINE_MIN_CIDR '=' NUMBER ';'
2465   {
2466 <  if (conf_parser_ctx.pass == 2)
2464 <    ConfigFileEntry.gline_request_time = $3;
2466 >  ConfigGeneral.dline_min_cidr = $3;
2467   };
2468  
2469 < general_gline_min_cidr: GLINE_MIN_CIDR '=' NUMBER ';'
2469 > general_dline_min_cidr6: DLINE_MIN_CIDR6 '=' NUMBER ';'
2470   {
2471 <  ConfigFileEntry.gline_min_cidr = $3;
2471 >  ConfigGeneral.dline_min_cidr6 = $3;
2472   };
2473  
2474 < general_gline_min_cidr6: GLINE_MIN_CIDR6 '=' NUMBER ';'
2474 > general_kline_min_cidr: KLINE_MIN_CIDR '=' NUMBER ';'
2475   {
2476 <  ConfigFileEntry.gline_min_cidr6 = $3;
2476 >  ConfigGeneral.kline_min_cidr = $3;
2477   };
2478  
2479 < general_tkline_expire_notices: TKLINE_EXPIRE_NOTICES '=' TBOOL ';'
2479 > general_kline_min_cidr6: KLINE_MIN_CIDR6 '=' NUMBER ';'
2480   {
2481 <  ConfigFileEntry.tkline_expire_notices = yylval.number;
2481 >  ConfigGeneral.kline_min_cidr6 = $3;
2482   };
2483  
2484 < general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';'
2484 > general_tkline_expire_notices: TKLINE_EXPIRE_NOTICES '=' TBOOL ';'
2485   {
2486 <  ConfigFileEntry.kill_chase_time_limit = $3;
2486 >  ConfigGeneral.tkline_expire_notices = yylval.number;
2487   };
2488  
2489 < general_hide_spoof_ips: HIDE_SPOOF_IPS '=' TBOOL ';'
2489 > general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';'
2490   {
2491 <  ConfigFileEntry.hide_spoof_ips = yylval.number;
2491 >  ConfigGeneral.kill_chase_time_limit = $3;
2492   };
2493  
2494   general_ignore_bogus_ts: IGNORE_BOGUS_TS '=' TBOOL ';'
2495   {
2496 <  ConfigFileEntry.ignore_bogus_ts = yylval.number;
2496 >  ConfigGeneral.ignore_bogus_ts = yylval.number;
2497   };
2498  
2499   general_failed_oper_notice: FAILED_OPER_NOTICE '=' TBOOL ';'
2500   {
2501 <  ConfigFileEntry.failed_oper_notice = yylval.number;
2501 >  ConfigGeneral.failed_oper_notice = yylval.number;
2502   };
2503  
2504   general_anti_nick_flood: ANTI_NICK_FLOOD '=' TBOOL ';'
2505   {
2506 <  ConfigFileEntry.anti_nick_flood = yylval.number;
2506 >  ConfigGeneral.anti_nick_flood = yylval.number;
2507   };
2508  
2509   general_max_nick_time: MAX_NICK_TIME '=' timespec ';'
2510   {
2511 <  ConfigFileEntry.max_nick_time = $3;
2511 >  ConfigGeneral.max_nick_time = $3;
2512   };
2513  
2514   general_max_nick_changes: MAX_NICK_CHANGES '=' NUMBER ';'
2515   {
2516 <  ConfigFileEntry.max_nick_changes = $3;
2516 >  ConfigGeneral.max_nick_changes = $3;
2517   };
2518  
2519   general_max_accept: MAX_ACCEPT '=' NUMBER ';'
2520   {
2521 <  ConfigFileEntry.max_accept = $3;
2521 >  ConfigGeneral.max_accept = $3;
2522   };
2523  
2524   general_anti_spam_exit_message_time: ANTI_SPAM_EXIT_MESSAGE_TIME '=' timespec ';'
2525   {
2526 <  ConfigFileEntry.anti_spam_exit_message_time = $3;
2526 >  ConfigGeneral.anti_spam_exit_message_time = $3;
2527   };
2528  
2529   general_ts_warn_delta: TS_WARN_DELTA '=' timespec ';'
2530   {
2531 <  ConfigFileEntry.ts_warn_delta = $3;
2531 >  ConfigGeneral.ts_warn_delta = $3;
2532   };
2533  
2534   general_ts_max_delta: TS_MAX_DELTA '=' timespec ';'
2535   {
2536    if (conf_parser_ctx.pass == 2)
2537 <    ConfigFileEntry.ts_max_delta = $3;
2537 >    ConfigGeneral.ts_max_delta = $3;
2538   };
2539  
2540 < general_havent_read_conf: HAVENT_READ_CONF '=' NUMBER ';'
2540 > general_invisible_on_connect: INVISIBLE_ON_CONNECT '=' TBOOL ';'
2541   {
2542 <  if (($3 > 0) && conf_parser_ctx.pass == 1)
2541 <  {
2542 <    ilog(LOG_TYPE_IRCD, "You haven't read your config file properly.");
2543 <    ilog(LOG_TYPE_IRCD, "There is a line in the example conf that will kill your server if not removed.");
2544 <    ilog(LOG_TYPE_IRCD, "Consider actually reading/editing the conf file, and removing this line.");
2545 <    exit(0);
2546 <  }
2542 >  ConfigGeneral.invisible_on_connect = yylval.number;
2543   };
2544  
2545 < general_invisible_on_connect: INVISIBLE_ON_CONNECT '=' TBOOL ';'
2545 > general_warn_no_connect_block: WARN_NO_CONNECT_BLOCK '=' TBOOL ';'
2546   {
2547 <  ConfigFileEntry.invisible_on_connect = yylval.number;
2547 >  ConfigGeneral.warn_no_connect_block = yylval.number;
2548   };
2549  
2550 < general_warn_no_nline: WARN_NO_NLINE '=' TBOOL ';'
2550 > general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';'
2551   {
2552 <  ConfigFileEntry.warn_no_nline = yylval.number;
2552 >  ConfigGeneral.stats_e_disabled = yylval.number;
2553   };
2554  
2555 < general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';'
2555 > general_stats_m_oper_only: STATS_M_OPER_ONLY '=' TBOOL ';'
2556   {
2557 <  ConfigFileEntry.stats_e_disabled = yylval.number;
2557 >  ConfigGeneral.stats_m_oper_only = yylval.number;
2558   };
2559  
2560   general_stats_o_oper_only: STATS_O_OPER_ONLY '=' TBOOL ';'
2561   {
2562 <  ConfigFileEntry.stats_o_oper_only = yylval.number;
2562 >  ConfigGeneral.stats_o_oper_only = yylval.number;
2563   };
2564  
2565   general_stats_P_oper_only: STATS_P_OPER_ONLY '=' TBOOL ';'
2566   {
2567 <  ConfigFileEntry.stats_P_oper_only = yylval.number;
2567 >  ConfigGeneral.stats_P_oper_only = yylval.number;
2568 > };
2569 >
2570 > general_stats_u_oper_only: STATS_U_OPER_ONLY '=' TBOOL ';'
2571 > {
2572 >  ConfigGeneral.stats_u_oper_only = yylval.number;
2573   };
2574  
2575   general_stats_k_oper_only: STATS_K_OPER_ONLY '=' TBOOL ';'
2576   {
2577 <  ConfigFileEntry.stats_k_oper_only = 2 * yylval.number;
2577 >  ConfigGeneral.stats_k_oper_only = 2 * yylval.number;
2578   } | STATS_K_OPER_ONLY '=' TMASKED ';'
2579   {
2580 <  ConfigFileEntry.stats_k_oper_only = 1;
2580 >  ConfigGeneral.stats_k_oper_only = 1;
2581   };
2582  
2583   general_stats_i_oper_only: STATS_I_OPER_ONLY '=' TBOOL ';'
2584   {
2585 <  ConfigFileEntry.stats_i_oper_only = 2 * yylval.number;
2585 >  ConfigGeneral.stats_i_oper_only = 2 * yylval.number;
2586   } | STATS_I_OPER_ONLY '=' TMASKED ';'
2587   {
2588 <  ConfigFileEntry.stats_i_oper_only = 1;
2588 >  ConfigGeneral.stats_i_oper_only = 1;
2589   };
2590  
2591   general_pace_wait: PACE_WAIT '=' timespec ';'
2592   {
2593 <  ConfigFileEntry.pace_wait = $3;
2593 >  ConfigGeneral.pace_wait = $3;
2594   };
2595  
2596   general_caller_id_wait: CALLER_ID_WAIT '=' timespec ';'
2597   {
2598 <  ConfigFileEntry.caller_id_wait = $3;
2598 >  ConfigGeneral.caller_id_wait = $3;
2599   };
2600  
2601   general_opers_bypass_callerid: OPERS_BYPASS_CALLERID '=' TBOOL ';'
2602   {
2603 <  ConfigFileEntry.opers_bypass_callerid = yylval.number;
2603 >  ConfigGeneral.opers_bypass_callerid = yylval.number;
2604   };
2605  
2606   general_pace_wait_simple: PACE_WAIT_SIMPLE '=' timespec ';'
2607   {
2608 <  ConfigFileEntry.pace_wait_simple = $3;
2608 >  ConfigGeneral.pace_wait_simple = $3;
2609   };
2610  
2611   general_short_motd: SHORT_MOTD '=' TBOOL ';'
2612   {
2613 <  ConfigFileEntry.short_motd = yylval.number;
2613 < };
2614 <  
2615 < general_no_oper_flood: NO_OPER_FLOOD '=' TBOOL ';'
2616 < {
2617 <  ConfigFileEntry.no_oper_flood = yylval.number;
2613 >  ConfigGeneral.short_motd = yylval.number;
2614   };
2615  
2616 < general_true_no_oper_flood: TRUE_NO_OPER_FLOOD '=' TBOOL ';'
2621 < {
2622 <  ConfigFileEntry.true_no_oper_flood = yylval.number;
2623 < };
2624 <
2625 < general_oper_pass_resv: OPER_PASS_RESV '=' TBOOL ';'
2616 > general_no_oper_flood: NO_OPER_FLOOD '=' TBOOL ';'
2617   {
2618 <  ConfigFileEntry.oper_pass_resv = yylval.number;
2618 >  ConfigGeneral.no_oper_flood = yylval.number;
2619   };
2620  
2621   general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';'
2622   {
2623 <  ConfigFileEntry.dots_in_ident = $3;
2623 >  ConfigGeneral.dots_in_ident = $3;
2624   };
2625  
2626   general_max_targets: MAX_TARGETS '=' NUMBER ';'
2627   {
2628 <  ConfigFileEntry.max_targets = $3;
2628 >  ConfigGeneral.max_targets = $3;
2629   };
2630  
2631 < general_use_egd: USE_EGD '=' TBOOL ';'
2631 > general_ping_cookie: PING_COOKIE '=' TBOOL ';'
2632   {
2633 <  ConfigFileEntry.use_egd = yylval.number;
2633 >  ConfigGeneral.ping_cookie = yylval.number;
2634   };
2635  
2636 < general_egdpool_path: EGDPOOL_PATH '=' QSTRING ';'
2646 < {
2647 <  if (conf_parser_ctx.pass == 2)
2648 <  {
2649 <    MyFree(ConfigFileEntry.egdpool_path);
2650 <    ConfigFileEntry.egdpool_path = xstrdup(yylval.string);
2651 <  }
2652 < };
2653 <
2654 < general_services_name: T_SERVICES_NAME '=' QSTRING ';'
2655 < {
2656 <  if (conf_parser_ctx.pass == 2 && valid_servname(yylval.string))
2657 <  {
2658 <    MyFree(ConfigFileEntry.service_name);
2659 <    ConfigFileEntry.service_name = xstrdup(yylval.string);
2660 <  }
2661 < };
2662 <
2663 < general_ping_cookie: PING_COOKIE '=' TBOOL ';'
2636 > general_disable_auth: DISABLE_AUTH '=' TBOOL ';'
2637   {
2638 <  ConfigFileEntry.ping_cookie = yylval.number;
2638 >  ConfigGeneral.disable_auth = yylval.number;
2639   };
2640  
2641 < general_disable_auth: DISABLE_AUTH '=' TBOOL ';'
2641 > general_throttle_count: THROTTLE_COUNT '=' NUMBER ';'
2642   {
2643 <  ConfigFileEntry.disable_auth = yylval.number;
2643 >  ConfigGeneral.throttle_count = $3;
2644   };
2645  
2646   general_throttle_time: THROTTLE_TIME '=' timespec ';'
2647   {
2648 <  ConfigFileEntry.throttle_time = yylval.number;
2648 >  ConfigGeneral.throttle_time = $3;
2649   };
2650  
2651   general_oper_umodes: OPER_UMODES
2652   {
2653 <  ConfigFileEntry.oper_umodes = 0;
2653 >  ConfigGeneral.oper_umodes = 0;
2654   } '='  umode_oitems ';' ;
2655  
2656   umode_oitems:    umode_oitems ',' umode_oitem | umode_oitem;
2657   umode_oitem:     T_BOTS
2658   {
2659 <  ConfigFileEntry.oper_umodes |= UMODE_BOTS;
2659 >  ConfigGeneral.oper_umodes |= UMODE_BOTS;
2660   } | T_CCONN
2661   {
2662 <  ConfigFileEntry.oper_umodes |= UMODE_CCONN;
2662 >  ConfigGeneral.oper_umodes |= UMODE_CCONN;
2663   } | T_DEAF
2664   {
2665 <  ConfigFileEntry.oper_umodes |= UMODE_DEAF;
2665 >  ConfigGeneral.oper_umodes |= UMODE_DEAF;
2666   } | T_DEBUG
2667   {
2668 <  ConfigFileEntry.oper_umodes |= UMODE_DEBUG;
2668 >  ConfigGeneral.oper_umodes |= UMODE_DEBUG;
2669   } | T_FULL
2670   {
2671 <  ConfigFileEntry.oper_umodes |= UMODE_FULL;
2671 >  ConfigGeneral.oper_umodes |= UMODE_FULL;
2672   } | HIDDEN
2673   {
2674 <  ConfigFileEntry.oper_umodes |= UMODE_HIDDEN;
2674 >  ConfigGeneral.oper_umodes |= UMODE_HIDDEN;
2675 > } | HIDE_CHANS
2676 > {
2677 >  ConfigGeneral.oper_umodes |= UMODE_HIDECHANS;
2678 > } | HIDE_IDLE
2679 > {
2680 >  ConfigGeneral.oper_umodes |= UMODE_HIDEIDLE;
2681   } | T_SKILL
2682   {
2683 <  ConfigFileEntry.oper_umodes |= UMODE_SKILL;
2683 >  ConfigGeneral.oper_umodes |= UMODE_SKILL;
2684   } | T_NCHANGE
2685   {
2686 <  ConfigFileEntry.oper_umodes |= UMODE_NCHANGE;
2686 >  ConfigGeneral.oper_umodes |= UMODE_NCHANGE;
2687   } | T_REJ
2688   {
2689 <  ConfigFileEntry.oper_umodes |= UMODE_REJ;
2689 >  ConfigGeneral.oper_umodes |= UMODE_REJ;
2690   } | T_UNAUTH
2691   {
2692 <  ConfigFileEntry.oper_umodes |= UMODE_UNAUTH;
2692 >  ConfigGeneral.oper_umodes |= UMODE_UNAUTH;
2693   } | T_SPY
2694   {
2695 <  ConfigFileEntry.oper_umodes |= UMODE_SPY;
2695 >  ConfigGeneral.oper_umodes |= UMODE_SPY;
2696   } | T_EXTERNAL
2697   {
2698 <  ConfigFileEntry.oper_umodes |= UMODE_EXTERNAL;
2720 < } | T_OPERWALL
2721 < {
2722 <  ConfigFileEntry.oper_umodes |= UMODE_OPERWALL;
2698 >  ConfigGeneral.oper_umodes |= UMODE_EXTERNAL;
2699   } | T_SERVNOTICE
2700   {
2701 <  ConfigFileEntry.oper_umodes |= UMODE_SERVNOTICE;
2701 >  ConfigGeneral.oper_umodes |= UMODE_SERVNOTICE;
2702   } | T_INVISIBLE
2703   {
2704 <  ConfigFileEntry.oper_umodes |= UMODE_INVISIBLE;
2704 >  ConfigGeneral.oper_umodes |= UMODE_INVISIBLE;
2705   } | T_WALLOP
2706   {
2707 <  ConfigFileEntry.oper_umodes |= UMODE_WALLOP;
2707 >  ConfigGeneral.oper_umodes |= UMODE_WALLOP;
2708   } | T_SOFTCALLERID
2709   {
2710 <  ConfigFileEntry.oper_umodes |= UMODE_SOFTCALLERID;
2710 >  ConfigGeneral.oper_umodes |= UMODE_SOFTCALLERID;
2711   } | T_CALLERID
2712   {
2713 <  ConfigFileEntry.oper_umodes |= UMODE_CALLERID;
2713 >  ConfigGeneral.oper_umodes |= UMODE_CALLERID;
2714   } | T_LOCOPS
2715   {
2716 <  ConfigFileEntry.oper_umodes |= UMODE_LOCOPS;
2716 >  ConfigGeneral.oper_umodes |= UMODE_LOCOPS;
2717   } | T_NONONREG
2718   {
2719 <  ConfigFileEntry.oper_umodes |= UMODE_REGONLY;
2719 >  ConfigGeneral.oper_umodes |= UMODE_REGONLY;
2720   } | T_FARCONNECT
2721   {
2722 <  ConfigFileEntry.oper_umodes |= UMODE_FARCONNECT;
2722 >  ConfigGeneral.oper_umodes |= UMODE_FARCONNECT;
2723   };
2724  
2725 < general_oper_only_umodes: OPER_ONLY_UMODES
2725 > general_oper_only_umodes: OPER_ONLY_UMODES
2726   {
2727 <  ConfigFileEntry.oper_only_umodes = 0;
2727 >  ConfigGeneral.oper_only_umodes = 0;
2728   } '='  umode_items ';' ;
2729  
2730 < umode_items:    umode_items ',' umode_item | umode_item;
2731 < umode_item:     T_BOTS
2730 > umode_items:  umode_items ',' umode_item | umode_item;
2731 > umode_item:   T_BOTS
2732   {
2733 <  ConfigFileEntry.oper_only_umodes |= UMODE_BOTS;
2733 >  ConfigGeneral.oper_only_umodes |= UMODE_BOTS;
2734   } | T_CCONN
2735   {
2736 <  ConfigFileEntry.oper_only_umodes |= UMODE_CCONN;
2736 >  ConfigGeneral.oper_only_umodes |= UMODE_CCONN;
2737   } | T_DEAF
2738   {
2739 <  ConfigFileEntry.oper_only_umodes |= UMODE_DEAF;
2739 >  ConfigGeneral.oper_only_umodes |= UMODE_DEAF;
2740   } | T_DEBUG
2741   {
2742 <  ConfigFileEntry.oper_only_umodes |= UMODE_DEBUG;
2742 >  ConfigGeneral.oper_only_umodes |= UMODE_DEBUG;
2743   } | T_FULL
2744 < {
2745 <  ConfigFileEntry.oper_only_umodes |= UMODE_FULL;
2744 > {
2745 >  ConfigGeneral.oper_only_umodes |= UMODE_FULL;
2746   } | T_SKILL
2747   {
2748 <  ConfigFileEntry.oper_only_umodes |= UMODE_SKILL;
2748 >  ConfigGeneral.oper_only_umodes |= UMODE_SKILL;
2749   } | HIDDEN
2750   {
2751 <  ConfigFileEntry.oper_only_umodes |= UMODE_HIDDEN;
2751 >  ConfigGeneral.oper_only_umodes |= UMODE_HIDDEN;
2752   } | T_NCHANGE
2753   {
2754 <  ConfigFileEntry.oper_only_umodes |= UMODE_NCHANGE;
2754 >  ConfigGeneral.oper_only_umodes |= UMODE_NCHANGE;
2755   } | T_REJ
2756   {
2757 <  ConfigFileEntry.oper_only_umodes |= UMODE_REJ;
2757 >  ConfigGeneral.oper_only_umodes |= UMODE_REJ;
2758   } | T_UNAUTH
2759   {
2760 <  ConfigFileEntry.oper_only_umodes |= UMODE_UNAUTH;
2760 >  ConfigGeneral.oper_only_umodes |= UMODE_UNAUTH;
2761   } | T_SPY
2762   {
2763 <  ConfigFileEntry.oper_only_umodes |= UMODE_SPY;
2763 >  ConfigGeneral.oper_only_umodes |= UMODE_SPY;
2764   } | T_EXTERNAL
2765   {
2766 <  ConfigFileEntry.oper_only_umodes |= UMODE_EXTERNAL;
2791 < } | T_OPERWALL
2792 < {
2793 <  ConfigFileEntry.oper_only_umodes |= UMODE_OPERWALL;
2766 >  ConfigGeneral.oper_only_umodes |= UMODE_EXTERNAL;
2767   } | T_SERVNOTICE
2768   {
2769 <  ConfigFileEntry.oper_only_umodes |= UMODE_SERVNOTICE;
2769 >  ConfigGeneral.oper_only_umodes |= UMODE_SERVNOTICE;
2770   } | T_INVISIBLE
2771   {
2772 <  ConfigFileEntry.oper_only_umodes |= UMODE_INVISIBLE;
2772 >  ConfigGeneral.oper_only_umodes |= UMODE_INVISIBLE;
2773   } | T_WALLOP
2774   {
2775 <  ConfigFileEntry.oper_only_umodes |= UMODE_WALLOP;
2775 >  ConfigGeneral.oper_only_umodes |= UMODE_WALLOP;
2776   } | T_SOFTCALLERID
2777   {
2778 <  ConfigFileEntry.oper_only_umodes |= UMODE_SOFTCALLERID;
2778 >  ConfigGeneral.oper_only_umodes |= UMODE_SOFTCALLERID;
2779   } | T_CALLERID
2780   {
2781 <  ConfigFileEntry.oper_only_umodes |= UMODE_CALLERID;
2781 >  ConfigGeneral.oper_only_umodes |= UMODE_CALLERID;
2782   } | T_LOCOPS
2783   {
2784 <  ConfigFileEntry.oper_only_umodes |= UMODE_LOCOPS;
2784 >  ConfigGeneral.oper_only_umodes |= UMODE_LOCOPS;
2785   } | T_NONONREG
2786   {
2787 <  ConfigFileEntry.oper_only_umodes |= UMODE_REGONLY;
2787 >  ConfigGeneral.oper_only_umodes |= UMODE_REGONLY;
2788   } | T_FARCONNECT
2789   {
2790 <  ConfigFileEntry.oper_only_umodes |= UMODE_FARCONNECT;
2790 >  ConfigGeneral.oper_only_umodes |= UMODE_FARCONNECT;
2791   };
2792  
2793   general_min_nonwildcard: MIN_NONWILDCARD '=' NUMBER ';'
2794   {
2795 <  ConfigFileEntry.min_nonwildcard = $3;
2795 >  ConfigGeneral.min_nonwildcard = $3;
2796   };
2797  
2798   general_min_nonwildcard_simple: MIN_NONWILDCARD_SIMPLE '=' NUMBER ';'
2799   {
2800 <  ConfigFileEntry.min_nonwildcard_simple = $3;
2800 >  ConfigGeneral.min_nonwildcard_simple = $3;
2801   };
2802  
2803   general_default_floodcount: DEFAULT_FLOODCOUNT '=' NUMBER ';'
2804   {
2805 <  ConfigFileEntry.default_floodcount = $3;
2805 >  ConfigGeneral.default_floodcount = $3;
2806 > };
2807 >
2808 > general_default_floodtime: DEFAULT_FLOODTIME '=' timespec ';'
2809 > {
2810 >  ConfigGeneral.default_floodtime = $3;
2811   };
2812  
2813  
2814   /***************************************************************************
2815 < *  section channel
2815 > * channel {} section
2816   ***************************************************************************/
2817 < channel_entry: CHANNEL
2840 <  '{' channel_items '}' ';';
2817 > channel_entry: CHANNEL '{' channel_items '}' ';';
2818  
2819   channel_items:      channel_items channel_item | channel_item;
2820   channel_item:       channel_max_bans |
2821 <                    channel_knock_delay | channel_knock_delay_channel |
2822 <                    channel_max_chans_per_user | channel_max_chans_per_oper |
2823 <                    channel_default_split_user_count |
2824 <                    channel_default_split_server_count |
2825 <                    channel_no_create_on_split |
2826 <                    channel_no_join_on_split |
2827 <                    channel_jflood_count | channel_jflood_time |
2828 <                    channel_disable_fake_channels | error;
2821 >                    channel_max_bans_large |
2822 >                    channel_invite_client_count |
2823 >                    channel_invite_client_time |
2824 >                    channel_invite_delay_channel |
2825 >                    channel_invite_expire_time |
2826 >                    channel_knock_client_count |
2827 >                    channel_knock_client_time |
2828 >                    channel_knock_delay_channel |
2829 >                    channel_max_channels |
2830 >                    channel_max_invites |
2831 >                    channel_default_join_flood_count |
2832 >                    channel_default_join_flood_time |
2833 >                    channel_disable_fake_channels |
2834 >                    error;
2835  
2836   channel_disable_fake_channels: DISABLE_FAKE_CHANNELS '=' TBOOL ';'
2837   {
2838    ConfigChannel.disable_fake_channels = yylval.number;
2839   };
2840  
2841 < channel_knock_delay: KNOCK_DELAY '=' timespec ';'
2841 > channel_invite_client_count: INVITE_CLIENT_COUNT '=' NUMBER ';'
2842   {
2843 <  ConfigChannel.knock_delay = $3;
2843 >  ConfigChannel.invite_client_count = $3;
2844   };
2845  
2846 < channel_knock_delay_channel: KNOCK_DELAY_CHANNEL '=' timespec ';'
2846 > channel_invite_client_time: INVITE_CLIENT_TIME '=' timespec ';'
2847   {
2848 <  ConfigChannel.knock_delay_channel = $3;
2848 >  ConfigChannel.invite_client_time = $3;
2849   };
2850  
2851 < channel_max_chans_per_user: MAX_CHANS_PER_USER '=' NUMBER ';'
2851 > channel_invite_delay_channel: INVITE_DELAY_CHANNEL '=' timespec ';'
2852   {
2853 <  ConfigChannel.max_chans_per_user = $3;
2853 >  ConfigChannel.invite_delay_channel = $3;
2854   };
2855  
2856 < channel_max_chans_per_oper: MAX_CHANS_PER_OPER '=' NUMBER ';'
2856 > channel_invite_expire_time: INVITE_EXPIRE_TIME '=' timespec ';'
2857   {
2858 <  ConfigChannel.max_chans_per_oper = $3;
2858 >  ConfigChannel.invite_expire_time = $3;
2859   };
2860  
2861 < channel_max_bans: MAX_BANS '=' NUMBER ';'
2861 > channel_knock_client_count: KNOCK_CLIENT_COUNT '=' NUMBER ';'
2862   {
2863 <  ConfigChannel.max_bans = $3;
2863 >  ConfigChannel.knock_client_count = $3;
2864 > };
2865 >
2866 > channel_knock_client_time: KNOCK_CLIENT_TIME '=' timespec ';'
2867 > {
2868 >  ConfigChannel.knock_client_time = $3;
2869 > };
2870 >
2871 > channel_knock_delay_channel: KNOCK_DELAY_CHANNEL '=' timespec ';'
2872 > {
2873 >  ConfigChannel.knock_delay_channel = $3;
2874   };
2875  
2876 < channel_default_split_user_count: DEFAULT_SPLIT_USER_COUNT '=' NUMBER ';'
2876 > channel_max_channels: MAX_CHANNELS '=' NUMBER ';'
2877   {
2878 <  ConfigChannel.default_split_user_count = $3;
2878 >  ConfigChannel.max_channels = $3;
2879   };
2880  
2881 < channel_default_split_server_count: DEFAULT_SPLIT_SERVER_COUNT '=' NUMBER ';'
2881 > channel_max_invites: MAX_INVITES '=' NUMBER ';'
2882   {
2883 <  ConfigChannel.default_split_server_count = $3;
2883 >  ConfigChannel.max_invites = $3;
2884   };
2885  
2886 < channel_no_create_on_split: NO_CREATE_ON_SPLIT '=' TBOOL ';'
2886 > channel_max_bans: MAX_BANS '=' NUMBER ';'
2887   {
2888 <  ConfigChannel.no_create_on_split = yylval.number;
2888 >  ConfigChannel.max_bans = $3;
2889   };
2890  
2891 < channel_no_join_on_split: NO_JOIN_ON_SPLIT '=' TBOOL ';'
2891 > channel_max_bans_large: MAX_BANS_LARGE '=' NUMBER ';'
2892   {
2893 <  ConfigChannel.no_join_on_split = yylval.number;
2893 >  ConfigChannel.max_bans_large = $3;
2894   };
2895  
2896 < channel_jflood_count: JOIN_FLOOD_COUNT '=' NUMBER ';'
2896 > channel_default_join_flood_count: DEFAULT_JOIN_FLOOD_COUNT '=' NUMBER ';'
2897   {
2898 <  GlobalSetOptions.joinfloodcount = yylval.number;
2898 >  ConfigChannel.default_join_flood_count = yylval.number;
2899   };
2900  
2901 < channel_jflood_time: JOIN_FLOOD_TIME '=' timespec ';'
2901 > channel_default_join_flood_time: DEFAULT_JOIN_FLOOD_TIME '=' timespec ';'
2902   {
2903 <  GlobalSetOptions.joinfloodtime = yylval.number;
2903 >  ConfigChannel.default_join_flood_time = $3;
2904   };
2905  
2906 +
2907   /***************************************************************************
2908 < *  section serverhide
2908 > * serverhide {} section
2909   ***************************************************************************/
2910 < serverhide_entry: SERVERHIDE
2917 <  '{' serverhide_items '}' ';';
2910 > serverhide_entry: SERVERHIDE '{' serverhide_items '}' ';';
2911  
2912   serverhide_items:   serverhide_items serverhide_item | serverhide_item;
2913 < serverhide_item:    serverhide_flatten_links | serverhide_disable_remote_commands |
2913 > serverhide_item:    serverhide_flatten_links |
2914 >                    serverhide_flatten_links_delay |
2915 >                    serverhide_flatten_links_file |
2916 >                    serverhide_disable_remote_commands |
2917                      serverhide_hide_servers |
2918 <                    serverhide_hide_services |
2919 <                    serverhide_links_delay |
2920 <                    serverhide_hidden | serverhide_hidden_name |
2921 <                    serverhide_hide_server_ips |
2918 >                    serverhide_hide_services |
2919 >                    serverhide_hidden |
2920 >                    serverhide_hidden_name |
2921 >                    serverhide_hide_server_ips |
2922                      error;
2923  
2924   serverhide_flatten_links: FLATTEN_LINKS '=' TBOOL ';'
# Line 2931 | Line 2927 | serverhide_flatten_links: FLATTEN_LINKS
2927      ConfigServerHide.flatten_links = yylval.number;
2928   };
2929  
2930 + serverhide_flatten_links_delay: FLATTEN_LINKS_DELAY '=' timespec ';'
2931 + {
2932 +  if (conf_parser_ctx.pass == 2)
2933 +  {
2934 +    if ($3 > 0)
2935 +    {
2936 +      event_write_links_file.when = $3;
2937 +      event_add(&event_write_links_file, NULL);
2938 +    }
2939 +    else
2940 +     event_delete(&event_write_links_file);
2941 +
2942 +    ConfigServerHide.flatten_links_delay = $3;
2943 +  }
2944 + };
2945 +
2946 + serverhide_flatten_links_file: FLATTEN_LINKS_FILE '=' QSTRING ';'
2947 + {
2948 +  if (conf_parser_ctx.pass == 2)
2949 +  {
2950 +    xfree(ConfigServerHide.flatten_links_file);
2951 +    ConfigServerHide.flatten_links_file = xstrdup(yylval.string);
2952 +  }
2953 + };
2954 +
2955   serverhide_disable_remote_commands: DISABLE_REMOTE_COMMANDS '=' TBOOL ';'
2956   {
2957    if (conf_parser_ctx.pass == 2)
# Line 2953 | Line 2974 | serverhide_hidden_name: HIDDEN_NAME '='
2974   {
2975    if (conf_parser_ctx.pass == 2)
2976    {
2977 <    MyFree(ConfigServerHide.hidden_name);
2977 >    xfree(ConfigServerHide.hidden_name);
2978      ConfigServerHide.hidden_name = xstrdup(yylval.string);
2979    }
2980   };
2981  
2961 serverhide_links_delay: LINKS_DELAY '=' timespec ';'
2962 {
2963  if (conf_parser_ctx.pass == 2)
2964  {
2965    if (($3 > 0) && ConfigServerHide.links_disabled == 1)
2966    {
2967      eventAddIsh("write_links_file", write_links_file, NULL, $3);
2968      ConfigServerHide.links_disabled = 0;
2969    }
2970
2971    ConfigServerHide.links_delay = $3;
2972  }
2973 };
2974
2982   serverhide_hidden: HIDDEN '=' TBOOL ';'
2983   {
2984    if (conf_parser_ctx.pass == 2)

Comparing ircd-hybrid/trunk/src/conf_parser.y (property svn:keywords):
Revision 2252 by michael, Sun Jun 16 13:29:13 2013 UTC vs.
Revision 8458 by michael, Sat Mar 31 15:34:53 2018 UTC

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

Diff Legend

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