def __init__(self,ras_ip,ras_id,ras_type,radius_secret,ports,ippools,attributes): GeneralUpdateRas.__init__(self,ras_ip,ras_id,ras_type,radius_secret,ports,ippools,attributes,self.type_attrs) self.port_inout_bytes={} #port => (in_bytes,out_bytes) self.onlines={}#port => {"username":,"in_bytes":,"out_byte":,"last_update":,"start_in_bytes":,"start_out_bytes":} self.port_mapping={} #port_no:port_desc self.port_mapping_last_update=0 self.handle_reload=True self.snmp_client=self.__createSnmpClient()
def _postAuth(self, ras_msg, auth_success): GeneralUpdateRas._postAuth(self, ras_msg, auth_success) if auth_success: try: remote_ip = ras_msg.getReplyPacket()["Framed-IP-Address"][0] self.ips[ras_msg["port"]] = remote_ip except KeyError: pass
def __init__(self,ras_ip,ras_id,ras_type,radius_secret,ports,ippools,attributes): GeneralUpdateRas.__init__(self,ras_ip,ras_id,ras_type,radius_secret,ports,ippools,attributes,self.type_attrs) self.onlines_mac={}#mac_address:{ip:ip,user_id:user_id} self.onlines={}#mac:{"in_bytes":i,"out_bytes":o} self.waitings={}#user_id:ras_msg self.waiting_lock=threading.Lock() if main.isStarting(): main.registerPostInitMethod(self.__postInitMethod) else: self.__postInitMethod() self.handle_reload=True
def _postAuth(self,ras_msg, auth_success): GeneralUpdateRas._postAuth(self,ras_msg, auth_success) if ras_msg.hasAttr("h323_pre_authentication") and auth_success: user_attrs = user_main.getUserPool().getUserByCallerID(ras_msg["caller_id"]).getUserAttrs() username = user_attrs["voip_username"] + user_attrs["voip_password"] ras_msg.getReplyPacket()["Cisco-AVPair"]="h323-ivr-in=%s"%username if user_attrs.hasAttr("voip_preferred_language"): self.setH323PreferredLanguage(ras_msg.getReplyPacket(), user_attrs["voip_preferred_language"]) elif ras_msg.hasAttr("h323_authorization") and auth_success: self.__addToAuthH323IDs(ras_msg["h323_conf_id"])
def _reload(self): GeneralUpdateRas._reload(self) self.inouts = {} self.snmp_client = self.__createSnmpClient()
def _reload(self): GeneralUpdateRas._reload(self) self.rsh_client = self.__createRSHClient()
def populateReOnlineRasMsg(self, ras_msg): GeneralUpdateRas.populateReOnlineRasMsg(self, ras_msg) mac = self.__getMacAddressFromPacket(ras_msg.getRequestPacket()) if mac: ras_msg["mac"] = mac
def _reload(self): GeneralUpdateRas._reload(self) self.snmp_client=self.__createSnmpClient() self.port_mapping_last_update=0
def __init__(self,ras_ip,ras_id,ras_type,radius_secret,ports,ippools,attributes): GeneralUpdateRas.__init__(self,ras_ip,ras_id,ras_type,radius_secret,ports,ippools,attributes,self.type_attrs) self.onlines={}# dic in format port=>{"username":,"in_bytes":,"out_bytes":}
def _reload(self): GeneralUpdateRas._reload(self) self.__removeLoginRetry() self.__initLoginRetry()
def unloaded(self): GeneralUpdateRas.unloaded(self) self.__removeLoginRetry()
def populateReOnlineRasMsg(self, ras_msg): GeneralUpdateRas.populateReOnlineRasMsg(self, ras_msg) ras_msg.setInAttrsIfExists({"Calling-Station-Id": "mac"})