class RefConfig(TlvModel): ref_name = BytesField(0x95) operation_rules = RepeatedField(ModelField(0x96, OperationRule)) label_rules = RepeatedField(ModelField(0x97, LabelRule))
class SqlresultsTlvModel(TlvModel): results = BytesField(0x02) # serialized results in bytes
class LabelRule(TlvModel): label = BytesField(0x98) min_value = UintField(0x9e, fixed_len=1) max_value = UintField(0x9f, fixed_len=1) user_id = BytesField(0x81) group_id = BytesField(0x82)
class HeadRef(TlvModel): head = BytesField(0x84) change_id = BytesField(0x85) change_id_meta_commit = BytesField(0xa5)
class CipherBlock(TlvModel): iv = BytesField(TLV_AC_AES_IV) cipher = BytesField(TLV_AC_ENCRYPTED_PAYLOAD)
class AccountConfig(TlvModel): user_id = BytesField(0x81) full_name = BytesField(0xa2) email = BytesField(0xa3)
class OperationRule(TlvModel): operation = UintField(0x9c) access = UintField(0x9d) user_id = BytesField(0x81) group_id = BytesField(0x82)
class CertRequest(TlvModel): identifier = BytesField(TypeNumber.GENERIC_NAME_COMPONENT) ecdh_n2 = BytesField(TLV_AC_ECDH_PUB_N2) anchor_digest = BytesField(TLV_SEC_BOOT_ANCHOR_DIGEST) ecdh_n1 = BytesField(TLV_AC_ECDH_PUB_N1)
class CertResponse(TlvModel): id_cert = BytesField(TypeNumber.DATA) iv = BytesField(TLV_AC_AES_IV) cipher = BytesField(TLV_AC_ENCRYPTED_PAYLOAD)
class SignOnRequest(TlvModel): identifier = BytesField(TypeNumber.GENERIC_NAME_COMPONENT) capabilities = BytesField(TLV_SEC_BOOT_CAPABILITIES) ecdh_n1 = BytesField(TLV_AC_ECDH_PUB_N1)
class SignOnResponse(TlvModel): anchor = BytesField(TypeNumber.DATA) ecdh_n2 = BytesField(TLV_AC_ECDH_PUB_N2) salt = BytesField(TLV_AC_SALT)
class MetaDataModel(TlvModel): source = BytesField(SVSyncTlvTypes.META_SOURCE.value) tseqno = UintField(SVSyncTlvTypes.META_TOTAL.value) nopcks = UintField(SVSyncTlvTypes.META_NOPCKS.value)
class MetaDataModel(TlvModel): source = BytesField(197) tseqno = UintField(198) nulled = UintField(199) nopcks = UintField(200)
class CertRequest(TlvModel): self_signed = BytesField(TypeNumber.DATA) testbed_signed = BytesField(TypeNumber.DATA)
class LabelValue(TlvModel): value = UintField(0xa0, fixed_len=1) description = BytesField(0xa1)
class SqlsTlvModel(TlvModel): sqls = RepeatedField( BytesField(0x02)) # multiple SQL statements, each is a byte array
class LabelConfig(TlvModel): label = BytesField(0x98) function = UintField(0x99) default_value = UintField(0x9a) values = RepeatedField(ModelField(0x9b, LabelValue))
class Model(TlvModel): name = NameField() int_val = UintField(0x03) str_val = BytesField(0x02) bool_val = BoolField(0x01) array = ModelField(0x05, WordArray)
class KeyRevocation(TlvModel): key_id = BytesField(0x83) revoke_time = BytesField(0xa4)
class StateVectorComponentModel(TlvModel): nid = BytesField(StateVectorModelTypes.KEY.value) seqno = UintField(StateVectorModelTypes.VALUE.value)
class GroupConfig(TlvModel): group_id = BytesField(0x82) full_name = BytesField(0xa2) owner = BytesField(0xa3) members = RepeatedField(BytesField(0xa4))
class Model(TlvModel): name = NameField() int_val = UintField(0x03) str_val = BytesField(0x02) bool_val = BoolField(0x01)
class ChangeMeta(TlvModel): change_id = BytesField(0x85) status = UintField(0xa6) patch_set = UintField(0x86) subject = BytesField(0xa7)
class PolicyAddRequest(TlvModel): data_name = BytesField(TLV_POLICY_DATA_STR) key_name = BytesField(TLV_POLICY_KEY_STR)