Skip to content

Reset

API reference for diameter.message.commands.reset.

This module contains Reset Request and Answer messages for the S6a/S6d and S7a/S7d interfaces, implementing AVPs documented in 3GPP TS 29.272.

Note

The Reset command used to be defined in both ProSe function (TS 29.344), as command code 8388667, and in S6a/S67 (TS 29.272), as command code 322 and name 3GPP-Reset. Later versions of the standards have since dropped the ProSe-specific command code and has replaced it with the S6a/S67-specific command code 322.

The old command code 8388667 maps currently to ProSeReset, which is left as an undefined placeholder.

Reset

Reset(header: MessageHeader = None, avps: list[Avp] = None)

Bases: DefinedMessage

A Reset base message.

This message class lists message attributes based on the current 3GPP TS 29.272 version 19.4.0 Release 19 as python properties, accessible as instance attributes. AVPs not listed in the spec protocol can be retrieved using the Reset.find_avps search method.

Examples:

AVPs accessible either as instance attributes or by searching:

>>> msg = Message.from_bytes(b"...")
>>> msg.session_id
dra1.python-diameter.org;2323;546
>>> msg.find_avps((AVP_SESSION_ID, 0))
['dra1.python-diameter.org;2323;546']

When diameter message is decoded using Message.from_bytes, it returns either an instance of ResetRequest or ResetAnswer automatically:

>>> msg = Message.from_bytes(b"...")
>>> assert msg.header.is_request is True
>>> assert isinstance(msg, ResetRequest)

When creating a new message, the ResetRequest or ResetAnswer class should be instantiated directly, and values for AVPs set as class attributes:

>>> msg = ResetRequest()
>>> msg.session_id = "dra1.python-diameter.org;2323;546"

Other, custom AVPs can be appended to the message using the Reset.append_avp method, or by overwriting the avp attribute entirely. Regardless of the custom AVPs set, the mandatory values listed in TS 29.272 must be set, however they can be set as None, if they are not to be used.

Warning

Every AVP documented for the subclasses of this command can be accessed as an instance attribute, even if the original network-received message did not contain that specific AVP. Such AVPs will be returned with the value None when accessed.

Every other AVP not mentioned here, and not present in a network-received message will raise an AttributeError when being accessed; their presence should be validated with hasattr before accessing.

ResetAnswer

ResetAnswer(header: MessageHeader = None, avps: list[Avp] = None)

Bases: Reset

A Reset-Answer message.

3GPP TS 29.272 version 19.4.0

auth_session_state instance-attribute

auth_session_state: int

drmp instance-attribute

drmp: int

experimental_result instance-attribute

experimental_result: ExperimentalResult

failed_avp instance-attribute

failed_avp: list[FailedAvp]

origin_host instance-attribute

origin_host: bytes

origin_realm instance-attribute

origin_realm: bytes

proxy_info instance-attribute

proxy_info: list[ProxyInfo]

result_code instance-attribute

result_code: int

route_record instance-attribute

route_record: list[bytes]

session_id instance-attribute

session_id: str

supported_features instance-attribute

supported_features: list[SupportedFeatures]

vendor_specific_application_id instance-attribute

vendor_specific_application_id: VendorSpecificApplicationId

ResetRequest

ResetRequest(header: MessageHeader = None, avps: list[Avp] = None)

Bases: Reset

A Reset-Request message.

3GPP TS 29.272 version 19.4.0

auth_session_state instance-attribute

auth_session_state: int

destination_host instance-attribute

destination_host: bytes

destination_realm instance-attribute

destination_realm: bytes

drmp instance-attribute

drmp: int

origin_host instance-attribute

origin_host: bytes

origin_realm instance-attribute

origin_realm: bytes

proxy_info instance-attribute

proxy_info: list[ProxyInfo]

reset_id instance-attribute

reset_id: list[bytes]

route_record instance-attribute

route_record: list[bytes]

session_id instance-attribute

session_id: str

subscription_data instance-attribute

subscription_data: SubscriptionData

subscription_data_deletion instance-attribute

subscription_data_deletion: SubscriptionDataDeletion

supported_features instance-attribute

supported_features: list[SupportedFeatures]

user_id instance-attribute

user_id: list[str]

vendor_specific_application_id instance-attribute

vendor_specific_application_id: VendorSpecificApplicationId