Beispiel #1
0
 def set_intrim_update(self, update_intreval=300):
     """
         Set the value of Acct-Interim-Interval  in Access Accept
     :param update_intreval:
     :return:
     """
     if update_intreval:
         self.AddAttribute(85, tools.EncodeInteger(update_intreval))
Beispiel #2
0
 def set_special_int(self, vendor, name, value):
     try:
         if not vendor_cfg.has_key(int(vendor)):
             return
         key = vendor_cfg[int(vendor)][name]
         self.AddAttribute(key, tools.EncodeInteger(value))
     except Exception, e:
         radiuslog.error("set_special error,vendor=%s,name=%s,value=%s;err=%s"\
             %(vendor,name,value,str(e)))
Beispiel #3
0
 def testUnsignedIntegerEncoding(self):
     self.assertEqual(tools.EncodeInteger(0xFFFFFFFF),
                      six.b('\xff\xff\xff\xff'))
Beispiel #4
0
 def testIntegerEncoding(self):
     self.assertEqual(tools.EncodeInteger(0x01020304),
                      six.b('\x01\x02\x03\x04'))
Beispiel #5
0
 def set_session_timeout(self, timeout):
     if timeout: self.AddAttribute(27, tools.EncodeInteger(timeout))
Beispiel #6
0
 def set_idle_timeout(self, timeout):
     if timeout:
         self.AddAttribute(28, tools.EncodeInteger(timeout))