• How to use nlist to get kernel name list ?

    From cun gong@21:1/5 to All on Sun Jan 8 18:36:01 2017
    I'm writing a program to trace the tcp socket like trpt(8), I refer to Freebsd's trpt.c source code, which calls the following code to see tcp_debug and tcp_debx pointer location (definition in netinet/tcp_debug.h):

    struct nlist nl[3];
    nl[0].n_name = strdup("_tcp_debug");
    nl[1].n_name = strdup("_tcp_debx");
    if (nlist(syst, nl) < 0 || !nl[0].n_value)
    ...

    But the n_name of "_tcp_debug" or "_tcp_debx" is invalid on AIX, who can tell me what's the n_name corresponding to the tcp_debug and tcp_debx on AIX ? Many thanks !

    In addition, I can see the following output from kdb:

    tcpdbg

    ---- TCP_DEBUG ----(@ F1000E0000C3BB00)----
    (tcp_debx= 88)
    ...

    'F1000E0000C3BB00' is I want to get through nlist via n_name.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lorinczy Zsigmond@21:1/5 to All on Tue Jan 10 12:47:44 2017
    Tried on linux, it didn't compile, due to lack of sys/protosw.h
    Tried on Aix6.1, it didn't compile, due to lack of err.h

    What platform did you use?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)