Sun ONE logo      Previous      Index      Next     

Sun ONE Web Server 6.1 NSAPI Programmer's Guide

Contents


About This Guide
Who Should Use This Guide
Using the Documentation
How This Guide Is Organized
Documentation Conventions
Product Support

Chapter 1   Syntax and Use of obj.conf
How the Server Handles Requests from Clients
HTTP Basics
NSAPI Filters
Steps in the Request-handling Process
Directives for Handling Requests
Dynamic Reconfiguration
Server Instructions in obj.conf
Summary of the Directives
Configuring HTTP Compression
The Object and Client Tags
The Object Tag
Objects that Use the name Attribute
Objects that Use the ppath Attribute
The Client Tag
Client Tag Parameters
Variables Defined in server.xml
Flow of Control in obj.conf
AuthTrans
NameTrans
How and When the Server Processes Other Objects
PathCheck
ObjectType
Setting the Type By File Extension
Forcing the Type
Input
Output
Service
Service Examples
Default Service Directive
AddLog
Error
Changes in Function Flow
Internal Redirects
Restarts
URI Translation
Syntax Rules for Editing obj.conf
Order of Directives
Parameters
Case Sensitivity
Separators
Quotes
Spaces
Line Continuation
Path Names
Comments
About obj.conf Directive Examples

Chapter 2   SAFs in the magnus.conf File
cindex-init
define-perf-bucket
dns-cache-init
flex-init
flex-rotate-init
init-cgi
init-clf
init-dav
init-filter-order
init-j2ee
init-uhome
load-modules
nt-console-init
perf-init
pool-init
register-http-method
stats-init
thread-pool-init

Chapter 3   Creating Custom SAFs
Future Compatibility Issues
The SAF Interface
SAF Parameters
pb (parameter block)
sn (session)
rq (request)
Result Codes
Creating and Using Custom SAFs
Write the Source Code
Compile and Link
Include Directory and nsapi.h File
Libraries
Linker Commands and Options for Generating a Shared Object
Additional Linker Flags
Compiler Flags
Compiling 3.x Plugins on AIX
Load and Initialize the SAF
Instruct the Server to Call the SAFs
Restart the Server
Test the SAF
Overview of NSAPI C Functions
Parameter Block Manipulation Routines
Protocol Utilities for Service SAFs
Memory Management
File I/O
Network I/O
Threads
Utilities
Virtual Server
Required Behavior of SAFs for Each Directive
Init SAFs
AuthTrans SAFs
NameTrans SAFs
PathCheck SAFs
ObjectType SAFs
Input SAFs
Output SAFs
Service SAFs
Error SAFs
AddLog SAFs
CGI to NSAPI Conversion

Chapter 4   Creating Custom Filters
Future Compatibility Issues
The NSAPI Filter Interface
Filter Methods
C Prototypes for Filter Methods
insert
remove
flush
read
write
writev
sendfile
Position of Filters in the Filter Stack
Filters that Alter Content-Length
Creating and Using Custom Filters
Write the Source Code
Compile and Link
Load and Initialize the Filter
Instruct the Server to Insert the Filter
Restart the Server
Test the Filter
Overview of NSAPI Functions for Filter Development

Chapter 5   Examples of Custom SAFs and Filters
Examples in the Build
AuthTrans Example
Installing the Example
Source Code
NameTrans Example
Installing the Example
Source Code
PathCheck Example
Installing the Example
Source Code
ObjectType Example
Installing the Example
Source Code
Output Example
Installing the Example
Source Code
Service Example
Installing the Example
Source Code
More Complex Service Example
AddLog Example
Installing the Example
Source Code
Quality of Service Example
Installing the Example
Source Code

Chapter 6   Creating Custom Server-parsed HTML Tags
Define the Functions that Implement the Tag
Write an Initialization Function
Load the New Tag into the Server

Chapter 7   NSAPI Function Reference
NSAPI Functions (in Alphabetical Order)
CALLOC
cinfo_find
condvar_init
condvar_notify
condvar_terminate
condvar_wait
crit_enter
crit_exit
crit_init
crit_terminate
daemon_atrestart
fc_open
fc_close
filebuf_buf2sd
filebuf_close
filebuf_getc
filebuf_open
filebuf_open_nostat
filter_create
filter_find
filter_insert
filter_layer
filter_name
filter_remove
flush
FREE
func_exec
func_find
func_insert
insert
log_error
MALLOC
net_flush
net_ip2host
net_read
net_sendfile
net_write
netbuf_buf2sd
netbuf_close
netbuf_getc
netbuf_grab
netbuf_open
nsapi_module_init
NSAPI_RUNTIME_VERSION
NSAPI_VERSION
param_create
param_free
pblock_copy
pblock_create
pblock_dup
pblock_find
pblock_findval
pblock_free
pblock_nninsert
pblock_nvinsert
pblock_pb2env
pblock_pblock2str
pblock_pinsert
pblock_remove
pblock_str2pblock
PERM_CALLOC
PERM_FREE
PERM_MALLOC
PERM_REALLOC
PERM_STRDUP
prepare_nsapi_thread
protocol_dump822
protocol_set_finfo
protocol_start_response
protocol_status
protocol_uri2url
protocol_uri2url_dynamic
read
REALLOC
remove
request_get_vs
request_header
request_stat_path
request_translate_uri
sendfile
session_dns
session_maxdns
shexp_casecmp
shexp_cmp
shexp_match
shexp_valid
STRDUP
system_errmsg
system_fclose
system_flock
system_fopenRO
system_fopenRW
system_fopenWA
system_fread
system_fwrite
system_fwrite_atomic
system_gmtime
system_localtime
system_lseek
system_rename
system_ulock
system_unix2local
systhread_attach
systhread_current
systhread_getdata
systhread_newkey
systhread_setdata
systhread_sleep
systhread_start
systhread_timerset
USE_NSAPI_VERSION
util_can_exec
util_chdir2path
util_chdir2path
util_cookie_find
util_env_find
util_env_free
util_env_replace
util_env_str
util_getline
util_hostname
util_is_mozilla
util_is_url
util_itoa
util_later_than
util_sh_escape
util_snprintf
util_sprintf
util_strcasecmp
util_strftime
util_strncasecmp
util_uri_escape
util_uri_is_evil
util_uri_parse
util_uri_unescape
util_vsnprintf
util_vsprintf
vs_alloc_slot
vs_get_data
vs_get_default_httpd_object
vs_get_doc_root
vs_get_httpd_objset
vs_get_id
vs_get_mime_type
vs_lookup_config_var
vs_register_cb
vs_set_data
vs_translate_uri
write
writev

Chapter 8   Data Structure Reference
Privatization of Some Data Structures
Session
pblock
pb_entry
pb_param
Session->client
Request
stat
shmem_s
cinfo
sendfiledata
Filter
FilterContext
FilterLayer
FilterMethods

Chapter 9   Using Wildcard Patterns
Wildcard Patterns
Wildcard Examples

Chapter 10   Time Formats
Chapter 11   Dynamic Results Caching Functions
dr_cache_destroy
dr_cache_init
dr_cache_refresh
dr_net_write
fc_net_write

Chapter 12   Hypertext Transfer Protocol
Compliance
Requests
Request Method, URI, and Protocol Version
Request Headers
Request Data
Responses
HTTP Protocol Version, Status Code, and Reason Phrase
Response Headers
Response Data
Buffered Streams

Appendix A   Alphabetical List of NSAPI Functions and Macros
Index


Previous      Index      Next     


Copyright 2004 Sun Microsystems, Inc. All rights reserved.