NSAPI Programmer's Guide for Enterprise Server 4.0
Table of Contents | Previous | Bookshelf

NSAPI Programmer's Guide for Enterprise Server 4.0
    

Index

A

abbrev, value of sizefmt attribute 240
about this book 7
AcceptLanguage
magnus.conf directive 213
access
logging 97, 98
access control lists
see also ACLs
ACLFile
magnus.conf directive 221
ACLs
settings in magnus.conf 221
add-footer
Service-class function 84
add-header
Service-class function 85
AddLog 13
example of custom SAF 196
flow of control 32
requirements for SAFs 120
summary 20
AddLog directive
obj.conf 97
Address
magnus.conf directive 208
AdminLanguage
magnus.conf directive 213
alphabetical reference
magnus.conf variables 255
NSAPI functions 123
SAFs 259
API functions
cif_find 124
condvar_init 125
condvar_notify 125
condvar_terminate 126
condvar_wait 126
crit_enter 126
crit_exit 127
crit_init 127
crit_terminate 128
daemon_atrestart 128
filebuf_buf2sd 129
filebuf_close 129
filebuf_getc 130
filebuf_open 130
filebuf_open_nostat 131
FREE 131
func_exec 132
func_find 132
log_error 133
magnus_atrestart 134
MALLOC 124, 134
net_ip2host 135
net_read 135
net_write 136
netbuf_buf2sd 136
netbuf_close 137
netbuf_getc 137
netbuf_grab 137
netbuf_open 138
param_create 138
param_free 139
pblock_copy 139
pblock_create 139
pblock_dup 140
pblock_find 140
pblock_findval 141
pblock_free 141
pblock_nninsert 141
pblock_nvinsert 142
pblock_pb2env 142
pblock_pblock2str 143
pblock_pinsert 143
pblock_remove 144
pblock_str2pblock 144
PERM_FREE 145
PERM_MALLOC 145, 146
PERM_STRDUP 147
protocol_dump822 147
protocol_set_finfo 148
protocol_start_response 148
protocol_status 149
protocol_uri2url 150, 151
REALLOC 152
request_header 152
request_stat_path 153
request_translate_uri 154
session_maxdns 154
shexp_casecmp 154
shexp_cmp 155
shexp_match 156
shexp_valid 156
STRDUP 157
system_errmsg 157
system_fclose 158
system_flock 158
system_fopenRO 158
system_fopenRW 159
system_fopenWA 159
system_fread 160
system_fwrite 160
system_fwrite_atomic 161
system_gmtime 161
system_localtime 162
system_lseek 162
system_rename 163
system_ulock 162, 163
system_unix2local 164
systhread_current 164
systhread_getdata 165
systhread_newkey 165
systhread_setdata 166
systhread_sleep 166
systhread_start 166
systhread_timerset 167
util_can_exec 167
util_chdir2path 168
util_cookie_find 169
util_cookie_next 169
util_env_find 170
util_env_free 170
util_env_replace 170
util_env_str 171
util_getline 171
util_hostname 172
util_is_mozilla 172
util_is_url 173
util_itoa 173
util_later_than 173
util_sh_escape 174
util_snprintf 174
util_strcasecmp 175
util_strftime 176
util_strncasecmp 176
util_uri_escape 177
util_uri_is_evil 177
util_uri_parse 178
util_uri_unescape 178
util_vsnprintf 178
util_vsprintf 179
util-cookie_find 169
util-sprintf 175
append-trailer
Service-class function 86
assign-name
NameTrans-class function 61
AsyncDNS
magnus.conf directive 214
AUTH_TYPE environment variable 121
AUTH_USER environment variable 121
AuthTrans 13
directive, full description 57
example of custom SAF 183
flow of control 25
requirements for SAFs 118
summary 18
auth-type function 58, 59

B

basic-auth
AuthTrans-class function 58
basic-ncsa
AuthTrans-class function 59
basics
of server operation 9
BlockingListenSockets
magnus.conf directive 215
browsers 11
builtin SAFs, core SAFs 37
bytes, value of sizefmt attribute 240

