def get_rsn_ie(defcipher, defauth, data):
answers = dict()<EOL>answers['<STR_LIT:version>'] = data[<NUM_LIT:0>] + (data[<NUM_LIT:1>] << <NUM_LIT:8>)<EOL>data = data[<NUM_LIT:2>:]<EOL>if len(data) < <NUM_LIT:4>:<EOL><INDENT>answers['<STR_LIT>'] = answers['<STR_LIT>'] = defcipher<EOL>return answers<EOL><DEDENT>answers['<STR_LIT>'] = get_cipher(data)<EOL>data = data[<NUM_LIT:4>:]<EOL>if len(data) < <NUM_LIT:2>:<EOL><INDENT>answers['<STR_LIT>'] = defcipher<EOL>return answers<EOL><DEDENT>count = data[<NUM_LIT:0>] | (data[<NUM_LIT:1>] << <NUM_LIT:8>)<EOL>if <NUM_LIT:2> + (count * <NUM_LIT:4>) > len(data):<EOL><INDENT>answers['<STR_LIT>'] = data<EOL>return answers<EOL><DEDENT>answers['<STR_LIT>'] = '<STR_LIT:U+0020>'.join(get_cipher(data[<NUM_LIT:2> + (i * <NUM_LIT:4>):]) for i in range(count))<EOL>data = data[<NUM_LIT:2> + (count * <NUM_LIT:4>):]<EOL>if len(data) < <NUM_LIT:2>:<EOL><INDENT>answers['<STR_LIT>'] = defauth<EOL>return answers<EOL><DEDENT>count = data[<NUM_LIT:0>] | (data[<NUM_LIT:1>] << <NUM_LIT:8>)<EOL>if <NUM_LIT:2> + (count * <NUM_LIT:4>) > len(data):<EOL><INDENT>answers['<STR_LIT>'] = data<EOL>return answers<EOL><DEDENT>answers['<STR_LIT>'] = '<STR_LIT:U+0020>'.join(get_auth(data[<NUM_LIT:2> + (i * <NUM_LIT:4>):]) for i in range(count))<EOL>data = data[<NUM_LIT:2> + (count * <NUM_LIT:4>):]<EOL>if len(data) >= <NUM_LIT:2>:<EOL><INDENT>capa = data[<NUM_LIT:0>] | (data[<NUM_LIT:1>] << <NUM_LIT:8>)<EOL>answers['<STR_LIT>'] = list()<EOL>if capa & <NUM_LIT>:<EOL><INDENT>answers['<STR_LIT>'].append('<STR_LIT>')<EOL><DEDENT>if capa & <NUM_LIT>:<EOL><INDENT>answers['<STR_LIT>'].append('<STR_LIT>')<EOL><DEDENT>case = {<NUM_LIT:0>: '<STR_LIT>', <NUM_LIT:1>: '<STR_LIT>', <NUM_LIT:2>: '<STR_LIT>', <NUM_LIT:3>: '<STR_LIT>'}.get((capa & <NUM_LIT>) >> <NUM_LIT:2>)<EOL>if case:<EOL><INDENT>answers['<STR_LIT>'].append(case)<EOL><DEDENT>case = {<NUM_LIT:0>: '<STR_LIT>', <NUM_LIT:1>: '<STR_LIT>', <NUM_LIT:2>: '<STR_LIT>', <NUM_LIT:3>: '<STR_LIT>'}.get((capa & <NUM_LIT>) >> <NUM_LIT:4>)<EOL>if case:<EOL><INDENT>answers['<STR_LIT>'].append(case)<EOL><DEDENT>if capa & <NUM_LIT>:<EOL><INDENT>answers['<STR_LIT>'].append('<STR_LIT>')<EOL><DEDENT>if capa & <NUM_LIT>:<EOL><INDENT>answers['<STR_LIT>'].append('<STR_LIT>')<EOL><DEDENT>if capa & <NUM_LIT>:<EOL><INDENT>answers['<STR_LIT>'].append('<STR_LIT>')<EOL><DEDENT>if capa & <NUM_LIT>:<EOL><INDENT>answers['<STR_LIT>'].append('<STR_LIT>')<EOL><DEDENT>if capa & <NUM_LIT>:<EOL><INDENT>answers['<STR_LIT>'].append('<STR_LIT>')<EOL><DEDENT>answers['<STR_LIT>'].append('<STR_LIT>'.format(capa))<EOL>data = data[<NUM_LIT:2>:]<EOL><DEDENT>invalid = False<EOL>if len(data) >= <NUM_LIT:2>:<EOL><INDENT>pmkid_count = data[<NUM_LIT:0>] | (data[<NUM_LIT:1>] << <NUM_LIT:8>)<EOL>if len(data) >= <NUM_LIT:2> + <NUM_LIT:16> * pmkid_count:<EOL><INDENT>answers['<STR_LIT>'] = pmkid_count<EOL>data = data[<NUM_LIT:2> + <NUM_LIT:16> * pmkid_count:]<EOL><DEDENT>else:<EOL><INDENT>invalid = True<EOL><DEDENT><DEDENT>if len(data) >= <NUM_LIT:4> and not invalid:<EOL><INDENT>answers['<STR_LIT>'] = get_cipher(data)<EOL>data = data[<NUM_LIT:4>:]<EOL><DEDENT>if data:<EOL><INDENT>answers['<STR_LIT>'.format(len(data))] = '<STR_LIT:U+0020>'.join(format(x, '<STR_LIT>') for x in data)<EOL><DEDENT>return answers<EOL>
http://git.kernel.org/cgit/linux/kernel/git/jberg/iw.git/tree/scan.c?id=v3.17#n441.

    Positional arguments:
    defcipher -- default cipher if not in data (string).
    defauth -- default authentication suites if not in data (string).
    data -- bytearray data to read.

    Returns:
    Dict.