Sun Java logo     Copyright      Index      Next     

Sun logo
Sun Java System Web Proxy Server 4.0.1 Developer's Guide 

Contents


About This Guide
Who Should Use This Guide
How This Guide Is Organized
Documentation Conventions
Using the Documentation
Contacting Sun Technical Support
Third-Party Web Site References
Feedback

Chapter 1   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
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
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
Connect
DNS
Filter
Route

Chapter 2   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 3   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

Chapter 4   NSAPI Function Reference
NSAPI Functions (in Alphabetical Order)
C
cache_digest
cache_filename
cache_fn_to_dig
CALLOC
ce_free
ce_lookup
cif_write_entry
cinfo_find
condvar_init
condvar_notify
condvar_terminate
condvar_wait
crit_enter
crit_exit
crit_init
crit_terminate
D
daemon_atrestart
dns_set_hostent
F
fc_close
fc_open
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
fs_blk_size
fs_blks_avail
func_exec
func_find
func_insert
I
insert
L
log_error
M
magnus_atrestart
MALLOC
N
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
P
param_create
param_free
pblock_copy
pblock_create
pblock_dup
pblock_find
pblock_findlong
pblock_findval
pblock_free
pblock_nlinsert
pblock_nninsert
pblock_nvinsert
pblock_pb2env
pblock_pblock2str
pblock_pinsert
pblock_remove
pblock_replace_name
pblock_str2pblock
PERM_CALLOC
PERM_FREE
PERM_MALLOC
PERM_REALLOC
PERM_STRDUP
prepare_nsapi_thread
protocol_dump822
protocol_finish_request
protocol_handle_session
protocol_parse_request
protocol_scan_headers
protocol_set_finfo
protocol_start_response
protocol_status
protocol_uri2url
protocol_uri2url_dynamic
R
read
REALLOC
remove
request_create
request_free
request_header
S
sem_grab
sem_init
sem_release
sem_terminate
sem_tgrab
sendfile
session_create
session_dns
session_free
session_maxdns
shexp_casecmp
shexp_cmp
shexp_match
shexp_valid
shmem_alloc
shmem_free
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_init
systhread_newkey
systhread_setdata
systhread_sleep
systhread_start
systhread_terminate
systhread_timerset
U
USE_NSAPI_VERSION
util_can_exec
util_chdir2path
util_cookie_find
util_does_process_exist
util_env_create
util_env_find
util_env_free
util_env_replace
util_env_str
util_get_current_gmt
util_get_int_from_aux_file
util_get_int_from_file
util_get_long_from_aux_file
util_get_long_from_file
util_get_string_from_aux_file
util_get_string_from_file
util_getline
util_hostname
util_is_mozilla
util_is_url
util_itoa
util_later_than
util_make_filename
util_make_gmt
util_make_local
util_move_dir
util_move_file
util_parse_http_time
util_put_int_to_file
util_put_long_to_file
util_put_string_to_aux_file
util_put_string_to_file
util_sect_id
util_sh_escape
util_snprintf
util_sprintf
util_strcasecmp
util_strftime
util_strncasecmp
util_uri_check
util_uri_escape
util_uri_is_evil
util_uri_parse
util_uri_unescape
util_url_cmp
util_url_fix_host name
util_url_has_FQDN
util_vsnprintf
util_vsprintf
W
write
writev

Chapter 5   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
The CacheEntry Data Structure
The CacheState Data Structure
The ConnectMode Data Structure

Chapter 6   Using Wildcard Patterns
Wildcard Patterns
Wildcard Examples

Chapter 7   Time Formats
Chapter 8   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


Copyright      Index      Next     


Part No: 819-3652-10.   Copyright 2004 Sun Microsystems, Inc. All rights reserved.