Class: AVPNames

Inherits:
Object
  • Object
show all
Includes:
AVPType
Defined in:
lib/diameter/avp.rb

Overview

Maps AVP names to their on-the-wire values and data definitions.

Constant Summary

AVAILABLE_AVPS =

The AVPs that can be looked up by name.

{
'Vendor-Specific-Application-Id' => [260, GROUPED],
'Vendor-Id' => [266, U32],
'Auth-Application-Id' => [258, U32],
'Session-Id' => [263, OCTETSTRING],
'Product-Name' => [269, OCTETSTRING],
'Auth-Session-State' => [277, U32],
'Inband-Security-Id' => [299, U32],
'Origin-Host' => [264, OCTETSTRING],
'Firmware-Revision' => [267, U32],
'Result-Code' => [268, U32],
'Origin-Realm' => [296, OCTETSTRING],
'Destination-Host' => [293, OCTETSTRING],
'Destination-Realm' => [283, OCTETSTRING],
'User-Name' => [1, OCTETSTRING],
'Host-IP-Address' => [257, IPADDR],
'Public-Identity' => [601, OCTETSTRING, Vendor::TGPP],
'Server-Name' => [602, OCTETSTRING, Vendor::TGPP],
'SIP-Number-Auth-Items' => [607, U32, Vendor::TGPP],
'SIP-Auth-Data-Item' => [612, GROUPED, Vendor::TGPP],
'SIP-Item-Number' => [613, U32, Vendor::TGPP],
'SIP-Authentication-Scheme' => [608, OCTETSTRING, Vendor::TGPP] }

Constants included from AVPType

AVPType::GROUPED, AVPType::IPADDR, AVPType::OCTETSTRING, AVPType::U32

Class Method Summary (collapse)

Class Method Details

+ (Array(Fixnum, AVPType), Array(Fixnum, AVPType, Vendor)) get(name)

Converts an AVP name into its code number, data type, and (if applicable) vendor ID.

Parameters:

  • name (String)

    The AVP name

Returns:

  • (Array(Fixnum, AVPType))

    if this is not vendor-specific

  • (Array(Fixnum, AVPType, Vendor))

    if this is vendor-specific



61
62
63
64
65
66
# File 'lib/diameter/avp.rb', line 61

def self.get(name)
  code, type, vendor = AVAILABLE_AVPS[name]
  vendor ||= 0
  fail "AVP name #{name} not recognised" if not code
  [code, type, vendor]
end