Skip to content

Home Agent MIP

API reference for diameter.message.commands.home_agent_mip.

This module contains Home-Agent-MIP Request and Answer messages, implementing AVPs documented in rfc4004.

HomeAgentMip

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

Bases: DefinedMessage

A Home-Agent-MIP base message.

This message class lists message attributes based on the current rfc4004 as python properties, acessible as instance attributes. AVPs not listed in the base protocol can be retrieved using the HomeAgentMip.find_avps search method.

Examples:

AVPs accessible either as instance attributes or by searching:

>>> msg = Message.from_bytes(b"...")
>>> msg.session_id
dra1.mvno.net;2323;546
>>> msg.find_avps((AVP_SESSION_ID, 0))
['dra1.mvno.net;2323;546']

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

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

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

>>> msg = HomeAgentMipRequest()
>>> msg.session_id = "dra1.mvno.net;2323;546"

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

HomeAgentMipAnswer

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

Bases: HomeAgentMip

A Home-Agent-MIP-Answer message.

acct_multi_session_id instance-attribute

acct_multi_session_id: str

auth_application_id instance-attribute

auth_application_id: int

error_message instance-attribute

error_message: str

error_reporting_host instance-attribute

error_reporting_host: bytes

mip_fa_to_ha_spi instance-attribute

mip_fa_to_ha_spi: int

mip_fa_to_mn_spi instance-attribute

mip_fa_to_mn_spi: int

mip_home_agent_address instance-attribute

mip_home_agent_address: str

mip_mobile_node_address instance-attribute

mip_mobile_node_address: str

mip_reg_reply instance-attribute

mip_reg_reply: bytes

origin_host instance-attribute

origin_host: bytes

origin_realm instance-attribute

origin_realm: bytes

origin_state_id instance-attribute

origin_state_id: int

proxy_info instance-attribute

proxy_info: list[ProxyInfo]

result_code instance-attribute

result_code: int

session_id instance-attribute

session_id: str

user_name instance-attribute

user_name: str

HomeAgentMipRequest

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

Bases: HomeAgentMip

A Home-Agent-MIP-Request message.

auth_application_id instance-attribute

auth_application_id: int

auth_session_state instance-attribute

auth_session_state: int

authorization_lifetime instance-attribute

authorization_lifetime: int

destination_host instance-attribute

destination_host: bytes

destination_realm instance-attribute

destination_realm: bytes

mip_feature_vector instance-attribute

mip_feature_vector: int

mip_filter_rule instance-attribute

mip_filter_rule: list[bytes]

mip_ha_to_fa_msa instance-attribute

mip_ha_to_fa_msa: MipHaToFaMsa

mip_ha_to_mn_msa instance-attribute

mip_ha_to_mn_msa: MipHaToMnMsa

mip_home_agent_address instance-attribute

mip_home_agent_address: str

mip_mn_to_fa_msa instance-attribute

mip_mn_to_fa_msa: MipMnToFaMsa

mip_mn_to_ha_msa instance-attribute

mip_mn_to_ha_msa: MipMnToHaMsa

mip_mobile_node_address instance-attribute

mip_mobile_node_address: str

mip_msa_lifetime instance-attribute

mip_msa_lifetime: int

mip_originating_foreign_aaa instance-attribute

mip_originating_foreign_aaa: MipOriginatingForeignAaa

mip_reg_request instance-attribute

mip_reg_request: bytes

origin_host instance-attribute

origin_host: bytes

origin_realm instance-attribute

origin_realm: bytes

origin_state_id instance-attribute

origin_state_id: int

proxy_info instance-attribute

proxy_info: list[ProxyInfo]

route_record instance-attribute

route_record: list[bytes]

session_id instance-attribute

session_id: str

user_name instance-attribute

user_name: str