{ "radius_agent": { "request_processors": [ { "id": "MikrotikPPPoEAuthCGR", "filters": [ "*string:~*vars.*radReqType:*radAuth" ], "flags": ["*authorize", "*attributes", "*accounts", "*continue"], "request_fields": [ {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Acct-Session-Id", "mandatory": true}, {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", "value": "~*req.NAS-IP-Address", "mandatory": true}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp"}, {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp"}, {"tag": "CallingStationId", "path": "*cgreq.CallingStationId", "type": "*variable", "value": "~*req.Calling-Station-Id"}, {"tag": "PasswordFromAttributes", "path": "*cgreq.PasswordFromAttributes", "type": "*constant", "value": "*attributes"} ], "reply_fields": [ {"tag": "SessionTimeout", "path": "*rep.Session-Timeout", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, {"tag": "AcctInterimInterval", "path": "*rep.Acct-Interim-Interval", "type": "*constant", "value": "60"}, {"tag": "FramedIPAddress", "path": "*rep.Framed-IP-Address", "type": "*variable", "value": "~*cgrep.Attributes.FramedIPAddress"}, {"tag": "FramedIPNetmask", "path": "*rep.Framed-IP-Netmask", "type": "*variable", "value": "~*cgrep.Attributes.FramedIPNetmask"}, {"tag": "MikrotikRateLimit", "path": "*rep.Mikrotik-Rate-Limit", "type": "*variable", "value": "~*cgrep.Attributes.MikrotikRateLimit"} ] }, { "id": "MikrotikPPPoEAuthPAP", "filters": [ "*string:~*vars.*radReqType:*radAuth", "*notempty:~*req.User-Password:" ], "flags": ["*radauth", "*pap", "*log"], "request_fields": [ {"tag": "UserPassword", "path": "*vars.UserPassword", "type": "*variable", "value": "~*cgrep.Attributes.PasswordFromAttributes"} ], "reply_fields": [ {"tag": "RemoveAddedFields", "filters": ["*notempty:~*cgrep.Error:"], "type": "*removeall", "path": "*rep"}, {"tag": "Code", "path": "*rep.*radReplyCode", "filters": ["*notempty:~*cgrep.Error:"], "type": "*constant", "value": "AccessReject"}, {"tag": "ReplyMessage", "path": "*rep.Reply-Message", "filters": ["*notempty:~*cgrep.Error:"], "type": "*variable", "value": "~*cgrep.Error"} ] }, { "id": "MikrotikPPPoEAuthCHAP", "filters": [ "*string:~*vars.*radReqType:*radAuth", "*notempty:~*req.CHAP-Password:" ], "flags": ["*radauth", "*chap", "*log"], "request_fields": [ {"tag": "UserPassword", "path": "*vars.UserPassword", "type": "*variable", "value": "~*cgrep.Attributes.PasswordFromAttributes"} ], "reply_fields": [ {"tag": "RemoveAddedFields", "filters": ["*notempty:~*cgrep.Error:"], "type": "*removeall", "path": "*rep"}, {"tag": "Code", "path": "*rep.*radReplyCode", "filters": ["*notempty:~*cgrep.Error:"], "type": "*constant", "value": "AccessReject"}, {"tag": "ReplyMessage", "path": "*rep.Reply-Message", "filters": ["*notempty:~*cgrep.Error:"], "type": "*variable", "value": "~*cgrep.Error"} ] }, { "id": "MikrotikPPPoEAuthMSCHAPv2", "filters": [ "*string:~*vars.*radReqType:*radAuth", "*notempty:~*req.Microsoft.MS-CHAP-Challenge:" ], "flags": ["*radauth", "*mschapv2", "*log"], "request_fields": [ {"tag": "UserPassword", "path": "*vars.UserPassword", "type": "*variable", "value": "~*cgrep.Attributes.PasswordFromAttributes"} ], "reply_fields": [ {"tag": "RemoveAddedFields", "filters": ["*notempty:~*cgrep.Error:"], "type": "*removeall", "path": "*rep"}, {"tag": "Code", "path": "*rep.*radReplyCode", "filters": ["*notempty:~*cgrep.Error:"], "type": "*constant", "value": "AccessReject"}, {"tag": "ReplyMessage", "path": "*rep.Reply-Message", "filters": ["*notempty:~*cgrep.Error:"], "type": "*variable", "value": "~*cgrep.Error"} ] } ] } }