def get_acctstatustype(self): try: return tools.DecodeInteger(self.get(40)[0]) except: if is_debug(): exception( 'Exception while trying to get nas accounting status') return None
def get_acct_output_gigawords(self): try: return tools.DecodeInteger(self.get(53)[0]) or 0 except: return 0
def get_acct_terminate_cause(self): try: return tools.DecodeInteger(self.get(49)[0]) or 0 except: return 0
def get_acct_output_packets(self): try: return tools.DecodeInteger(self.get(48)[0]) or 0 except: return 0
def get_acct_sessiontime(self): try: return tools.DecodeInteger(self.get(46)[0]) or 0 except: return 0
def get_acct_input_octets(self): try: return tools.DecodeInteger(self.get(42)[0]) or 0 except: return 0
def get_acct_status_type(self): try: return tools.DecodeInteger(self.get(40)[0]) except: return None
def get_acctinputoctets(self): try: return tools.DecodeInteger(self.get(42)[0]) except: return None
def get_service_type(self): try: return tools.DecodeInteger(self.get(0)[0]) or 0 except: return 0
d = dictionary.Dictionary(*dicts) for oid, name in d.vendors.backward.items(): if oid != 0: const_vendor.append((oid, name)) for k in d.attributes: attr = d.attributes[k] oid = d.vendors[attr.vendor] key = makeKey(oid, attr.code) if attr.type == 'integer': for vname, value in attr.values.forward.items(): newName = attr.name.replace('-', '') + '_' + vname.replace( '-', '').replace('.', '') const_value.append((key, tools.DecodeInteger(value), newName)) newName = 'Attr' + attr.name.replace('-', '') output.append((key, tmpl.format(name=attr.name, oid=oid, code=attr.code, tag='true' if attr.has_tag else 'false', encrypt=attr.encrypt, type=attrMap.get(attr.type, 'AttributeUnknown')), "%s AttributeKey = %s" % (newName, key))) output = sorted(output, key=lambda x: x[0]) const_vendor = sorted(const_vendor, key=lambda x: x[0]) const_value = sorted(const_value, key=lambda x: (x[0], x[1]))
def get_nasporttype(self): try: return tools.DecodeInteger(self.get(61)[0]) except: return None
def get_acctoutputgigawords(self): try: return tools.DecodeInteger(self.get(53)[0]) except: return None
def get_acctterminatecause(self): try: return tools.DecodeInteger(self.get(49)[0]) except: return None
def get_acctoutputpackets(self): try: return tools.DecodeInteger(self.get(48)[0]) except: return None
def get_nas_port_type(self): try: return tools.DecodeInteger(self.get(61)[0]) or 0 except: return 0
def testIntegerDecoding(self): self.assertEqual(tools.DecodeInteger(six.b('\x01\x02\x03\x04')), 0x01020304)
def get_session_timeout(self): try: return tools.DecodeInteger(self.get(27)[0]) or 0 except: return 0