Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: sam.eads@hboc.com (Sam Eads)
Subject: Re: Finding out LAT source name
Date: 11 Jan 1995 19:22:56 GMT	[thread overview]
Message-ID: <3f1b6g$oib@news.hboc.com> (raw)
In-Reply-To: 3eunql$n3q@ulowell.uml.edu

In article <3eunql$n3q@ulowell.uml.edu>, oneill@cs.uml.edu (Brian 'Doc' O'Neill) says:
>
>I'm in the process of porting some shadow password stuff (John F. Haugh II's
>implementation) to OSF/1 V3.0 on the Alpha, and noticed that by default
>OSF/1 doesn't log the source LAT host when a person logs in, nor can I find
>the routines which can get them which were under Ultrix. Does anyone know
>how to determine the source host under OSF/1??
>
>===========================================================================
>Brian O'Neill - Systems Manager, Computer Science         oneill@cs.uml.edu
>University of Massachusetts at Lowell        Chief Editor, InterWeb Journal
>(508) 934-3645                            http://interweb.uml.edu/InterWeb/
>"Nothing's the same anymore." - Sinclair, Babylon 5, _Chrysalis_

Brian,

Listed below is an example program of how to get the information you
need.  I haven't figured out if there's any way to get the destination
service name.  You might want that if you had more than one service
defined on the system and wanted to know which one a user had connected
to.  I originally got parts of this example from DEC through DSNLink, so
I guess I should give them some credit too. (The DSNLink people are
sometimes VERY helpful).  As far as I know, this stuff isn't documented
anywhere.

ALSO NOTE: Since LAT was completely re-implemented in OSF/1 V3.0, you
have to use different code for OSF/1 V2.0.  THIS CODE WILL ONLY WORK
FOR V3.0 OSF/1.  I have the 2.0 code if anyone needs it.

Hope this helps.


Here's the code :

/*
** Get LAT connection information
**
** This code is for OSF/1 V3.0 ONLY
**
** Written by someone at Digital Equipment Corporation
**
** Adapted by Sam Eads (HBO & Company, Atlanta, GA, U.S.A)
*/

#include        <stropts.h>
#include        <lat/streams/latioc.h>
#include        <sys/fcntl.h>
#include        <sys/stat.h>
struct  stat    statb;


main(agc,arg)
int agc;
char **arg;
{
        int tfd;
        lats_info latioctl_port;
        struct strioctl strioctl;

        tfd = open("/dev/streams/lat",O_RDWR);
        if(tfd < 0) {
                perror("openning /dev/streams/lat");
                exit(0);
                }
        if(fstat(0,&statb) < 0) {
                perror("stating fd 0");
                exit(0);
                }
        bzero(&latioctl_port,sizeof(lats_info));
        latioctl_port.info_dev = minor(statb.st_rdev);
        strioctl.ic_cmd = LIOC_INFO_SHOW;
        strioctl.ic_len = sizeof(lats_info);
        strioctl.ic_dp = (char *)&latioctl_port;
        if(ioctl(tfd,I_STR,&strioctl) < 0) {
                perror("on latioctl call");
                exit(0);
                }
        close(tfd);
        printf("lcl_svc=%s\n",latioctl_port.lcl_service);
        printf("lcl_por=%s\n",latioctl_port.lcl_port);
        printf("rmt_svc=%s\n",latioctl_port.rmt_service);
        printf("rmt_por=%s\n",latioctl_port.rmt_port);
        printf("rmt_ond=%s\n",latioctl_port.rmt_node);
}


Sam Eads
Sr. Systems Programmer
HBO & Company, Inc.
Atlanta, GA USA
Email: sam.eads@hboc.com


  reply	other threads:[~1995-01-11 19:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-01-10 19:40 Finding out LAT source name Brian 'Doc' O'Neill
1995-01-11 19:22 ` Sam Eads [this message]
1995-01-12  3:11 ` Scott Ruch
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox