/******************************************************************************
 * This file is part of a software distribution, which is furnished under the *
 * terms of a license.  Use of this software  by any means is subject to this *
 * license  and  signifies  the  acceptance of  the  licensing  terms  stated *
 * therein. Please see  the file LICENSE in the  top-level directory  of this *
 * software  distribution  for detailed copyright  disclaimers  and licensing *
 * terms.                                                                     *
 ******************************************************************************
 * Copryight (c) by Andreas S. Wetzel - All rights reserved.                  *
 ******************************************************************************/

/* $Id: vd_genvldat.c,v 1.2 2001/03/19 14:54:05 mickey Exp $ */

#include <vchat.h>
#include <proto_vchatd.h>

#include <sys/param.h>

/*** Externals ***/

extern VP vp;
extern VD vd;

extern struct sockaddr_in tel_sock_in;
extern signed long inichan;

/*** Code ***/

VLOGINDAT *genvldat(void)
{
	static VLOGINDAT vldat;

	BZERO((char *)&vldat, sizeof(VLOGINDAT));

	strcpy(vldat.uname, "TELNET");
	strcpy(vldat.nick, vp.nick);

	vldat.remote_user_ip = vd.cl_ip;

	return(&vldat);
}

VIDENT *ident(void)
{
	static VIDENT vid;

	vid.magic = htonl(VCLIENT_MAGIC);
	vid.proto = htonl(PROTO_REV);
	vid.type = htonl(((inichan << 8) & 0xffffff00) | (CLIENT_GATEWAY & 0x000000ff));
	sprintf(vid.ident, "VTG-%s-%s", OS_TYPE, VERSION);

	return(&vid);
}


syntax highlighted by Code2HTML, v. 0.9.1