version 1.26, 2001/04/18 14:15:00 |
version 1.26.2.1, 2001/09/27 19:03:54 |
|
|
#include "log.h" |
#include "log.h" |
#include "canohost.h" |
#include "canohost.h" |
|
|
void check_ip_options(int socket, char *ipaddr); |
static void check_ip_options(int, char *); |
|
|
/* |
/* |
* Return the canonical name of the host at the other end of the socket. The |
* Return the canonical name of the host at the other end of the socket. The |
* caller should free the returned string with xfree. |
* caller should free the returned string with xfree. |
*/ |
*/ |
|
|
char * |
static char * |
get_remote_hostname(int socket, int reverse_mapping_check) |
get_remote_hostname(int socket, int reverse_mapping_check) |
{ |
{ |
struct sockaddr_storage from; |
struct sockaddr_storage from; |
|
|
* exit here if we detect any IP options. |
* exit here if we detect any IP options. |
*/ |
*/ |
/* IPv4 only */ |
/* IPv4 only */ |
void |
static void |
check_ip_options(int socket, char *ipaddr) |
check_ip_options(int socket, char *ipaddr) |
{ |
{ |
u_char options[200]; |
u_char options[200]; |
|
|
* Returns the remote IP-address of socket as a string. The returned |
* Returns the remote IP-address of socket as a string. The returned |
* string must be freed. |
* string must be freed. |
*/ |
*/ |
char * |
static char * |
get_socket_address(int socket, int remote, int flags) |
get_socket_address(int socket, int remote, int flags) |
{ |
{ |
struct sockaddr_storage addr; |
struct sockaddr_storage addr; |
|
|
|
|
/* Returns the local/remote port for the socket. */ |
/* Returns the local/remote port for the socket. */ |
|
|
int |
static int |
get_sock_port(int sock, int local) |
get_sock_port(int sock, int local) |
{ |
{ |
struct sockaddr_storage from; |
struct sockaddr_storage from; |
|
|
|
|
/* Returns remote/local port number for the current connection. */ |
/* Returns remote/local port number for the current connection. */ |
|
|
int |
static int |
get_port(int local) |
get_port(int local) |
{ |
{ |
/* |
/* |