Diameter ABNF Specification Syntax(3.0)


 uses the ABNF format defined in the Diameter Base Protocol RFC (RFC 6733).

Example - ABNF Specification file

CCR and CCA command specification for the Diameter Credit-Control application (Nortel GGSN): ccr_cca_abnf

Example - The Diameter Command ABNF Specification - Copied from RFC 6733:

Every Command Code that is defined  must  include a corresponding ABNF specification that is used to define the AVPs. The following format is used in the definition:

command-def = command-name "::=" 
  diameter-message 
 
command-name = diameter-name 

diameter-name = ALPHA *(ALPHA / DIGIT / "-")
 
diameter-message = header [ *fixed] [ *required] 
[ *optional] [ *fixed]
 
header = "<" Diameter-Header:" command-id 
[r-bit] [p-bit] [e-bit] [application-id]">" 

application-id = 1*DIGIT 

command-id = 1*DIGIT 
The Command Code assigned to the command 

r-bit = ", REQ" 
If present, the 'R' bit in the Command Flags is set, indicating that the message is a request, as opposed to an answer. 

p-bit = ", PXY" 
If present, the 'P' bit in the Command Flags is set, indicating that the message is proxiable. 

e-bit = ", ERR" 
If present, the 'E' bit in the Command Flags is set, indicating that the answer message contains a Result-Code AVP in the "protocol error" class.
 
fixed = [qual] "<" avp-spec ">" 
Defines the fixed position of an AVP
 
required = [qual] "{" avp-spec "}" 
The AVP MUST be present and can appear anywhere in the message. 

optional = [qual] "[" avp-name "]" 
The AVP-name in the 'optional' rule cannot evaluate to any AVP Name which is included in a fixed or required rule. The AVP can appear anywhere in the message. 

qual = [min] "*" [max] 
See ABNF conventions, RFC 2234 Section 6.6. The absence of any qualifiers depends on whether it precedes a fixed, required or optional rule. If a fixed or required rule has no qualifier, then exactly one such AVP MUST be present. If an optional rule has no qualifier, then 0 or 1 such AVP may be present. 

NOTE: "[" and "]" have a different meaning than in ABNF (see the optional rule, above). These braces cannot be used to express optional fixed rules (such as an optional ICV at the end). To do this, the convention is '0*1fixed'. 

min = 1*DIGIT 
The minimum number of times the element may be present. The default value is zero. 

max = 1*DIGIT 
The maximum number of times the element may be present. The default value is infinity. A value of zero implies the AVP MUST NOT be present. 

avp-spec = diameter-name 
The AVP-spec has to be an AVP Name, defined in the base or extended Diameter specifications. 

avp-name = avp-spec / "AVP" 
The string "AVP" stands for *any* arbitrary AVP Name, which does not conflict with the required or fixed position AVPs defined in the command code definition.

The following is a definition of a fictitious command code:

Example-Request ::= < "Diameter-Header: 9999999, REQ, PXY > 
{ User-Name } 
* { Origin-Host } 
* [ AVP ]