C

cache
enabling memory allocation pool 55
for static files 40
cache-init
Init-class function 40
case sensitivity
in obj.conf 34
catch-all
Service directive 32
cert2user
PathCheck-class function 67
certificates
settings in magnus.conf 222
CGI
environment variables in NSAPI 121
settings in magnus.conf 219
to NSAPI conversion 121
cgi attribute of the exec command 242
CGIExpirationTimeout
magnus.conf directive 219
CGIWaitPid
magnus.conf directive 219
check-acl
PathCheck-class function 68
checking
secret keys 77
Chroot
magnus.conf directive 222
cif_find
API function 124
cindex-ini
Init-class function 43
cinfo
NSAPI data structure 206
cinfo_find
API function 124
Ciphers
magnus.conf directive 223
client
field in session parameter 105
getting DNS name for 204
getting IP address for 204
sessions and 202
CLIENT_CERT environment variable 122
ClientLanguage
magnus.conf directive 213
clients
CLIENT tag 23
requests 11
CLIENT tag 23
cmd attribute of the exec command 242
comments
in obj.conf 35
common-log
Service-class function 97
Common Log subsystem, initializing 52
compiling
custom SAFs 110
Concurrency
magnus.conf directive 208
condvar_init
API function 125
condvar_notify
API function 125
condvar_terminate
API function 126
condvar_wait
API function 126
config command
server-parsed HTML 240
config directory
location 10
configuration files 10
location 10
connectons
settings in magnus.conf 214
CONTENT_LENGTH environment variable 121
CONTENT_TYPE environment variable 121
cookies
NSAPI utility functions 169
creating
custom SAFs 103
crit_enter
API function 126
crit_exit
API function 127
crit_init
API function 127
crit_terminate
API function 128
csd
field in session parameter 105
custom SAFs
creating 103

D

daemon_atrestart
API function 128
DaemonStats
magnus.conf directive 220
data structures
NSAPI reference 201
DATE_GMT
server parsed variable 242
DATE_LOCAL
server parsed variable 242
Day of month 237
default
Service directive 32
DefaultLanguage
magnus.conf directive 213
defining
custom SAFs 103
deny-existence
PathCheck-class function 69
directive_is_cacheable
field in request parameter 106
directives
for handling requests 14
in obj.conf 37
magnus.conf 207
order of 33
SAFs for each directive 117
summary for obj.conf 18
syntax in obj.conf 18
DNS
magnus.conf directive 214
dns-cache-init 45
DNS lookup
directives in magnus.conf 214
DNS names
getting clients 204
DOCUMENT_NAME
server parsed variable 242
DOCUMENT_URI
server parsed variable 242
document-root 62
documents
file typing 82
dynamic link library, loading 53

E

echo command
server-parsed HTML 241
enc 228
Enterprise Server
see server
Enterprise Server 4.0 Administrator's Guide 216, 217
environment variables
and init-cgi function 51
CGI to NSAPI conversion 121
in server-prased commands 242
errmsg attribute of config command 240
Error 14
Error directive
flow of control 33
obj.conf 100
requirements for SAFs 120
summary 21
ErrorLog
magnus.conf directive 220
error logging
settings in magnus.conf 219
errors
finding most recent system error 157
sending customized messages 101
examples
location in the build 182
of custom SAFs (plugins) 181
of custom SAFs in the build 182
wildcard patterns 234
exec command
server-parsed HTML 242

F

