Changeset View
Changeset View
Standalone View
Standalone View
contrib/tcp_wrappers/ptx.c
Show All 29 Lines | |||||
#include "tcpd.h" | #include "tcpd.h" | ||||
/* Forward declarations. */ | /* Forward declarations. */ | ||||
static void ptx_sink(); | static void ptx_sink(); | ||||
/* tli_host - determine TLI endpoint info, PTX version */ | /* tli_host - determine TLI endpoint info, PTX version */ | ||||
void tli_host(request) | void tli_host(struct request_info *request) | ||||
struct request_info *request; | |||||
{ | { | ||||
static struct sockaddr_in client; | static struct sockaddr_in client; | ||||
static struct sockaddr_in server; | static struct sockaddr_in server; | ||||
/* | /* | ||||
* getpeerinaddr() was suggested by someone at Sequent. It seems to work | * getpeerinaddr() was suggested by someone at Sequent. It seems to work | ||||
* with connection-oriented (TCP) services such as rlogind and telnetd, | * with connection-oriented (TCP) services such as rlogind and telnetd, | ||||
* but it returns 0.0.0.0 with datagram (UDP) services. No problem: UDP | * but it returns 0.0.0.0 with datagram (UDP) services. No problem: UDP | ||||
Show All 28 Lines | if (SWAP_MODULE(request->fd, "sockmod", "timod") != 0) | ||||
tcpd_warn("replace sockmod by timod: %m"); | tcpd_warn("replace sockmod by timod: %m"); | ||||
if (request->sink != 0) | if (request->sink != 0) | ||||
request->sink = ptx_sink; | request->sink = ptx_sink; | ||||
} | } | ||||
} | } | ||||
/* ptx_sink - absorb unreceived IP datagram */ | /* ptx_sink - absorb unreceived IP datagram */ | ||||
static void ptx_sink(fd) | static void ptx_sink(int fd) | ||||
int fd; | |||||
{ | { | ||||
char buf[BUFSIZ]; | char buf[BUFSIZ]; | ||||
struct sockaddr sa; | struct sockaddr sa; | ||||
int size = sizeof(sa); | int size = sizeof(sa); | ||||
/* | /* | ||||
* Eat up the not-yet received datagram. Where needed, switch to the | * Eat up the not-yet received datagram. Where needed, switch to the | ||||
* socket programming interface. | * socket programming interface. | ||||
Show All 10 Lines |