{"action":"created","issue":{"url":"https://api.github.com/repos/talkincode/ToughRADIUS/issues/95","repository_url":"https://api.github.com/repos/talkincode/ToughRADIUS","labels_url":"https://api.github.com/repos/talkincode/ToughRADIUS/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/talkincode/ToughRADIUS/issues/95/comments","events_url":"https://api.github.com/repos/talkincode/ToughRADIUS/issues/95/events","html_url":"https://github.com/talkincode/ToughRADIUS/issues/95","id":153871015,"number":95,"title":"增加Mikrotik-Xmit-Limit支持","user":{"login":"fillorkill","id":6785438,"avatar_url":"https://avatars.githubusercontent.com/u/6785438?v=3","gravatar_id":"","url":"https://api.github.com/users/fillorkill","html_url":"https://github.com/fillorkill","followers_url":"https://api.github.com/users/fillorkill/followers","following_url":"https://api.github.com/users/fillorkill/following{/other_user}","gists_url":"https://api.github.com/users/fillorkill/gists{/gist_id}","starred_url":"https://api.github.com/users/fillorkill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fillorkill/subscriptions","organizations_url":"https://api.github.com/users/fillorkill/orgs","repos_url":"https://api.github.com/users/fillorkill/repos","events_url":"https://api.github.com/users/fillorkill/events{/privacy}","received_events_url":"https://api.github.com/users/fillorkill/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-09T21:11:10Z","updated_at":"2016-05-11T15:32:58Z","closed_at":null,"body":"目前貌似并不支持\r\nRadiusError:current radius cannot support attribute Mikrotik-Xmit-Limit,Can not encode non-integer(10000000) as integer"},"comment":{"url":"https://api.github.com/repos/talkincode/ToughRADIUS/issues/comments/218496668","html_url":"https://github.com/talkincode/ToughRADIUS/issues/95#issuecomment-218496668","issue_url":"https://api.github.com/repos/talkincode/ToughRADIUS/issues/95","id":218496668,"user":{"login":"fillorkill","id":6785438,"avatar_url":"https://avatars.githubusercontent.com/u/6785438?v=3","gravatar_id":"","url":"https://api.github.com/users/fillorkill","html_url":"https://github.com/fillorkill","followers_url":"https://api.github.com/users/fillorkill/followers","following_url":"https://api.github.com/users/fillorkill/following{/other_user}","gists_url":"https://api.github.com/users/fillorkill/gists{/gist_id}","starred_url":"https://api.github.com/users/fillorkill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fillorkill/subscriptions","organizations_url":"https://api.github.com/users/fillorkill/orgs","repos_url":"https://api.github.com/users/fillorkill/repos","events_url":"https://api.github.com/users/fillorkill/events{/privacy}","received_events_url":"https://api.github.com/users/fillorkill/received_events","type":"User","site_admin":false},"created_at":"2016-05-11T15:32:58Z","updated_at":"2016-05-11T15:32:58Z","body":"authenticate accept之后\r\n\r\n修改radiusd.py: 在 # todo: May have a type matching problem下面，修改为：\r\nfor attr_name in attrs:\r\n                    try:\r\n                        # todo: May have a type matching problem\r\n                        if utils.safestr(attr_name) == \"Mikrotik-Xmit-Limit\":\r\n                                reply.AddAttribute(utils.safestr(attr_name), int(auth_resp['flow_length'])*1024)\r\n                        else:\r\n                                reply.AddAttribute(utils.safestr(attr_name), attrs[attr_name])\r\n                    except Exception as err:\r\n                        errstr = \"RadiusError:current radius cannot support attribute {0},{1}\".format(\r\n                            attr_name,utils.safestr(err.message))\r\n                        logger.error(errstr)\r\n\r\n同时需在radius_authorize.py中def policy_filter最后添加\r\n        self.reply['flow_length'] = self.get_user_flow_length()\r\n这样可以实现Mikrotik-Xmit-Limit流量计费，自动断开功能。"}}