コード例 #1
0
ファイル: gtp_v2.py プロジェクト: altair0708/scapy
class IE_APN(gtp.IE_Base):
    name = "IE APN"
    fields_desc = [ByteEnumField("ietype", 71, IEType),
                   ShortField("length", None),
                   BitField("CR_flag", 0, 4),
                   BitField("instance", 0, 4),
                   gtp.APNStrLenField("APN", "internet",
                                      length_from=lambda x: x.length)]
コード例 #2
0
class IE_APN(gtp.IE_Base):
    name = "IE APN"
    fields_desc = [
        ByteEnumField("ietype", 71, IEType),
        FieldLenField("length",
                      None,
                      length_of="APN",
                      adjust=lambda pkt, x: x + 4,
                      fmt="H"),
        BitField("CR_flag", 0, 4),
        BitField("instance", 0, 4),
        gtp.APNStrLenField("APN", "internet", length_from=lambda x: x.length)
    ]