home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / libnet / mkautocf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.1 KB  |  99 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. /* mkautocf.h: Proxy auto-config parser and evaluator
  19.  * Ari Luotonen */
  20.  
  21. #ifndef MK_PROXY_AUTO_CONFIG
  22. #define MK_PROXY_AUTO_CONFIG
  23.  
  24.  
  25. #include "xp_mcom.h"
  26. #include "xp.h"
  27.  
  28. /*
  29.  * Called by netlib to get a single string of "host:port" format,
  30.  * given the XP_List containing opaque proxy config objects.
  31.  *
  32.  * This function will return an address to a proxy that is (to its
  33.  * knowledge) up and running.  Netlib can later inform this module
  34.  * using the function pacf_proxy_is_down() that a proxy is down
  35.  * and should not be called for a few minutes.
  36.  *
  37.  * Returns FALSE if everything has failed, and an error should be
  38.  * displayed to the user.
  39.  *
  40.  * Returns TRUE if there is hope.
  41.  * If *ret is NULL, a direct connection should be attempted.
  42.  * If *ret is not null, it is the proxy address to use.
  43.  *
  44.  */
  45. MODULE_PRIVATE Bool
  46. pacf_get_proxy_addr(MWContext *context, char *list,
  47.             char **  ret_proxy_addr,
  48.             u_long * ret_socks_addr,
  49.             short *  ret_socks_port);
  50.  
  51.  
  52. MODULE_PRIVATE char *pacf_find_proxies_for_url(MWContext *context, 
  53.                            URL_Struct *URL_s);
  54.  
  55.  
  56. /*
  57.  * A stream constructor function for application/x-ns-proxy-autoconfig.
  58.  *
  59.  *
  60.  *
  61.  */
  62. MODULE_PRIVATE NET_StreamClass *
  63. NET_ProxyAutoConfig(int fmt, void *data_obj, URL_Struct *URL_s, MWContext *w);
  64.  
  65.  
  66. /*
  67.  * Called by mkgeturl.c to originally retrieve, and re-retrieve
  68.  * the proxy autoconfig file.
  69.  *
  70.  * autoconfig_url is the URL pointing to the autoconfig.
  71.  *
  72.  * The rest of the parameters are what was passed to NET_GetURL(),
  73.  * and when the autoconfig load finishes NET_GetURL() will be called
  74.  * with those exact same parameters.
  75.  *
  76.  * This is because the proxy config is loaded when NET_GetURL() is
  77.  * called for the very first time, and the actual request must be put
  78.  * on hold when the proxy config is being loaded.
  79.  *
  80.  * When called from the explicit proxy config RE-load function
  81.  * NET_ReloadProxyConfig, the four last parameters are all zero,
  82.  * and no request gets restarted.
  83.  *
  84.  */
  85. MODULE_PRIVATE int NET_LoadProxyConfig(char *autoconf_url,
  86.                        URL_Struct *URL_s,
  87.                        FO_Present_Types output_format,
  88.                        MWContext *window_id,
  89.                        Net_GetUrlExitFunc *exit_routine);
  90.  
  91. /*
  92.  * NET_GetNoProxyFailover
  93.  * Returns TRUE if we're not allowing proxy failover.
  94.  */
  95. MODULE_PRIVATE Bool NET_GetNoProxyFailover(void);
  96.  
  97. #endif /* ! MK_PROXY_AUTO_CONFIG */
  98.  
  99.