http_vhost.inc 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. { Licensed to the Apache Software Foundation (ASF) under one or more
  2. * contributor license agreements. See the NOTICE file distributed with
  3. * this work for additional information regarding copyright ownership.
  4. * The ASF licenses this file to You under the Apache License, Version 2.0
  5. * (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. }
  16. {
  17. * @package Virtual Host package
  18. }
  19. {
  20. * called before any config is read
  21. * @param p Pool to allocate out of
  22. }
  23. procedure ap_init_vhost_config(p: Papr_pool_t);
  24. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  25. external LibHTTPD name LibNamePrefix + 'ap_init_vhost_config' + LibSuff4;
  26. {
  27. * called after the config has been read to compile the tables needed to do
  28. * the run-time vhost lookups
  29. * @param p The pool to allocate out of
  30. * @param main_server The start of the virtual host list
  31. * @deffunc ap_fini_vhost_config(apr_pool_t *p, server_rec *main_server)
  32. }
  33. procedure ap_fini_vhost_config(p: Papr_pool_t; main_server: Pserver_rec);
  34. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  35. external LibHTTPD name LibNamePrefix + 'ap_fini_vhost_config' + LibSuff8;
  36. {
  37. * handle addresses in <VirtualHost> statement
  38. * @param p The pool to allocate out of
  39. * @param hostname The hostname in the VirtualHost statement
  40. * @param s The list of Virtual Hosts.
  41. }
  42. //const char *ap_parse_vhost_addrs(apr_pool_t *p, const char *hostname, server_rec *s);
  43. {
  44. * handle NameVirtualHost directive
  45. * @param cmd Command Parameters structure
  46. * @param dummy NOT USED
  47. * @param arg a host of the form "<address>[:port]"
  48. }
  49. //const char *ap_set_name_virtual_host (cmd_parms *cmd, void *dummy,
  50. // const char *arg);
  51. {
  52. * Callback function for every Name Based Virtual Host.
  53. * @param baton Opaque user object
  54. * @param conn The current Connection
  55. * @param s The current Server
  56. * @see ap_vhost_iterate_given_conn
  57. * @return 0 on success, any non-zero return will stop the iteration.
  58. }
  59. type
  60. ap_vhost_iterate_conn_cb = function (baton: Pointer; conn: Pconn_rec; s: Pserver_rec): Integer;
  61. {
  62. * For every virtual host on this connection, call func_cb.
  63. * @param conn The current connection
  64. * @param func_cb Function called for every Name Based Virtual Host for this
  65. * connection.
  66. * @param baton Opaque object passed to func_cb.
  67. * @return The return value from func_cb.
  68. * @note If func_cb returns non-zero, the function will return at this point,
  69. * and not continue iterating the virtual hosts.
  70. }
  71. function ap_vhost_iterate_given_conn(conn: Pconn_rec;
  72. func_cb: ap_vhost_iterate_conn_cb; baton: Pointer): Integer;
  73. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  74. external LibHTTPD name LibNamePrefix + 'ap_vhost_iterate_given_conn' + LibSuff12;
  75. {
  76. * given an ip address only, give our best guess as to what vhost it is
  77. * @param conn The current connection
  78. }
  79. procedure ap_update_vhost_given_ip(conn: Pconn_rec);
  80. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  81. external LibHTTPD name LibNamePrefix + 'ap_update_vhost_given_ip' + LibSuff4;
  82. {
  83. * ap_update_vhost_given_ip is never enough, and this is always called after
  84. * the headers have been read. It may change r->server.
  85. * @param r The current request
  86. }
  87. procedure ap_update_vhost_from_headers(r: Prequest_rec);
  88. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  89. external LibHTTPD name LibNamePrefix + 'ap_update_vhost_from_headers' + LibSuff4;
  90. {
  91. * Match the host in the header with the hostname of the server for this
  92. * request.
  93. * @param r The current request
  94. * @param host The hostname in the headers
  95. * @param port The port from the headers
  96. * @return return 1 if the host:port matches any of the aliases of r->server,
  97. * return 0 otherwise
  98. * @deffunc int ap_matches_request_vhost(request_rec *r, const char *host, apr_port_t port)
  99. }
  100. function ap_matches_request_vhost(r: Prequest_rec; const host: PChar;
  101. port: apr_port_t): Integer;
  102. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  103. external LibHTTPD name LibNamePrefix + 'ap_matches_request_vhost' + LibSuff12;