Apache HTTPD
Macros | Functions

Macros

#define REMOTE_HOST   (0)
 
#define REMOTE_NAME   (1)
 
#define REMOTE_NOLOOKUP   (2)
 
#define REMOTE_DOUBLE_REV   (3)
 

Functions

const charap_get_useragent_host (request_rec *req, int type, int *str_is_ip)
 
const charap_get_remote_host (conn_rec *conn, void *dir_config, int type, int *str_is_ip)
 

Detailed Description

Macro Definition Documentation

◆ REMOTE_DOUBLE_REV

#define REMOTE_DOUBLE_REV   (3)

REMOTE_DOUBLE_REV will always force a DNS lookup, and also force a double reverse lookup, regardless of the HostnameLookups setting. The result is the (double reverse checked) hostname, or NULL if any of the lookups fail.

Definition at line 118 of file http_core.h.

◆ REMOTE_HOST

#define REMOTE_HOST   (0)

REMOTE_HOST returns the hostname, or NULL if the hostname lookup fails. It will force a DNS lookup according to the HostnameLookups setting.

Definition at line 100 of file http_core.h.

◆ REMOTE_NAME

#define REMOTE_NAME   (1)

REMOTE_NAME returns the hostname, or the dotted quad if the hostname lookup fails. It will force a DNS lookup according to the HostnameLookups setting.

Definition at line 106 of file http_core.h.

◆ REMOTE_NOLOOKUP

#define REMOTE_NOLOOKUP   (2)

REMOTE_NOLOOKUP is like REMOTE_NAME except that a DNS lookup is never forced.

Definition at line 111 of file http_core.h.

Function Documentation

◆ ap_get_remote_host()

const char * ap_get_remote_host ( conn_rec conn,
void *  dir_config,
int  type,
int str_is_ip 
)

Lookup the remote client's DNS name or IP address

Parameters
connThe current connection
dir_configThe directory config vector from the request
typeThe type of lookup to perform. One of:
    REMOTE_HOST returns the hostname, or NULL if the hostname
                lookup fails.  It will force a DNS lookup according to the
                HostnameLookups setting.
    REMOTE_NAME returns the hostname, or the dotted quad if the
                hostname lookup fails.  It will force a DNS lookup according
                to the HostnameLookups setting.
    REMOTE_NOLOOKUP is like REMOTE_NAME except that a DNS lookup is
                    never forced.
    REMOTE_DOUBLE_REV will always force a DNS lookup, and also force
                  a double reverse lookup, regardless of the HostnameLookups
                  setting.  The result is the (double reverse checked)
                  hostname, or NULL if any of the lookups fail.
str_is_ipunless NULL is passed, this will be set to non-zero on output when an IP address string is returned
Returns
The remote hostname (based on the connection client_ip)

Definition at line 957 of file core.c.

◆ ap_get_useragent_host()

const char * ap_get_useragent_host ( request_rec req,
int  type,
int str_is_ip 
)

Lookup the remote user agent's DNS name or IP address

Parameters
reqThe current request
typeThe type of lookup to perform. One of:
    REMOTE_HOST returns the hostname, or NULL if the hostname
                lookup fails.  It will force a DNS lookup according to the
                HostnameLookups setting.
    REMOTE_NAME returns the hostname, or the dotted quad if the
                hostname lookup fails.  It will force a DNS lookup according
                to the HostnameLookups setting.
    REMOTE_NOLOOKUP is like REMOTE_NAME except that a DNS lookup is
                    never forced.
    REMOTE_DOUBLE_REV will always force a DNS lookup, and also force
                  a double reverse lookup, regardless of the HostnameLookups
                  setting.  The result is the (double reverse checked)
                  hostname, or NULL if any of the lookups fail.
str_is_ipunless NULL is passed, this will be set to non-zero on output when an IP address string is returned
Returns
The remote hostname (based on the request useragent_ip)

Definition at line 1036 of file core.c.