fancy indexing 43
file attribute of include command 241
filebuf_buf2sd
API function 129
filebuf_close
API function 129
filebuf_getc
API function 130
filebuf_open
API function 130
filebuf_open_nostat
API function 131
file cache 40
and logging 47
initializing 40
file descriptor
closing 158
locking 158
opening read-only 158
opening read-write 159
opening write-append 159
reading into a buffer 160
unlocking 162, 163
writing from a buffer 160
writing without interruption 161
file I/O routines 115
file name extension
mapping to MIME types 54
file name extensions
MIME types 227
object type 28
files
forcing type of 80
mapping types of 227
typing 82
typing by wildcard pattern 80
file types 80
find-index
PathCheck-class function 70
find-links
PathCheck-class function 70
find-pathinfo
PathCheck-class function 71
flastmod command
affected by timefmt attribute 240
server-parsed HTML 241
flexible logging 45
flex-init
Init-class function 45
flex-log
AddLog-class function 98
flex-rotate-init
Init-class function 50
flow of control 24
fn argument
in directives in obj.conf 18
footers
adding 84
force-type 29
example 29
ObjectType-class function 80
forcing
object type 28
formats
time 237
forward slashes 35
FREE
API function 131
fsize command
server-parsed HTML 241
func_exec
API function 132
func_find
API function 132
funcs 111
funcs parameter 53
functions
pre-defined SAFs 37
see also SAFs

G

GATEWAY_INTERFACE environment variable 121
GET
method 83
get-client-cert
PathCheck-class function 71
GMT time
getting thread-safe value 161

H

hard links, finding 70
HEAD
method 83
header files
nsapi.h 110, 201
headers 12
adding 85
field in request parameter 106
home-page 63
HOST environment variable 122
HTML tags
server-parsed 239
HTTP 243
basics 12
compliance with 1.1 243
requests 244
responses 245
HTTP_* environment variable 121
HTTPS_KEYSIZE environment variable 122
HTTPS_SECRETKEYSIZE environment variable 122
HTTPS environment variable 122
HUP signal
Chroot and 223
PidLog and 221
HyperText Transfer Protocol
see HTTP

I

imagemap
Service-class function 87
include command
server-parsed HTML 241
include directory
for SAFs 110
index-common
Service-class function 87
indexing
fancy 43
index-simple
Service-class function 89
Init
flow of control 24
obj.conf directive 39
requirements for SAFs 118
summary 18
init-cgi 51
Init-class function 45, 51
init-clf
Init-class function 52
initializing
global settings 207
plugins 110
SAFs 110
initializing for CGI 51
init-uhome
Init-class function 53
IP address
getting clients 204
iponly function 98, 99

K

KeepAliveTimeout
magnus.conf directive 215
KernelThreads
magnus.conf directive 215
key-toosmall
Service-class function 89

L

lang 228
language issues
directives in magnus.conf 212
LAST_MODIFIED
server parsed variable 242
LateInit parameter to Init directive 40
line continuation 35
linking
SAFs 110
list-dir
Service-class function 90
ListenQ
magnus.conf directive 216
load-config
PathCheck-class function 73
loading
custom SAFs 110
MIME types file 228
plugins 110
SAFs 110
load-modules 110
example 111
Init-class function 53
LoadObjects
magnus.conf directive 211
load-types
Init-class function 54
localtime
getting thread-safe value 162
local-types parameter 55
log_error
API function 133
log analyzer 97, 98
log file 97, 98
analyzer for 97, 98
log format 47
logging
cookies 47
flexible 45
impact on cache acceleration 47
relaxed mode 47
rotating logs 50
settings in magnus.conf 219
LogVerbose
magnus.conf directive 220

M

magnus.conf 10, 207
alphabetical list of directives 255
directives in 207
magnus_atrestart
API function 134
make-dir
Service-class function 91
MALLOC
API function 124, 134
matching
special characters 233
MaxKeepAliveConnections
magnus.conf directive 216
MaxProcs
magnus.conf directive 216
memory allocation, pool-init Init-class function 55
memory management routines 115
method 12
server and 83
mime.types 11
mime.types file 227, 228
sample of 231
MIME types 227
mapping from file name extensions 54
typing files 82
MIME types file
loading 228
syntax 230
MIME-types parameter 55
month name 237
mozilla-redirect 64
MtaHost
magnus.conf directive 209

