obtaining connecting client addr under TLI

Douglas C. Schmidt schmidt at indetech.com
Wed Aug 29 03:21:53 AEST 1990


Hi,

	I've got a quick question regarding the use of TLI.  Using BSD sockets
it is possible to determine the address (and thereby retrieve the hostname) of
a connecting client, i.e. (stripped of error handling, etc),

----------------------------------------
	int 		   accept_fd;
	int                server_fd;
	struct sockaddr_in client_addr;
	int                client_len = sizeof client_addr;
	struct hostent	  *hp, *gethostbyaddr ();
	...
	
	memset ((char *) &client_addr, 0, sizeof client_addr);
	client_len = sizeof client_addr;
	accept_fd = accept (server_fd, &client_addr, &client_len);
	hp = gethostbyaddr (client_addr.sin_addr, client_len, AF_INET);
	printf ("client name = %s\n", hp->h_name);
----------------------------------------	

	Can anyone please tell me the equivalent calls to do this using TLI.
It isn't clear from the manual how the connecting client address is returned,
e.g., via t_bind or t_accept.

	thanks in advance!
	
		Doug
-- 
____*_  Douglas C. Schmidt          schmidt at indetech.com
\  / /  Independence Technologies   {sun,sharkey,pacbell}!indetech!schmidt
 \/ /   42705 Lawrence Place        FAX: 415 438-2034
  \/    Fremont, CA 94538           Voice: 415 438-2023



More information about the Comp.unix.questions mailing list