idx
int64
0
252k
question
stringlengths
48
5.28k
target
stringlengths
5
1.23k
237,100
def _update_data ( self , datapoint , key , new_data ) : if new_data : try : self . data [ datapoint ] . update ( { key : new_data } ) except KeyError : self . data [ datapoint ] = { key : new_data }
update or assign new data to datapoint
237,101
def _update_params ( self ) : if self . data . get ( 'title' ) : self . params [ 'title' ] = self . data . get ( 'title' ) if self . data . get ( 'pageid' ) : self . params [ 'pageid' ] = self . data . get ( 'pageid' ) if self . data . get ( 'wikibase' ) : self . params [ 'wikibase' ] = self . data . get ( 'wikibase' )
update params from response data
237,102
def skip_action ( self , action ) : if 'skip' not in self . flags : self . flags [ 'skip' ] = [ ] self . flags [ 'skip' ] . append ( action )
append action to skip flag
237,103
def images ( self , fields = None , token = None ) : if 'image' not in self . data : return out = [ ] for img in self . data [ 'image' ] : if token and token not in img [ 'kind' ] : continue info = { } for key in img : if fields and key not in fields : continue info . update ( { key : img [ key ] } ) if info : out . ap...
Returns image info keys for kind containing token
237,104
def get ( self , url , status ) : crl = self . cobj try : crl . setopt ( pycurl . URL , url ) except UnicodeEncodeError : crl . setopt ( pycurl . URL , url . encode ( 'utf-8' ) ) if not self . silent : print ( status , file = sys . stderr ) if self . DISABLED : print ( "Requests DISABLED" , file = sys . stderr ) else :...
in favor of python - requests for speed
237,105
def curl_perform ( self , crl ) : bfr = BytesIO ( ) crl . setopt ( crl . WRITEFUNCTION , bfr . write ) crl . perform ( ) info = curl_info ( crl ) if info : if self . verbose and not self . silent : for item in sorted ( info ) : print ( " %s: %s" % ( item , info [ item ] ) , file = sys . stderr ) self . info = info bod...
performs HTTP GET and returns body of response
237,106
def safequote_restbase ( title ) : try : return quote ( title . encode ( 'utf-8' ) , safe = '' ) except UnicodeDecodeError : return quote ( title , safe = '' )
Safequote restbase title possibly having slash in title
237,107
def category ( self , title , pageid = None , cparams = None , namespace = None ) : query = self . LIST . substitute ( WIKI = self . uri , ENDPOINT = self . endpoint , LIST = 'categorymembers' ) status = pageid or title query += "&cmlimit=500" if namespace is not None : query += "&cmnamespace=%d" % namespace if title a...
Returns category query string
237,108
def labels ( self , qids ) : if len ( qids ) > 50 : raise ValueError ( "The limit is 50." ) self . domain = 'www.wikidata.org' self . uri = self . wiki_uri ( self . domain ) query = self . WIKIDATA . substitute ( WIKI = self . uri , ENDPOINT = self . endpoint , LANG = self . variant or self . lang , PROPS = 'labels' ) ...
Returns Wikidata labels query string
237,109
def imageinfo ( self , files ) : files = '|' . join ( [ safequote ( x ) for x in files ] ) self . set_status ( 'imageinfo' , files ) return self . IMAGEINFO . substitute ( WIKI = self . uri , ENDPOINT = self . endpoint , FILES = files )
Returns imageinfo query string
237,110
def parse ( self , title , pageid = None ) : qry = self . PARSE . substitute ( WIKI = self . uri , ENDPOINT = self . endpoint , PAGE = safequote ( title ) or pageid ) if pageid and not title : qry = qry . replace ( '&page=' , '&pageid=' ) . replace ( '&redirects' , '' ) if self . variant : qry += '&variant=' + self . v...
Returns Mediawiki action = parse query string
237,111
def query ( self , titles , pageids = None , cparams = None ) : query = self . QUERY . substitute ( WIKI = self . uri , ENDPOINT = self . endpoint , TITLES = safequote ( titles ) or pageids ) status = titles or pageids if pageids and not titles : query = query . replace ( '&titles=' , '&pageids=' ) if cparams : query +...
Returns MediaWiki action = query query string
237,112
def random ( self , namespace = 0 ) : query = self . LIST . substitute ( WIKI = self . uri , ENDPOINT = self . endpoint , LIST = 'random' ) query += "&rnlimit=1&rnnamespace=%d" % namespace emoji = [ u'\U0001f32f' , u'\U0001f355' , u'\U0001f35c' , u'\U0001f363' , u'\U0001f369' , u'\U0001f36a' , u'\U0001f36d' , u'\U0001f...
Returns query string for random page
237,113
def restbase ( self , endpoint , title ) : if not endpoint : raise ValueError ( "invalid endpoint: %s" % endpoint ) route = endpoint if title and endpoint != '/page/' : route = endpoint + safequote_restbase ( title ) self . set_status ( 'restbase' , route ) return "%s/api/rest_v1/%s" % ( self . uri , route [ 1 : ] )
Returns RESTBase query string
237,114
def site ( self , action ) : query = None viewdays = 7 hostpath = self . uri + self . endpoint if action == 'siteinfo' : query = hostpath + ( '?action=query' '&meta=siteinfo|siteviews' '&siprop=general|statistics' '&list=mostviewed&pvimlimit=max' ) query += '&pvisdays=%d' % viewdays self . set_status ( 'query' , 'sitei...
Returns site query
237,115
def wikidata ( self , title , wikibase = None ) : self . domain = 'www.wikidata.org' self . uri = self . wiki_uri ( self . domain ) query = self . WIKIDATA . substitute ( WIKI = self . uri , ENDPOINT = self . endpoint , LANG = self . variant or self . lang , PROPS = "aliases|info|claims|descriptions|labels|sitelinks" )...
Returns Wikidata query string
237,116
def _handle_response ( self ) : content = self . cache [ 'restbase' ] [ 'info' ] [ 'content-type' ] if content . startswith ( 'text/html' ) : html = self . cache [ 'restbase' ] [ 'response' ] if isinstance ( html , bytes ) : html = html . decode ( 'utf-8' ) self . data [ 'html' ] = html return response = self . _load_r...
returns RESTBase response if appropriate
237,117
def _query ( self , action , qobj ) : return qobj . restbase ( self . params [ 'rest_endpoint' ] , self . params . get ( 'title' ) )
returns WPToolsQuery string from action
237,118
def _unpack_images ( self , rdata ) : image = rdata . get ( 'image' ) originalimage = rdata . get ( 'originalimage' ) thumbnail = rdata . get ( 'thumbnail' ) if image or originalimage or thumbnail : if 'image' not in self . data : self . data [ 'image' ] = [ ] def file_url ( info ) : if 'source' in info : info [ 'url' ...
Set image data from RESTBase response
237,119
def is_text ( obj , name = None ) : try : ans = isinstance ( obj , basestring ) except NameError : ans = isinstance ( obj , str ) if name : print ( "is_text: (%s) %s = %s" % ( ans , name , obj . __class__ ) , file = sys . stderr ) return ans
returns True if object is text - like
237,120
def json_loads ( data ) : try : return json . loads ( data , encoding = 'utf-8' ) except TypeError : return json . loads ( data . decode ( 'utf-8' ) )
python - version - safe json . loads
237,121
def stderr ( msg , silent = False ) : if not silent : print ( msg , file = sys . stderr )
write msg to stderr if not silent
237,122
def template_to_dict ( tree , debug = 0 , find = False ) : obj = defaultdict ( str ) errors = [ ] for item in tree : try : name = item . findtext ( 'name' ) . strip ( ) if debug : template_to_dict_debug ( name , item , debug ) find_val = template_to_dict_find ( item , debug ) iter_val = template_to_dict_iter ( item , d...
returns wikitext template as dict
237,123
def template_to_dict_debug ( name , item , debug ) : if debug == 1 : print ( "\n%s = " % name ) elif debug > 1 : print ( "\n%s" % name ) print ( "=" * 64 ) print ( lxml . etree . tostring ( item ) ) print ( )
Print debug statements to compare algorithms
237,124
def template_to_dict_iter_debug ( elm ) : if elm . text is not None : print ( " <%s>%s</%s>" % ( elm . tag , elm . text , elm . tag ) , end = '' ) if elm . tail is not None : print ( elm . tail ) else : print ( ) else : if elm . tail is not None : print ( " <%s>%s" % ( elm . tag , elm . tail ) ) else : print ( " ...
Print expanded element on stdout for debugging
237,125
def template_to_text ( tmpl , debug = 0 ) : tarr = [ ] for item in tmpl . itertext ( ) : tarr . append ( item ) text = "{{%s}}" % "|" . join ( tarr ) . strip ( ) if debug > 1 : print ( "+ template_to_text:" ) print ( " %s" % text ) return text
convert parse tree template to text
237,126
def post_build ( self , p , pay ) : p += pay if self . auxdlen != 0 : print ( "NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0)." ) print ( " Subsequent Group Records are lost!" ) return p
Called implicitly before a packet is sent .
237,127
def post_build ( self , p , pay ) : p += pay if self . type in [ 0 , 0x31 , 0x32 , 0x22 ] : p = p [ : 1 ] + chr ( 0 ) + p [ 2 : ] if self . chksum is None : ck = checksum ( p [ : 2 ] + p [ 4 : ] ) p = p [ : 2 ] + ck . to_bytes ( 2 , 'big' ) + p [ 4 : ] return p
Called implicitly before a packet is sent to compute and place IGMPv3 checksum .
237,128
def mysummary ( self ) : if isinstance ( self . underlayer , IP ) : return self . underlayer . sprintf ( "IGMPv3: %IP.src% > %IP.dst% %IGMPv3.type% %IGMPv3.gaddr%" ) else : return self . sprintf ( "IGMPv3 %IGMPv3.type% %IGMPv3.gaddr%" )
Display a summary of the IGMPv3 object .
237,129
def adjust_ether ( self , ip = None , ether = None ) : if ip != None and ip . haslayer ( IP ) and ether != None and ether . haslayer ( Ether ) : iplong = atol ( ip . dst ) ether . dst = "01:00:5e:%02x:%02x:%02x" % ( ( iplong >> 16 ) & 0x7F , ( iplong >> 8 ) & 0xFF , ( iplong ) & 0xFF ) return True else : return False
Called to explicitely fixup an associated Ethernet header
237,130
def adjust_ip ( self , ip = None ) : if ip != None and ip . haslayer ( IP ) : if ( self . type == 0x11 ) : if ( self . gaddr == "0.0.0.0" ) : ip . dst = "224.0.0.1" retCode = True elif isValidMCAddr ( self . gaddr ) : ip . dst = self . gaddr retCode = True else : print ( "Warning: Using invalid Group Address" ) retCode...
Called to explicitely fixup an associated IP header
237,131
def ospf_lsa_checksum ( lsa ) : CHKSUM_OFFSET = 16 if len ( lsa ) < CHKSUM_OFFSET : raise Exception ( "LSA Packet too short (%s bytes)" % len ( lsa ) ) c0 = c1 = 0 lsa = lsa [ : CHKSUM_OFFSET ] + lsa [ CHKSUM_OFFSET + 2 : ] for char in lsa [ 2 : ] : c0 += char c1 += c0 c0 %= 255 c1 %= 255 x = ( ( len ( lsa ) - CHKSUM_O...
Fletcher checksum for OSPF LSAs returned as a 2 byte string .
237,132
def _LSAGuessPayloadClass ( p , ** kargs ) : cls = conf . raw_layer if len ( p ) >= 4 : typ = p [ 3 ] clsname = _OSPF_LSclasses . get ( typ , "Raw" ) cls = globals ( ) [ clsname ] return cls ( p , ** kargs )
Guess the correct LSA class for a given payload
237,133
def locate_ip ( ip ) : ip = map ( int , ip . split ( "." ) ) ip = ip [ 3 ] + ( ip [ 2 ] << 8 ) + ( ip [ 1 ] << 16 ) + ( ip [ 0 ] << 24 ) cloc = country_loc_kdb . get_base ( ) db = IP_country_kdb . get_base ( ) d = 0 f = len ( db ) - 1 while ( f - d ) > 1 : guess = ( d + f ) / 2 if ip > db [ guess ] [ 0 ] : d = guess el...
Get geographic coordinates from IP using geoip database
237,134
def _resolve_one ( self , ip ) : if in6_isaddr6to4 ( ip ) : tmp = inet_pton ( socket . AF_INET6 , ip ) addr = inet_ntop ( socket . AF_INET , tmp [ 2 : 6 ] ) elif in6_isaddrTeredo ( ip ) : addr = teredoAddrExtractInfo ( ip ) [ 2 ] else : addr = ip _ , asn , desc = AS_resolver_riswhois . _resolve_one ( self , addr ) retu...
overloaded version to provide a Whois resolution on the embedded IPv4 address if the address is 6to4 or Teredo . Otherwise the native IPv6 address is passed .
237,135
def in6_6to4ExtractAddr ( addr ) : try : addr = inet_pton ( socket . AF_INET6 , addr ) except : return None if addr [ : 2 ] != b" \x02" : return None return inet_ntop ( socket . AF_INET , addr [ 2 : 6 ] )
Extract IPv4 address embbeded in 6to4 address . Passed address must be a 6to4 addrees . None is returned on error .
237,136
def in6_getLocalUniquePrefix ( ) : tod = time . time ( ) i = int ( tod ) j = int ( ( tod - i ) * ( 2 ** 32 ) ) tod = struct . pack ( "!II" , i , j ) rawmac = get_if_raw_hwaddr ( conf . iface6 ) mac = b":" . join ( map ( lambda x : b"%.02x" % ord ( x ) , list ( rawmac ) ) ) eui64 = inet_pton ( socket . AF_INET6 , '::' +...
Returns a pseudo - randomly generated Local Unique prefix . Function follows recommandation of Section 3 . 2 . 2 of RFC 4193 for prefix generation .
237,137
def in6_getnsmac ( a ) : a = struct . unpack ( '16B' , a ) [ - 4 : ] mac = '33:33:' mac += ( ':' . join ( map ( lambda x : '%.2x' % x , a ) ) ) return mac
Return the multicast mac address associated with provided IPv6 address . Passed address must be in network format .
237,138
def _where ( filename , dirs = [ ] , env = "PATH" ) : if not isinstance ( dirs , list ) : dirs = [ dirs ] if glob ( filename ) : return filename paths = [ os . curdir ] + os . environ [ env ] . split ( os . path . pathsep ) + dirs for path in paths : for match in glob ( os . path . join ( path , filename ) ) : if match...
Find file in current dir or system path
237,139
def win_find_exe ( filename , installsubdir = None , env = "ProgramFiles" ) : for fn in [ filename , filename + ".exe" ] : try : if installsubdir is None : path = _where ( fn ) else : path = _where ( fn , dirs = [ os . path . join ( os . environ [ env ] , installsubdir ) ] ) except IOError : path = filename else : brea...
Find executable in current dir system path or given ProgramFiles subdir
237,140
def init_loopback ( self , data ) : self . name = data [ "name" ] self . description = data [ 'description' ] self . win_index = data [ 'win_index' ] self . mac = data [ "mac" ] self . guid = data [ "guid" ] self . ip = "127.0.0.1"
Just initialize the object for our Pseudo Loopback
237,141
def update ( self , data ) : self . name = data [ "name" ] self . description = data [ 'description' ] self . win_index = data [ 'win_index' ] if conf . use_winpcapy : self . _update_pcapdata ( ) try : self . ip = socket . inet_ntoa ( get_if_raw_addr ( data [ 'guid' ] ) ) except ( KeyError , AttributeError , NameError ...
Update info about network interface according to given dnet dictionary
237,142
def pcap_name ( self , devname ) : try : pcap_name = self . data [ devname ] . pcap_name except KeyError : raise ValueError ( "Unknown network interface %r" % devname ) else : return pcap_name
Return pcap device name for given Windows device name .
237,143
def bitmap2RRlist ( bitmap ) : RRlist = [ ] while bitmap : if len ( bitmap ) < 2 : warning ( "bitmap too short (%i)" % len ( bitmap ) ) return window_block = ( bitmap [ 0 ] ) offset = 256 * window_block bitmap_len = ( bitmap [ 1 ] ) if bitmap_len <= 0 or bitmap_len > 32 : warning ( "bitmap length is no valid (%i)" % bi...
Decode the Type Bit Maps field of the NSEC Resource Record into an integer list .
237,144
def IE_Dispatcher ( s ) : if len ( s ) < 1 : return Raw ( s ) ietype = ord ( s [ 0 ] ) cls = ietypecls . get ( ietype , Raw ) if cls == Raw and ietype & 128 == 128 : cls = IE_NotImplementedTLV return cls ( s )
Choose the correct Information Element class .
237,145
def filter ( self , func ) : return self . __class__ ( list ( filter ( func , self . res ) ) , name = "filtered %s" % self . listname )
Returns a packet list filtered by a truth function
237,146
def multiplot ( self , f , lfilter = None , ** kargs ) : d = defaultdict ( list ) for i in self . res : if lfilter and not lfilter ( i ) : continue k , v = f ( i ) d [ k ] . append ( v ) figure = plt . figure ( ) ax = figure . add_axes ( plt . axes ( ) ) for i in d : ax . plot ( d [ i ] , ** kargs ) return figure
Uses a function that returns a label and a value for this label then plots all the values label by label
237,147
def filter ( self , func ) : return self . __class__ ( [ i for i in self . res if func ( * i ) ] , name = 'filtered %s' % self . listname )
Returns a SndRcv list filtered by a truth function
237,148
def _PPIGuessPayloadClass ( p , ** kargs ) : if len ( p ) >= 4 : t , pfh_len = struct . unpack ( "<HH" , p [ : 4 ] ) cls = getPPIType ( t , "default" ) pfh_len += 4 out = cls ( p [ : pfh_len ] , ** kargs ) if ( out . payload ) : out . payload = conf . raw_layer ( out . payload . load ) if ( len ( p ) > pfh_len ) : out ...
This function tells the PacketListField how it should extract the TLVs from the payload . We pass cls only the length string pfh_len says it needs . If a payload is returned that means part of the sting was unused . This converts to a Raw layer and the remainder of p is added as Raw s payload . If there is no payload t...
237,149
def i2b ( self , pkt , x ) : if type ( x ) is str : x = bytes ( [ ord ( i ) for i in x ] ) return x
Convert internal value to internal value
237,150
def randval ( self ) : fmtt = self . fmt [ - 1 ] if fmtt in "BHIQ" : return { "B" : RandByte , "H" : RandShort , "I" : RandInt , "Q" : RandLong } [ fmtt ] ( ) elif fmtt == "s" : if self . fmt [ 0 ] in "0123456789" : l = int ( self . fmt [ : - 1 ] ) else : l = int ( self . fmt [ 1 : - 1 ] ) return RandBin ( l ) else : w...
Return a volatile object whose value is both random and suitable for this field
237,151
def str2bytes ( x ) : if type ( x ) is bytes : return x elif type ( x ) is str : return bytes ( [ ord ( i ) for i in x ] ) else : return str2bytes ( str ( x ) )
Convert input argument to bytes
237,152
def is_private_addr ( x ) : paddrs = [ '10.0.0.0/8' , '172.16.0.0/12' , '192.168.0.0/16' ] found = False for ipr in paddrs : try : if ipaddress . ip_address ( x ) in ipaddress . ip_network ( ipr ) : found = True continue except : break return found
Returns True if the IPv4 Address is an RFC 1918 private address .
237,153
def corrupt_bytes ( s , p = 0.01 , n = None ) : s = bytes ( s ) s = array . array ( "B" , s ) l = len ( s ) if n is None : n = max ( 1 , int ( l * p ) ) for i in random . sample ( range ( l ) , n ) : s [ i ] = ( s [ i ] + random . randint ( 1 , 255 ) ) % 256 return s . tobytes ( )
Corrupt a given percentage or number of bytes from bytes
237,154
def wireshark ( pktlist , * args ) : fname = get_temp_file ( ) wrpcap ( fname , pktlist ) subprocess . Popen ( [ conf . prog . wireshark , "-r" , fname ] + list ( args ) )
Run wireshark on a list of packets
237,155
def tdecode ( pkt , * args ) : if not args : args = [ "-V" ] fname = get_temp_file ( ) wrpcap ( fname , [ pkt ] ) subprocess . call ( [ "tshark" , "-r" , fname ] + list ( args ) )
Run tshark to decode and display the packet . If no args defined uses - V
237,156
def hexedit ( x ) : x = bytes ( x ) fname = get_temp_file ( ) with open ( fname , "wb" ) as f : f . write ( x ) subprocess . call ( [ conf . prog . hexedit , fname ] ) with open ( fname , "rb" ) as f : x = f . read ( ) return x
Run external hex editor on a packet or bytes . Set editor in conf . prog . hexedit
237,157
def _write_packet ( self , packet , sec = None , usec = None , caplen = None , wirelen = None ) : if caplen is None : caplen = len ( packet ) if wirelen is None : wirelen = caplen if sec is None or usec is None : t = time . time ( ) it = int ( t ) if sec is None : sec = it if usec is None : usec = int ( round ( ( t - i...
writes a single packet to the pcap file
237,158
def get_packet_time ( self , pkt ) : if pkt . sent_time : t = pkt . sent_time sec = int ( t ) else : t = pkt . time sec = int ( t ) usec = int ( round ( ( t - sec ) * 1000000 ) ) return ( sec , usec )
Return the second and micro - second timestamp components for a packet .
237,159
def zero_mutable_fields ( pkt , sending = False ) : if pkt . haslayer ( AH ) : pkt [ AH ] . icv = chr ( 0 ) * len ( pkt [ AH ] . icv ) else : raise TypeError ( 'no AH layer found' ) if pkt . version == 4 : pkt . tos = 0 pkt . flags = 0 pkt . ttl = 0 pkt . chksum = 0 immutable_opts = [ ] for opt in pkt . options : if op...
When using AH all mutable fields must be zeroed before calculating the ICV . See RFC 4302 Section 3 . 3 . 3 . 1 . Handling Mutable Fields .
237,160
def decrypt ( self , esp , key , icv_size = None ) : if icv_size is None : icv_size = self . icv_size if self . is_aead else 0 iv = esp . data [ : self . iv_size ] data = esp . data [ self . iv_size : len ( esp . data ) - icv_size ] icv = esp . data [ len ( esp . data ) - icv_size : ] if self . cipher : cipher = self ....
Decrypt an ESP packet
237,161
def igmpize ( self , ip = None , ether = None ) : if ( self . type != 0x11 ) : self . mrtime = 0 if ( self . adjust_ip ( ip ) == True ) : if ( self . adjust_ether ( ip , ether ) == True ) : return True return False
Called to explicitely fixup associated IP and Ethernet headers
237,162
def additionalAssignment ( MobileAllocation_presence = 0 , StartingTime_presence = 0 ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x3B ) c = ChannelDescription ( ) packet = a / b / c if MobileAllocation_presence is 1 : d = MobileAllocationHdr ( ieiMA = 0x72 , eightBitMA = 0x0 ) packet = packet / d if StartingT...
ADDITIONAL ASSIGNMENT Section 9 . 1 . 1
237,163
def assignmentComplete ( ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x29 ) c = RrCause ( ) packet = a / b / c return packet
ASSIGNMENT COMPLETE Section 9 . 1 . 3
237,164
def channelModeModify ( VgcsTargetModeIdentication_presence = 0 , MultiRateConfiguration_presence = 0 ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x8 ) c = ChannelDescription2 ( ) d = ChannelMode ( ) packet = a / b / c / d if VgcsTargetModeIdentication is 1 : e = VgcsTargetModeIdenticationHdr ( ieiVTMI = 0x01...
CHANNEL MODE MODIFY Section 9 . 1 . 5
237,165
def channelModeModifyAcknowledge ( ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x17 ) c = ChannelDescription2 ( ) d = ChannelMode ( ) packet = a / b / c / d return packet
CHANNEL MODE MODIFY ACKNOWLEDGE Section 9 . 1 . 6
237,166
def channelRelease ( BaRange_presence = 0 , GroupChannelDescription_presence = 0 , GroupCipherKeyNumber_presence = 0 , GprsResumption_presence = 0 , BaListPref_presence = 0 ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0xD ) c = RrCause ( ) packet = a / b / c if BaRange_presence is 1 : d = BaRangeHdr ( ieiBR = ...
CHANNEL RELEASE Section 9 . 1 . 7
237,167
def cipheringModeCommand ( ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x35 ) c = RrCause ( ) d = CipherModeSettingAndcipherResponse ( ) packet = a / b / c / d return packet
CIPHERING MODE COMMAND Section 9 . 1 . 9
237,168
def cipheringModeComplete ( MobileId_presence = 0 ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x32 ) packet = a / b if MobileId_presence is 1 : c = MobileIdHdr ( ieiMI = 0x17 , eightBitMI = 0x0 ) packet = packet / c return packet
CIPHERING MODE COMPLETE Section 9 . 1 . 10
237,169
def classmarkChange ( MobileStationClassmark3_presence = 0 ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x16 ) c = MobileStationClassmark2 ( ) packet = a / b / c if MobileStationClassmark3_presence is 1 : e = MobileStationClassmark3 ( ieiMSC3 = 0x20 ) packet = packet / e return packet
CLASSMARK CHANGE Section 9 . 1 . 11
237,170
def classmarkEnquiry ( ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x13 ) packet = a / b return packet
CLASSMARK ENQUIRY Section 9 . 1 . 12
237,171
def configurationChangeCommand ( ChannelMode_presence = 0 , ChannelMode_presence1 = 0 , ChannelMode_presence2 = 0 , ChannelMode_presence3 = 0 , ChannelMode_presence4 = 0 , ChannelMode_presence5 = 0 , ChannelMode_presence6 = 0 , ChannelMode_presence7 = 0 ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x30 ) c = M...
CONFIGURATION CHANGE COMMAND Section 9 . 1 . 12b
237,172
def configurationChangeAcknowledge ( ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x31 ) c = MobileId ( ) packet = a / b / c return packet
CONFIGURATION CHANGE ACKNOWLEDGE Section 9 . 1 . 12c
237,173
def frequencyRedefinition ( CellChannelDescription_presence = 0 ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x14 ) c = ChannelDescription ( ) d = MobileAllocation ( ) e = StartingTime ( ) packet = a / b / c / d / e if CellChannelDescription_presence is 1 : f = CellChannelDescriptionHdr ( ieiCCD = 0x62 , eight...
Frequency redefinition Section 9 . 1 . 13
237,174
def pdchAssignmentCommand ( ChannelDescription_presence = 0 , CellChannelDescription_presence = 0 , MobileAllocation_presence = 0 , StartingTime_presence = 0 , FrequencyList_presence = 0 , ChannelDescription_presence1 = 0 , FrequencyChannelSequence_presence = 0 , MobileAllocation_presence1 = 0 , PacketChannelDescriptio...
PDCH ASSIGNMENT COMMAND Section 9 . 1 . 13a
237,175
def gprsSuspensionRequest ( ) : a = TpPd ( pd = 0x6 ) b = MessageType ( ) c = Tlli ( ) d = RoutingAreaIdentification ( ) e = SuspensionCause ( ) packet = a / b / c / d / e return packet
GPRS SUSPENSION REQUEST Section 9 . 1 . 13b
237,176
def handoverComplete ( MobileTimeDifference_presence = 0 ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x2c ) c = RrCause ( ) packet = a / b / c if MobileTimeDifference_presence is 1 : d = MobileTimeDifferenceHdr ( ieiMTD = 0x77 , eightBitMTD = 0x0 ) packet = packet / d return packet
HANDOVER COMPLETE Section 9 . 1 . 16
237,177
def immediateAssignment ( ChannelDescription_presence = 0 , PacketChannelDescription_presence = 0 , StartingTime_presence = 0 ) : a = L2PseudoLength ( ) b = TpPd ( pd = 0x6 ) c = MessageType ( mesType = 0x3F ) d = PageModeAndDedicatedModeOrTBF ( ) packet = a / b / c / d if ChannelDescription_presence is 1 : f = Channel...
IMMEDIATE ASSIGNMENT Section 9 . 1 . 18
237,178
def immediateAssignmentExtended ( StartingTime_presence = 0 ) : a = L2PseudoLength ( ) b = TpPd ( pd = 0x6 ) c = MessageType ( mesType = 0x39 ) d = PageModeAndSpareHalfOctets ( ) f = ChannelDescription ( ) g = RequestReference ( ) h = TimingAdvance ( ) i = MobileAllocation ( ) packet = a / b / c / d / f / g / h / i if ...
IMMEDIATE ASSIGNMENT EXTENDED Section 9 . 1 . 19
237,179
def immediateAssignmentReject ( ) : a = L2PseudoLength ( l2pLength = 0x13 ) b = TpPd ( pd = 0x6 ) c = MessageType ( mesType = 0x3a ) d = PageModeAndSpareHalfOctets ( ) f = RequestReference ( ) g = WaitIndication ( ) h = RequestReference ( ) i = WaitIndication ( ) j = RequestReference ( ) k = WaitIndication ( ) l = Requ...
IMMEDIATE ASSIGNMENT REJECT Section 9 . 1 . 20
237,180
def measurementReport ( ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x15 ) c = MeasurementResults ( ) packet = a / b / c return packet
MEASUREMENT REPORT Section 9 . 1 . 21
237,181
def notificationResponse ( ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x26 ) c = MobileStationClassmark2 ( ) d = MobileId ( ) e = DescriptiveGroupOrBroadcastCallReference ( ) packet = a / b / c / d / e return packet
NOTIFICATION RESPONSE Section 9 . 1 . 21d
237,182
def rrCellChangeOrder ( ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x8 ) c = CellDescription ( ) d = NcModeAndSpareHalfOctets ( ) packet = a / b / c / d return packet
RR - CELL CHANGE ORDER Section 9 . 1 . 21e
237,183
def pagingRequestType1 ( MobileId_presence = 0 ) : a = L2PseudoLength ( ) b = TpPd ( pd = 0x6 ) c = MessageType ( mesType = 0x21 ) d = PageModeAndChannelNeeded ( ) f = MobileId ( ) packet = a / b / c / d / f if MobileId_presence is 1 : g = MobileIdHdr ( ieiMI = 0x17 , eightBitMI = 0x0 ) packet = packet / g h = P1RestOc...
PAGING REQUEST TYPE 1 Section 9 . 1 . 22
237,184
def pagingRequestType2 ( MobileId_presence = 0 ) : a = L2PseudoLength ( ) b = TpPd ( pd = 0x6 ) c = MessageType ( mesType = 0x22 ) d = PageModeAndChannelNeeded ( ) f = MobileId ( ) g = MobileId ( ) packet = a / b / c / d / f / g if MobileId_presence is 1 : h = MobileIdHdr ( ieiMI = 0x17 , eightBitMI = 0x0 ) packet = pa...
PAGING REQUEST TYPE 2 Section 9 . 1 . 23
237,185
def pagingRequestType3 ( ) : a = L2PseudoLength ( l2pLength = 0x13 ) b = TpPd ( pd = 0x6 ) c = MessageType ( mesType = 0x24 ) d = PageModeAndChannelNeeded ( ) e = TmsiPTmsi ( ) f = TmsiPTmsi ( ) g = TmsiPTmsi ( ) h = TmsiPTmsi ( ) i = P3RestOctets ( ) packet = a / b / c / d / e / f / g / h / i return packet
PAGING REQUEST TYPE 3 Section 9 . 1 . 24
237,186
def pagingResponse ( ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x27 ) c = CiphKeySeqNrAndSpareHalfOctets ( ) d = MobileStationClassmark2 ( ) e = MobileId ( ) packet = a / b / c / d / e return packet
PAGING RESPONSE Section 9 . 1 . 25
237,187
def partialRelease ( ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0xa ) c = ChannelDescription ( ) packet = a / b / c return packet
PARTIAL RELEASE Section 9 . 1 . 26
237,188
def partialReleaseComplete ( ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0xf ) packet = a / b return packet
PARTIAL RELEASE COMPLETE Section 9 . 1 . 27
237,189
def physicalInformation ( ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x2d ) c = TimingAdvance ( ) packet = a / b / c return packet
PHYSICAL INFORMATION Section 9 . 1 . 28
237,190
def rrInitialisationRequest ( ) : a = TpPd ( pd = 0x6 ) b = MessageType ( mesType = 0x3c ) c = CiphKeySeqNrAndMacModeAndChannelCodingRequest ( ) e = MobileStationClassmark2 ( ) f = Tlli ( ) g = ChannelRequestDescription ( ) h = GprsMeasurementResults ( ) packet = a / b / c / e / f / g / h return packet
RR Initialisation Request Section 9 . 1 . 28 . a
237,191
def systemInformationType1 ( ) : a = L2PseudoLength ( l2pLength = 0x15 ) b = TpPd ( pd = 0x6 ) c = MessageType ( mesType = 0x19 ) d = CellChannelDescription ( ) e = RachControlParameters ( ) f = Si1RestOctets ( ) packet = a / b / c / d / e / f return packet
SYSTEM INFORMATION TYPE 1 Section 9 . 1 . 31
237,192
def systemInformationType2 ( ) : a = L2PseudoLength ( l2pLength = 0x16 ) b = TpPd ( pd = 0x6 ) c = MessageType ( mesType = 0x1a ) d = NeighbourCellsDescription ( ) e = NccPermitted ( ) f = RachControlParameters ( ) packet = a / b / c / d / e / f return packet
SYSTEM INFORMATION TYPE 2 Section 9 . 1 . 32
237,193
def systemInformationType2bis ( ) : a = L2PseudoLength ( l2pLength = 0x15 ) b = TpPd ( pd = 0x6 ) c = MessageType ( mesType = 0x2 ) d = NeighbourCellsDescription ( ) e = RachControlParameters ( ) f = Si2bisRestOctets ( ) packet = a / b / c / d / e / f return packet
SYSTEM INFORMATION TYPE 2bis Section 9 . 1 . 33
237,194
def systemInformationType2ter ( ) : a = L2PseudoLength ( l2pLength = 0x12 ) b = TpPd ( pd = 0x6 ) c = MessageType ( mesType = 0x3 ) d = NeighbourCellsDescription2 ( ) e = Si2terRestOctets ( ) packet = a / b / c / d / e return packet
SYSTEM INFORMATION TYPE 2ter Section 9 . 1 . 34
237,195
def systemInformationType3 ( ) : a = L2PseudoLength ( l2pLength = 0x12 ) b = TpPd ( pd = 0x6 ) c = MessageType ( mesType = 0x1b ) d = CellIdentity ( ) e = LocalAreaId ( ) f = ControlChannelDescription ( ) g = CellOptionsBCCH ( ) h = CellSelectionParameters ( ) i = RachControlParameters ( ) j = Si3RestOctets ( ) packet ...
SYSTEM INFORMATION TYPE 3 Section 9 . 1 . 35
237,196
def systemInformationType4 ( ChannelDescription_presence = 0 , MobileAllocation_presence = 0 ) : a = L2PseudoLength ( ) b = TpPd ( pd = 0x6 ) c = MessageType ( mesType = 0x1C ) d = LocalAreaId ( ) e = CellSelectionParameters ( ) f = RachControlParameters ( ) packet = a / b / c / d / e / f if ChannelDescription_presence...
SYSTEM INFORMATION TYPE 4 Section 9 . 1 . 36
237,197
def systemInformationType5bis ( ) : a = L2PseudoLength ( l2pLength = 0x12 ) b = TpPd ( pd = 0x6 ) c = MessageType ( mesType = 0x5 ) d = NeighbourCellsDescription ( ) packet = a / b / c / d return packet
SYSTEM INFORMATION TYPE 5bis Section 9 . 1 . 38
237,198
def systemInformationType5ter ( ) : a = L2PseudoLength ( l2pLength = 0x12 ) b = TpPd ( pd = 0x6 ) c = MessageType ( mesType = 0x6 ) d = NeighbourCellsDescription2 ( ) packet = a / b / c / d return packet
SYSTEM INFORMATION TYPE 5ter Section 9 . 1 . 39
237,199
def systemInformationType6 ( ) : a = L2PseudoLength ( l2pLength = 0x0b ) b = TpPd ( pd = 0x6 ) c = MessageType ( mesType = 0x1e ) d = CellIdentity ( ) e = LocalAreaId ( ) f = CellOptionsBCCH ( ) g = NccPermitted ( ) h = Si6RestOctets ( ) packet = a / b / c / d / e / f / g return packet
SYSTEM INFORMATION TYPE 6 Section 9 . 1 . 40