Join Today
+ Reply to Thread
Results 1 to 2 of 2

Thread: NAPI Decoded?

  1. Default NAPI Decoded?

    I hope I'm not reinventing the wheel here, but is the NAPI decoded? I couldn't find anything on it but I thought I would feel stupid to have gotten it all worked out only to find it was already done.

    I'm screwing with my phone and I want to keep my internet connection up as well as have it auto start when the phone boots. I don't care to deal with the java and especially the dialogs poping up (I'm assuming that part is in the qt-napi library and not the ezx-napi library, but maybe I'm wrong).

    Daniel

  2. Default Re: NAPI Decoded?

    Just of note, this is the conversation during a connect

    Code:
    [4116cc38] connect(10, {sa_family=AF_UNIX, path="/tmp/dsm.ipc"}, 14) = 0
    [4116c8c0] write(10, "\1\20\0\0\231\2\0\0gE\213k\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 120) = 120
    [410fcfd8] select(11, [10], NULL, NULL, {210, 0}) = 1 (in [10], left {210, 0})
    [4116cce8] recv(10, "\1\20\0\0\0\0\0\0\0\0\0\0", 12, 0) = 12
    [4116cc38] connect(11, {sa_family=AF_UNIX, path="/tmp/dsm.ipc"}, 14) = 0
    [4116c8c0] write(11, "\2\20\0\0\231\2\0\0gE\213k\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 120) = 120
    [410fcfd8] select(11, [10], NULL, NULL, {210, 0}) = 1 (in [10], left {210, 0})
    [4116cce8] recv(10, "\2\20\0\0\0\0\0\0\0\0\0\0", 12, 0) = 12
    [41103910] getsockname(11, {sa_family=AF_UNIX, path=@}, [2]) = 0
    [411038f0] getpeername(11, {sa_family=AF_UNIX, path=@}, [15]) = 0
    [41103cd0] setsockopt(11, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
    [4116c8c0] write(10, "\3\20\0\0\231\2\0\0gE\213k\0\0\0\0T-Mobile Internet\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 120) = 120
    [410fcfd8] select(11, [10], NULL, NULL, {210, 0}) = 1 (in [10], left {210, 0})
    [4116cce8] recv(10, "\3\20\0\0\0\1\0\0\0\0\0\0", 12, 0) = 12
    [410fc934] ioctl(11, FIONREAD, [112])   = 0
    [4116c970] read(11, "\1\0\1\1internet2.voicestream.com\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\1\0\0\0\0", 4096) = 112
    [410fc934] ioctl(11, FIONREAD, [0])     = 0
    [410fc934] ioctl(11, FIONREAD, [0])     = 0
    [410fc934] ioctl(11, FIONREAD, [112])   = 0
    [4116c970] read(11, "\3\0\1\1internet2.voicestream.com\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\1\0\0\0\0\20\0\1\1internet2.voicestream.com\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\1\0\0\0\0", 4096) = 224
    [410fc934] ioctl(11, FIONREAD, [0])     = 0
    [410fc934] ioctl(11, FIONREAD, [0])     = 0
    [410fc934] ioctl(11, FIONREAD, [0])     = 0
    [4116c8c0] write(10, "\5\20\0\0\231\2\0\0gE\213k\0\0\0\0\1\0\0\0internet2.voicestream.com\0\6\0001\0\0\0\0\0\0\0\f\0\0\0\f\0\0\0!\0\0\0\250I\6\0P^\6\0X\372\5\0\21\0\0\0\250I\6\0$~\25AP\0\0\0\21\0\0\0\1\0\0\0\270\307\5\0\20\0\0\0\21\0\0\0P\323\5\0", 120) = 120
    [410fcfd8] select(11, [10], NULL, NULL, {210, 0}) = 1 (in [10], left {210, 0})
    [4116cce8] recv(10, "\5\20\0\0\0\0\0\0\0\0\0\0", 12, 0) = 12
    [4116ca20] close(10)                    = 0
    [4116ca20] close(11)                    = 0
    
    
    
    And this is a disconnect:
    
    
    
    [4116cc38] connect(10, {sa_family=AF_UNIX, path="/tmp/dsm.ipc"}, 14) = 0
    [4116c8c0] write(10, "\1\20\0\0\236\2\0\0gE\213k\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 120) = 120
    [410fcfd8] select(11, [10], NULL, NULL, {210, 0}) = 1 (in [10], left {210, 0})
    [4116cce8] recv(10, "\1\20\0\0\0\0\0\0\0\0\0\0", 12, 0) = 12
    [4116cc38] connect(11, {sa_family=AF_UNIX, path="/tmp/dsm.ipc"}, 14) = 0
    [4116c8c0] write(11, "\2\20\0\0\236\2\0\0gE\213k\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 120) = 120
    [410fcfd8] select(11, [10], NULL, NULL, {210, 0}) = 1 (in [10], left {210, 0})
    [4116cce8] recv(10, "\2\20\0\0\0\0\0\0\0\0\0\0", 12, 0) = 12
    [41103910] getsockname(11, {sa_family=AF_UNIX, path=@}, [2]) = 0
    [411038f0] getpeername(11, {sa_family=AF_UNIX, path=@}, [15]) = 0
    [41103cd0] setsockopt(11, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
    [410fc934] ioctl(11, FIONREAD, [112])   = 0
    [4116c970] read(11, "\3\0\0\1internet2.voicestream.com\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\1\10\0\0\0", 4096) = 112
    [410fc934] ioctl(11, FIONREAD, [0])     = 0
    [410fc934] ioctl(11, FIONREAD, [0])     = 0
    [4116c8c0] write(10, "\6\20\0\0\236\2\0\0gE\213k\0\0\0\0\1\0\0\0internet2.voicestream.com\0\4\0001\0\0\0\0\0\0\0\240\264\4\0000\265\4\0h\256\4\0008\216\4\0p\264\4\0X\264\4\0!\0\0\0\370\277\5\0\240\352\5\0\0\0\0\0\21\0\0\0$~\25A$~\25A\20\0\0\0\20\0\0\0\1\0\0\0", 120) = 120
    [410fcfd8] select(11, [10], NULL, NULL, {210, 0}) = 1 (in [10], left {210, 0})
    [4116cce8] recv(10, "\6\20\0\0\0\0\0\0\0\0\0\0", 12, 0) = 12
    [410fc934] ioctl(11, FIONREAD, [112])   = 0
    [4116c970] read(11, "\4\0\0\1internet2.voicestream.com\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\1\10\0\0\0", 4096) = 112
    [410fc934] ioctl(11, FIONREAD, [0])     = 0
    [410fc934] ioctl(11, FIONREAD, [0])     = 0
    [410fc934] ioctl(11, FIONREAD, [112])   = 0
    [4116c970] read(11, "\5\0\0\1internet2.voicestream.com\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\1\10\0\0\0", 4096) = 112
    [410fc934] ioctl(11, FIONREAD, [0])     = 0
    [410fc934] ioctl(11, FIONREAD, [0])     = 0
    [4116ca20] close(10)                    = 0
    [4116ca20] close(11)                    = 0

    I'm still a newbie here so this was good progress for me, lol!

    In both cases, it looks like socket 10 is a command channel and 11 is a status channel (i.e., results). It almost looks like you could just send it commands and not pay attention to the results (since I don't want to throw up dialogs), except that after it seems to get confirmation that the connection was sucessfull (my guess is that it's the octal 20 opcode in the middle of that last big packet recieved), then the command channel sends some ugly-arse packet with all kinds of crap in it (the opcode 5, 20) followed by an ack from the dsm.

    Ok, I'm off to sleep now, I'm supposed to be at work in 2 and 1/2 hours. This stuff is addictive! Input more than welcome

    Daniel


 
+ Reply to Thread

Similar Threads

  1. GPS: A780 LAPI interface decoded
    By Floe in forum Development
    Replies: 18
    Last Post: 06-01-2006, 08:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Single Sign On provided by vBSSO

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1