def __init__(self, teid, source_ip, sqn=0x00, ebi=5, interface=7, nit=0, mcc=333, mnc=88, fteid=False): GTPV2MessageBase.__init__( self, t=0x01, sequence=sqn, msg_type=GTPmessageTypeDigit['modify-bearer-request']) self.set_teid(teid) self.add_ie(BearerContext(ip=source_ip, interface=interface)) self.add_ie(EPSBearerID(ebi=ebi)) self.add_ie(FQCSID(node_id_type=nit, ip=source_ip, mcc=mcc, mnc=mnc)) self.__fteid = 0x00000000 if fteid: fteid = FTeid(source_ip, interface) self.__fteid = fteid.get_teid() self.add_ie(fteid)
def __init__(self): ''' Constructor ''' GTPV2MessageBase.__init__(self, msg_type=GTPmessageTypeDigit['echo-request']) self.add_ie(Recovery(rc=13))
def __init__(self, seq_num): ''' Constructor ''' GTPV2MessageBase.__init__( self, msg_type=GTPmessageTypeDigit['echo-response'], sequence=seq_num) self.add_ie(Recovery(rc=0))
def __init__(self, source_ip, sqn=0x00, nit=0, mcc=222, mnc=88): GTPV2MessageBase.__init__( self, t=0x01, sequence=sqn, msg_type=GTPmessageTypeDigit['delete-pdn-connection-set-request']) self.set_teid(0x00) self.add_ie(FQCSID(node_id_type=nit, ip=source_ip, mcc=mcc, mnc=mnc))
def __init__(self, source_ip, interface=7, imsi="222885500003199", mcc="222", mnc="88", lac=2788, rac=1, apn="wap.tim.it", p_dns='127.0.0.1', s_dns="127.0.0.2", gsn="127.0.0.1", phone="393282270202", imei='3518280450609004', rat_type='E-UTRAN', tac=0, ecgi=0, sac=0, cgi=0, sm=0, recovery=True, ebi=5): GTPV2MessageBase.__init__( self, t=0x01, msg_type=GTPmessageTypeDigit['create-session-request']) self.add_ie(Imsi(imsi)) self.add_ie(RatType(rat_type)) fteid = FTeid(source_ip, interface) self.__fteid = fteid.get_teid() self.add_ie(fteid) self.add_ie(AccessPointName(apn)) self.add_ie(BearerContext(ebi=ebi, ip=source_ip, interface=interface)) self.add_ie( UserLocationInformation(mcc=mcc, mnc=mnc, lac=lac, rac=rac, tac=tac, ecgi=ecgi, sac=sac, cgi=cgi)) self.add_ie(ServingNetwork(mcc=mcc, mnc=mnc)) self.add_ie(SelectionMode(selection_mode=sm)) self.add_ie(PDNAddressAllocation()) self.add_ie(ApnRestriction()) self.add_ie(AggregateMaximumBitRate()) self.add_ie(Msisdn(msisdn=phone)) self.add_ie(MEIdentity(imei)) self.add_ie(ChargingCharacteristic()) self.add_ie(ProtocolConfigurationOptions(p_dns=p_dns, s_dns=s_dns)) if recovery: self.add_ie(Recovery())
def __init__(self, sqn=0x00): ''' Constructor ''' GTPV2MessageBase.__init__( self, t=0x01, sequence=sqn, msg_type=GTPmessageTypeDigit['delete-pdn-connection-set-response']) self.set_teid(0x00) self.add_ie(Cause())
def __init__(self, teid, nit=0, source_ip='127.0.0.1', sqn=0x00): ''' Constructor ''' GTPV2MessageBase.__init__( self, t=0x01, sequence=sqn, msg_type=GTPmessageTypeDigit['delete-bearer-response']) self.set_teid(teid) self.add_ie(Cause()) self.add_ie(FQCSID(node_id_type=nit, ip=source_ip))
def __init__(self, teid, source_ip, sqn=0x00, ebi=5, interface=7): ''' Constructor ''' GTPV2MessageBase.__init__( self, t=0x01, sequence=sqn, msg_type=GTPmessageTypeDigit['create-bearer-request']) self.set_teid(teid) self.add_ie(BearerContext(ip=source_ip, interface=interface)) self.add_ie(EPSBearerID(ebi=ebi))
def __init__(self, teid, source_ip, nit=0, sqn=0x00, ebi=5, interface=7, cause=3, mcc=333, mnc=88): GTPV2MessageBase.__init__( self, t=0x01, sequence=sqn, msg_type=GTPmessageTypeDigit['delete-bearer-request']) self.set_teid(teid) self.add_ie(EPSBearerID(ebi=ebi)) self.add_ie(Cause(cause=cause)) self.add_ie(FQCSID(node_id_type=nit, ip=source_ip, mcc=mcc, mnc=mnc))
def __init__(self, teid, source_ip, interface, sqn=0x00, p_dns='127.0.0.1', s_dns="127.0.0.2"): ''' Constructor ''' GTPV2MessageBase.__init__( self, t=0x01, sequence=sqn, msg_type=GTPmessageTypeDigit['create-session-response']) self.set_teid(teid) self.add_ie(FTeid(source_ip, interface)) self.add_ie(Cause()) self.add_ie(BearerContext(ip=source_ip, interface=interface)) self.add_ie(ProtocolConfigurationOptions(p_dns=p_dns, s_dns=s_dns)) self.add_ie(PDNAddressAllocation()) self.add_ie(ApnRestriction())
def __init__(self, teid, source_ip="127.0.0.1", ebi=5, mcc="333", interface=7, mnc="88", lac=2788, rac=1, tac=0, ecgi=0, sac=0, cgi=0): ''' Constructor ''' GTPV2MessageBase.__init__( self, t=0x01, msg_type=GTPmessageTypeDigit['delete-session-request']) self.set_teid(teid) self.add_ie(EPSBearerID(ebi)) if interface == 10 or interface == 11: self.add_ie( UserLocationInformation(mcc=mcc, mnc=mnc, lac=lac, rac=rac, tac=tac, ecgi=ecgi, sac=sac, cgi=cgi)) #This is not exactly correct. Here MME/SGSN IP should be set within #their TEID associated to the teid of the tunnel that will be deleted fteid = FTeid(source_ip, interface) self.add_ie(fteid)