GTP::ie

Description

This set of commands allows for the parsing and interpretation of GTP IE elements.

Syntax

GTP::ie exists [<ie-path>]
GTP::ie count [-type <value>] [-instance <value>] [<ie-path>]
GTP::ie get instance <ie-path>
GTP::ie get length <ie-path>
GTP::ie get encode_type <ie-path>
GTP::ie get value <ie-path>
GTP::ie get list [-type <value>] [-instance <value>] [<ie-path>]
GTP::ie info <version>
GTP::ie info <version> <type>
GTP::ie info <version> <name>
GTP::ie info -encode-type <version> <type>
GTP::ie info -encode-type <version> <name>
GTP::ie info -name <version> <type>
GTP::ie info -type <version> <name>

GTP::ie exists ` <%3Cie-path%3E.html>`__

  • Helps verify if this IE exists. In the absence of ie-path, it returns true, if at the least one IE element is present in the message.

GTP::ie count -type -instance ` <%3Cie-path%3E.html>`__

The count of IEs held by referred path is returned that matches the given type & instance, if the options are provided. The path provides the scope for counting. Path has to be the last argument to the command. The absence of path argument sets the message as the scope, hence count of all IEs in the message is returned. If “-type ” is provided, only those IEs that matches this type within the scope are counted. If “-instance ” is provided, only those IEs that matches this instance within the scope are counted.
NOTE: The count happens at the given scope, implying it does not include any embedded IEs in the count. Say message has 3 IEs and one of which is grouped-IE. Here “GTP::ie count” returns 3. GTP::ie count bearer_context Returns count of embedded IEs in the first bearer-context in the message. GTP::ie count Returns count of all IEs in the message. GTP::ie-count -type ip-address pdn-conn Return the count of IP address IEs inside the first PDN connection IE in the message. Only first PDN Connection is used as absence of index in path defaults to 0.

GTP::ie get instance

* Returns the instance value of this IE. For messages of version 1, instance value is returned as 0.

GTP::ie get length

  • Returns the length in octets of value of this IE

GTP::ie get encode_type

  • Returns the type of encoding of the value.

GTP::ie get value

Returns the value of this IE as the TclList object of following elements in the same order as listed below:
type: UINT8 index: UINT8 length: UINT16 instance: UINT8 encode_type: Constant string as one of the defined encode types. value:

GTP::ie get list -type -instance ` <%3Cie-path%3E.html>`__

Returns list of IE objects in the contained scope. The scope is provided by the path. path has to be the last argument. Absence of any path set the message level as scope. * -type helps collect IEs that matches this type value only. * -instance helps collect IEs of given instance value only.
In case of messages of version 1, all elements are considered to have instance value of 0. Each IE_object is same as the output for “GTP::ie –value ” e.g.
* GTP::ie list
Returns the list of all the IE elements contained in the message.

GTP::ie info

List the following info for each IE supported in this version: * , , ,

GTP::ie info

* Return the info as in GTP::ie info for the specified IE only.

GTP::ie info

* Return the info as in GTP::ie info for the specified IE only.

GTP::ie info -encode-type

* Returns only the encode type of the specified IE.

GTP::ie info -encode-type

* Returns only the encode type of the specified IE.

GTP::ie info -name

* Returns the name of specified IE.

GTP::ie info -type

* Returns the type of specified IE.

Examples

proc decode_ie { ie_list } {
  foreach ie $ie_list {
    foreach { type len instance value } $ie {}
    switch [gtp_encode_type $type] {
      "grouped" {
        decode_ie $value
      }
      "string" {
        log local0. "${type}/${instance} ($len) : $value"
      }
      "unsigned32" {
        binary scan $value I value
        set value [expr {$value & 0xffffffff}]
        log local0. "${type}/${instance} ($len) : $value"
              default {
        binary scan $value H[expr {2 * $len}] value
        log local0. "${type}/${instance} ($len) : $value"
      }
    }
  }
}

proc apn_encode { apn } {
    set result ""
    foreach element [ split $apn . ] {
        set len [format %c [string length $element]]
        append result $len$element
    }
    return $result
}
when GTP_SIGNALLING_INGRESS {
    set apn_name [ call apn_encode "test.koenning.org"]
        if {[GTP::header version] == 1 &&  [GTP::header type] == 32 } {
                GTP::ie set value 131 $apn_name
        }
}


Warning

The links to the sample code below are remnants of the old DevCentral wiki and will result in a 404 error. For best results, please copy the link text and search the codeshare directly on DevCentral.

Sample Code:

  • Introduced: BIGIP-11.5.0

The BIG-IP API Reference documentation contains community-contributed content. F5 does not monitor or control community code contributions. We make no guarantees or warranties regarding the available code, and it may contain errors, defects, bugs, inaccuracies, or security vulnerabilities. Your access to and use of any code available in the BIG-IP API reference guides is solely at your own risk.