N

name attribute
in obj.conf objects 21
in objects 22
NameTrans 13
directive in obj.conf 61
example of custom SAF 185
flow of control 25
requirements for SAFs 119
summary 19
NameTrans-class function 62, 63, 64
NativePoolMaxThreads
magnus.conf directive 218
NativePoolMinThreads
magnus.conf directive 218
NativePoolQueueSize
magnus.conf directive 218
NativePoolStackSize
magnus.conf directive 218
NativeThread parameter to Init directive 54
native thread pools
settings in magnus.conf 217
net_ip2host
API function 135
net_read
API function 135
net_write
API function 136
netbuf_buf2sd
API function 136
netbuf_close
API function 137
netbuf_getc
API function 137
netbuf_grab
API function 137
netbuf_open
API function 138
network I/O routines 116
NSAPI
alphabetical function reference
functions NSAPI reference 123

CGI environment variables 121
data structures reference 201
using 14
nsapi.h 110, 201
location 110
overview of data structures 201
NSAPI functions
overview 113
NSCP_POOL_STACKSIZE 218
NSCP_POOL_THREADMAX 218
NSCP_POOL_WORKQUEUEMAX 218
nshttpd3x.lib 110
nshttpd40.lib 110
ntcgicheck
PathCheck-class function 76
nt-uri-clean
PathCheck-class function 75

O

obj.conf 10
adding directives for new SAFs 111
case sensitivity 34
CLIENT tag 23
comments 35
directives 17, 37
directives summary 18
directive syntax 18
flow of control 24
OBJECT tag 21
parameters for directives 34
processinng other objects 26
server instructions 17
syntax rules 33
use 17
object
default,
specifying 212
object configuration file
specifying in magnus.conf 211
objects
processing non-default objects 26
OBJECT tag 21
name attribute 21
ppath attribute 21
ObjectType 13
directive in obj.conf 79
example of custom SAF 191
flow of control 27
requirements for SAFs 119
summary 19
object type
forcing 28
setting by file extension 28
order
of directives in obj.conf 33
overview
server operation 9

P

param_create
API function 138
param_free
API function 139
parameter block
manipulation routines 114
SAF parameter 104
parameters
for obj.conf directives 34
for SAFs 104
parse-html
Service-class function 91
path
absolute with Chroot directive 223
PATH_INFO environment variable 121
PATH_TRANSLATED environment variable 121
PathCheck 13
directive in obj.conf 66
example of custom SAF 188
flow of control 27
requirements for SAFs 119
summary 19
path name
converting Unix-style to local 164
path names 35
patterns 233
pb
SAF parameter 104
pb_entry
NSAPI data structure 203
pb_param
NSAPI data structure 203
pblock
NSAPI data structure 203
see parameter block
pblock_copy
API function 139
pblock_create
API function 139
pblock_dup
API function 140
pblock_find
API function 140
pblock_findval
API function 141
pblock_free
API function 141
pblock_nninsert
API function 141
pblock_nvinsert
API function 142
pblock_pb2env
API function 142
pblock_pblock2str
API function 143
pblock_pinsert
API function 143
pblock_remove
API function 144
pblock_str2pblock
API function 144
PERM_FREE
API function 145
PERM_MALLOC
API function 145, 146
PERM_STRDUP
API function 147
pfx2dir 64
example 26
NameTrans-class function 64
PidLog
magnus.conf directive 221
plugins
creating 103
example of new plugins 181
instructing the server to use 111
loading and initializing 110
pool-init Init-class function 55
port
magnus.conf directive 209
specifying 209
POST
method 83
PostThreadsEarly
magnus.conf directive 216
ppath attribute
in obj.conf objects 21
in objects 23
predefined SAFs 37
preface 7
processes
settings in magnus.conf 214
processing
non-default objects 26
protocol_dump822
API function 147
protocol_set_finfo
API function 148
protocol_start_response
API function 148
protocol_status
API function 149
protocol_uri2url
API function 150, 151
protocol utility routines 115

