Beispiel #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.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
Beispiel #2
0
def init_wrappers():
    global main_twrapper, server_twrapper, event_twrapper, radius_twrapper

    main_twrapper = twrapper.ThreadPoolWrapper(defs.MAX_OTHER_THREADS, "main")
    server_twrapper = twrapper.ThreadPoolWrapper(defs.MAX_SERVER_THREADS,
                                                 "server")
    event_twrapper = twrapper.ThreadPoolWrapper(defs.MAX_EVENT_THREADS,
                                                "event")
    radius_twrapper = twrapper.ThreadPoolWrapper(defs.MAX_RADIUS_THREADS,
                                                 "radius")

    from core import main
    main.registerPostInitMethod(postInit)
Beispiel #3
0
    def init(self):

        self.onlines = {}  #mac_ip:{mac:mac,ip:ip,user_id:user_id}
        self.inouts = {
        }  #mac_ip:{"in_bytes":i,"out_bytes":o,"in_rate":,"out_rate":}
        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
        self.last_onlines_update = 0
Beispiel #4
0
def init():
    global pe_manager
    pe_manager=PeriodicEventsManager()
    main.registerPostInitMethod(postInit)
Beispiel #5
0
def init():
    global pe_manager
    pe_manager=PeriodicEventsManager()
    main.registerPostInitMethod(postInit)
Beispiel #6
0
def init():
    global lowload, midnight
    lowload = DailyEvents("lowload", "LOWLOAD_JOBS", 4, 1)
    midnight = DailyEvents("midnight", "MIDNIGHT_JOBS", 0, 1)
    main.registerPostInitMethod(postInit)
Beispiel #7
0
def init():
    global lowload, midnight
    lowload = DailyEvents("lowload", "LOWLOAD_JOBS", 4, 30)
    midnight = DailyEvents("midnight", "MIDNIGHT_JOBS", 0, 30)
    main.registerPostInitMethod(postInit)