1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
/*----------------------------------------------------------------------------*/
/* Xymon monitor library. */
/* */
/* Copyright (C) 2002-2011 Henrik Storner <henrik@storner.dk> */
/* */
/* This program is released under the GNU General Public License (GPL), */
/* version 2. See the file "COPYING" for details. */
/* */
/*----------------------------------------------------------------------------*/
#ifndef __URL_H__
#define __URL_H__
/* Fix building on GNU */
#ifndef MAXPATHLEN
# ifdef PATH_MAX
# define MAXPATHLEN PATH_MAX
# elif defined(MAX_PATH)
# define MAXPATHLEN MAX_PATH
# elif defined(_MAX_PATH)
# define MAXPATHLEN _MAX_PATH
# elif defined(CCHMAXPATH)
# define MAXPATHLEN CCHMAXPATH
# else
# define MAXPATHLEN 1024
# endif
#endif
extern int obeybbproxysyntax;
typedef struct urlelem_t {
char *origform;
char *scheme;
char *schemeopts;
char *host;
char *ip;
int port;
char *auth;
char *relurl;
int parseerror;
} urlelem_t;
enum webtesttype_t {
WEBTEST_PLAIN, WEBTEST_CONTENT, WEBTEST_CONT, WEBTEST_NOCONT, WEBTEST_POST, WEBTEST_NOPOST, WEBTEST_TYPE, WEBTEST_STATUS, WEBTEST_HEAD, WEBTEST_SOAP, WEBTEST_NOSOAP,
};
typedef struct weburl_t {
int testtype;
char *columnname;
struct urlelem_t *desturl;
struct urlelem_t *proxyurl;
unsigned char *postcontenttype;
unsigned char *postdata;
unsigned char *expdata;
unsigned char *okcodes;
unsigned char *badcodes;
} weburl_t;
extern char *urlunescape(char *url);
extern char *urldecode(char *envvar);
extern char *urlencode(char *s);
extern int urlvalidate(char *query, char *validchars);
extern char *cleanurl(char *url);
extern void parse_url(char *inputurl, urlelem_t *url);
extern char *decode_url(char *testspec, weburl_t *weburl);
#endif
|