Exemple #1
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.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()
Exemple #2
0
    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
Exemple #3
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_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
Exemple #4
0
    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"])
Exemple #5
0
 def _reload(self):
     GeneralUpdateRas._reload(self)
     self.inouts = {}
     self.snmp_client = self.__createSnmpClient()
Exemple #6
0
 def _reload(self):
     GeneralUpdateRas._reload(self)
     self.rsh_client = self.__createRSHClient()
Exemple #7
0
    def populateReOnlineRasMsg(self, ras_msg):
        GeneralUpdateRas.populateReOnlineRasMsg(self, ras_msg)

        mac = self.__getMacAddressFromPacket(ras_msg.getRequestPacket())
        if mac:
            ras_msg["mac"] = mac
Exemple #8
0
 def _reload(self):
     GeneralUpdateRas._reload(self)
     self.snmp_client=self.__createSnmpClient()
     self.port_mapping_last_update=0
Exemple #9
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":}
Exemple #10
0
 def _reload(self):
     GeneralUpdateRas._reload(self)
     self.__removeLoginRetry()
     self.__initLoginRetry()
Exemple #11
0
 def unloaded(self):
     GeneralUpdateRas.unloaded(self)
     self.__removeLoginRetry()
Exemple #12
0
    def _reload(self):
	GeneralUpdateRas._reload(self)
	self.snmp_client=self.__createSnmpClient()
	self.port_mapping_last_update=0
Exemple #13
0
 def populateReOnlineRasMsg(self, ras_msg):
     GeneralUpdateRas.populateReOnlineRasMsg(self, ras_msg)
     ras_msg.setInAttrsIfExists({"Calling-Station-Id": "mac"})
Exemple #14
0
    def _reload(self):
	GeneralUpdateRas._reload(self)
	self.__removeLoginRetry()
	self.__initLoginRetry()
Exemple #15
0
    def unloaded(self):
	GeneralUpdateRas.unloaded(self)
	self.__removeLoginRetry()