Changeset View
Changeset View
Standalone View
Standalone View
contrib/tcp_wrappers/rfc931.c
Show All 38 Lines | |||||
#define ANY_PORT 0 /* Any old port will do */ | #define ANY_PORT 0 /* Any old port will do */ | ||||
int rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */ | int rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */ | ||||
static jmp_buf timebuf; | static jmp_buf timebuf; | ||||
/* fsocket - open stdio stream on top of socket */ | /* fsocket - open stdio stream on top of socket */ | ||||
static FILE *fsocket(domain, type, protocol) | static FILE *fsocket(int domain, int type, int protocol) | ||||
int domain; | |||||
int type; | |||||
int protocol; | |||||
{ | { | ||||
int s; | int s; | ||||
FILE *fp; | FILE *fp; | ||||
if ((s = socket(domain, type, protocol)) < 0) { | if ((s = socket(domain, type, protocol)) < 0) { | ||||
tcpd_warn("socket: %m"); | tcpd_warn("socket: %m"); | ||||
return (0); | return (0); | ||||
} else { | } else { | ||||
Show All 9 Lines | |||||
static void timeout(int sig) | static void timeout(int sig) | ||||
{ | { | ||||
longjmp(timebuf, sig); | longjmp(timebuf, sig); | ||||
} | } | ||||
/* rfc931 - return remote user name, given socket structures */ | /* rfc931 - return remote user name, given socket structures */ | ||||
void rfc931(rmt_sin, our_sin, dest) | |||||
#ifdef INET6 | #ifdef INET6 | ||||
struct sockaddr *rmt_sin; | void rfc931(struct sockaddr *rmt_sin, struct sockaddr *our_sin, char *dest) | ||||
struct sockaddr *our_sin; | |||||
#else | #else | ||||
struct sockaddr_in *rmt_sin; | void rfc931(struct sockaddr_in *rmt_sin, struct sockaddr_in *our_sin, | ||||
struct sockaddr_in *our_sin; | char *dest) | ||||
#endif | #endif | ||||
char *dest; | |||||
{ | { | ||||
unsigned rmt_port; | unsigned rmt_port; | ||||
unsigned our_port; | unsigned our_port; | ||||
#ifdef INET6 | #ifdef INET6 | ||||
struct sockaddr_storage rmt_query_sin; | struct sockaddr_storage rmt_query_sin; | ||||
struct sockaddr_storage our_query_sin; | struct sockaddr_storage our_query_sin; | ||||
int alen; | int alen; | ||||
#else | #else | ||||
▲ Show 20 Lines • Show All 140 Lines • Show Last 20 Lines |