Q

QUERY_STRING_UNESCAPED
server parsed variable 242
QUERY_STRING environment variable 121
QUERY environment variable 122
query-handler
Service-class function 92
quotes 34

R

RcvBufSize
magnus.conf directive 216
REALLOC
API function 152
record-useragent
Service-class function 99
redirect
NameTrans-class function 64
reference
NSAPI data structures 201
NSAPI functions 123
relaxed logging 47
REMOTE_ADDR environment variable 121
REMOTE_HOST environment variable 122
REMOTE_IDENT environment variable 122
REMOTE_USER environment variable 122
remove-dir
Service-class function 92
remove-file
Service-class function 93
rename-file
Service-class function 93
REQ_ABORTED
response code 108
REQ_EXIT
response code 108
REQ_NOACTION
response code 107
REQ_PROCEED
response code 107
reqpb
field in request parameter 106
request
NSAPI data structure 204
SAF parameter 105
REQUEST_METHOD environment variable 122
request_stat_path
API function 153
request_translate_uri
API function 154
request-handling process 11
flow of control 24
steps 13
request-header
API function 152
request-response process 11
see request-handling process
requests
directives for handling 14
how server handles 11
HTTP 244
methods 12
steps in handling 13
require-auth
PathCheck-class function 76
responses, HTTP 245
result codes 107
RootObject
magnus.conf directive 212
rotating logs 50
rq
SAF parameter 105
rq->directive_is_cacheable 106
rq->headers 106
rq->reqpb 106
rq->srvhdrs 106
rq->vars 106
RqThrottle
magnus.conf directive 217
RqThrottleMinPerSocket
magnus.conf directive 217
rules
for editing obj.conf 33

S

SAF
return values 107
SAFs
alphabetical list 259
compiling and linking 110
creating 103
examples of custom SAFs 181
for each directive 117
include directory 110
interface 104
loading and initializing 110
parameters 104
predefined 37
result codes 107
signature 104
writing new 14
SCRIPT_NAME environment variable 122
search patterns 233
secret keys
checking 77
Security
magnus.conf directive 223
security
constraining the server 222
settings in mangus.conf 222
send-cgi
Service-class function 94
send-error
Error-class function 100
send-file
Service-class function 94
send-range
Service-class function 95
send-shellcgi
Service-class function 95
send-wincgi
Service-class function 96
separators 34
server
basics of operation 9
constraining 222
flow of control 24
initialization variables in magnus.conf 207
initializing 39
instructions for using plugins 111
instructions in obj.conf 17
modifying 9
processing non-default objects 26
request handling 11
SERVER_NAME environment variable 122
SERVER_PORT environment variable 122
SERVER_PROTOCOL environment variable 122
SERVER_SOFTWARE environment variable 122
SERVER_URL environment variable 122
Server Application Functions
see SAFs
ServerCert
magnus.conf directive 224
ServerID
magnus.conf directive 209
server information
magnus.conf directives 208
ServerKey
magnus.conf directive 224
ServerName
magnus.conf directive 209
server-parsed HTML tags 239
ServerRoot
magnus.conf directive 210
servers
HUP signal 221
killing process of 221
TERM signal 221
server-side
HTML tags 239
includes 239
Service 13
default directive 32
directive in obj.conf 83
directives for new SAFs (plugins) 112
example of custom SAF 194
examples 30
flow of control 29
requirements for SAFs 120
summary 20
session
defined 202
NSAPI data structure 202
resolving the IP address of 154
SAF parameter 105
Session->client
NSAPI data structure 204
session_maxdns
API function 154
shared library, loading 53
shell expression
comparing (case-blind) to a string 154
comparing (case-sensitive) to a string 155, 156
validating 156
shexp_casecmp
API function 154
shexp_cmp
API function 155
shexp_match
API function 156
shexp_valid
API function 156
shlib 110
shlib parameter 53
shmem_s
NSAPI data structure 205
shtml-hacktype
ObjectType-class function 80
sizefmt attribute of config command 240
sn
SAF parameter 105
sn->client 105
sn->csd 105
SndBufSize
magnus.conf directive 217
socket
closing 137
reading from 135
sending a buffer to 136
sending file buffer to 129
writing to 136
spaces 35
special characters 233
sprintf, see util_sprintf 175
srvhdrs
field in request parameter 106
SSL
settings in magnus.conf 222
SSL2
magnus.conf directive 225
SSL3Ciphers
magnus.conf directive 225
SSL3SessionTimeout
magnus.conf directive 225
SSLCacheEntries
magnus.conf directive 224
ssl-check
PathCheck-class function 77
SSLClientAuth
magnus.conf directive 224
SSLSessionTimeout
magnus.conf directive 224
StackSize
magnus.conf directive 217
stat
structure 205
statistic collection
settings in magnus.conf 219
STRDUP
API function 157
string
creating a copy of 157
symbolic links
finding 70
syntax
directives in obj.conf 18
for editing obj.conf 33
MIME types file 230
system 163
system_errmsg
API function 157
system_fclose
API function 158
system_flock
API function 158
system_fopenRO
API function 158
system_fopenRW
API function 159
system_fopenWA
API function 159
system_fread
API function 160
system_fwrite
API function 160
system_fwrite_atomic
API function 161
system_gmtime
API function 161
system_localtime
API function 162
system_lseek
API function 162
system_rename
API function 163
system_ulock
API function 162, 163
system_unix2local
API function 164
systhread_current
API function 164
systhread_getdata
API function 165
systhread_newkey
API function 165
systhread_setdata
API function 166
systhread_sleep
API function 166
systhread_start
API function 166
systhread_timerset
API function 167

