| |
- AVP
class AVP |
|
A Diameter AVP
See RFC3588 section 4 for details.
An AVP consists of a code, some flags, an optional vendor ID, and a payload.
The payload is not checked for correct size and content until you try to
construct one of its subclasses from it. Eg
avp = ...
try:
application_id = AVP_Unsigned32.narrow(avp).queryValue()
...
except InvalidAVPLengthError, ex:
..
Members:
code (int) The AVP code
vendor_id (int) The vendor ID. Assigning directly to this has the delayed effect of of setting/unsetting the vendor flag bit
payload
See also: ProtocolConstants |
|
Methods defined here:
- __init__(self, code=0, payload='', vendor_id=0)
- __str__(self)
- decode(self, unpacker, bytes)
- encode(self, packer)
- encodeSize(self)
- isMandatory(self)
- Returns if the mandatory (M) flag is set
- isPrivate(self)
- Returns if the private (P) flag is set
- isVendorSpecific(self)
- Returns if the AVP is vendor-specific (has non-zero vendor_id)
- setM(self)
- Sets the M-bit and returns the instance
- setMandatory(self, f)
- Sets/unsets the mandatory (M) flag
- setPrivate(self, f)
- Sets/unsets the private (P) flag
- str_prefix__(self)
- Return a string prefix suitable for building a __str__ result
Static methods defined here:
- decodeSize(unpacker, bytes)
Data and other attributes defined here:
- avp_flag_mandatory = 64
- avp_flag_private = 32
- avp_flag_vendor = 128
| |