tli-sequent.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Warning - this relies heavily on the TLI implementation in PTX 2.X and will
* probably not work under PTX 4.
*
* Author: Tim Wright, Sequent Computer Systems Ltd., UK.
*
* Modified slightly to conform to the new internal interfaces - Wietse
*/
#ifndef lint
static char sccsid[] = "@(#) tli-sequent.c 1.1 94/12/28 17:42:51";
#endif
#ifdef TLI_SEQUENT
/* System libraries. */
#include <stdio.h>
#include <syslog.h>
#include <errno.h>
#include <string.h>
extern int errno;
extern char *sys_errlist[];
extern int sys_nerr;
extern int t_errno;
extern char *t_errlist[];
extern int t_nerr;
/* Local stuff. */
#include "tcpd.h"
#include "tli-sequent.h"
/* Forward declarations. */
static char *tli_error();
static void tli_sink();
/* tli_host - determine endpoint info */
struct request_info *request;
{
static struct sockaddr_in client;
static struct sockaddr_in server;
struct _ti_user *tli_state_ptr;
union T_primitives *TSI_prim_ptr;
int len;
/*
* Use DNS and socket routines for name and address conversions.
*/
/*
* Find out the client address using getpeerinaddr(). This call is the
*/
return;
}
/* Call TLI utility routine to get information on endpoint */
return;
/* UDP - may need to get address the hard way */
/* The UDP endpoint is not connected so we didn't get the */
/* remote address - get it the hard way ! */
/* Look at the control part of the top message on the stream */
/* we don't want to remove it from the stream so we use I_PEEK */
/* Don't even look at the data */
case -1:
return;
case 0:
/* No control part - we're hosed */
return;
default:
/* FALL THROUGH */
;
}
/* Can we even check the PRIM_type ? */
tcpd_warn("UDP control info garbage");
return;
}
tcpd_warn("wrong type for UDP control info");
return;
}
/* Validate returned unitdata indication packet */
tcpd_warn("UDP control info garbaged");
return;
}
/* Extract the address */
}
}
else
}
/* tli_error - convert tli error number to text */
static char *tli_error()
{
static char buf[40];
return (buf);
} else {
}
} else {
return (buf);
} else {
return (sys_errlist[errno]);
}
}
}
/* tli_sink - absorb unreceived datagram */
int fd;
{
struct t_unitdata *unit;
int flags;
/*
* Something went wrong. Absorb the datagram to keep inetd from looping.
* Allocate storage for address, control and data. If that fails, sleep
* for a couple of seconds in an attempt to keep inetd from looping too
* fast.
*/
sleep(5);
} else {
}
}
#endif /* TLI_SEQUENT */