Esempio n. 1
0
logging.info("DNS server(s): " +
             ', '.join(map(str, dns_values['v4'] + dns_values['v6'])))

idx = ipr.link_lookup(ifname='wwan0')[0]

ipr.flush_addr(index=idx)
ipr.link('set', index=idx, state='up')
ipr.addr('add', index=idx, address=ip_addr)

if not cfg.nodefaultroute:
    ipr.route('add', dst='default', priority=cfg.metric, oif=idx)

# Add DNS values to /etc/resolv.conf
if not cfg.noresolv:
    with open('/etc/resolv.conf', 'a') as resolv:
        resolv.write('\n# Added by xmm7360\n')
        for dns in dns_values['v4'] + dns_values['v6']:
            resolv.write('nameserver %s\n' % dns)

# this gives us way too much stuff, which we need
pscr = r.execute('UtaMsCallPsConnectReq',
                 rpc.pack_UtaMsCallPsConnectReq(),
                 is_async=True)
# this gives us a handle we need
dcr = r.execute('UtaRPCPsConnectToDatachannelReq',
                rpc.pack_UtaRPCPsConnectToDatachannelReq())

csr_req = pscr['body'][:-6] + dcr['body'] + b'\x02\x04\0\0\0\0'

r.execute('UtaRPCPSConnectSetupReq', csr_req)
Esempio n. 2
0
def test_pack_UtaRPCPsConnectToDatachannelReq():
    expected = '55180204000000180204000000002F73696F7363632F504349452F494F534D2F4950532F3000'
    assert rpc.pack_UtaRPCPsConnectToDatachannelReq(
        "/sioscc/PCIE/IOSM/IPS/0") == binascii.unhexlify(expected)