[comp.unix.ultrix] How do I get lat info from C?

john@dekalb.UUCP (John Cothran) (03/05/91)

   The lat.h include file has several structures defined with lots of goodies.
In particular:

/*
 * LAT parameters data structure for LAT_SERVPORT.
 */
struct lat_servport {
    u_char lsp_name[17];		/* LAT server name */
    u_char lsp_port[17];		/* LAT server port name */
    u_char lsp_serv[17];		/* LAT destination */
    u_char lsp_flags;			/* LAT flags */
#define LSP_DEFAULT_SERVICE	1	/* serve the default service */
#define LSP_HIC			2	/* terminal is for HIC */
#define LSP_APPL_SERVICE	3	/* terminal is for appl service */
    dev_t lsp_dev;			/* LAT tty number */
};

My question is what functions can I call to get this info?  I want to write a
program that will list all users and the server/port they are coming in on.
I assume it can be done since "w" now shows the server name.

   Thanks in advance.  John.

--
  John Cothran - DeKalb College - gatech!dekalb!john - john@dekalb

thomas@mipsbx.lkg.dec.com (Matt Thomas) (03/10/91)

In article <1226@dekalb.UUCP> john@dekalb.UUCP (John Cothran) writes:
>   The lat.h include file has several structures defined with lots of goodies.
>In particular:
>
>[...]
>
>My question is what functions can I call to get this info?  I want to write a
>program that will list all users and the server/port they are coming in on.
>I assume it can be done since "w" now shows the server name.

Actually, login does a LIOCTTYI ioctl (on the LAT tty fd) and stores the
resultant information in the wtmp/utmp files from which w and last display
the server name.  lcp(8) -p uses LIOCGSRVPRT ioctl on (AF_LAT, SOCK_DGRAM,
LATPROTO_CTL) socket with lsp_dev set to the LAT tty to be queried.

-- 
Matt Thomas                     Internet:   thomas@wrl.dec.com
DECnet-ULTRIX Development       UUCP:       ...!decwrl!thomas
Digital Equipment Corporation   Disclaimer: This message reflects my own
Littleton, MA                               warped views, etc.