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-7.3/src/ircd_parser.y (file contents), Revision 1123 by michael, Sun Feb 6 21:57:50 2011 UTC vs.
ircd-hybrid/trunk/src/conf_parser.y (file contents), Revision 1644 by michael, Tue Nov 6 22:20:16 2012 UTC

# Line 1 | Line 1
1   /*
2   *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3 < *  ircd_parser.y: Parses the ircd configuration file.
3 > *  conf_parser.y: Parses the ircd configuration file.
4   *
5   *  Copyright (C) 2005 by the past and present ircd coders, and others.
6   *
# Line 32 | Line 32
32   #include "stdinc.h"
33   #include "ircd.h"
34   #include "list.h"
35 < #include "s_conf.h"
35 > #include "conf.h"
36 > #include "conf_class.h"
37   #include "event.h"
38 < #include "s_log.h"
38 > #include "log.h"
39   #include "client.h"     /* for UMODE_ALL only */
40   #include "irc_string.h"
41   #include "sprintf_irc.h"
# Line 52 | Line 53
53   #include <openssl/rsa.h>
54   #include <openssl/bio.h>
55   #include <openssl/pem.h>
56 + #include <openssl/dh.h>
57   #endif
58  
59 + int yylex(void);
60 +
61   static char *class_name = NULL;
62 < static struct ConfItem *yy_conf = NULL;
59 < static struct AccessItem *yy_aconf = NULL;
60 < static struct MatchItem *yy_match_item = NULL;
62 > static struct MaskItem *yy_conf = NULL;
63   static struct ClassItem *yy_class = NULL;
64   static char *yy_class_name = NULL;
65  
66   static dlink_list col_conf_list  = { NULL, NULL, 0 };
65 static dlink_list hub_conf_list  = { NULL, NULL, 0 };
66 static dlink_list leaf_conf_list = { NULL, NULL, 0 };
67   static unsigned int listener_flags = 0;
68   static unsigned int regex_ban = 0;
69   static char userbuf[IRCD_BUFSIZE];
70   static char hostbuf[IRCD_BUFSIZE];
71   static char reasonbuf[REASONLEN + 1];
72   static char gecos_name[REALLEN * 4];
73 <
73 > static char lfile[IRCD_BUFSIZE];
74 > static unsigned int ltype = 0;
75 > static unsigned int lsize = 0;
76   static char *resv_reason = NULL;
77   static char *listener_address = NULL;
76 static int not_atom = 0;
78  
79   struct CollectItem
80   {
# Line 103 | Line 104 | free_collect_item(struct CollectItem *it
104    MyFree(item);
105   }
106  
106 static void
107 unhook_hub_leaf_confs(void)
108 {
109  dlink_node *ptr;
110  dlink_node *next_ptr;
111  struct CollectItem *yy_hconf;
112  struct CollectItem *yy_lconf;
113
114  DLINK_FOREACH_SAFE(ptr, next_ptr, hub_conf_list.head)
115  {
116    yy_hconf = ptr->data;
117    dlinkDelete(&yy_hconf->node, &hub_conf_list);
118    free_collect_item(yy_hconf);
119  }
120
121  DLINK_FOREACH_SAFE(ptr, next_ptr, leaf_conf_list.head)
122  {
123    yy_lconf = ptr->data;
124    dlinkDelete(&yy_lconf->node, &leaf_conf_list);
125    free_collect_item(yy_lconf);
126  }
127 }
128
107   %}
108  
109   %union {
# Line 134 | Line 112 | unhook_hub_leaf_confs(void)
112   }
113  
114   %token  ACCEPT_PASSWORD
137 %token  ACTION
115   %token  ADMIN
116   %token  AFTYPE
140 %token  T_ALLOW
117   %token  ANTI_NICK_FLOOD
118   %token  ANTI_SPAM_EXIT_MESSAGE_TIME
119   %token  AUTOCONN
120 < %token  T_BLOCK
145 < %token  BURST_AWAY
146 < %token  BURST_TOPICWHO
147 < %token  BYTES KBYTES MBYTES GBYTES TBYTES
120 > %token  BYTES KBYTES MBYTES
121   %token  CALLER_ID_WAIT
122   %token  CAN_FLOOD
150 %token  CAN_IDLE
123   %token  CHANNEL
124   %token  CIDR_BITLEN_IPV4
125   %token  CIDR_BITLEN_IPV6
154 %token  CIPHER_PREFERENCE
126   %token  CLASS
156 %token  COMPRESSED
157 %token  COMPRESSION_LEVEL
127   %token  CONNECT
128   %token  CONNECTFREQ
160 %token  CRYPTLINK
161 %token  DEFAULT_CIPHER_PREFERENCE
129   %token  DEFAULT_FLOODCOUNT
130   %token  DEFAULT_SPLIT_SERVER_COUNT
131   %token  DEFAULT_SPLIT_USER_COUNT
# Line 167 | Line 134 | unhook_hub_leaf_confs(void)
134   %token  DIE
135   %token  DISABLE_AUTH
136   %token  DISABLE_FAKE_CHANNELS
170 %token  DISABLE_HIDDEN
171 %token  DISABLE_LOCAL_CHANNELS
137   %token  DISABLE_REMOTE_COMMANDS
138   %token  DOTS_IN_IDENT
174 %token  DURATION
139   %token  EGDPOOL_PATH
140   %token  EMAIL
177 %token  ENABLE
141   %token  ENCRYPTED
142   %token  EXCEED_LIMIT
143   %token  EXEMPT
144   %token  FAILED_OPER_NOTICE
145   %token  IRCD_FLAGS
146   %token  FLATTEN_LINKS
184 %token  FFAILED_OPERLOG
185 %token  FKILLLOG
186 %token  FKLINELOG
187 %token  FGLINELOG
188 %token  FIOERRLOG
189 %token  FOPERLOG
190 %token  FOPERSPYLOG
191 %token  FUSERLOG
147   %token  GECOS
148   %token  GENERAL
149   %token  GLINE
150 < %token  GLINES
150 > %token  GLINE_DURATION
151 > %token  GLINE_ENABLE
152   %token  GLINE_EXEMPT
153 < %token  GLINE_LOG
198 < %token  GLINE_TIME
153 > %token  GLINE_REQUEST_DURATION
154   %token  GLINE_MIN_CIDR
155   %token  GLINE_MIN_CIDR6
156   %token  GLOBAL_KILL
# Line 203 | Line 158 | unhook_hub_leaf_confs(void)
158   %token  NEED_IDENT
159   %token  HAVENT_READ_CONF
160   %token  HIDDEN
206 %token  HIDDEN_ADMIN
161   %token  HIDDEN_NAME
208 %token  HIDDEN_OPER
162   %token  HIDE_SERVER_IPS
163   %token  HIDE_SERVERS
164   %token  HIDE_SPOOF_IPS
165   %token  HOST
166   %token  HUB
167   %token  HUB_MASK
215 %token  IDLETIME
168   %token  IGNORE_BOGUS_TS
169   %token  INVISIBLE_ON_CONNECT
170   %token  IP
# Line 220 | Line 172 | unhook_hub_leaf_confs(void)
172   %token  KILL_CHASE_TIME_LIMIT
173   %token  KLINE
174   %token  KLINE_EXEMPT
223 %token  KLINE_REASON
224 %token  KLINE_WITH_REASON
175   %token  KNOCK_DELAY
176   %token  KNOCK_DELAY_CHANNEL
177   %token  LEAF_MASK
178   %token  LINKS_DELAY
179   %token  LISTEN
180   %token  T_LOG
231 %token  LOGGING
232 %token  LOG_LEVEL
181   %token  MAX_ACCEPT
182   %token  MAX_BANS
183 + %token  MAX_CHANS_PER_OPER
184   %token  MAX_CHANS_PER_USER
185   %token  MAX_GLOBAL
186   %token  MAX_IDENT
# Line 256 | Line 205 | unhook_hub_leaf_confs(void)
205   %token  NO_JOIN_ON_SPLIT
206   %token  NO_OPER_FLOOD
207   %token  NO_TILDE
259 %token  NOT
208   %token  NUMBER
261 %token  NUMBER_PER_IDENT
209   %token  NUMBER_PER_CIDR
210   %token  NUMBER_PER_IP
264 %token  NUMBER_PER_IP_GLOBAL
211   %token  OPERATOR
212   %token  OPERS_BYPASS_CALLERID
267 %token  OPER_LOG
213   %token  OPER_ONLY_UMODES
214   %token  OPER_PASS_RESV
215   %token  OPER_SPY_T
# Line 277 | Line 222 | unhook_hub_leaf_confs(void)
222   %token  PATH
223   %token  PING_COOKIE
224   %token  PING_TIME
280 %token  PING_WARNING
225   %token  PORT
226   %token  QSTRING
227   %token  QUIET_ON_BAN
# Line 286 | Line 230 | unhook_hub_leaf_confs(void)
230   %token  REDIRSERV
231   %token  REGEX_T
232   %token  REHASH
289 %token  TREJECT_HOLD_TIME
233   %token  REMOTE
234   %token  REMOTEBAN
235   %token  RESTRICT_CHANNELS
293 %token  RESTRICTED
236   %token  RSA_PRIVATE_KEY_FILE
237   %token  RSA_PUBLIC_KEY_FILE
238   %token  SSL_CERTIFICATE_FILE
239 < %token  T_SSL_CONNECTION_METHOD
239 > %token  SSL_DH_PARAM_FILE
240 > %token  T_SSL_CLIENT_METHOD
241 > %token  T_SSL_SERVER_METHOD
242   %token  T_SSLV3
243   %token  T_TLSV1
244   %token  RESV
# Line 304 | Line 248 | unhook_hub_leaf_confs(void)
248   %token  SEND_PASSWORD
249   %token  SERVERHIDE
250   %token  SERVERINFO
307 %token  SERVLINK_PATH
251   %token  IRCD_SID
252   %token  TKLINE_EXPIRE_NOTICES
253   %token  T_SHARED
254   %token  T_CLUSTER
255   %token  TYPE
256   %token  SHORT_MOTD
314 %token  SILENT
257   %token  SPOOF
258   %token  SPOOF_NOTICE
259   %token  STATS_E_DISABLED
# Line 321 | Line 263 | unhook_hub_leaf_confs(void)
263   %token  STATS_P_OPER_ONLY
264   %token  TBOOL
265   %token  TMASKED
324 %token  T_REJECT
266   %token  TS_MAX_DELTA
267   %token  TS_WARN_DELTA
268   %token  TWODOTS
# Line 331 | Line 272 | unhook_hub_leaf_confs(void)
272   %token  T_CALLERID
273   %token  T_CCONN
274   %token  T_CCONN_FULL
275 < %token  T_CLIENT_FLOOD
275 > %token  T_SSL_CIPHER_LIST
276   %token  T_DEAF
277   %token  T_DEBUG
278 < %token  T_DRONE
278 > %token  T_DLINE
279   %token  T_EXTERNAL
280   %token  T_FULL
281   %token  T_INVISIBLE
282   %token  T_IPV4
283   %token  T_IPV6
284   %token  T_LOCOPS
344 %token  T_LOGPATH
345 %token  T_L_CRIT
346 %token  T_L_DEBUG
347 %token  T_L_ERROR
348 %token  T_L_INFO
349 %token  T_L_NOTICE
350 %token  T_L_TRACE
351 %token  T_L_WARN
285   %token  T_MAX_CLIENTS
286   %token  T_NCHANGE
287   %token  T_OPERWALL
288 + %token  T_RECVQ
289   %token  T_REJ
290   %token  T_SERVER
291   %token  T_SERVNOTICE
292 + %token  T_SET
293   %token  T_SKILL
294   %token  T_SPY
295   %token  T_SSL
296   %token  T_UMODES
297   %token  T_UNAUTH
298 + %token  T_UNDLINE
299 + %token  T_UNLIMITED
300   %token  T_UNRESV
301   %token  T_UNXLINE
302 + %token  T_GLOBOPS
303   %token  T_WALLOP
304 + %token  T_RESTART
305 + %token  T_SERVICE
306 + %token  T_SERVICES_NAME
307   %token  THROTTLE_TIME
367 %token  TOPICBURST
308   %token  TRUE_NO_OPER_FLOOD
369 %token  TKLINE
370 %token  TXLINE
371 %token  TRESV
309   %token  UNKLINE
310   %token  USER
311   %token  USE_EGD
375 %token  USE_EXCEPT
376 %token  USE_INVEX
377 %token  USE_KNOCK
312   %token  USE_LOGGING
379 %token  USE_WHOIS_ACTUALLY
313   %token  VHOST
314   %token  VHOST6
315   %token  XLINE
383 %token  WARN
316   %token  WARN_NO_NLINE
317 + %token  T_SIZE
318 + %token  T_FILE
319  
320   %type <string> QSTRING
321   %type <number> NUMBER
# Line 405 | Line 339 | conf_item:        admin_entry
339                  | serverinfo_entry
340                  | serverhide_entry
341                  | resv_entry
342 +                | service_entry
343                  | shared_entry
344                  | cluster_entry
345                  | connect_entry
# Line 412 | Line 347 | conf_item:        admin_entry
347                  | deny_entry
348                  | exempt_entry
349                  | general_entry
415                | gline_entry
350                  | gecos_entry
351                  | modules_entry
352                  | error ';'
# Line 483 | Line 417 | serverinfo_items:       serverinfo_items
417   serverinfo_item:        serverinfo_name | serverinfo_vhost |
418                          serverinfo_hub | serverinfo_description |
419                          serverinfo_network_name | serverinfo_network_desc |
420 <                        serverinfo_max_clients |
420 >                        serverinfo_max_clients | serverinfo_ssl_dh_param_file |
421                          serverinfo_rsa_private_key_file | serverinfo_vhost6 |
422                          serverinfo_sid | serverinfo_ssl_certificate_file |
423 <                        serverinfo_ssl_connection_method |
423 >                        serverinfo_ssl_client_method | serverinfo_ssl_server_method |
424 >                        serverinfo_ssl_cipher_list |
425                          error ';' ;
426  
427  
428 < serverinfo_ssl_connection_method: T_SSL_CONNECTION_METHOD
428 > serverinfo_ssl_client_method: T_SSL_CLIENT_METHOD '=' client_method_types ';' ;
429 > serverinfo_ssl_server_method: T_SSL_SERVER_METHOD '=' server_method_types ';' ;
430 >
431 > client_method_types: client_method_types ',' client_method_type_item | client_method_type_item;
432 > client_method_type_item: T_SSLV3
433   {
434   #ifdef HAVE_LIBCRYPTO
435 <  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
436 <    ServerInfo.tls_version = 0;
435 >  if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx)
436 >    SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_SSLv3);
437   #endif
438 < } '=' method_types ';'
438 > } | T_TLSV1
439   {
440   #ifdef HAVE_LIBCRYPTO
441 <  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
442 <  {
504 <    if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_SSLV3))
505 <      SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3);
506 <    if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_TLSV1))
507 <      SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1);
508 <  }
441 >  if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx)
442 >    SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_TLSv1);
443   #endif
444   };
445  
446 < method_types: method_types ',' method_type_item | method_type_item;
447 < method_type_item: T_SSLV3
446 > server_method_types: server_method_types ',' server_method_type_item | server_method_type_item;
447 > server_method_type_item: T_SSLV3
448   {
449   #ifdef HAVE_LIBCRYPTO
450 <  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
451 <    ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_SSLV3;
450 >  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
451 >    SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3);
452   #endif
453   } | T_TLSV1
454   {
455   #ifdef HAVE_LIBCRYPTO
456 <  if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2)
457 <    ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_TLSV1;
456 >  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
457 >    SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1);
458   #endif
459   };
460  
# Line 536 | Line 470 | serverinfo_ssl_certificate_file: SSL_CER
470      }
471  
472      if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string,
473 +                                     SSL_FILETYPE_PEM) <= 0 ||
474 +        SSL_CTX_use_certificate_file(ServerInfo.client_ctx, yylval.string,
475                                       SSL_FILETYPE_PEM) <= 0)
476      {
477        yyerror(ERR_lib_error_string(ERR_get_error()));
# Line 543 | Line 479 | serverinfo_ssl_certificate_file: SSL_CER
479      }
480  
481      if (SSL_CTX_use_PrivateKey_file(ServerInfo.server_ctx, ServerInfo.rsa_private_key_file,
482 +                                    SSL_FILETYPE_PEM) <= 0 ||
483 +        SSL_CTX_use_PrivateKey_file(ServerInfo.client_ctx, ServerInfo.rsa_private_key_file,
484                                      SSL_FILETYPE_PEM) <= 0)
485      {
486        yyerror(ERR_lib_error_string(ERR_get_error()));
487        break;
488      }
489  
490 <    if (!SSL_CTX_check_private_key(ServerInfo.server_ctx))
490 >    if (!SSL_CTX_check_private_key(ServerInfo.server_ctx) ||
491 >        !SSL_CTX_check_private_key(ServerInfo.client_ctx))
492      {
493        yyerror(ERR_lib_error_string(ERR_get_error()));
494        break;
# Line 585 | Line 524 | serverinfo_rsa_private_key_file: RSA_PRI
524        break;
525      }
526  
527 <    ServerInfo.rsa_private_key = (RSA *)PEM_read_bio_RSAPrivateKey(file, NULL,
589 <      0, NULL);
527 >    ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
528  
529      BIO_set_close(file, BIO_CLOSE);
530      BIO_free(file);
# Line 618 | Line 556 | serverinfo_rsa_private_key_file: RSA_PRI
556   #endif
557   };
558  
559 + serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';'
560 + {
561 + /* TBD - XXX: error reporting */
562 + #ifdef HAVE_LIBCRYPTO
563 +  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
564 +  {
565 +    BIO *file = BIO_new_file(yylval.string, "r");
566 +
567 +    if (file)
568 +    {
569 +      DH *dh = PEM_read_bio_DHparams(file, NULL, NULL, NULL);
570 +
571 +      BIO_free(file);
572 +
573 +      if (dh)
574 +      {
575 +        if (DH_size(dh) < 128)
576 +          ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::ssl_dh_param_file -- need at least a 1024 bit DH prime size");
577 +        else
578 +          SSL_CTX_set_tmp_dh(ServerInfo.server_ctx, dh);
579 +
580 +        DH_free(dh);
581 +      }
582 +    }
583 +  }
584 + #endif
585 + };
586 +
587 + serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
588 + {
589 + #ifdef HAVE_LIBCRYPTO
590 +  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
591 +    SSL_CTX_set_cipher_list(ServerInfo.server_ctx, yylval.string);
592 + #endif
593 + };
594 +
595   serverinfo_name: NAME '=' QSTRING ';'
596   {
597    /* this isn't rehashable */
# Line 627 | Line 601 | serverinfo_name: NAME '=' QSTRING ';'
601        DupString(ServerInfo.name, yylval.string);
602      else
603      {
604 <      ilog(L_ERROR, "Ignoring serverinfo::name -- invalid name. Aborting.");
604 >      ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::name -- invalid name. Aborting.");
605        exit(0);
606      }
607    }
# Line 642 | Line 616 | serverinfo_sid: IRCD_SID '=' QSTRING ';'
616        DupString(ServerInfo.sid, yylval.string);
617      else
618      {
619 <      ilog(L_ERROR, "Ignoring serverinfo::sid -- invalid SID. Aborting.");
619 >      ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::sid -- invalid SID. Aborting.");
620        exit(0);
621      }
622    }
# Line 693 | Line 667 | serverinfo_vhost: VHOST '=' QSTRING ';'
667      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
668  
669      if (getaddrinfo(yylval.string, NULL, &hints, &res))
670 <      ilog(L_ERROR, "Invalid netmask for server vhost(%s)", yylval.string);
670 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string);
671      else
672      {
673        assert(res != NULL);
# Line 722 | Line 696 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
696      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
697  
698      if (getaddrinfo(yylval.string, NULL, &hints, &res))
699 <      ilog(L_ERROR, "Invalid netmask for server vhost6(%s)", yylval.string);
699 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost6(%s)", yylval.string);
700      else
701      {
702        assert(res != NULL);
# Line 806 | Line 780 | admin_description: DESCRIPTION '=' QSTRI
780   /***************************************************************************
781   *  section logging
782   ***************************************************************************/
783 < /* XXX */
784 < logging_entry:          LOGGING  '{' logging_items '}' ';' ;
811 <
812 < logging_items:          logging_items logging_item |
813 <                        logging_item ;
783 > logging_entry:          T_LOG  '{' logging_items '}' ';' ;
784 > logging_items:          logging_items logging_item | logging_item ;
785  
786 < logging_item:           logging_path | logging_oper_log |
816 <                        logging_log_level |
817 <                        logging_use_logging | logging_fuserlog |
818 <                        logging_foperlog | logging_fglinelog |
819 <                        logging_fklinelog | logging_killlog |
820 <                        logging_foperspylog | logging_ioerrlog |
821 <                        logging_ffailed_operlog |
786 > logging_item:           logging_use_logging | logging_file_entry |
787                          error ';' ;
788  
789 < logging_path:           T_LOGPATH '=' QSTRING ';'
825 <                        {
826 <                        };
827 <
828 < logging_oper_log:       OPER_LOG '=' QSTRING ';'
829 <                        {
830 <                        };
831 <
832 < logging_fuserlog: FUSERLOG '=' QSTRING ';'
789 > logging_use_logging: USE_LOGGING '=' TBOOL ';'
790   {
791    if (conf_parser_ctx.pass == 2)
792 <    strlcpy(ConfigLoggingEntry.userlog, yylval.string,
836 <            sizeof(ConfigLoggingEntry.userlog));
792 >    ConfigLoggingEntry.use_logging = yylval.number;
793   };
794  
795 < logging_ffailed_operlog: FFAILED_OPERLOG '=' QSTRING ';'
795 > logging_file_entry:
796   {
797 <  if (conf_parser_ctx.pass == 2)
798 <    strlcpy(ConfigLoggingEntry.failed_operlog, yylval.string,
799 <            sizeof(ConfigLoggingEntry.failed_operlog));
800 < };
845 <
846 < logging_foperlog: FOPERLOG '=' QSTRING ';'
797 >  lfile[0] = '\0';
798 >  ltype = 0;
799 >  lsize = 0;
800 > } T_FILE  '{' logging_file_items '}' ';'
801   {
802 <  if (conf_parser_ctx.pass == 2)
803 <    strlcpy(ConfigLoggingEntry.operlog, yylval.string,
850 <            sizeof(ConfigLoggingEntry.operlog));
802 >  if (conf_parser_ctx.pass == 2 && ltype > 0)
803 >    log_add_file(ltype, lsize, lfile);
804   };
805  
806 < logging_foperspylog: FOPERSPYLOG '=' QSTRING ';'
807 < {
855 <  if (conf_parser_ctx.pass == 2)
856 <    strlcpy(ConfigLoggingEntry.operspylog, yylval.string,
857 <            sizeof(ConfigLoggingEntry.operspylog));
858 < };
806 > logging_file_items: logging_file_items logging_file_item |
807 >                    logging_file_item ;
808  
809 < logging_fglinelog: FGLINELOG '=' QSTRING ';'
810 < {
862 <  if (conf_parser_ctx.pass == 2)
863 <    strlcpy(ConfigLoggingEntry.glinelog, yylval.string,
864 <            sizeof(ConfigLoggingEntry.glinelog));
865 < };
809 > logging_file_item:  logging_file_name | logging_file_type |
810 >                    logging_file_size | error ';' ;
811  
812 < logging_fklinelog: FKLINELOG '=' QSTRING ';'
812 > logging_file_name: NAME '=' QSTRING ';'
813   {
814 <  if (conf_parser_ctx.pass == 2)
815 <    strlcpy(ConfigLoggingEntry.klinelog, yylval.string,
871 <            sizeof(ConfigLoggingEntry.klinelog));
872 < };
814 >  strlcpy(lfile, yylval.string, sizeof(lfile));
815 > }
816  
817 < logging_ioerrlog: FIOERRLOG '=' QSTRING ';'
817 > logging_file_size: T_SIZE '=' sizespec ';'
818   {
819 <  if (conf_parser_ctx.pass == 2)
820 <    strlcpy(ConfigLoggingEntry.ioerrlog, yylval.string,
821 <            sizeof(ConfigLoggingEntry.ioerrlog));
819 >  lsize = $3;
820 > } | T_SIZE '=' T_UNLIMITED ';'
821 > {
822 >  lsize = 0;
823   };
824  
825 < logging_killlog: FKILLLOG '=' QSTRING ';'
825 > logging_file_type: TYPE
826   {
827    if (conf_parser_ctx.pass == 2)
828 <    strlcpy(ConfigLoggingEntry.killlog, yylval.string,
829 <            sizeof(ConfigLoggingEntry.killlog));
886 < };
828 >    ltype = 0;
829 > } '='  logging_file_type_items ';' ;
830  
831 < logging_log_level: LOG_LEVEL '=' T_L_CRIT ';'
832 < {
890 <  if (conf_parser_ctx.pass == 2)
891 <    set_log_level(L_CRIT);
892 < } | LOG_LEVEL '=' T_L_ERROR ';'
831 > logging_file_type_items: logging_file_type_items ',' logging_file_type_item | logging_file_type_item;
832 > logging_file_type_item:  USER
833   {
834    if (conf_parser_ctx.pass == 2)
835 <    set_log_level(L_ERROR);
836 < } | LOG_LEVEL '=' T_L_WARN ';'
835 >    ltype = LOG_TYPE_USER;
836 > } | OPERATOR
837   {
838    if (conf_parser_ctx.pass == 2)
839 <    set_log_level(L_WARN);
840 < } | LOG_LEVEL '=' T_L_NOTICE ';'
839 >    ltype = LOG_TYPE_OPER;
840 > } | GLINE
841   {
842    if (conf_parser_ctx.pass == 2)
843 <    set_log_level(L_NOTICE);
844 < } | LOG_LEVEL '=' T_L_TRACE ';'
843 >    ltype = LOG_TYPE_GLINE;
844 > } | T_DLINE
845   {
846    if (conf_parser_ctx.pass == 2)
847 <    set_log_level(L_TRACE);
848 < } | LOG_LEVEL '=' T_L_INFO ';'
847 >    ltype = LOG_TYPE_DLINE;
848 > } | KLINE
849   {
850    if (conf_parser_ctx.pass == 2)
851 <    set_log_level(L_INFO);
852 < } | LOG_LEVEL '=' T_L_DEBUG ';'
851 >    ltype = LOG_TYPE_KLINE;
852 > } | KILL
853   {
854    if (conf_parser_ctx.pass == 2)
855 <    set_log_level(L_DEBUG);
856 < };
917 <
918 < logging_use_logging: USE_LOGGING '=' TBOOL ';'
855 >    ltype = LOG_TYPE_KILL;
856 > } | T_DEBUG
857   {
858    if (conf_parser_ctx.pass == 2)
859 <    ConfigLoggingEntry.use_logging = yylval.number;
859 >    ltype = LOG_TYPE_DEBUG;
860   };
861  
862 +
863   /***************************************************************************
864   * section oper
865   ***************************************************************************/
# Line 928 | Line 867 | oper_entry: OPERATOR
867   {
868    if (conf_parser_ctx.pass == 2)
869    {
870 <    yy_conf = make_conf_item(OPER_TYPE);
871 <    yy_aconf = map_to_conf(yy_conf);
933 <    SetConfEncrypted(yy_aconf); /* Yes, the default is encrypted */
870 >    yy_conf = conf_make(CONF_OPER);
871 >    SetConfEncrypted(yy_conf); /* Yes, the default is encrypted */
872    }
873    else
874    {
875      MyFree(class_name);
876      class_name = NULL;
877    }
878 < } oper_name_b '{' oper_items '}' ';'
878 > } '{' oper_items '}' ';'
879   {
880    if (conf_parser_ctx.pass == 2)
881    {
# Line 953 | Line 891 | oper_entry: OPERATOR
891  
892      DLINK_FOREACH_SAFE(ptr, next_ptr, col_conf_list.head)
893      {
894 <      struct AccessItem *new_aconf;
957 <      struct ConfItem *new_conf;
894 >      struct MaskItem *new_conf;
895        yy_tmp = ptr->data;
896  
897 <      new_conf = make_conf_item(OPER_TYPE);
898 <      new_aconf = (struct AccessItem *)map_to_conf(new_conf);
962 <
963 <      new_aconf->flags = yy_aconf->flags;
897 >      new_conf = conf_make(CONF_OPER);
898 >      new_conf->flags = yy_conf->flags;
899  
900        if (yy_conf->name != NULL)
901          DupString(new_conf->name, yy_conf->name);
902        if (yy_tmp->user != NULL)
903 <        DupString(new_aconf->user, yy_tmp->user);
903 >        DupString(new_conf->user, yy_tmp->user);
904        else
905 <        DupString(new_aconf->user, "*");
905 >        DupString(new_conf->user, "*");
906        if (yy_tmp->host != NULL)
907 <        DupString(new_aconf->host, yy_tmp->host);
907 >        DupString(new_conf->host, yy_tmp->host);
908        else
909 <        DupString(new_aconf->host, "*");
909 >        DupString(new_conf->host, "*");
910 >
911 >      new_conf->htype = parse_netmask(new_conf->host, &new_conf->addr,
912 >                                     &new_conf->bits);
913 >
914        conf_add_class_to_conf(new_conf, class_name);
915 <      if (yy_aconf->passwd != NULL)
916 <        DupString(new_aconf->passwd, yy_aconf->passwd);
915 >      if (yy_conf->passwd != NULL)
916 >        DupString(new_conf->passwd, yy_conf->passwd);
917  
918 <      new_aconf->port = yy_aconf->port;
918 >      new_conf->port = yy_conf->port;
919   #ifdef HAVE_LIBCRYPTO
920 <      if (yy_aconf->rsa_public_key_file != NULL)
920 >      if (yy_conf->rsa_public_key_file != NULL)
921        {
922          BIO *file;
923  
924 <        DupString(new_aconf->rsa_public_key_file,
925 <                  yy_aconf->rsa_public_key_file);
924 >        DupString(new_conf->rsa_public_key_file,
925 >                  yy_conf->rsa_public_key_file);
926  
927 <        file = BIO_new_file(yy_aconf->rsa_public_key_file, "r");
928 <        new_aconf->rsa_public_key = (RSA *)PEM_read_bio_RSA_PUBKEY(file,
927 >        file = BIO_new_file(yy_conf->rsa_public_key_file, "r");
928 >        new_conf->rsa_public_key = PEM_read_bio_RSA_PUBKEY(file,
929                                                             NULL, 0, NULL);
930          BIO_set_close(file, BIO_CLOSE);
931          BIO_free(file);
# Line 994 | Line 933 | oper_entry: OPERATOR
933   #endif
934  
935   #ifdef HAVE_LIBCRYPTO
936 <      if (yy_tmp->name && (yy_tmp->passwd || yy_aconf->rsa_public_key)
936 >      if (yy_tmp->name && (yy_tmp->passwd || yy_conf->rsa_public_key)
937            && yy_tmp->host)
938   #else
939        if (yy_tmp->name && yy_tmp->passwd && yy_tmp->host)
# Line 1010 | Line 949 | oper_entry: OPERATOR
949      }
950  
951      yy_conf = NULL;
1013    yy_aconf = NULL;
1014
952  
953      MyFree(class_name);
954      class_name = NULL;
955    }
956   };
957  
1021 oper_name_b: | oper_name_t;
958   oper_items:     oper_items oper_item | oper_item;
959   oper_item:      oper_name | oper_user | oper_password |
960                  oper_umodes | oper_class | oper_encrypted |
# Line 1028 | Line 964 | oper_name: NAME '=' QSTRING ';'
964   {
965    if (conf_parser_ctx.pass == 2)
966    {
1031    if (strlen(yylval.string) > OPERNICKLEN)
1032      yylval.string[OPERNICKLEN] = '\0';
1033
1034    MyFree(yy_conf->name);
1035    DupString(yy_conf->name, yylval.string);
1036  }
1037 };
1038
1039 oper_name_t: QSTRING
1040 {
1041  if (conf_parser_ctx.pass == 2)
1042  {
1043    if (strlen(yylval.string) > OPERNICKLEN)
1044      yylval.string[OPERNICKLEN] = '\0';
1045
967      MyFree(yy_conf->name);
968      DupString(yy_conf->name, yylval.string);
969    }
# Line 1065 | Line 986 | oper_user: USER '=' QSTRING ';'
986  
987      split_nuh(&nuh);
988  
989 <    if (yy_aconf->user == NULL)
989 >    if (yy_conf->user == NULL)
990      {
991 <      DupString(yy_aconf->user, userbuf);
992 <      DupString(yy_aconf->host, hostbuf);
991 >      DupString(yy_conf->user, userbuf);
992 >      DupString(yy_conf->host, hostbuf);
993 >
994 >      yy_conf->htype = parse_netmask(yy_conf->host, &yy_conf->addr,
995 >                                    &yy_conf->bits);
996      }
997      else
998      {
# Line 1086 | Line 1010 | oper_password: PASSWORD '=' QSTRING ';'
1010   {
1011    if (conf_parser_ctx.pass == 2)
1012    {
1013 <    if (yy_aconf->passwd != NULL)
1014 <      memset(yy_aconf->passwd, 0, strlen(yy_aconf->passwd));
1013 >    if (yy_conf->passwd != NULL)
1014 >      memset(yy_conf->passwd, 0, strlen(yy_conf->passwd));
1015  
1016 <    MyFree(yy_aconf->passwd);
1017 <    DupString(yy_aconf->passwd, yylval.string);
1016 >    MyFree(yy_conf->passwd);
1017 >    DupString(yy_conf->passwd, yylval.string);
1018    }
1019   };
1020  
# Line 1099 | Line 1023 | oper_encrypted: ENCRYPTED '=' TBOOL ';'
1023    if (conf_parser_ctx.pass == 2)
1024    {
1025      if (yylval.number)
1026 <      SetConfEncrypted(yy_aconf);
1026 >      SetConfEncrypted(yy_conf);
1027      else
1028 <      ClearConfEncrypted(yy_aconf);
1028 >      ClearConfEncrypted(yy_conf);
1029    }
1030   };
1031  
# Line 1112 | Line 1036 | oper_rsa_public_key_file: RSA_PUBLIC_KEY
1036    {
1037      BIO *file;
1038  
1039 <    if (yy_aconf->rsa_public_key != NULL)
1039 >    if (yy_conf->rsa_public_key != NULL)
1040      {
1041 <      RSA_free(yy_aconf->rsa_public_key);
1042 <      yy_aconf->rsa_public_key = NULL;
1041 >      RSA_free(yy_conf->rsa_public_key);
1042 >      yy_conf->rsa_public_key = NULL;
1043      }
1044  
1045 <    if (yy_aconf->rsa_public_key_file != NULL)
1045 >    if (yy_conf->rsa_public_key_file != NULL)
1046      {
1047 <      MyFree(yy_aconf->rsa_public_key_file);
1048 <      yy_aconf->rsa_public_key_file = NULL;
1047 >      MyFree(yy_conf->rsa_public_key_file);
1048 >      yy_conf->rsa_public_key_file = NULL;
1049      }
1050  
1051 <    DupString(yy_aconf->rsa_public_key_file, yylval.string);
1051 >    DupString(yy_conf->rsa_public_key_file, yylval.string);
1052      file = BIO_new_file(yylval.string, "r");
1053  
1054      if (file == NULL)
# Line 1133 | Line 1057 | oper_rsa_public_key_file: RSA_PUBLIC_KEY
1057        break;
1058      }
1059  
1060 <    yy_aconf->rsa_public_key = (RSA *)PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL);
1060 >    yy_conf->rsa_public_key = PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL);
1061  
1062 <    if (yy_aconf->rsa_public_key == NULL)
1062 >    if (yy_conf->rsa_public_key == NULL)
1063      {
1064        yyerror("Ignoring rsa_public_key_file -- Key invalid; check key syntax.");
1065        break;
# Line 1159 | Line 1083 | oper_class: CLASS '=' QSTRING ';'
1083   oper_umodes: T_UMODES
1084   {
1085    if (conf_parser_ctx.pass == 2)
1086 <    yy_aconf->modes = 0;
1086 >    yy_conf->modes = 0;
1087   } '='  oper_umodes_items ';' ;
1088  
1089   oper_umodes_items: oper_umodes_items ',' oper_umodes_item | oper_umodes_item;
1090   oper_umodes_item:  T_BOTS
1091   {
1092    if (conf_parser_ctx.pass == 2)
1093 <    yy_aconf->modes |= UMODE_BOTS;
1093 >    yy_conf->modes |= UMODE_BOTS;
1094   } | T_CCONN
1095   {
1096    if (conf_parser_ctx.pass == 2)
1097 <    yy_aconf->modes |= UMODE_CCONN;
1097 >    yy_conf->modes |= UMODE_CCONN;
1098   } | T_CCONN_FULL
1099   {
1100    if (conf_parser_ctx.pass == 2)
1101 <    yy_aconf->modes |= UMODE_CCONN_FULL;
1101 >    yy_conf->modes |= UMODE_CCONN_FULL;
1102   } | T_DEAF
1103   {
1104    if (conf_parser_ctx.pass == 2)
1105 <    yy_aconf->modes |= UMODE_DEAF;
1105 >    yy_conf->modes |= UMODE_DEAF;
1106   } | T_DEBUG
1107   {
1108    if (conf_parser_ctx.pass == 2)
1109 <    yy_aconf->modes |= UMODE_DEBUG;
1109 >    yy_conf->modes |= UMODE_DEBUG;
1110   } | T_FULL
1111   {
1112    if (conf_parser_ctx.pass == 2)
1113 <    yy_aconf->modes |= UMODE_FULL;
1113 >    yy_conf->modes |= UMODE_FULL;
1114 > } | HIDDEN
1115 > {
1116 >  if (conf_parser_ctx.pass == 2)
1117 >    yy_conf->modes |= UMODE_HIDDEN;
1118   } | T_SKILL
1119   {
1120    if (conf_parser_ctx.pass == 2)
1121 <    yy_aconf->modes |= UMODE_SKILL;
1121 >    yy_conf->modes |= UMODE_SKILL;
1122   } | T_NCHANGE
1123   {
1124    if (conf_parser_ctx.pass == 2)
1125 <    yy_aconf->modes |= UMODE_NCHANGE;
1125 >    yy_conf->modes |= UMODE_NCHANGE;
1126   } | T_REJ
1127   {
1128    if (conf_parser_ctx.pass == 2)
1129 <    yy_aconf->modes |= UMODE_REJ;
1129 >    yy_conf->modes |= UMODE_REJ;
1130   } | T_UNAUTH
1131   {
1132    if (conf_parser_ctx.pass == 2)
1133 <    yy_aconf->modes |= UMODE_UNAUTH;
1133 >    yy_conf->modes |= UMODE_UNAUTH;
1134   } | T_SPY
1135   {
1136    if (conf_parser_ctx.pass == 2)
1137 <    yy_aconf->modes |= UMODE_SPY;
1137 >    yy_conf->modes |= UMODE_SPY;
1138   } | T_EXTERNAL
1139   {
1140    if (conf_parser_ctx.pass == 2)
1141 <    yy_aconf->modes |= UMODE_EXTERNAL;
1141 >    yy_conf->modes |= UMODE_EXTERNAL;
1142   } | T_OPERWALL
1143   {
1144    if (conf_parser_ctx.pass == 2)
1145 <    yy_aconf->modes |= UMODE_OPERWALL;
1145 >    yy_conf->modes |= UMODE_OPERWALL;
1146   } | T_SERVNOTICE
1147   {
1148    if (conf_parser_ctx.pass == 2)
1149 <    yy_aconf->modes |= UMODE_SERVNOTICE;
1149 >    yy_conf->modes |= UMODE_SERVNOTICE;
1150   } | T_INVISIBLE
1151   {
1152    if (conf_parser_ctx.pass == 2)
1153 <    yy_aconf->modes |= UMODE_INVISIBLE;
1153 >    yy_conf->modes |= UMODE_INVISIBLE;
1154   } | T_WALLOP
1155   {
1156    if (conf_parser_ctx.pass == 2)
1157 <    yy_aconf->modes |= UMODE_WALLOP;
1157 >    yy_conf->modes |= UMODE_WALLOP;
1158   } | T_SOFTCALLERID
1159   {
1160    if (conf_parser_ctx.pass == 2)
1161 <    yy_aconf->modes |= UMODE_SOFTCALLERID;
1161 >    yy_conf->modes |= UMODE_SOFTCALLERID;
1162   } | T_CALLERID
1163   {
1164    if (conf_parser_ctx.pass == 2)
1165 <    yy_aconf->modes |= UMODE_CALLERID;
1165 >    yy_conf->modes |= UMODE_CALLERID;
1166   } | T_LOCOPS
1167   {
1168    if (conf_parser_ctx.pass == 2)
1169 <    yy_aconf->modes |= UMODE_LOCOPS;
1169 >    yy_conf->modes |= UMODE_LOCOPS;
1170   };
1171  
1172   oper_flags: IRCD_FLAGS
1173   {
1174 +  if (conf_parser_ctx.pass == 2)
1175 +    yy_conf->port = 0;
1176   } '='  oper_flags_items ';';
1177  
1178   oper_flags_items: oper_flags_items ',' oper_flags_item | oper_flags_item;
1179 < oper_flags_item: NOT { not_atom = 1; } oper_flags_item_atom
1250 <                | { not_atom = 0; } oper_flags_item_atom;
1251 <
1252 < oper_flags_item_atom: GLOBAL_KILL
1179 > oper_flags_item: GLOBAL_KILL
1180   {
1181    if (conf_parser_ctx.pass == 2)
1182 <  {
1256 <    if (not_atom)yy_aconf->port &= ~OPER_FLAG_GLOBAL_KILL;
1257 <    else yy_aconf->port |= OPER_FLAG_GLOBAL_KILL;
1258 <  }
1182 >    yy_conf->port |= OPER_FLAG_GLOBAL_KILL;
1183   } | REMOTE
1184   {
1185    if (conf_parser_ctx.pass == 2)
1186 <  {
1263 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTE;
1264 <    else yy_aconf->port |= OPER_FLAG_REMOTE;
1265 <  }
1186 >    yy_conf->port |= OPER_FLAG_REMOTE;
1187   } | KLINE
1188   {
1189    if (conf_parser_ctx.pass == 2)
1190 <  {
1270 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_K;
1271 <    else yy_aconf->port |= OPER_FLAG_K;
1272 <  }
1190 >    yy_conf->port |= OPER_FLAG_K;
1191   } | UNKLINE
1192   {
1193    if (conf_parser_ctx.pass == 2)
1194 <  {
1195 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_UNKLINE;
1196 <    else yy_aconf->port |= OPER_FLAG_UNKLINE;
1197 <  }
1194 >    yy_conf->port |= OPER_FLAG_UNKLINE;
1195 > } | T_DLINE
1196 > {
1197 >  if (conf_parser_ctx.pass == 2)
1198 >    yy_conf->port |= OPER_FLAG_DLINE;
1199 > } | T_UNDLINE
1200 > {
1201 >  if (conf_parser_ctx.pass == 2)
1202 >    yy_conf->port |= OPER_FLAG_UNDLINE;
1203   } | XLINE
1204   {
1205    if (conf_parser_ctx.pass == 2)
1206 <  {
1284 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_X;
1285 <    else yy_aconf->port |= OPER_FLAG_X;
1286 <  }
1206 >    yy_conf->port |= OPER_FLAG_X;
1207   } | GLINE
1208   {
1209    if (conf_parser_ctx.pass == 2)
1210 <  {
1291 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_GLINE;
1292 <    else yy_aconf->port |= OPER_FLAG_GLINE;
1293 <  }
1210 >    yy_conf->port |= OPER_FLAG_GLINE;
1211   } | DIE
1212   {
1213    if (conf_parser_ctx.pass == 2)
1214 <  {
1215 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_DIE;
1299 <    else yy_aconf->port |= OPER_FLAG_DIE;
1300 <  }
1301 < } | REHASH
1214 >    yy_conf->port |= OPER_FLAG_DIE;
1215 > } | T_RESTART
1216   {
1217    if (conf_parser_ctx.pass == 2)
1218 <  {
1219 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REHASH;
1306 <    else yy_aconf->port |= OPER_FLAG_REHASH;
1307 <  }
1308 < } | ADMIN
1218 >    yy_conf->port |= OPER_FLAG_RESTART;
1219 > } | REHASH
1220   {
1221    if (conf_parser_ctx.pass == 2)
1222 <  {
1223 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_ADMIN;
1313 <    else yy_aconf->port |= OPER_FLAG_ADMIN;
1314 <  }
1315 < } | HIDDEN_ADMIN
1222 >    yy_conf->port |= OPER_FLAG_REHASH;
1223 > } | ADMIN
1224   {
1225    if (conf_parser_ctx.pass == 2)
1226 <  {
1319 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_ADMIN;
1320 <    else yy_aconf->port |= OPER_FLAG_HIDDEN_ADMIN;
1321 <  }
1226 >    yy_conf->port |= OPER_FLAG_ADMIN;
1227   } | NICK_CHANGES
1228   {
1229    if (conf_parser_ctx.pass == 2)
1230 <  {
1326 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_N;
1327 <    else yy_aconf->port |= OPER_FLAG_N;
1328 <  }
1230 >    yy_conf->port |= OPER_FLAG_N;
1231   } | T_OPERWALL
1232   {
1233    if (conf_parser_ctx.pass == 2)
1234 <  {
1235 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPERWALL;
1334 <    else yy_aconf->port |= OPER_FLAG_OPERWALL;
1335 <  }
1336 < } | OPER_SPY_T
1234 >    yy_conf->port |= OPER_FLAG_OPERWALL;
1235 > } | T_GLOBOPS
1236   {
1237    if (conf_parser_ctx.pass == 2)
1238 <  {
1239 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_OPER_SPY;
1341 <    else yy_aconf->port |= OPER_FLAG_OPER_SPY;
1342 <  }
1343 < } | HIDDEN_OPER
1238 >    yy_conf->port |= OPER_FLAG_GLOBOPS;
1239 > } | OPER_SPY_T
1240   {
1241    if (conf_parser_ctx.pass == 2)
1242 <  {
1347 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_HIDDEN_OPER;
1348 <    else yy_aconf->port |= OPER_FLAG_HIDDEN_OPER;
1349 <  }
1242 >    yy_conf->port |= OPER_FLAG_OPER_SPY;
1243   } | REMOTEBAN
1244   {
1245    if (conf_parser_ctx.pass == 2)
1246 <  {
1247 <    if (not_atom) yy_aconf->port &= ~OPER_FLAG_REMOTEBAN;
1355 <    else yy_aconf->port |= OPER_FLAG_REMOTEBAN;
1356 <  }
1357 < } | ENCRYPTED
1246 >    yy_conf->port |= OPER_FLAG_REMOTEBAN;
1247 > } | T_SET
1248   {
1249    if (conf_parser_ctx.pass == 2)
1250 <  {
1251 <    if (not_atom) ClearConfEncrypted(yy_aconf);
1252 <    else SetConfEncrypted(yy_aconf);
1253 <  }
1250 >    yy_conf->port |= OPER_FLAG_SET;
1251 > } | MODULE
1252 > {
1253 >  if (conf_parser_ctx.pass == 2)
1254 >    yy_conf->port |= OPER_FLAG_MODULE;
1255   };
1256  
1257  
# Line 1371 | Line 1262 | class_entry: CLASS
1262   {
1263    if (conf_parser_ctx.pass == 1)
1264    {
1265 <    yy_conf = make_conf_item(CLASS_TYPE);
1375 <    yy_class = map_to_conf(yy_conf);
1265 >    yy_class = class_make();
1266    }
1267 < } class_name_b '{' class_items '}' ';'
1267 > } '{' class_items '}' ';'
1268   {
1269    if (conf_parser_ctx.pass == 1)
1270    {
1381    struct ConfItem *cconf = NULL;
1271      struct ClassItem *class = NULL;
1272  
1273      if (yy_class_name == NULL)
1274 <      delete_conf_item(yy_conf);
1274 >      class_free(yy_class);
1275      else
1276      {
1277 <      cconf = find_exact_name_conf(CLASS_TYPE, yy_class_name, NULL, NULL);
1277 >      class = class_find(yy_class_name, 0);
1278  
1279 <      if (cconf != NULL)                /* The class existed already */
1279 >      if (class != NULL)                /* The class existed already */
1280        {
1281          int user_count = 0;
1282  
1283 <        rebuild_cidr_class(cconf, yy_class);
1395 <
1396 <        class = map_to_conf(cconf);
1283 >        rebuild_cidr_class(class, yy_class);
1284  
1285 <        user_count = class->curr_user_count;
1285 >        user_count = class->ref_count;
1286          memcpy(class, yy_class, sizeof(*class));
1287 <        class->curr_user_count = user_count;
1287 >        class->ref_count = user_count;
1288          class->active = 1;
1289  
1290 <        delete_conf_item(yy_conf);
1290 >        class_free(yy_class);
1291  
1292 <        MyFree(cconf->name);            /* Allows case change of class name */
1293 <        cconf->name = yy_class_name;
1292 >        MyFree(class->name);            /* Allows case change of class name */
1293 >        class->name = yy_class_name;
1294        }
1295        else      /* Brand new class */
1296        {
1297 <        MyFree(yy_conf->name);          /* just in case it was allocated */
1298 <        yy_conf->name = yy_class_name;
1297 >        MyFree(yy_class->name);          /* just in case it was allocated */
1298 >        yy_class->name = yy_class_name;
1299          yy_class->active = 1;
1300        }
1301      }
# Line 1417 | Line 1304 | class_entry: CLASS
1304    }
1305   };
1306  
1420 class_name_b: | class_name_t;
1421
1307   class_items:    class_items class_item | class_item;
1308   class_item:     class_name |
1309                  class_cidr_bitlen_ipv4 | class_cidr_bitlen_ipv6 |
1310                  class_ping_time |
1426                class_ping_warning |
1311                  class_number_per_cidr |
1312                  class_number_per_ip |
1313                  class_connectfreq |
# Line 1431 | Line 1315 | class_item:     class_name |
1315                  class_max_global |
1316                  class_max_local |
1317                  class_max_ident |
1318 <                class_sendq |
1318 >                class_sendq | class_recvq |
1319                  error ';' ;
1320  
1321   class_name: NAME '=' QSTRING ';'
# Line 1443 | Line 1327 | class_name: NAME '=' QSTRING ';'
1327    }
1328   };
1329  
1446 class_name_t: QSTRING
1447 {
1448  if (conf_parser_ctx.pass == 1)
1449  {
1450    MyFree(yy_class_name);
1451    DupString(yy_class_name, yylval.string);
1452  }
1453 };
1454
1330   class_ping_time: PING_TIME '=' timespec ';'
1331   {
1332    if (conf_parser_ctx.pass == 1)
1333 <    PingFreq(yy_class) = $3;
1459 < };
1460 <
1461 < class_ping_warning: PING_WARNING '=' timespec ';'
1462 < {
1463 <  if (conf_parser_ctx.pass == 1)
1464 <    PingWarning(yy_class) = $3;
1333 >    yy_class->ping_freq = $3;
1334   };
1335  
1336   class_number_per_ip: NUMBER_PER_IP '=' NUMBER ';'
1337   {
1338    if (conf_parser_ctx.pass == 1)
1339 <    MaxPerIp(yy_class) = $3;
1339 >    yy_class->max_perip = $3;
1340   };
1341  
1342   class_connectfreq: CONNECTFREQ '=' timespec ';'
1343   {
1344    if (conf_parser_ctx.pass == 1)
1345 <    ConFreq(yy_class) = $3;
1345 >    yy_class->con_freq = $3;
1346   };
1347  
1348   class_max_number: MAX_NUMBER '=' NUMBER ';'
1349   {
1350    if (conf_parser_ctx.pass == 1)
1351 <    MaxTotal(yy_class) = $3;
1351 >    yy_class->max_total = $3;
1352   };
1353  
1354   class_max_global: MAX_GLOBAL '=' NUMBER ';'
1355   {
1356    if (conf_parser_ctx.pass == 1)
1357 <    MaxGlobal(yy_class) = $3;
1357 >    yy_class->max_global = $3;
1358   };
1359  
1360   class_max_local: MAX_LOCAL '=' NUMBER ';'
1361   {
1362    if (conf_parser_ctx.pass == 1)
1363 <    MaxLocal(yy_class) = $3;
1363 >    yy_class->max_local = $3;
1364   };
1365  
1366   class_max_ident: MAX_IDENT '=' NUMBER ';'
1367   {
1368    if (conf_parser_ctx.pass == 1)
1369 <    MaxIdent(yy_class) = $3;
1369 >    yy_class->max_ident = $3;
1370   };
1371  
1372   class_sendq: SENDQ '=' sizespec ';'
1373   {
1374    if (conf_parser_ctx.pass == 1)
1375 <    MaxSendq(yy_class) = $3;
1375 >    yy_class->max_sendq = $3;
1376 > };
1377 >
1378 > class_recvq: T_RECVQ '=' sizespec ';'
1379 > {
1380 >  if (conf_parser_ctx.pass == 1)
1381 >    if ($3 >= CLIENT_FLOOD_MIN && $3 <= CLIENT_FLOOD_MAX)
1382 >      yy_class->max_recvq = $3;
1383   };
1384  
1385   class_cidr_bitlen_ipv4: CIDR_BITLEN_IPV4 '=' NUMBER ';'
1386   {
1387    if (conf_parser_ctx.pass == 1)
1388 <    CidrBitlenIPV4(yy_class) = $3;
1388 >    yy_class->cidr_bitlen_ipv4 = $3 > 32 ? 32 : $3;
1389   };
1390  
1391   class_cidr_bitlen_ipv6: CIDR_BITLEN_IPV6 '=' NUMBER ';'
1392   {
1393    if (conf_parser_ctx.pass == 1)
1394 <    CidrBitlenIPV6(yy_class) = $3;
1394 >    yy_class->cidr_bitlen_ipv6 = $3 > 128 ? 128 : $3;
1395   };
1396  
1397   class_number_per_cidr: NUMBER_PER_CIDR '=' NUMBER ';'
1398   {
1399    if (conf_parser_ctx.pass == 1)
1400 <    NumberPerCidr(yy_class) = $3;
1400 >    yy_class->number_per_cidr = $3;
1401   };
1402  
1403   /***************************************************************************
# Line 1631 | Line 1507 | auth_entry: IRCD_AUTH
1507   {
1508    if (conf_parser_ctx.pass == 2)
1509    {
1510 <    yy_conf = make_conf_item(CLIENT_TYPE);
1635 <    yy_aconf = map_to_conf(yy_conf);
1510 >    yy_conf = conf_make(CONF_CLIENT);
1511    }
1512    else
1513    {
# Line 1646 | Line 1521 | auth_entry: IRCD_AUTH
1521      struct CollectItem *yy_tmp = NULL;
1522      dlink_node *ptr = NULL, *next_ptr = NULL;
1523  
1524 <    if (yy_aconf->user && yy_aconf->host)
1524 >    if (yy_conf->user && yy_conf->host)
1525      {
1526        conf_add_class_to_conf(yy_conf, class_name);
1527 <      add_conf_by_address(CONF_CLIENT, yy_aconf);
1527 >      add_conf_by_address(CONF_CLIENT, yy_conf);
1528      }
1529      else
1530 <      delete_conf_item(yy_conf);
1530 >      conf_free(yy_conf);
1531  
1532      /* copy over settings from first struct */
1533      DLINK_FOREACH_SAFE(ptr, next_ptr, col_conf_list.head)
1534      {
1535 <      struct AccessItem *new_aconf;
1661 <      struct ConfItem *new_conf;
1662 <
1663 <      new_conf = make_conf_item(CLIENT_TYPE);
1664 <      new_aconf = map_to_conf(new_conf);
1535 >      struct MaskItem *new_conf = conf_make(CONF_CLIENT);
1536  
1537        yy_tmp = ptr->data;
1538  
1539        assert(yy_tmp->user && yy_tmp->host);
1540  
1541 <      if (yy_aconf->passwd != NULL)
1542 <        DupString(new_aconf->passwd, yy_aconf->passwd);
1541 >      if (yy_conf->passwd != NULL)
1542 >        DupString(new_conf->passwd, yy_conf->passwd);
1543        if (yy_conf->name != NULL)
1544          DupString(new_conf->name, yy_conf->name);
1545 <      if (yy_aconf->passwd != NULL)
1546 <        DupString(new_aconf->passwd, yy_aconf->passwd);
1545 >      if (yy_conf->passwd != NULL)
1546 >        DupString(new_conf->passwd, yy_conf->passwd);
1547  
1548 <      new_aconf->flags = yy_aconf->flags;
1549 <      new_aconf->port  = yy_aconf->port;
1548 >      new_conf->flags = yy_conf->flags;
1549 >      new_conf->port  = yy_conf->port;
1550  
1551 <      DupString(new_aconf->user, yy_tmp->user);
1552 <      collapse(new_aconf->user);
1551 >      DupString(new_conf->user, yy_tmp->user);
1552 >      collapse(new_conf->user);
1553  
1554 <      DupString(new_aconf->host, yy_tmp->host);
1555 <      collapse(new_aconf->host);
1554 >      DupString(new_conf->host, yy_tmp->host);
1555 >      collapse(new_conf->host);
1556  
1557        conf_add_class_to_conf(new_conf, class_name);
1558 <      add_conf_by_address(CONF_CLIENT, new_aconf);
1558 >      add_conf_by_address(CONF_CLIENT, new_conf);
1559        dlinkDelete(&yy_tmp->node, &col_conf_list);
1560        free_collect_item(yy_tmp);
1561      }
# Line 1692 | Line 1563 | auth_entry: IRCD_AUTH
1563      MyFree(class_name);
1564      class_name = NULL;
1565      yy_conf = NULL;
1695    yy_aconf = NULL;
1566    }
1567   };
1568  
# Line 1719 | Line 1589 | auth_user: USER '=' QSTRING ';'
1589  
1590      split_nuh(&nuh);
1591  
1592 <    if (yy_aconf->user == NULL)
1592 >    if (yy_conf->user == NULL)
1593      {
1594 <      DupString(yy_aconf->user, userbuf);
1595 <      DupString(yy_aconf->host, hostbuf);
1594 >      DupString(yy_conf->user, userbuf);
1595 >      DupString(yy_conf->host, hostbuf);
1596      }
1597      else
1598      {
# Line 1736 | Line 1606 | auth_user: USER '=' QSTRING ';'
1606    }
1607   };
1608  
1739 /* XXX - IP/IPV6 tags don't exist anymore - put IP/IPV6 into user. */
1740
1609   auth_passwd: PASSWORD '=' QSTRING ';'
1610   {
1611    if (conf_parser_ctx.pass == 2)
1612    {
1613      /* be paranoid */
1614 <    if (yy_aconf->passwd != NULL)
1615 <      memset(yy_aconf->passwd, 0, strlen(yy_aconf->passwd));
1614 >    if (yy_conf->passwd != NULL)
1615 >      memset(yy_conf->passwd, 0, strlen(yy_conf->passwd));
1616  
1617 <    MyFree(yy_aconf->passwd);
1618 <    DupString(yy_aconf->passwd, yylval.string);
1617 >    MyFree(yy_conf->passwd);
1618 >    DupString(yy_conf->passwd, yylval.string);
1619    }
1620   };
1621  
# Line 1765 | Line 1633 | auth_encrypted: ENCRYPTED '=' TBOOL ';'
1633    if (conf_parser_ctx.pass == 2)
1634    {
1635      if (yylval.number)
1636 <      SetConfEncrypted(yy_aconf);
1636 >      SetConfEncrypted(yy_conf);
1637      else
1638 <      ClearConfEncrypted(yy_aconf);
1638 >      ClearConfEncrypted(yy_conf);
1639    }
1640   };
1641  
# Line 1776 | Line 1644 | auth_flags: IRCD_FLAGS
1644   } '='  auth_flags_items ';';
1645  
1646   auth_flags_items: auth_flags_items ',' auth_flags_item | auth_flags_item;
1647 < auth_flags_item: NOT { not_atom = 1; } auth_flags_item_atom
1780 <                | { not_atom = 0; } auth_flags_item_atom;
1781 <
1782 < auth_flags_item_atom: SPOOF_NOTICE
1647 > auth_flags_item: SPOOF_NOTICE
1648   {
1649    if (conf_parser_ctx.pass == 2)
1650 <  {
1786 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_SPOOF_NOTICE;
1787 <    else yy_aconf->flags |= CONF_FLAGS_SPOOF_NOTICE;
1788 <  }
1650 >    yy_conf->flags |= CONF_FLAGS_SPOOF_NOTICE;
1651   } | EXCEED_LIMIT
1652   {
1653    if (conf_parser_ctx.pass == 2)
1654 <  {
1793 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NOLIMIT;
1794 <    else yy_aconf->flags |= CONF_FLAGS_NOLIMIT;
1795 <  }
1654 >    yy_conf->flags |= CONF_FLAGS_NOLIMIT;
1655   } | KLINE_EXEMPT
1656   {
1657    if (conf_parser_ctx.pass == 2)
1658 <  {
1800 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTKLINE;
1801 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTKLINE;
1802 <  }
1658 >    yy_conf->flags |= CONF_FLAGS_EXEMPTKLINE;
1659   } | NEED_IDENT
1660   {
1661    if (conf_parser_ctx.pass == 2)
1662 <  {
1807 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_IDENTD;
1808 <    else yy_aconf->flags |= CONF_FLAGS_NEED_IDENTD;
1809 <  }
1662 >    yy_conf->flags |= CONF_FLAGS_NEED_IDENTD;
1663   } | CAN_FLOOD
1664   {
1665    if (conf_parser_ctx.pass == 2)
1666 <  {
1814 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_CAN_FLOOD;
1815 <    else yy_aconf->flags |= CONF_FLAGS_CAN_FLOOD;
1816 <  }
1817 < } | CAN_IDLE
1818 < {
1819 <  if (conf_parser_ctx.pass == 2)
1820 <  {
1821 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_IDLE_LINED;
1822 <    else yy_aconf->flags |= CONF_FLAGS_IDLE_LINED;
1823 <  }
1666 >    yy_conf->flags |= CONF_FLAGS_CAN_FLOOD;
1667   } | NO_TILDE
1668   {
1669    if (conf_parser_ctx.pass == 2)
1670 <  {
1828 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NO_TILDE;
1829 <    else yy_aconf->flags |= CONF_FLAGS_NO_TILDE;
1830 <  }
1670 >    yy_conf->flags |= CONF_FLAGS_NO_TILDE;
1671   } | GLINE_EXEMPT
1672   {
1673    if (conf_parser_ctx.pass == 2)
1674 <  {
1835 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTGLINE;
1836 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTGLINE;
1837 <  }
1674 >    yy_conf->flags |= CONF_FLAGS_EXEMPTGLINE;
1675   } | RESV_EXEMPT
1676   {
1677    if (conf_parser_ctx.pass == 2)
1678 <  {
1842 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_EXEMPTRESV;
1843 <    else yy_aconf->flags |= CONF_FLAGS_EXEMPTRESV;
1844 <  }
1678 >    yy_conf->flags |= CONF_FLAGS_EXEMPTRESV;
1679   } | NEED_PASSWORD
1680   {
1681    if (conf_parser_ctx.pass == 2)
1682 <  {
1849 <    if (not_atom) yy_aconf->flags &= ~CONF_FLAGS_NEED_PASSWORD;
1850 <    else yy_aconf->flags |= CONF_FLAGS_NEED_PASSWORD;
1851 <  }
1682 >    yy_conf->flags |= CONF_FLAGS_NEED_PASSWORD;
1683   };
1684  
1854 /* XXX - need check for illegal hostnames here */
1685   auth_spoof: SPOOF '=' QSTRING ';'
1686   {
1687    if (conf_parser_ctx.pass == 2)
1688    {
1689      MyFree(yy_conf->name);
1690  
1691 <    if (strlen(yylval.string) < HOSTLEN)
1691 >    if (strlen(yylval.string) <= HOSTLEN && valid_hostname(yylval.string))
1692      {    
1693        DupString(yy_conf->name, yylval.string);
1694 <      yy_aconf->flags |= CONF_FLAGS_SPOOF_IP;
1694 >      yy_conf->flags |= CONF_FLAGS_SPOOF_IP;
1695      }
1696      else
1697      {
1698 <      ilog(L_ERROR, "Spoofs must be less than %d..ignoring it", HOSTLEN);
1698 >      ilog(LOG_TYPE_IRCD, "Spoof either is too long or contains invalid characters. Ignoring it.");
1699        yy_conf->name = NULL;
1700      }
1701    }
# Line 1875 | Line 1705 | auth_redir_serv: REDIRSERV '=' QSTRING '
1705   {
1706    if (conf_parser_ctx.pass == 2)
1707    {
1708 <    yy_aconf->flags |= CONF_FLAGS_REDIR;
1708 >    yy_conf->flags |= CONF_FLAGS_REDIR;
1709      MyFree(yy_conf->name);
1710      DupString(yy_conf->name, yylval.string);
1711    }
# Line 1885 | Line 1715 | auth_redir_port: REDIRPORT '=' NUMBER ';
1715   {
1716    if (conf_parser_ctx.pass == 2)
1717    {
1718 <    yy_aconf->flags |= CONF_FLAGS_REDIR;
1719 <    yy_aconf->port = $3;
1718 >    yy_conf->flags |= CONF_FLAGS_REDIR;
1719 >    yy_conf->port = $3;
1720    }
1721   };
1722  
# Line 1948 | Line 1778 | resv_nick: NICK '=' QSTRING ';'
1778   };
1779  
1780   /***************************************************************************
1781 + *  section service
1782 + ***************************************************************************/
1783 + service_entry: T_SERVICE '{' service_items '}' ';';
1784 +
1785 + service_items:     service_items service_item | service_item;
1786 + service_item:      service_name | error;
1787 +
1788 + service_name: NAME '=' QSTRING ';'
1789 + {
1790 +  if (conf_parser_ctx.pass == 2)
1791 +  {
1792 +    if (valid_servname(yylval.string))
1793 +    {
1794 +      yy_conf = conf_make(CONF_SERVICE);
1795 +      DupString(yy_conf->name, yylval.string);
1796 +    }
1797 +  }
1798 + };
1799 +
1800 + /***************************************************************************
1801   *  section shared, for sharing remote klines etc.
1802   ***************************************************************************/
1803   shared_entry: T_SHARED
1804   {
1805    if (conf_parser_ctx.pass == 2)
1806    {
1807 <    yy_conf = make_conf_item(ULINE_TYPE);
1808 <    yy_match_item = map_to_conf(yy_conf);
1959 <    yy_match_item->action = SHARED_ALL;
1807 >    yy_conf = conf_make(CONF_ULINE);
1808 >    yy_conf->flags = SHARED_ALL;
1809    }
1810   } '{' shared_items '}' ';'
1811   {
# Line 1995 | Line 1844 | shared_user: USER '=' QSTRING ';'
1844  
1845      split_nuh(&nuh);
1846  
1847 <    DupString(yy_match_item->user, userbuf);
1848 <    DupString(yy_match_item->host, hostbuf);
1847 >    DupString(yy_conf->user, userbuf);
1848 >    DupString(yy_conf->host, hostbuf);
1849    }
1850   };
1851  
1852   shared_type: TYPE
1853   {
1854    if (conf_parser_ctx.pass == 2)
1855 <    yy_match_item->action = 0;
1855 >    yy_conf->flags = 0;
1856   } '=' shared_types ';' ;
1857  
1858   shared_types: shared_types ',' shared_type_item | shared_type_item;
1859   shared_type_item: KLINE
1860   {
1861    if (conf_parser_ctx.pass == 2)
1862 <    yy_match_item->action |= SHARED_KLINE;
1863 < } | TKLINE
1862 >    yy_conf->flags |= SHARED_KLINE;
1863 > } | UNKLINE
1864   {
1865    if (conf_parser_ctx.pass == 2)
1866 <    yy_match_item->action |= SHARED_TKLINE;
1867 < } | UNKLINE
1866 >    yy_conf->flags |= SHARED_UNKLINE;
1867 > } | T_DLINE
1868   {
1869    if (conf_parser_ctx.pass == 2)
1870 <    yy_match_item->action |= SHARED_UNKLINE;
1871 < } | XLINE
1870 >    yy_conf->flags |= SHARED_DLINE;
1871 > } | T_UNDLINE
1872   {
1873    if (conf_parser_ctx.pass == 2)
1874 <    yy_match_item->action |= SHARED_XLINE;
1875 < } | TXLINE
1874 >    yy_conf->flags |= SHARED_UNDLINE;
1875 > } | XLINE
1876   {
1877    if (conf_parser_ctx.pass == 2)
1878 <    yy_match_item->action |= SHARED_TXLINE;
1878 >    yy_conf->flags |= SHARED_XLINE;
1879   } | T_UNXLINE
1880   {
1881    if (conf_parser_ctx.pass == 2)
1882 <    yy_match_item->action |= SHARED_UNXLINE;
1882 >    yy_conf->flags |= SHARED_UNXLINE;
1883   } | RESV
1884   {
1885    if (conf_parser_ctx.pass == 2)
1886 <    yy_match_item->action |= SHARED_RESV;
2038 < } | TRESV
2039 < {
2040 <  if (conf_parser_ctx.pass == 2)
2041 <    yy_match_item->action |= SHARED_TRESV;
1886 >    yy_conf->flags |= SHARED_RESV;
1887   } | T_UNRESV
1888   {
1889    if (conf_parser_ctx.pass == 2)
1890 <    yy_match_item->action |= SHARED_UNRESV;
1890 >    yy_conf->flags |= SHARED_UNRESV;
1891   } | T_LOCOPS
1892   {
1893    if (conf_parser_ctx.pass == 2)
1894 <    yy_match_item->action |= SHARED_LOCOPS;
1894 >    yy_conf->flags |= SHARED_LOCOPS;
1895   } | T_ALL
1896   {
1897    if (conf_parser_ctx.pass == 2)
1898 <    yy_match_item->action = SHARED_ALL;
1898 >    yy_conf->flags = SHARED_ALL;
1899   };
1900  
1901   /***************************************************************************
# Line 2060 | Line 1905 | cluster_entry: T_CLUSTER
1905   {
1906    if (conf_parser_ctx.pass == 2)
1907    {
1908 <    yy_conf = make_conf_item(CLUSTER_TYPE);
2064 <    yy_conf->flags = SHARED_ALL;
1908 >    yy_conf = conf_make(CONF_CLUSTER);
1909    }
1910   } '{' cluster_items '}' ';'
1911   {
# Line 2093 | Line 1937 | cluster_type_item: KLINE
1937   {
1938    if (conf_parser_ctx.pass == 2)
1939      yy_conf->flags |= SHARED_KLINE;
2096 } | TKLINE
2097 {
2098  if (conf_parser_ctx.pass == 2)
2099    yy_conf->flags |= SHARED_TKLINE;
1940   } | UNKLINE
1941   {
1942    if (conf_parser_ctx.pass == 2)
1943      yy_conf->flags |= SHARED_UNKLINE;
1944 < } | XLINE
1944 > } | T_DLINE
1945   {
1946    if (conf_parser_ctx.pass == 2)
1947 <    yy_conf->flags |= SHARED_XLINE;
1948 < } | TXLINE
1947 >    yy_conf->flags |= SHARED_DLINE;
1948 > } | T_UNDLINE
1949 > {
1950 >  if (conf_parser_ctx.pass == 2)
1951 >    yy_conf->flags |= SHARED_UNDLINE;
1952 > } | XLINE
1953   {
1954    if (conf_parser_ctx.pass == 2)
1955 <    yy_conf->flags |= SHARED_TXLINE;
1955 >    yy_conf->flags |= SHARED_XLINE;
1956   } | T_UNXLINE
1957   {
1958    if (conf_parser_ctx.pass == 2)
# Line 2117 | Line 1961 | cluster_type_item: KLINE
1961   {
1962    if (conf_parser_ctx.pass == 2)
1963      yy_conf->flags |= SHARED_RESV;
2120 } | TRESV
2121 {
2122  if (conf_parser_ctx.pass == 2)
2123    yy_conf->flags |= SHARED_TRESV;
1964   } | T_UNRESV
1965   {
1966    if (conf_parser_ctx.pass == 2)
# Line 2142 | Line 1982 | connect_entry: CONNECT
1982   {
1983    if (conf_parser_ctx.pass == 2)
1984    {
1985 <    yy_conf = make_conf_item(SERVER_TYPE);
2146 <    yy_aconf = (struct AccessItem *)map_to_conf(yy_conf);
2147 <    yy_aconf->passwd = NULL;
2148 <    /* defaults */
2149 <    yy_aconf->port = PORTNUM;
1985 >    yy_conf = conf_make(CONF_SERVER);
1986  
1987 <    if (ConfigFileEntry.burst_away)
1988 <      yy_aconf->flags = CONF_FLAGS_BURST_AWAY;
1987 >    /* defaults */
1988 >    yy_conf->port = PORTNUM;
1989    }
1990    else
1991    {
1992      MyFree(class_name);
1993      class_name = NULL;
1994    }
1995 < } connect_name_b '{' connect_items '}' ';'
1995 > } '{' connect_items '}' ';'
1996   {
1997    if (conf_parser_ctx.pass == 2)
1998    {
1999 <    struct CollectItem *yy_hconf=NULL;
2000 <    struct CollectItem *yy_lconf=NULL;
2001 <    dlink_node *ptr;
2002 <    dlink_node *next_ptr;
2003 < #ifdef HAVE_LIBCRYPTO
2004 <    if (yy_aconf->host &&
2005 <        ((yy_aconf->passwd && yy_aconf->spasswd) ||
2006 <         (yy_aconf->rsa_public_key && IsConfCryptLink(yy_aconf))))
2171 < #else /* !HAVE_LIBCRYPTO */
2172 <      if (yy_aconf->host && !IsConfCryptLink(yy_aconf) &&
2173 <          yy_aconf->passwd && yy_aconf->spasswd)
2174 < #endif /* !HAVE_LIBCRYPTO */
2175 <        {
2176 <          if (conf_add_server(yy_conf, class_name) == -1)
2177 <          {
2178 <            delete_conf_item(yy_conf);
2179 <            yy_conf = NULL;
2180 <            yy_aconf = NULL;
2181 <          }
2182 <        }
2183 <        else
2184 <        {
2185 <          /* Even if yy_conf ->name is NULL
2186 <           * should still unhook any hub/leaf confs still pending
2187 <           */
2188 <          unhook_hub_leaf_confs();
2189 <
2190 <          if (yy_conf->name != NULL)
2191 <          {
2192 < #ifndef HAVE_LIBCRYPTO
2193 <            if (IsConfCryptLink(yy_aconf))
2194 <              yyerror("Ignoring connect block -- no OpenSSL support");
2195 < #else
2196 <            if (IsConfCryptLink(yy_aconf) && !yy_aconf->rsa_public_key)
2197 <              yyerror("Ignoring connect block -- missing key");
2198 < #endif
2199 <            if (yy_aconf->host == NULL)
2200 <              yyerror("Ignoring connect block -- missing host");
2201 <            else if (!IsConfCryptLink(yy_aconf) &&
2202 <                    (!yy_aconf->passwd || !yy_aconf->spasswd))
2203 <              yyerror("Ignoring connect block -- missing password");
2204 <          }
2205 <
2206 <
2207 <          /* XXX
2208 <           * This fixes a try_connections() core (caused by invalid class_ptr
2209 <           * pointers) reported by metalrock. That's an ugly fix, but there
2210 <           * is currently no better way. The entire config subsystem needs an
2211 <           * rewrite ASAP. make_conf_item() shouldn't really add things onto
2212 <           * a doubly linked list immediately without any sanity checks!  -Michael
2213 <           */
2214 <          delete_conf_item(yy_conf);
2215 <
2216 <          yy_aconf = NULL;
2217 <          yy_conf = NULL;
2218 <        }
2219 <
2220 <      /*
2221 <       * yy_conf is still pointing at the server that is having
2222 <       * a connect block built for it. This means, y_aconf->name
2223 <       * points to the actual irc name this server will be known as.
2224 <       * Now this new server has a set or even just one hub_mask (or leaf_mask)
2225 <       * given in the link list at yy_hconf. Fill in the HUB confs
2226 <       * from this link list now.
2227 <       */        
2228 <      DLINK_FOREACH_SAFE(ptr, next_ptr, hub_conf_list.head)
1999 >    if (yy_conf->host && yy_conf->passwd && yy_conf->spasswd)
2000 >    {
2001 >      if (conf_add_server(yy_conf, class_name) == -1)
2002 >        conf_free(yy_conf);
2003 >    }
2004 >    else
2005 >    {
2006 >      if (yy_conf->name != NULL)
2007        {
2008 <        struct ConfItem *new_hub_conf;
2009 <        struct MatchItem *match_item;
2010 <
2011 <        yy_hconf = ptr->data;
2234 <
2235 <        /* yy_conf == NULL is a fatal error for this connect block! */
2236 <        if ((yy_conf != NULL) && (yy_conf->name != NULL))
2237 <        {
2238 <          new_hub_conf = make_conf_item(HUB_TYPE);
2239 <          match_item = (struct MatchItem *)map_to_conf(new_hub_conf);
2240 <          DupString(new_hub_conf->name, yy_conf->name);
2241 <          if (yy_hconf->user != NULL)
2242 <            DupString(match_item->user, yy_hconf->user);
2243 <          else
2244 <            DupString(match_item->user, "*");
2245 <          if (yy_hconf->host != NULL)
2246 <            DupString(match_item->host, yy_hconf->host);
2247 <          else
2248 <            DupString(match_item->host, "*");
2249 <        }
2250 <        dlinkDelete(&yy_hconf->node, &hub_conf_list);
2251 <        free_collect_item(yy_hconf);
2008 >        if (yy_conf->host == NULL)
2009 >          yyerror("Ignoring connect block -- missing host");
2010 >        else if (!yy_conf->passwd || !yy_conf->spasswd)
2011 >          yyerror("Ignoring connect block -- missing password");
2012        }
2013  
2014 <      /* Ditto for the LEAF confs */
2015 <
2016 <      DLINK_FOREACH_SAFE(ptr, next_ptr, leaf_conf_list.head)
2017 <      {
2018 <        struct ConfItem *new_leaf_conf;
2019 <        struct MatchItem *match_item;
2020 <
2021 <        yy_lconf = ptr->data;
2014 >      /* XXX
2015 >       * This fixes a try_connections() core (caused by invalid class_ptr
2016 >       * pointers) reported by metalrock. That's an ugly fix, but there
2017 >       * is currently no better way. The entire config subsystem needs an
2018 >       * rewrite ASAP. make_conf_item() shouldn't really add things onto
2019 >       * a doubly linked list immediately without any sanity checks!  -Michael
2020 >       */
2021 >      conf_free(yy_conf);
2022 >    }
2023  
2024 <        if ((yy_conf != NULL) && (yy_conf->name != NULL))
2025 <        {
2026 <          new_leaf_conf = make_conf_item(LEAF_TYPE);
2266 <          match_item = (struct MatchItem *)map_to_conf(new_leaf_conf);
2267 <          DupString(new_leaf_conf->name, yy_conf->name);
2268 <          if (yy_lconf->user != NULL)
2269 <            DupString(match_item->user, yy_lconf->user);
2270 <          else
2271 <            DupString(match_item->user, "*");
2272 <          if (yy_lconf->host != NULL)
2273 <            DupString(match_item->host, yy_lconf->host);
2274 <          else
2275 <            DupString(match_item->host, "*");
2276 <        }
2277 <        dlinkDelete(&yy_lconf->node, &leaf_conf_list);
2278 <        free_collect_item(yy_lconf);
2279 <      }
2280 <      MyFree(class_name);
2281 <      class_name = NULL;
2282 <      yy_conf = NULL;
2283 <      yy_aconf = NULL;
2024 >    MyFree(class_name);
2025 >    class_name = NULL;
2026 >    yy_conf = NULL;
2027    }
2028   };
2029  
2287 connect_name_b: | connect_name_t;
2030   connect_items:  connect_items connect_item | connect_item;
2031   connect_item:   connect_name | connect_host | connect_vhost |
2032                  connect_send_password | connect_accept_password |
2033 <                connect_aftype | connect_port |
2033 >                connect_aftype | connect_port | connect_ssl_cipher_list |
2034                  connect_flags | connect_hub_mask | connect_leaf_mask |
2035 <                connect_class | connect_encrypted |
2294 <                connect_rsa_public_key_file | connect_cipher_preference |
2035 >                connect_class | connect_encrypted |
2036                  error ';' ;
2037  
2038   connect_name: NAME '=' QSTRING ';'
2039   {
2040    if (conf_parser_ctx.pass == 2)
2041    {
2301    if (yy_conf->name != NULL)
2302      yyerror("Multiple connect name entry");
2303
2304    MyFree(yy_conf->name);
2305    DupString(yy_conf->name, yylval.string);
2306  }
2307 };
2308
2309 connect_name_t: QSTRING
2310 {
2311  if (conf_parser_ctx.pass == 2)
2312  {
2313    if (yy_conf->name != NULL)
2314      yyerror("Multiple connect name entry");
2315
2042      MyFree(yy_conf->name);
2043      DupString(yy_conf->name, yylval.string);
2044    }
# Line 2322 | Line 2048 | connect_host: HOST '=' QSTRING ';'
2048   {
2049    if (conf_parser_ctx.pass == 2)
2050    {
2051 <    MyFree(yy_aconf->host);
2052 <    DupString(yy_aconf->host, yylval.string);
2051 >    MyFree(yy_conf->host);
2052 >    DupString(yy_conf->host, yylval.string);
2053    }
2054   };
2055  
# Line 2340 | Line 2066 | connect_vhost: VHOST '=' QSTRING ';'
2066      hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
2067  
2068      if (getaddrinfo(yylval.string, NULL, &hints, &res))
2069 <      ilog(L_ERROR, "Invalid netmask for server vhost(%s)", yylval.string);
2069 >      ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string);
2070      else
2071      {
2072        assert(res != NULL);
2073  
2074 <      memcpy(&yy_aconf->my_ipnum, res->ai_addr, res->ai_addrlen);
2075 <      yy_aconf->my_ipnum.ss.ss_family = res->ai_family;
2076 <      yy_aconf->my_ipnum.ss_len = res->ai_addrlen;
2074 >      memcpy(&yy_conf->bind, res->ai_addr, res->ai_addrlen);
2075 >      yy_conf->bind.ss.ss_family = res->ai_family;
2076 >      yy_conf->bind.ss_len = res->ai_addrlen;
2077        freeaddrinfo(res);
2078      }
2079    }
# Line 2362 | Line 2088 | connect_send_password: SEND_PASSWORD '='
2088      else if (strchr($3, ' ') != NULL)
2089        yyerror("Server passwords cannot contain spaces");
2090      else {
2091 <      if (yy_aconf->spasswd != NULL)
2092 <        memset(yy_aconf->spasswd, 0, strlen(yy_aconf->spasswd));
2091 >      if (yy_conf->spasswd != NULL)
2092 >        memset(yy_conf->spasswd, 0, strlen(yy_conf->spasswd));
2093  
2094 <      MyFree(yy_aconf->spasswd);
2095 <      DupString(yy_aconf->spasswd, yylval.string);
2094 >      MyFree(yy_conf->spasswd);
2095 >      DupString(yy_conf->spasswd, yylval.string);
2096      }
2097    }
2098   };
# Line 2380 | Line 2106 | connect_accept_password: ACCEPT_PASSWORD
2106      else if (strchr($3, ' ') != NULL)
2107        yyerror("Server passwords cannot contain spaces");
2108      else {
2109 <      if (yy_aconf->passwd != NULL)
2110 <        memset(yy_aconf->passwd, 0, strlen(yy_aconf->passwd));
2109 >      if (yy_conf->passwd != NULL)
2110 >        memset(yy_conf->passwd, 0, strlen(yy_conf->passwd));
2111  
2112 <      MyFree(yy_aconf->passwd);
2113 <      DupString(yy_aconf->passwd, yylval.string);
2112 >      MyFree(yy_conf->passwd);
2113 >      DupString(yy_conf->passwd, yylval.string);
2114      }
2115    }
2116   };
# Line 2392 | Line 2118 | connect_accept_password: ACCEPT_PASSWORD
2118   connect_port: PORT '=' NUMBER ';'
2119   {
2120    if (conf_parser_ctx.pass == 2)
2121 <    yy_aconf->port = $3;
2121 >    yy_conf->port = $3;
2122   };
2123  
2124   connect_aftype: AFTYPE '=' T_IPV4 ';'
2125   {
2126    if (conf_parser_ctx.pass == 2)
2127 <    yy_aconf->aftype = AF_INET;
2127 >    yy_conf->aftype = AF_INET;
2128   } | AFTYPE '=' T_IPV6 ';'
2129   {
2130   #ifdef IPV6
2131    if (conf_parser_ctx.pass == 2)
2132 <    yy_aconf->aftype = AF_INET6;
2132 >    yy_conf->aftype = AF_INET6;
2133   #endif
2134   };
2135  
# Line 2412 | Line 2138 | connect_flags: IRCD_FLAGS
2138   } '='  connect_flags_items ';';
2139  
2140   connect_flags_items: connect_flags_items ',' connect_flags_item | connect_flags_item;
2141 < connect_flags_item: NOT  { not_atom = 1; } connect_flags_item_atom
2416 <                        |  { not_atom = 0; } connect_flags_item_atom;
2417 <
2418 < connect_flags_item_atom: COMPRESSED
2141 > connect_flags_item: AUTOCONN
2142   {
2143    if (conf_parser_ctx.pass == 2)
2144 < #ifndef HAVE_LIBZ
2145 <    yyerror("Ignoring flags = compressed; -- no zlib support");
2423 < #else
2424 < {
2425 <   if (not_atom)ClearConfCompressed(yy_aconf);
2426 <   else SetConfCompressed(yy_aconf);
2427 < }
2428 < #endif
2429 < } | CRYPTLINK
2430 < {
2431 <  if (conf_parser_ctx.pass == 2)
2432 <  {
2433 <    if (not_atom)ClearConfCryptLink(yy_aconf);
2434 <    else SetConfCryptLink(yy_aconf);
2435 <  }
2436 < } | AUTOCONN
2144 >    SetConfAllowAutoConn(yy_conf);
2145 > } | T_SSL
2146   {
2147    if (conf_parser_ctx.pass == 2)
2148 <  {
2440 <    if (not_atom)ClearConfAllowAutoConn(yy_aconf);
2441 <    else SetConfAllowAutoConn(yy_aconf);
2442 <  }
2443 < } | BURST_AWAY
2444 < {
2445 <  if (conf_parser_ctx.pass == 2)
2446 <  {
2447 <    if (not_atom)ClearConfAwayBurst(yy_aconf);
2448 <    else SetConfAwayBurst(yy_aconf);
2449 <  }
2450 < } | TOPICBURST
2451 < {
2452 <  if (conf_parser_ctx.pass == 2)
2453 <  {
2454 <    if (not_atom)ClearConfTopicBurst(yy_aconf);
2455 <    else SetConfTopicBurst(yy_aconf);
2456 <  }
2457 < }
2458 < ;
2459 <
2460 < connect_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';'
2461 < {
2462 < #ifdef HAVE_LIBCRYPTO
2463 <  if (conf_parser_ctx.pass == 2)
2464 <  {
2465 <    BIO *file;
2466 <
2467 <    if (yy_aconf->rsa_public_key != NULL)
2468 <    {
2469 <      RSA_free(yy_aconf->rsa_public_key);
2470 <      yy_aconf->rsa_public_key = NULL;
2471 <    }
2472 <
2473 <    if (yy_aconf->rsa_public_key_file != NULL)
2474 <    {
2475 <      MyFree(yy_aconf->rsa_public_key_file);
2476 <      yy_aconf->rsa_public_key_file = NULL;
2477 <    }
2478 <
2479 <    DupString(yy_aconf->rsa_public_key_file, yylval.string);
2480 <
2481 <    if ((file = BIO_new_file(yylval.string, "r")) == NULL)
2482 <    {
2483 <      yyerror("Ignoring rsa_public_key_file -- file doesn't exist");
2484 <      break;
2485 <    }
2486 <
2487 <    yy_aconf->rsa_public_key = (RSA *)PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL);
2488 <
2489 <    if (yy_aconf->rsa_public_key == NULL)
2490 <    {
2491 <      yyerror("Ignoring rsa_public_key_file -- Key invalid; check key syntax.");
2492 <      break;
2493 <    }
2494 <      
2495 <    BIO_set_close(file, BIO_CLOSE);
2496 <    BIO_free(file);
2497 <  }
2498 < #endif /* HAVE_LIBCRYPTO */
2148 >    SetConfSSL(yy_conf);
2149   };
2150  
2151   connect_encrypted: ENCRYPTED '=' TBOOL ';'
# Line 2503 | Line 2153 | connect_encrypted: ENCRYPTED '=' TBOOL '
2153    if (conf_parser_ctx.pass == 2)
2154    {
2155      if (yylval.number)
2156 <      yy_aconf->flags |= CONF_FLAGS_ENCRYPTED;
2156 >      yy_conf->flags |= CONF_FLAGS_ENCRYPTED;
2157      else
2158 <      yy_aconf->flags &= ~CONF_FLAGS_ENCRYPTED;
2158 >      yy_conf->flags &= ~CONF_FLAGS_ENCRYPTED;
2159    }
2160   };
2161  
# Line 2513 | Line 2163 | connect_hub_mask: HUB_MASK '=' QSTRING '
2163   {
2164    if (conf_parser_ctx.pass == 2)
2165    {
2166 <    struct CollectItem *yy_tmp;
2166 >    char *mask;
2167  
2168 <    yy_tmp = (struct CollectItem *)MyMalloc(sizeof(struct CollectItem));
2169 <    DupString(yy_tmp->host, yylval.string);
2520 <    DupString(yy_tmp->user, "*");
2521 <    dlinkAdd(yy_tmp, &yy_tmp->node, &hub_conf_list);
2168 >    DupString(mask, yylval.string);
2169 >    dlinkAdd(mask, make_dlink_node(), &yy_conf->hub_list);
2170    }
2171   };
2172  
# Line 2526 | Line 2174 | connect_leaf_mask: LEAF_MASK '=' QSTRING
2174   {
2175    if (conf_parser_ctx.pass == 2)
2176    {
2177 <    struct CollectItem *yy_tmp;
2177 >    char *mask;
2178  
2179 <    yy_tmp = (struct CollectItem *)MyMalloc(sizeof(struct CollectItem));
2180 <    DupString(yy_tmp->host, yylval.string);
2533 <    DupString(yy_tmp->user, "*");
2534 <    dlinkAdd(yy_tmp, &yy_tmp->node, &leaf_conf_list);
2179 >    DupString(mask, yylval.string);
2180 >    dlinkAdd(mask, make_dlink_node(), &yy_conf->leaf_list);
2181    }
2182   };
2183  
# Line 2544 | Line 2190 | connect_class: CLASS '=' QSTRING ';'
2190    }
2191   };
2192  
2193 < connect_cipher_preference: CIPHER_PREFERENCE '=' QSTRING ';'
2193 > connect_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
2194   {
2195   #ifdef HAVE_LIBCRYPTO
2196    if (conf_parser_ctx.pass == 2)
2197    {
2198 <    struct EncCapability *ecap;
2199 <    const char *cipher_name;
2554 <    int found = 0;
2555 <
2556 <    yy_aconf->cipher_preference = NULL;
2557 <    cipher_name = yylval.string;
2558 <
2559 <    for (ecap = CipherTable; ecap->name; ecap++)
2560 <    {
2561 <      if ((irccmp(ecap->name, cipher_name) == 0) &&
2562 <          (ecap->cap & CAP_ENC_MASK))
2563 <      {
2564 <        yy_aconf->cipher_preference = ecap;
2565 <        found = 1;
2566 <        break;
2567 <      }
2568 <    }
2569 <
2570 <    if (!found)
2571 <      yyerror("Invalid cipher");
2198 >    MyFree(yy_conf->cipher_list);
2199 >    DupString(yy_conf->cipher_list, yylval.string);
2200    }
2201   #else
2202    if (conf_parser_ctx.pass == 2)
2203 <    yyerror("Ignoring cipher_preference -- no OpenSSL support");
2203 >    yyerror("Ignoring connect::ciphers -- no OpenSSL support");
2204   #endif
2205   };
2206  
2207 +
2208   /***************************************************************************
2209   *  section kill
2210   ***************************************************************************/
# Line 2602 | Line 2231 | kill_entry: KILL
2231          if (!(exp_user = ircd_pcre_compile(userbuf, &errptr)) ||
2232              !(exp_host = ircd_pcre_compile(hostbuf, &errptr)))
2233          {
2234 <          ilog(L_ERROR, "Failed to add regular expression based K-Line: %s",
2234 >          ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: %s",
2235                 errptr);
2236            break;
2237          }
2238  
2239 <        yy_aconf = map_to_conf(make_conf_item(RKLINE_TYPE));
2240 <        yy_aconf->regexuser = exp_user;
2241 <        yy_aconf->regexhost = exp_host;
2239 >        yy_conf = conf_make(CONF_RKLINE);
2240 >        yy_conf->regexuser = exp_user;
2241 >        yy_conf->regexhost = exp_host;
2242  
2243 <        DupString(yy_aconf->user, userbuf);
2244 <        DupString(yy_aconf->host, hostbuf);
2243 >        DupString(yy_conf->user, userbuf);
2244 >        DupString(yy_conf->host, hostbuf);
2245  
2246          if (reasonbuf[0])
2247 <          DupString(yy_aconf->reason, reasonbuf);
2247 >          DupString(yy_conf->reason, reasonbuf);
2248          else
2249 <          DupString(yy_aconf->reason, "No reason");
2249 >          DupString(yy_conf->reason, "No reason");
2250   #else
2251 <        ilog(L_ERROR, "Failed to add regular expression based K-Line: no PCRE support");
2251 >        ilog(LOG_TYPE_IRCD, "Failed to add regular expression based K-Line: no PCRE support");
2252          break;
2253   #endif
2254        }
2255        else
2256        {
2257 <        yy_aconf = map_to_conf(make_conf_item(KLINE_TYPE));
2257 >        yy_conf = conf_make(CONF_KLINE);
2258  
2259 <        DupString(yy_aconf->user, userbuf);
2260 <        DupString(yy_aconf->host, hostbuf);
2259 >        DupString(yy_conf->user, userbuf);
2260 >        DupString(yy_conf->host, hostbuf);
2261  
2262          if (reasonbuf[0])
2263 <          DupString(yy_aconf->reason, reasonbuf);
2263 >          DupString(yy_conf->reason, reasonbuf);
2264          else
2265 <          DupString(yy_aconf->reason, "No reason");
2266 <        add_conf_by_address(CONF_KILL, yy_aconf);
2265 >          DupString(yy_conf->reason, "No reason");
2266 >        add_conf_by_address(CONF_KLINE, yy_conf);
2267        }
2268      }
2269  
2270 <    yy_aconf = NULL;
2270 >    yy_conf = NULL;
2271    }
2272   };
2273  
# Line 2694 | Line 2323 | deny_entry: DENY
2323    {
2324      if (hostbuf[0] && parse_netmask(hostbuf, NULL, NULL) != HM_HOST)
2325      {
2326 <      yy_aconf = map_to_conf(make_conf_item(DLINE_TYPE));
2327 <      DupString(yy_aconf->host, hostbuf);
2326 >      yy_conf = conf_make(CONF_DLINE);
2327 >      DupString(yy_conf->host, hostbuf);
2328  
2329        if (reasonbuf[0])
2330 <        DupString(yy_aconf->reason, reasonbuf);
2330 >        DupString(yy_conf->reason, reasonbuf);
2331        else
2332 <        DupString(yy_aconf->reason, "No reason");
2333 <      add_conf_by_address(CONF_DLINE, yy_aconf);
2334 <      yy_aconf = NULL;
2332 >        DupString(yy_conf->reason, "No reason");
2333 >      add_conf_by_address(CONF_DLINE, yy_conf);
2334 >      yy_conf = NULL;
2335      }
2336    }
2337   };
# Line 2736 | Line 2365 | exempt_ip: IP '=' QSTRING ';'
2365    {
2366      if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST)
2367      {
2368 <      yy_aconf = map_to_conf(make_conf_item(EXEMPTDLINE_TYPE));
2369 <      DupString(yy_aconf->host, yylval.string);
2368 >      yy_conf = conf_make(CONF_EXEMPT);
2369 >      DupString(yy_conf->host, yylval.string);
2370  
2371 <      add_conf_by_address(CONF_EXEMPTDLINE, yy_aconf);
2372 <      yy_aconf = NULL;
2371 >      add_conf_by_address(CONF_EXEMPT, yy_conf);
2372 >      yy_conf = NULL;
2373      }
2374    }
2375   };
# Line 2769 | Line 2398 | gecos_entry: GECOS
2398  
2399          if (!(exp_p = ircd_pcre_compile(gecos_name, &errptr)))
2400          {
2401 <          ilog(L_ERROR, "Failed to add regular expression based X-Line: %s",
2401 >          ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: %s",
2402                 errptr);
2403            break;
2404          }
2405  
2406 <        yy_conf = make_conf_item(RXLINE_TYPE);
2407 <        yy_conf->regexpname = exp_p;
2406 >        yy_conf = conf_make(CONF_RXLINE);
2407 >        yy_conf->regexuser = exp_p;
2408   #else
2409 <        ilog(L_ERROR, "Failed to add regular expression based X-Line: no PCRE support");
2409 >        ilog(LOG_TYPE_IRCD, "Failed to add regular expression based X-Line: no PCRE support");
2410          break;
2411   #endif
2412        }
2413        else
2414 <        yy_conf = make_conf_item(XLINE_TYPE);
2414 >        yy_conf = conf_make(CONF_XLINE);
2415  
2787      yy_match_item = map_to_conf(yy_conf);
2416        DupString(yy_conf->name, gecos_name);
2417  
2418        if (reasonbuf[0])
2419 <        DupString(yy_match_item->reason, reasonbuf);
2419 >        DupString(yy_conf->reason, reasonbuf);
2420        else
2421 <        DupString(yy_match_item->reason, "No reason");
2421 >        DupString(yy_conf->reason, "No reason");
2422      }
2423    }
2424   };
# Line 2833 | Line 2461 | general_item:       general_hide_spoof_i
2461                      general_max_nick_time | general_max_nick_changes |
2462                      general_max_accept | general_anti_spam_exit_message_time |
2463                      general_ts_warn_delta | general_ts_max_delta |
2464 <                    general_kill_chase_time_limit | general_kline_with_reason |
2465 <                    general_kline_reason | general_invisible_on_connect |
2464 >                    general_kill_chase_time_limit |
2465 >                    general_invisible_on_connect |
2466                      general_warn_no_nline | general_dots_in_ident |
2467                      general_stats_o_oper_only | general_stats_k_oper_only |
2468                      general_pace_wait | general_stats_i_oper_only |
2469                      general_pace_wait_simple | general_stats_P_oper_only |
2470                      general_short_motd | general_no_oper_flood |
2471                      general_true_no_oper_flood | general_oper_pass_resv |
2472 <                    general_idletime | general_message_locale |
2472 >                    general_message_locale |
2473                      general_oper_only_umodes | general_max_targets |
2474                      general_use_egd | general_egdpool_path |
2475                      general_oper_umodes | general_caller_id_wait |
2476                      general_opers_bypass_callerid | general_default_floodcount |
2477                      general_min_nonwildcard | general_min_nonwildcard_simple |
2478 <                    general_servlink_path | general_disable_remote_commands |
2851 <                    general_default_cipher_preference |
2852 <                    general_compression_level | general_client_flood |
2478 >                    general_disable_remote_commands |
2479                      general_throttle_time | general_havent_read_conf |
2480                      general_ping_cookie |
2481 <                    general_disable_auth | general_burst_away |
2482 <                    general_tkline_expire_notices | general_gline_min_cidr |
2483 <                    general_gline_min_cidr6 | general_use_whois_actually |
2484 <                    general_reject_hold_time | general_stats_e_disabled |
2485 <                    general_max_watch |
2481 >                    general_disable_auth |
2482 >                    general_tkline_expire_notices | general_gline_enable |
2483 >                    general_gline_duration | general_gline_request_duration |
2484 >                    general_gline_min_cidr |
2485 >                    general_gline_min_cidr6 |
2486 >                    general_stats_e_disabled |
2487 >                    general_max_watch | general_services_name |
2488                      error;
2489  
2490  
# Line 2865 | Line 2493 | general_max_watch: MAX_WATCH '=' NUMBER
2493    ConfigFileEntry.max_watch = $3;
2494   };
2495  
2496 < general_gline_min_cidr: GLINE_MIN_CIDR '=' NUMBER ';'
2496 > general_gline_enable: GLINE_ENABLE '=' TBOOL ';'
2497   {
2498 <  ConfigFileEntry.gline_min_cidr = $3;
2498 >  if (conf_parser_ctx.pass == 2)
2499 >    ConfigFileEntry.glines = yylval.number;
2500   };
2501  
2502 < general_gline_min_cidr6: GLINE_MIN_CIDR6 '=' NUMBER ';'
2502 > general_gline_duration: GLINE_DURATION '=' timespec ';'
2503   {
2504 <  ConfigFileEntry.gline_min_cidr6 = $3;
2504 >  if (conf_parser_ctx.pass == 2)
2505 >    ConfigFileEntry.gline_time = $3;
2506   };
2507  
2508 < general_burst_away: BURST_AWAY '=' TBOOL ';'
2508 > general_gline_request_duration: GLINE_REQUEST_DURATION '=' timespec ';'
2509   {
2510 <  ConfigFileEntry.burst_away = yylval.number;
2510 >  if (conf_parser_ctx.pass == 2)
2511 >    ConfigFileEntry.gline_request_time = $3;
2512   };
2513  
2514 < general_use_whois_actually: USE_WHOIS_ACTUALLY '=' TBOOL ';'
2514 > general_gline_min_cidr: GLINE_MIN_CIDR '=' NUMBER ';'
2515   {
2516 <  ConfigFileEntry.use_whois_actually = yylval.number;
2516 >  ConfigFileEntry.gline_min_cidr = $3;
2517   };
2518  
2519 < general_reject_hold_time: TREJECT_HOLD_TIME '=' timespec ';'
2519 > general_gline_min_cidr6: GLINE_MIN_CIDR6 '=' NUMBER ';'
2520   {
2521 <  GlobalSetOptions.rejecttime = yylval.number;
2521 >  ConfigFileEntry.gline_min_cidr6 = $3;
2522   };
2523  
2524   general_tkline_expire_notices: TKLINE_EXPIRE_NOTICES '=' TBOOL ';'
# Line 2960 | Line 2591 | general_havent_read_conf: HAVENT_READ_CO
2591   {
2592    if (($3 > 0) && conf_parser_ctx.pass == 1)
2593    {
2594 <    ilog(L_CRIT, "You haven't read your config file properly.");
2595 <    ilog(L_CRIT, "There is a line in the example conf that will kill your server if not removed.");
2596 <    ilog(L_CRIT, "Consider actually reading/editing the conf file, and removing this line.");
2594 >    ilog(LOG_TYPE_IRCD, "You haven't read your config file properly.");
2595 >    ilog(LOG_TYPE_IRCD, "There is a line in the example conf that will kill your server if not removed.");
2596 >    ilog(LOG_TYPE_IRCD, "Consider actually reading/editing the conf file, and removing this line.");
2597      exit(0);
2598    }
2599   };
2600  
2970 general_kline_with_reason: KLINE_WITH_REASON '=' TBOOL ';'
2971 {
2972  ConfigFileEntry.kline_with_reason = yylval.number;
2973 };
2974
2975 general_kline_reason: KLINE_REASON '=' QSTRING ';'
2976 {
2977  if (conf_parser_ctx.pass == 2)
2978  {
2979    MyFree(ConfigFileEntry.kline_reason);
2980    DupString(ConfigFileEntry.kline_reason, yylval.string);
2981  }
2982 };
2983
2601   general_invisible_on_connect: INVISIBLE_ON_CONNECT '=' TBOOL ';'
2602   {
2603    ConfigFileEntry.invisible_on_connect = yylval.number;
# Line 3073 | Line 2690 | general_message_locale: MESSAGE_LOCALE '
2690    }
2691   };
2692  
3076 general_idletime: IDLETIME '=' timespec ';'
3077 {
3078  ConfigFileEntry.idletime = $3;
3079 };
3080
2693   general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';'
2694   {
2695    ConfigFileEntry.dots_in_ident = $3;
# Line 3088 | Line 2700 | general_max_targets: MAX_TARGETS '=' NUM
2700    ConfigFileEntry.max_targets = $3;
2701   };
2702  
3091 general_servlink_path: SERVLINK_PATH '=' QSTRING ';'
3092 {
3093  if (conf_parser_ctx.pass == 2)
3094  {
3095    MyFree(ConfigFileEntry.servlink_path);
3096    DupString(ConfigFileEntry.servlink_path, yylval.string);
3097  }
3098 };
3099
3100 general_default_cipher_preference: DEFAULT_CIPHER_PREFERENCE '=' QSTRING ';'
3101 {
3102 #ifdef HAVE_LIBCRYPTO
3103  if (conf_parser_ctx.pass == 2)
3104  {
3105    struct EncCapability *ecap;
3106    const char *cipher_name;
3107    int found = 0;
3108
3109    ConfigFileEntry.default_cipher_preference = NULL;
3110    cipher_name = yylval.string;
3111
3112    for (ecap = CipherTable; ecap->name; ecap++)
3113    {
3114      if ((irccmp(ecap->name, cipher_name) == 0) &&
3115          (ecap->cap & CAP_ENC_MASK))
3116      {
3117        ConfigFileEntry.default_cipher_preference = ecap;
3118        found = 1;
3119        break;
3120      }
3121    }
3122
3123    if (!found)
3124      yyerror("Invalid cipher");
3125  }
3126 #else
3127  if (conf_parser_ctx.pass == 2)
3128    yyerror("Ignoring default_cipher_preference -- no OpenSSL support");
3129 #endif
3130 };
3131
3132 general_compression_level: COMPRESSION_LEVEL '=' NUMBER ';'
3133 {
3134  if (conf_parser_ctx.pass == 2)
3135  {
3136    ConfigFileEntry.compression_level = $3;
3137 #ifndef HAVE_LIBZ
3138    yyerror("Ignoring compression_level -- no zlib support");
3139 #else
3140    if ((ConfigFileEntry.compression_level < 1) ||
3141        (ConfigFileEntry.compression_level > 9))
3142    {
3143      yyerror("Ignoring invalid compression_level, using default");
3144      ConfigFileEntry.compression_level = 0;
3145    }
3146 #endif
3147  }
3148 };
3149
2703   general_use_egd: USE_EGD '=' TBOOL ';'
2704   {
2705    ConfigFileEntry.use_egd = yylval.number;
# Line 3161 | Line 2714 | general_egdpool_path: EGDPOOL_PATH '=' Q
2714    }
2715   };
2716  
2717 + general_services_name: T_SERVICES_NAME '=' QSTRING ';'
2718 + {
2719 +  if (conf_parser_ctx.pass == 2 && valid_servname(yylval.string))
2720 +  {
2721 +    MyFree(ConfigFileEntry.service_name);
2722 +    DupString(ConfigFileEntry.service_name, yylval.string);
2723 +  }
2724 + };
2725 +
2726   general_ping_cookie: PING_COOKIE '=' TBOOL ';'
2727   {
2728    ConfigFileEntry.ping_cookie = yylval.number;
# Line 3200 | Line 2762 | umode_oitem:     T_BOTS
2762   } | T_FULL
2763   {
2764    ConfigFileEntry.oper_umodes |= UMODE_FULL;
2765 + } | HIDDEN
2766 + {
2767 +  ConfigFileEntry.oper_umodes |= UMODE_HIDDEN;
2768   } | T_SKILL
2769   {
2770    ConfigFileEntry.oper_umodes |= UMODE_SKILL;
# Line 3268 | Line 2833 | umode_item:    T_BOTS
2833   } | T_SKILL
2834   {
2835    ConfigFileEntry.oper_only_umodes |= UMODE_SKILL;
2836 + } | HIDDEN
2837 + {
2838 +  ConfigFileEntry.oper_only_umodes |= UMODE_HIDDEN;
2839   } | T_NCHANGE
2840   {
2841    ConfigFileEntry.oper_only_umodes |= UMODE_NCHANGE;
# Line 3321 | Line 2889 | general_default_floodcount: DEFAULT_FLOO
2889    ConfigFileEntry.default_floodcount = $3;
2890   };
2891  
3324 general_client_flood: T_CLIENT_FLOOD '=' sizespec ';'
3325 {
3326  ConfigFileEntry.client_flood = $3;
3327 };
3328
3329
3330 /***************************************************************************
3331 *  section glines
3332 ***************************************************************************/
3333 gline_entry: GLINES
3334 {
3335  if (conf_parser_ctx.pass == 2)
3336  {
3337    yy_conf = make_conf_item(GDENY_TYPE);
3338    yy_aconf = map_to_conf(yy_conf);
3339  }
3340 } '{' gline_items '}' ';'
3341 {
3342  if (conf_parser_ctx.pass == 2)
3343  {
3344    /*
3345     * since we re-allocate yy_conf/yy_aconf after the end of action=, at the
3346     * end we will have one extra, so we should free it.
3347     */
3348    if (yy_conf->name == NULL || yy_aconf->user == NULL)
3349    {
3350      delete_conf_item(yy_conf);
3351      yy_conf = NULL;
3352      yy_aconf = NULL;
3353    }
3354  }
3355 };
3356
3357 gline_items:        gline_items gline_item | gline_item;
3358 gline_item:         gline_enable |
3359                    gline_duration |
3360                    gline_logging |
3361                    gline_user |
3362                    gline_server |
3363                    gline_action |
3364                    error;
3365
3366 gline_enable: ENABLE '=' TBOOL ';'
3367 {
3368  if (conf_parser_ctx.pass == 2)
3369    ConfigFileEntry.glines = yylval.number;
3370 };
3371
3372 gline_duration: DURATION '=' timespec ';'
3373 {
3374  if (conf_parser_ctx.pass == 2)
3375    ConfigFileEntry.gline_time = $3;
3376 };
3377
3378 gline_logging: LOGGING
3379 {
3380  if (conf_parser_ctx.pass == 2)
3381    ConfigFileEntry.gline_logging = 0;
3382 } '=' gline_logging_types ';';
3383 gline_logging_types:     gline_logging_types ',' gline_logging_type_item | gline_logging_type_item;
3384 gline_logging_type_item: T_REJECT
3385 {
3386  if (conf_parser_ctx.pass == 2)
3387    ConfigFileEntry.gline_logging |= GDENY_REJECT;
3388 } | T_BLOCK
3389 {
3390  if (conf_parser_ctx.pass == 2)
3391    ConfigFileEntry.gline_logging |= GDENY_BLOCK;
3392 };
3393
3394 gline_user: USER '=' QSTRING ';'
3395 {
3396  if (conf_parser_ctx.pass == 2)
3397  {
3398    struct split_nuh_item nuh;
3399
3400    nuh.nuhmask  = yylval.string;
3401    nuh.nickptr  = NULL;
3402    nuh.userptr  = userbuf;
3403    nuh.hostptr  = hostbuf;
3404
3405    nuh.nicksize = 0;
3406    nuh.usersize = sizeof(userbuf);
3407    nuh.hostsize = sizeof(hostbuf);
3408
3409    split_nuh(&nuh);
3410
3411    if (yy_aconf->user == NULL)
3412    {
3413      DupString(yy_aconf->user, userbuf);
3414      DupString(yy_aconf->host, hostbuf);
3415    }
3416    else
3417    {
3418      struct CollectItem *yy_tmp = MyMalloc(sizeof(struct CollectItem));
3419
3420      DupString(yy_tmp->user, userbuf);
3421      DupString(yy_tmp->host, hostbuf);
3422
3423      dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list);
3424    }
3425  }
3426 };
3427
3428 gline_server: NAME '=' QSTRING ';'
3429 {
3430  if (conf_parser_ctx.pass == 2)  
3431  {
3432    MyFree(yy_conf->name);
3433    DupString(yy_conf->name, yylval.string);
3434  }
3435 };
3436
3437 gline_action: ACTION
3438 {
3439  if (conf_parser_ctx.pass == 2)
3440    yy_aconf->flags = 0;
3441 } '=' gdeny_types ';'
3442 {
3443  if (conf_parser_ctx.pass == 2)
3444  {
3445    struct CollectItem *yy_tmp = NULL;
3446    dlink_node *ptr, *next_ptr;
3447
3448    DLINK_FOREACH_SAFE(ptr, next_ptr, col_conf_list.head)
3449    {
3450      struct AccessItem *new_aconf;
3451      struct ConfItem *new_conf;
3452
3453      yy_tmp = ptr->data;
3454      new_conf = make_conf_item(GDENY_TYPE);
3455      new_aconf = map_to_conf(new_conf);
3456
3457      new_aconf->flags = yy_aconf->flags;
3458
3459      if (yy_conf->name != NULL)
3460        DupString(new_conf->name, yy_conf->name);
3461      else
3462        DupString(new_conf->name, "*");
3463      if (yy_aconf->user != NULL)
3464         DupString(new_aconf->user, yy_tmp->user);
3465      else  
3466        DupString(new_aconf->user, "*");
3467      if (yy_aconf->host != NULL)
3468        DupString(new_aconf->host, yy_tmp->host);
3469      else
3470        DupString(new_aconf->host, "*");
3471
3472      dlinkDelete(&yy_tmp->node, &col_conf_list);
3473    }
3474
3475    /*
3476     * In case someone has fed us with more than one action= after user/name
3477     * which would leak memory  -Michael
3478     */
3479    if (yy_conf->name == NULL || yy_aconf->user == NULL)
3480      delete_conf_item(yy_conf);
3481
3482    yy_conf = make_conf_item(GDENY_TYPE);
3483    yy_aconf = map_to_conf(yy_conf);
3484  }
3485 };
3486
3487 gdeny_types: gdeny_types ',' gdeny_type_item | gdeny_type_item;
3488 gdeny_type_item: T_REJECT
3489 {
3490  if (conf_parser_ctx.pass == 2)
3491    yy_aconf->flags |= GDENY_REJECT;
3492 } | T_BLOCK
3493 {
3494  if (conf_parser_ctx.pass == 2)
3495    yy_aconf->flags |= GDENY_BLOCK;
3496 };
2892  
2893   /***************************************************************************
2894   *  section channel
# Line 3502 | Line 2897 | channel_entry: CHANNEL
2897    '{' channel_items '}' ';';
2898  
2899   channel_items:      channel_items channel_item | channel_item;
2900 < channel_item:       channel_disable_local_channels | channel_use_except |
2901 <                    channel_use_invex | channel_use_knock |
2902 <                    channel_max_bans | channel_knock_delay |
3508 <                    channel_knock_delay_channel | channel_max_chans_per_user |
2900 > channel_item:       channel_max_bans |
2901 >                    channel_knock_delay | channel_knock_delay_channel |
2902 >                    channel_max_chans_per_user | channel_max_chans_per_oper |
2903                      channel_quiet_on_ban | channel_default_split_user_count |
2904                      channel_default_split_server_count |
2905                      channel_no_create_on_split | channel_restrict_channels |
2906 <                    channel_no_join_on_split | channel_burst_topicwho |
2906 >                    channel_no_join_on_split |
2907                      channel_jflood_count | channel_jflood_time |
2908                      channel_disable_fake_channels | error;
2909  
# Line 3523 | Line 2917 | channel_restrict_channels: RESTRICT_CHAN
2917    ConfigChannel.restrict_channels = yylval.number;
2918   };
2919  
3526 channel_disable_local_channels: DISABLE_LOCAL_CHANNELS '=' TBOOL ';'
3527 {
3528  ConfigChannel.disable_local_channels = yylval.number;
3529 };
3530
3531 channel_use_except: USE_EXCEPT '=' TBOOL ';'
3532 {
3533  ConfigChannel.use_except = yylval.number;
3534 };
3535
3536 channel_use_invex: USE_INVEX '=' TBOOL ';'
3537 {
3538  ConfigChannel.use_invex = yylval.number;
3539 };
3540
3541 channel_use_knock: USE_KNOCK '=' TBOOL ';'
3542 {
3543  ConfigChannel.use_knock = yylval.number;
3544 };
3545
2920   channel_knock_delay: KNOCK_DELAY '=' timespec ';'
2921   {
2922    ConfigChannel.knock_delay = $3;
# Line 3558 | Line 2932 | channel_max_chans_per_user: MAX_CHANS_PE
2932    ConfigChannel.max_chans_per_user = $3;
2933   };
2934  
2935 + channel_max_chans_per_oper: MAX_CHANS_PER_OPER '=' NUMBER ';'
2936 + {
2937 +  ConfigChannel.max_chans_per_oper = $3;
2938 + };
2939 +
2940   channel_quiet_on_ban: QUIET_ON_BAN '=' TBOOL ';'
2941   {
2942    ConfigChannel.quiet_on_ban = yylval.number;
# Line 3588 | Line 2967 | channel_no_join_on_split: NO_JOIN_ON_SPL
2967    ConfigChannel.no_join_on_split = yylval.number;
2968   };
2969  
3591 channel_burst_topicwho: BURST_TOPICWHO '=' TBOOL ';'
3592 {
3593  ConfigChannel.burst_topicwho = yylval.number;
3594 };
3595
2970   channel_jflood_count: JOIN_FLOOD_COUNT '=' NUMBER ';'
2971   {
2972    GlobalSetOptions.joinfloodcount = yylval.number;
# Line 3612 | Line 2986 | serverhide_entry: SERVERHIDE
2986   serverhide_items:   serverhide_items serverhide_item | serverhide_item;
2987   serverhide_item:    serverhide_flatten_links | serverhide_hide_servers |
2988                      serverhide_links_delay |
3615                    serverhide_disable_hidden |
2989                      serverhide_hidden | serverhide_hidden_name |
2990                      serverhide_hide_server_ips |
2991                      error;
# Line 3658 | Line 3031 | serverhide_hidden: HIDDEN '=' TBOOL ';'
3031      ConfigServerHide.hidden = yylval.number;
3032   };
3033  
3661 serverhide_disable_hidden: DISABLE_HIDDEN '=' TBOOL ';'
3662 {
3663  if (conf_parser_ctx.pass == 2)
3664    ConfigServerHide.disable_hidden = yylval.number;
3665 };
3666
3034   serverhide_hide_server_ips: HIDE_SERVER_IPS '=' TBOOL ';'
3035   {
3036    if (conf_parser_ctx.pass == 2)

Diff Legend

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