query = "\
INSERT INTO ${..postauth_table} \
- (username, pass, reply, authdate) \
+ (username, pass, reply, authdate, class) \
VALUES ( \
'%{SQL-User-Name}', \
'%{%{User-Password}:-%{Chap-Password}}', \
'%{reply.Packet-Type}', \
- '%{expr:%l * 1000 + %M / 1000}')"
+ '%{expr:%l * 1000 + %M / 1000}', \
+ '%{reply.Class}')"
}
pass text,
reply text,
authdate timestamp,
+ class text,
PRIMARY KEY (username, authdate)
) WITH CLUSTERING ORDER BY (authdate ASC);
query = "\
INSERT INTO ${..postauth_table} \
- (userName, pass, reply, authdate) \
+ (userName, pass, reply, authdate, class) \
VALUES(\
'%{User-Name}', \
'%{%{User-Password}:-CHAP-PASSWORD}', \
'%{reply.Packet-Type}', \
- '%S.%{expr:%M / 1000}')"
+ '%S.%{expr:%M / 1000}', \
+ '%{reply.Class}')"
}
[userName] [varchar] (64) NOT NULL ,
[pass] [varchar] (64) NOT NULL ,
[reply] [varchar] (32) NOT NULL ,
- [authdate] [datetime] NOT NULL
+ [authdate] [datetime] NOT NULL,
+ [class] [varchar] (64) NULL
)
GO
CONSTRAINT [DF_radpostauth_pass] DEFAULT ('') FOR [pass],
CONSTRAINT [DF_radpostauth_reply] DEFAULT ('') FOR [reply],
CONSTRAINT [DF_radpostauth_authdate] DEFAULT (getdate()) FOR [authdate],
+ CONSTRAINT [DF_radpostauth_class] DEFAULT ('') FOR [class],
CONSTRAINT [PK_radpostauth] PRIMARY KEY NONCLUSTERED
(
[id]
query = "\
INSERT INTO ${..postauth_table} \
- (username, pass, reply, authdate) \
+ (username, pass, reply, authdate, class) \
VALUES ( \
'%{SQL-User-Name}', \
'%{%{User-Password}:-%{Chap-Password}}', \
'%{reply.Packet-Type}', \
- '%S.%M')"
+ '%S.%M', \
+ '%{reply.Class}')"
}
pass varchar(64) NOT NULL default '',
reply varchar(32) NOT NULL default '',
authdate timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
+ class varchar(64) NOT NULL default '',
PRIMARY KEY (id)
) ENGINE = INNODB;
pass varchar(64) NOT NULL default '',
reply varchar(32) NOT NULL default '',
authdate timestamp NOT NULL,
+ class varchar(64) NOT NULL default '',
PRIMARY KEY (id)
) ENGINE=ndbcluster;
# logfile = ${logdir}/post-auth.sql
query = "\
INSERT INTO ${..postauth_table} \
- (username, pass, reply, authdate) \
+ (username, pass, reply, authdate, class) \
VALUES (\
'%{User-Name}', \
'%{%{User-Password}:-%{Chap-Password}}', \
'%{reply.Packet-Type}', \
- TO_TIMESTAMP('%S.%M','YYYY-MM-DDHH24:MI:SS.FF'))"
+ TO_TIMESTAMP('%S.%M','YYYY-MM-DDHH24:MI:SS.FF'), \
+ '%{reply.Class}')"
}
UserName VARCHAR(64) NOT NULL,
Pass VARCHAR(64),
Reply VARCHAR(64),
- AuthDate TIMESTAMP(6) WITH TIME ZONE
+ AuthDate TIMESTAMP(6) WITH TIME ZONE,
+ Class VARCHAR(64),
);
CREATE SEQUENCE radpostauth_seq START WITH 1 INCREMENT BY 1;
query = "\
INSERT INTO ${..postauth_table} \
- (username, pass, reply, authdate) \
+ (username, pass, reply, authdate, class) \
VALUES(\
'%{User-Name}', \
'%{%{User-Password}:-Chap-Password}', \
'%{reply.Packet-Type}', \
- '%S.%M')"
+ '%S.%M', \
+ '%{reply.Class}')"
}
reply text,
CalledStationId text,
CallingStationId text,
- authdate timestamp with time zone NOT NULL default now()
+ authdate timestamp with time zone NOT NULL default now(),
+ Class text,
);
--
query = "\
INSERT INTO ${..postauth_table} \
- (username, pass, reply, authdate) \
+ (username, pass, reply, authdate, class) \
VALUES ( \
'%{SQL-User-Name}', \
'%{%{User-Password}:-%{Chap-Password}}', \
'%{reply.Packet-Type}', \
- '%S.%M')"
+ '%S.%M', \
+ '%{reply.Class}')"
}
username varchar(64) NOT NULL default '',
pass varchar(64) NOT NULL default '',
reply varchar(32) NOT NULL default '',
- authdate timestamp NOT NULL
+ authdate timestamp NOT NULL,
+ class varchar(64) NOT NULL default ''
);
--