Skip to content

AA

API reference for diameter.message.commands.aa.

This module contains AA Request and Answer messages, implementing AVPs documented in rfc7155.

Aa

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

Bases: DefinedMessage

An AA message.

This message class lists message attributes based on the current rfc7155 as python properties, acessible as instance attributes. AVPs not listed in the RFC can be retrieved using the Aa.find_avps search method.

Examples:

AVPs accessible either as instance attributes or by searching:

>>> msg = Message.from_bytes(b"...")
>>> msg.origin_realm
b'mvno.net'
>>> msg.find_avps((AVP_ORIGIN_REALM, 0))
[b'mvno.net']

When a diameter message is decoded using Message.from_bytes, it returns either an instance of AaRequest or AaAnswer automatically:

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

When creating a new message by hand, the AaRequest or AaAnswer class should be instantiated directly, and values for AVPs set as class attributes:

>>> msg = AaRequest()
>>> msg.origin_realm = b"mvno.net"

Other, custom AVPs can be appended to the message using the Aa.append_avp method, or by overwriting the avp attribute entirely. Regardless of the custom AVPs set, the mandatory values listed in rfc7155 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.

AaAnswer

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

Bases: Aa

An AA-Answer message.

Note

The "Class" AVP can be accessed via state_class attribute, as "class" is a reserved keyword.

acct_interim_interval instance-attribute

acct_interim_interval: int

arap_challenge_response instance-attribute

arap_challenge_response: bytes

arap_features instance-attribute

arap_features: bytes

arap_security instance-attribute

arap_security: int

arap_security_data instance-attribute

arap_security_data: list[bytes]

arap_zone_access instance-attribute

arap_zone_access: int

auth_application_id instance-attribute

auth_application_id: int

auth_grace_period instance-attribute

auth_grace_period: int

authorization_lifetime instance-attribute

authorization_lifetime: int

callback_id instance-attribute

callback_id: str

callback_number instance-attribute

callback_number: str

configuration_token instance-attribute

configuration_token: list[bytes]

error_message instance-attribute

error_message: str

error_reporting_host instance-attribute

error_reporting_host: bytes

failed_avp instance-attribute

failed_avp: list[FailedAvp]

filter_id instance-attribute

filter_id: list[str]
framed_appletalk_link: int

framed_appletalk_network instance-attribute

framed_appletalk_network: list[int]

framed_appletalk_zone instance-attribute

framed_appletalk_zone: bytes

framed_compression instance-attribute

framed_compression: list[int]

framed_interface_id instance-attribute

framed_interface_id: int

framed_ip_address instance-attribute

framed_ip_address: bytes

framed_ip_netmask instance-attribute

framed_ip_netmask: bytes

framed_ipv6_pool instance-attribute

framed_ipv6_pool: bytes

framed_ipv6_prefix instance-attribute

framed_ipv6_prefix: list[bytes]

framed_ipv6_route instance-attribute

framed_ipv6_route: list[str]

framed_ipx_network instance-attribute

framed_ipx_network: int

framed_mtu instance-attribute

framed_mtu: int

framed_pool instance-attribute

framed_pool: bytes

framed_protocol instance-attribute

framed_protocol: int

framed_route instance-attribute

framed_route: list[str]

framed_routing instance-attribute

framed_routing: int

idle_timeout instance-attribute

idle_timeout: int

login_ip_host instance-attribute

login_ip_host: list[str]

login_ipv6_host instance-attribute

login_ipv6_host: list[bytes]

login_lat_group instance-attribute

login_lat_group: bytes

login_lat_node instance-attribute

login_lat_node: bytes

login_lat_port instance-attribute

login_lat_port: str

login_lat_service instance-attribute

login_lat_service: bytes

login_service instance-attribute

login_service: int

login_tcp_port instance-attribute

login_tcp_port: int

multi_round_time_out instance-attribute

multi_round_time_out: int

nas_filter_rule instance-attribute

nas_filter_rule: list[bytes]

origin_aaa_protocol instance-attribute

origin_aaa_protocol: int

origin_host instance-attribute

origin_host: bytes

origin_realm instance-attribute

origin_realm: bytes

origin_state_id instance-attribute

origin_state_id: int

password_retry instance-attribute

password_retry: int

port_limit instance-attribute

port_limit: int

prompt instance-attribute

prompt: int

