ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/conf.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/conf.c (file contents):
Revision 7159 by michael, Thu Jan 28 11:26:51 2016 UTC vs.
Revision 7209 by michael, Wed Feb 3 15:10:39 2016 UTC

# Line 29 | Line 29
29   #include "ircd_defs.h"
30   #include "conf.h"
31   #include "conf_pseudo.h"
32 + #include "conf_shared.h"
33   #include "server.h"
34   #include "resv.h"
35   #include "channel.h"
# Line 69 | Line 70 | struct conf_parser_context conf_parser_c
70   /* general conf items link list root, other than k lines etc. */
71   dlink_list service_items;
72   dlink_list server_items;
72 dlink_list cluster_items;
73   dlink_list operator_items;
74 dlink_list shared_items;
74   dlink_list gecos_items;
75   dlink_list nresv_items;
76   dlink_list cresv_items;
# Line 139 | Line 138 | map_to_list(enum maskitem_type type)
138      case CONF_XLINE:
139        return &gecos_items;
140        break;
142    case CONF_SHARED:
143      return &shared_items;
144      break;
141      case CONF_NRESV:
142        return &nresv_items;
143        break;
# Line 157 | Line 153 | map_to_list(enum maskitem_type type)
153      case CONF_SERVICE:
154        return &service_items;
155        break;
160    case CONF_CLUSTER:
161      return &cluster_items;
162      break;
156      default:
157        return NULL;
158    }
# Line 585 | Line 578 | find_matching_name_conf(enum maskitem_ty
578      break;
579  
580    case CONF_XLINE:
588  case CONF_SHARED:
581    case CONF_NRESV:
582    case CONF_CRESV:
583      DLINK_FOREACH(node, list->head)
# Line 646 | Line 638 | find_exact_name_conf(enum maskitem_type
638    switch(type)
639    {
640    case CONF_XLINE:
649  case CONF_SHARED:
641    case CONF_NRESV:
642    case CONF_CRESV:
643  
# Line 1131 | Line 1122 | clear_out_old_conf(void)
1122    dlink_node *node = NULL, *node_next = NULL;
1123    dlink_list *free_items [] = {
1124      &server_items,   &operator_items,
1125 <     &shared_items,   &gecos_items,
1126 <     &nresv_items, &cluster_items,  &service_items, &cresv_items, NULL
1125 >     &gecos_items,
1126 >     &nresv_items, &service_items, &cresv_items, NULL
1127    };
1128  
1129    dlink_list ** iterator = free_items; /* C is dumb */
# Line 1174 | Line 1165 | clear_out_old_conf(void)
1165  
1166    pseudo_clear();
1167  
1168 +  shared_clear();  /* Clear shared {} items */
1169 +
1170    /* Clean out ConfigServerInfo */
1171    xfree(ConfigServerInfo.description);
1172    ConfigServerInfo.description = NULL;
# Line 1745 | Line 1738 | match_conf_password(const char *password
1738   }
1739  
1740   /*
1748 * cluster_a_line
1749 *
1750 * inputs       - client sending the cluster
1751 *              - command name "KLINE" "XLINE" etc.
1752 *              - capab -- CAPAB_KLN etc. from server.h
1753 *              - cluster type -- CLUSTER_KLINE etc. from conf.h
1754 *              - pattern and args to send along
1755 * output       - none
1756 * side effects - Take source_p send the pattern with args given
1757 *                along to all servers that match capab and cluster type
1758 */
1759 void
1760 cluster_a_line(struct Client *source_p, const char *command, unsigned int capab,
1761               unsigned int cluster_type, const char *pattern, ...)
1762 {
1763  va_list args;
1764  char buffer[IRCD_BUFSIZE] = "";
1765  const dlink_node *node = NULL;
1766
1767  va_start(args, pattern);
1768  vsnprintf(buffer, sizeof(buffer), pattern, args);
1769  va_end(args);
1770
1771  DLINK_FOREACH(node, cluster_items.head)
1772  {
1773    const struct MaskItem *conf = node->data;
1774
1775    if (conf->flags & cluster_type)
1776      sendto_match_servs(source_p, conf->name, CAPAB_CLUSTER | capab,
1777                         "%s %s %s", command, conf->name, buffer);
1778  }
1779 }
1780
1781 /*
1741   * split_nuh
1742   *
1743   * inputs       - pointer to original mask (modified in place)

Diff Legend

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