summaryrefslogtreecommitdiff
path: root/apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/httpact.h
blob: ee50b8a7821a50e99aeb660812c4e174335684a6 (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
 * Copyright (c) 1994, 1995.  Netscape Communications Corporation.  All
 * rights reserved.
 *
 * Use of this software is governed by the terms of the license agreement for
 * the Netscape Communications or Netscape Comemrce Server between the
 * parties.
 */


/* ------------------------------------------------------------------------ */


/*
 * httpact.h: Defines the API characteristics for HTTP servers
 *
 * Rob McCool
 */


#ifndef HTTPACT_H
#define HTTPACT_H

#include "frame/req.h"
#include "frame/object.h"


/* ------------------------------ Constants ------------------------------- */

#ifdef MCC_BATMAN
#define NUM_DIRECTIVES 5
#else
#ifdef MCC_PROXY
#define NUM_DIRECTIVES 10
#else
#define NUM_DIRECTIVES 7
#endif
#endif


/* -------------------------- Generic Prototypes -------------------------- */


/*
 * directive_name2num will return the position of the abbreviated directive
 * dir in the directive table.
 *
 * If dir does not exist in the table, it will return -1.
 */

int directive_name2num(char *dir);


/*
 * directive_num2name returns a string describing directive number num.
 */
const char *directive_num2name(int num);


/*
 * servact_finderror looks through the request's object set to find a
 * suitable error function to execute. Returns REQ_PROCEED if a function
 * was found and executed successfully, REQ_NOACTION otherwise.
 */
int servact_finderror(Session *sn, Request *rq);


/*
 * Read in and handle one request from the given session
 */
void servact_handle(Session *sn);


/* ----------------------- HTTP specific prototypes ----------------------- */


int servact_handle_processed(Session *sn, Request *rq);

/*
 * Returns the translated path (filename) for the given uri, NULL otherwise.
 * If authentication is required for the given uri, nothing is returned even
 * if the current user has authenticated to that area.
 */
char *servact_translate_uri(char *uri, Session *sn);



#ifdef MCC_PROXY

/* ----------------------- proxy specific prototypes ---------------------- */

/*
 * Resolves the given hostname, first trying to find a resolver
 * function from obj.conf, and if that fails, just calls gethostbyname().
 *
 */
struct hostent *servact_gethostbyname(char *host, Session *sn, Request *rq);


/*
 * Establishes a connection to the specified host and port using
 * a Connect class function from obj.conf.  Returns the sockect
 * descriptor that is connected (and which should be SSL_Import()'ed
 * by the caller).
 *
 * Returns -2 (REQ_NOACTION), if no such Connect class function exists.
 * The caller should use the native connect mechanism in that case.
 *
 * Returns -1 (REQ_ABORT) on failure to connect.  The caller should not
 * attempt to use the native connect.
 *
 */
int servact_connect(char *host, int port, Session *sn, Request *rq);


#endif  /* ! MCC_PROXY */

#endif