proxy_info instance-attribute

proxy_info: list[ProxyInfo]

qos_filter_rule instance-attribute

qos_filter_rule: list[bytes]

re_auth_request_type instance-attribute

re_auth_request_type: int

redirect_host instance-attribute

redirect_host: list[str]

redirect_host_usage instance-attribute

redirect_host_usage: int

redirect_max_cache_time instance-attribute

redirect_max_cache_time: int

reply_message instance-attribute

reply_message: list[str]

result_code instance-attribute

result_code: int

service_type instance-attribute

service_type: int

session_id instance-attribute

session_id: str

session_timeout instance-attribute

session_timeout: int

state instance-attribute

state: bytes

state_class instance-attribute

state_class: list[bytes]

tunneling instance-attribute

tunneling: list[Tunneling]

user_name instance-attribute

user_name: str

AaRequest

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

Bases: Aa

An AA-Request message.

af_charging_identifier instance-attribute

af_charging_identifier: str

arap_password instance-attribute

arap_password: bytes

arap_security instance-attribute

arap_security: int

arap_security_data instance-attribute

arap_security_data: list[bytes]

auth_application_id instance-attribute

auth_application_id: int

auth_grace_period instance-attribute

auth_grace_period: int

auth_request_type instance-attribute

auth_request_type: int

auth_session_state instance-attribute

auth_session_state: int

authorization_lifetime instance-attribute

authorization_lifetime: int

callback_number instance-attribute

callback_number: str

called_station_id instance-attribute

called_station_id: str

calling_station_id instance-attribute

calling_station_id: str

chap_auth instance-attribute

chap_auth: ChapAuth

chap_challenge instance-attribute

chap_challenge: bytes

connect_info instance-attribute

connect_info: str

destination_host instance-attribute

destination_host: bytes

destination_realm instance-attribute

destination_realm: bytes

framed_compression instance-attribute

framed_compression: list[int]

framed_interface_id instance-attribute

framed_interface_id: int

framed_ip_address instance-attribute

framed_ip_address: bytes

framed_ip_netmask instance-attribute

framed_ip_netmask: bytes

framed_ipv6_prefix instance-attribute

framed_ipv6_prefix: list[bytes]

framed_mtu instance-attribute

framed_mtu: int

framed_protocol instance-attribute

framed_protocol: int

login_ip_host instance-attribute

login_ip_host: list[str]

login_ipv6_host instance-attribute

login_ipv6_host: list[bytes]

login_lat_group instance-attribute

login_lat_group: bytes

login_lat_node instance-attribute

login_lat_node: bytes

login_lat_port instance-attribute

login_lat_port: str

login_lat_service instance-attribute

login_lat_service: bytes

media_component_description instance-attribute

media_component_description: MediaComponentDescription

nas_identifier instance-attribute

nas_identifier: str

nas_ip_address instance-attribute

nas_ip_address: bytes

nas_ipv6_address instance-attribute

nas_ipv6_address: bytes

nas_port instance-attribute

nas_port: int

nas_port_id instance-attribute

nas_port_id: str

nas_port_type instance-attribute

nas_port_type: int

origin_aaa_protocol instance-attribute

origin_aaa_protocol: int

origin_host instance-attribute

origin_host: bytes

origin_realm instance-attribute

origin_realm: bytes

origin_state_id instance-attribute

origin_state_id: int

originating_line_info instance-attribute

originating_line_info: bytes

port_limit instance-attribute

port_limit: int

proxy_info instance-attribute

proxy_info: list[ProxyInfo]

route_record instance-attribute

route_record: list[bytes]

service_type instance-attribute

service_type: int

session_id instance-attribute

session_id: str

specific_action instance-attribute

specific_action: list[int]

state instance-attribute

state: bytes

subscription_id instance-attribute

subscription_id: list[SubscriptionId]

supported_features instance-attribute

supported_features: SupportedFeatures

tunneling instance-attribute

tunneling: list[Tunneling]

user_name instance-attribute

user_name: str

user_password instance-attribute

user_password: bytes

add_subscription_id

add_subscription_id(
    subscription_id_type: int, subscription_id_data: str
)

Add a subscription ID to the request.

Parameters:

Name Type Description Default
subscription_id_type int

One of the E_SUBSCRIPTION_ID_TYPE_* constant values

required
subscription_id_data str

Actual subscription ID

required