* Return the default port from the current request
* @param r The current request
* @return The current port
- * @deffunc unsigned short ap_run_default_port(const request_rec *r)
+ * @deffunc apr_port_t ap_run_default_port(const request_rec *r)
*/
-AP_DECLARE_HOOK(unsigned short,default_port,(const request_rec *))
+AP_DECLARE_HOOK(apr_port_t,default_port,(const request_rec *))
#ifdef __cplusplus
}
/** The bound address, for this server */
apr_in_addr host_addr;
/** The bound port, for this server */
- unsigned short host_port;
+ apr_port_t host_port;
/** The name given in <VirtualHost> */
char *virthost;
};
/** The server hostname */
char *server_hostname;
/** for redirects, etc. */
- unsigned short port;
+ apr_port_t port;
/* Log files --- note that transfer log is now in the modules... */
* @param port The port the server is running on
* @param r The current request
* @return The server's hostname
- * @deffunc char *ap_construct_server(apr_pool_t *p, const char *hostname, unsiged port, const request_rec *r)
+ * @deffunc char *ap_construct_server(apr_pool_t *p, const char *hostname, apr_port_t port, const request_rec *r)
*/
AP_DECLARE(char *) ap_construct_server(apr_pool_t *p, const char *hostname,
- unsigned port, const request_rec *r);
+ apr_port_t port, const request_rec *r);
/**
* Escape a shell command
* @param p The pool to allocate out of
* @param hostname The hostname to parse
* @param port The port found in the hostname
* @return The address of the server
- * @deffunc unsigned long ap_get_virthost_addr(char *hostname, unsigned shor *port)
+ * @deffunc unsigned long ap_get_virthost_addr(char *hostname, apr_port_t *port)
*/
-unsigned long ap_get_virthost_addr(char *hostname, unsigned short *port);
+unsigned long ap_get_virthost_addr(char *hostname, apr_port_t *port);
/*
* Redefine assert() to something more useful for an Apache...
/** The name of the scheme */
const char *name;
/** The default port for the scheme */
- unsigned short default_port;
+ apr_port_t default_port;
};
#define DEFAULT_FTP_DATA_PORT 20
struct hostent *hostent;
/** The port number, numeric, valid only if port_str != NULL */
- unsigned short port;
+ apr_port_t port;
/** has the structure been initialized */
unsigned is_initialized:1;
* http, ftp, https, gopher, wais, nntp, snews, and prospero
* @param scheme_str The string that contains the current scheme
* @return The default port for this scheme
- * @deffunc unsigned short ap_default_port_for_scheme(const char *scheme_str)
+ * @deffunc apr_port_t ap_default_port_for_scheme(const char *scheme_str)
*/
-AP_DECLARE(unsigned short) ap_default_port_for_scheme(const char *scheme_str);
+AP_DECLARE(apr_port_t) ap_default_port_for_scheme(const char *scheme_str);
/**
* Return the default for the current request
* @param r The current request
* @return The default port
- * @deffunc unsigned short ap_default_port_for_request(const request_rec *r)
+ * @deffunc apr_port_t ap_default_port_for_request(const request_rec *r)
*/
-AP_DECLARE(unsigned short) ap_default_port_for_request(const request_rec *r);
+AP_DECLARE(apr_port_t) ap_default_port_for_request(const request_rec *r);
/**
* Create a copy of a "struct hostent" record; it was presumably returned
AP_DECLARE(unsigned) ap_get_server_port(const request_rec *r)
{
- unsigned port;
+ apr_port_t port;
core_dir_config *d =
(core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module);
int one = 1;
char addr[512];
apr_status_t stat;
- apr_uint32_t port;
+ apr_port_t port;
char *ipaddr;
apr_get_local_port(&port,s);
ap_listen_rec *new;
apr_status_t status;
char *oldaddr;
- unsigned int oldport;
+ apr_port_t oldport;
/* see if we've got an old listener for this address:port */
for (walk = &old_listeners; *walk; walk = &(*walk)->next) {
const char *rmt_ip,
char user[RFC1413_USERLEN+1], server_rec *srv)
{
- unsigned int rmt_port, our_port;
- unsigned int sav_rmt_port, sav_our_port;
+ apr_port_t rmt_port, our_port;
+ apr_port_t sav_rmt_port, sav_our_port;
apr_status_t status;
int i;
char *cp;
}
AP_DECLARE(char *) ap_construct_server(apr_pool_t *p, const char *hostname,
- unsigned port, const request_rec *r)
+ apr_port_t port, const request_rec *r)
{
if (ap_is_default_port(port, r))
return apr_pstrdup(p, hostname);
* Parses a host of the form <address>[:port]
* :port is permitted if 'port' is not NULL
*/
-unsigned long ap_get_virthost_addr(char *w, unsigned short *ports)
+unsigned long ap_get_virthost_addr(char *w, apr_port_t *ports)
{
struct hostent *hep;
unsigned long my_addr;
apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in);
apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts;
int i;
- apr_uint32_t rport;
+ apr_port_t rport;
/* use a temporary apr_table_t which we'll overlap onto
* r->subprocess_env later
};
-AP_DECLARE(unsigned short) ap_default_port_for_scheme(const char *scheme_str)
+AP_DECLARE(apr_port_t) ap_default_port_for_scheme(const char *scheme_str)
{
schemes_t *scheme;
return 0;
}
-AP_DECLARE(unsigned short) ap_default_port_for_request(const request_rec *r)
+AP_DECLARE(apr_port_t) ap_default_port_for_request(const request_rec *r)
{
return (r->parsed_uri.scheme)
? ap_default_port_for_scheme(r->parsed_uri.scheme)
* names we'll match have ports associated with them
*/
const char *host = r->hostname;
- unsigned port;
+ apr_port_t port;
server_rec *s;
server_rec *last_s;
name_chain *src;
server_rec *s;
server_rec *last_s;
name_chain *src;
- unsigned port;
+ apr_port_t port;
apr_get_local_port(&port, r->connection->client_socket);
/*