#include "support.h"
#include "sys.h"
#include <stdlib.h>
+#include <stdio.h>
#include <string.h>
#include <arpa/inet.h>
#define MAX_STRINGS 80 /* Maximum number of feature params. */
int stringno;
char *name, *pass, *host;
char *stringlist[MAX_STRINGS];
- struct ConnectionClass *class;
+ struct ConnectionClass *c_class;
struct ConfItem *aconf;
struct DenyConf *dconf;
struct ServerConf *sconf;
connectblock: CONNECT
{
name = pass = host = NULL;
- class = NULL;
+ c_class = NULL;
port = 0;
} '{' connectitems '}'
{
- if (name != NULL && pass != NULL && host != NULL && class != NULL &&
+ if (name != NULL && pass != NULL && host != NULL && c_class != NULL &&
/*ccount < MAXCONFLINKS &&*/ !strchr(host, '*') &&
!strchr(host, '?'))
{
aconf->status = CONF_SERVER;
aconf->name = name;
aconf->passwd = pass;
- aconf->conn_class = class;
+ aconf->conn_class = c_class;
aconf->port = port;
aconf->status = CONF_SERVER;
aconf->host = host;
};
connectclass: CLASS '=' QSTRING ';'
{
- class = find_class(yylval.text);
+ c_class = find_class(yylval.text);
};
connecthost: HOST '=' QSTRING ';'
{
serverblock: SERVER
{
- aconf = MyMalloc(sizeof(*aconf));
+ aconf = (struct ConfItem*) MyMalloc(sizeof(*aconf));
memset(aconf, 0, sizeof(*aconf));
} '{' serveritems '}'
{
operblock: OPER
{
- aconf = MyMalloc(sizeof(*aconf));
+ aconf = (struct ConfItem*) MyMalloc(sizeof(*aconf));
memset(aconf, 0, sizeof(*aconf));
aconf->status = CONF_OPERATOR;
} '{' operitems '}' ';'
if (!strchr(yylval.text, '@'))
{
int uh_len;
- char *b = MyMalloc((uh_len = strlen(yylval.text)+3));
+ char *b = (char*) MyMalloc((uh_len = strlen(yylval.text)+3));
ircd_snprintf(0, b, uh_len, "*@%s", yylval.text);
aconf->host = b;
}
clientblock: CLIENT
{
- aconf = MyMalloc(sizeof(*aconf));
+ aconf = (struct ConfItem*) MyMalloc(sizeof(*aconf));
memset(aconf, 0, sizeof(*aconf));
aconf->status = CONF_CLIENT;
} '{' clientitems '}'
killblock: KILL
{
- dconf = MyMalloc(sizeof(*dconf));
+ dconf = (struct DenyConf*) MyMalloc(sizeof(*dconf));
memset(dconf, 0, sizeof(*dconf));
} '{' killitems '}'
{
struct CRuleNode *node;
if (host != NULL && pass != NULL && (node=crule_parse(pass)) != NULL)
{
- struct CRuleConf *p = MyMalloc(sizeof(*p));
+ struct CRuleConf *p = (struct CRuleConf*) MyMalloc(sizeof(*p));
p->hostmask = host;
p->rule = pass;
p->type = tconn;
quarantineblock: QUARANTINE '{'
{
if (qconf != NULL)
- qconf = MyMalloc(sizeof(*qconf));
+ qconf = (struct qline*) MyMalloc(sizeof(*qconf));
else
{
if (qconf->chname != NULL)
{
log_write(LS_CONFIG, L_ERROR, 0, "quarantine blocks need a channel name "
"and a reason.");
- return;
+ return 0;
}
qconf->next = GlobalQuarantineList;
GlobalQuarantineList = qconf;