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))
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)))
def testUnsignedIntegerEncoding(self): self.assertEqual(tools.EncodeInteger(0xFFFFFFFF), six.b('\xff\xff\xff\xff'))
def testIntegerEncoding(self): self.assertEqual(tools.EncodeInteger(0x01020304), six.b('\x01\x02\x03\x04'))
def set_session_timeout(self, timeout): if timeout: self.AddAttribute(27, tools.EncodeInteger(timeout))
def set_idle_timeout(self, timeout): if timeout: self.AddAttribute(28, tools.EncodeInteger(timeout))