The system provides a Python object for input GTPv1-C packet alc.gtp1c. The alc.gtp1c packet has following attributes to represent the GTPv1-C header fields as displayed in Table: GTPv1-C header fields .
Class attributes | GTPv1-C header field | Access |
---|---|---|
alc.gtp1c.version |
Integer, version field in the header |
Read |
alc.gtp1c.ptbit |
boolean, true mean 1, false means 0; PT bit in the header |
Read |
alc.gtp1c.ebit |
boolean, E bit in the header |
Read |
alc.gtp1c.sbit |
boolean, S bit in the header |
Read |
alc.gtp1c.pnbit |
boolean, PN bit in the header |
Read |
alc.gtp1c.type |
Integer message type field in the header |
Read |
alc.gtp1c.len |
Integer message length field in the header |
Read |
alc.gtp1c.teid |
Unsigned integer, or None if TEID does not exist |
Read |
alc.gtp1c.seq |
Integer sequence number in the header |
Read |
alc.gtp1c.npdu_number |
Integer N-PDU Number field in the header |
Read |
alc.gtp1c.next_ext_type |
Integer Next Extension Type field in the header |
Read |
alc.gtp1c.ext_list |
Tuple, a tuple of extension headers; each element in the tuple represent one extension header: (ext_type, ext_content) |
Read |
The following is a list of alc.gtp1c functions:
alc.gtp1c.drop()
The system drops the resulting packet.
alc.gtp1c.getIEList()
The system returns a tuple of ie-type, each element represent one IE instance in the packet.
alc.gtp1c.get(ie_type)
The system returns a tuple of str, each str is the IE data of specified ie_type instances. If the specified IE does not exist, then return (); if the IE length=0, then return ‟” for this IE instance.
alc.gtp1c.set(ie_type, ie_tuple)
This function removes all instances of ie_type and insert a list of new IE instances. Each element in ie_tuple is a string, represent one instance of IE to be inserted. For each inserted IE instance, the type is ie_type. System uses the TV format for type<128 and TLV format for type>=128.
alc.gtp1c.clear(ie_type)
This function removes all existing instances of ie_type.