T

TerminateTimeout
magnus.conf directive 217
TERM signal 221
thread
allocating a key for 165
creating 166
getting a pointer to 164
getting data belonging to 165
putting to sleep 166
setting data belonging to 166
setting interrupt timer 167
thread pools
settings in magnus.conf 217
thread routines 116
threads
settings in magnus.conf 214
timefmt tag 240
time formats 237
trailers
appending 86
type
content-type 228
type-by-exp
ObjectType-class function 80
type-by-extension 228
ObjectType-class function 82

U

Umask
magnus.conf directive 226
Unix
constraining the server 222
unix-home
NameTrans-class function 65
unix-uri-clean
PathCheck-class function 78
Unix user account
specifying 210
upload-file
Service-class function 96
URL
mapping to other servers 64
translated to file path 19
User
magnus.conf directive 210
user account
specifying 210
user home directories
symlinks and 71
util_can_exec
API function 167
util_chdir2path
API function 168
util_cookie_find
API function 169
util_cookie_next
API function 169
util_env_find
API function 170
util_env_free
API function 170
util_env_replace
API function 170
util_env_str
API function 171
util_getline
API function 171
util_hostname
API function 172
util_is_mozilla
API function 172
util_is_url
API function 173
util_itoa
API function 173
util_later_than
API function 173
util_sh_escape
API function 174
util_snprintf
API function 174
util_sprintf
API function 175
util_strcasecmp
API function 175
util_strftime 237
API function 176
util_strncasecmp
API function 176
util_uri_escape
API function 177
util_uri_is_evil
API function 177
util_uri_parse
API function 178
util_uri_unescape
API function 178
util_vsnprintf
API function 178
util_vsprintf
API function 179
utility routines 117

V

variables
magnus.conf 207
vars
field in request parameter 106
virtual attribute of the include command 241
VirtualServerFile
magnus.conf directive 211
vsnprintf, see util_vsnprintf 178
vsprintf, see util_vsprintf 179

W

weekday 237
wildcard patterns 233
file typing and 80

Table of Contents | Previous | Bookshelf

Last Updated: 08/12/99 14:33:26

Copyright © 1999 Netscape Communications Corporation