Академический Документы
Профессиональный Документы
Культура Документы
Note: Generally, this project is not being discussed under NDA with any accounts or third parties.
Should you require permission to discuss this with a particular organization outside the company,
please contact the author.
Revision: 0.4
Date: March 6,1996
Author(s): Philippe Choquier
Document: htmla.doc
Microsoft Confidential
1 Background
This specification describes the BGI based administrative tool for Microsoft Internet services. This tool
generates HTML documents and allow the configuration of the Microsoft W3, Gopher and FTP services
through any web browser.
It is exposed as a set of extension to the HTML format to query and update the status of services.
These extensions are used in scripts stored on the web server and interpreted by the htmla DLL to generate
HTML replies to queries received as URLs
2 Framework
All URL references will go to the HTML BGI DLL. An execution context will be provided by the path
contained after the ‘?’ character in the URL.
The characters before the first ‘/’ in the path will determine the service name : http, ftp, gopher or dir. The
“dir” services allow access to directory browsing functionalities, and is not an Internet service.
The characters between the first ‘/’ and ‘+’ ( if present ) will determine script name. The file name will be
constructed by concatenating the path of the DLL, the script name and the “.htr” extension.
All characters following ‘+’ ( if present ) will be stored in the “urlparam” variable ( see the variables
section below ), and will be typically be used to store an element reference ( see the discussion of
references in the verb section below ).
Ex:
http://www.gibraltar.com/scripts/htmla.dll?htttp/servprop
This will reference the servprop.htr script file stored in the same directory as htmla.dll
http://www.gibraltar.com/scripts/htmla.dll?htttp/servuser/list+11.0.0.1!255.255.255.255
This will reference the servuser/list.htr script file stored in the same directory as htmla.dll, with the
variable “urlparam” set to “11.0.0.1!255.255.255.255”
3 Syntax
The extended keywords described below cannot be nested, i.e. you cannot use a ‘<%’ construct while in
another.
The begin/end iteration defines a loop block that will be repeated loopvar times. This is to be used with a
list, such as the IP access lists and the virtual root list. The loopvar variable should be the count associated
with each list ( see the variables section below for the definition of lists and counters ).
3.3 IF
<%if exp1 relop exp2%>
Exp1 and Exp2 can be either a variable name as defined in the “variables” section below, or a literal
numeric or string ( inside quotes ) value. In either case, the type of both expression must match.
Operator Description
EQ equal
NE not equal
LT less than
GT greater than
LE less than or equal
GE greater than or equal
RF Reference ( for string only )
The RF ( Reference ) relational operator tests for the occurrence of Exp2 inside Exp1, where Exp1 is
parsed as the result of a FORM HTML construct, i.e. tests for Exp2 being the target of an assignment.
3.4 ELIF
<%elif exp1 relop exp2%>
See the discussion for the “IF” statement above.
3.5 ELSE
<%else%>
3.6 ENDIF
<%endif%>
3.7 ONERROR
<%onerror LabelReference%>
Will transfer execution to the given label if any error occurs ( i.e. reqstatus becomes not 0 ).
3.8 GOTO
<%goto LabelReference%>
Transfer execution to the given label. Scanning for label is forward looking only : you can only goto a
label following your current location.
3.9 LABEL
<%label LabelReference%>
Define a label.
3.10 REDIRECT
<%redirect%>URL<%/redirect%>
The text defined by this construction will be used as a URL to redirect the web server to ( i.e. a
HSE_REQ_SEND_URL call will be issued with this text as a parameter ).
3.11 POST
<%post%>service_info?message_body<%/post%>
This is an internal redirection request, where service_info will be decoded as service “/” script file, and
message_body will be presented to the service as if a POST request had been used.
The htmla.dll will reprocess this request as if it came from a client. This is mostly usefull to link between
“dir” and Internet services.
Verb execution will update the “reqstatus” variable, which will contains a numeric value giving the status
of the request. If the status is not zero the service configuration will not be updated.
This status can be used in the “onerror” andor “if” commands described above.
5 Variables
Variable names are case-insensitive.
All variables referencing a configuration structure as defined in inetcom.h or inetinfo.h is prefixed with
either “com” for INET_COM_CONFIG_INFO, “w3” for W3_CONFIG_INFO, “ftp” for
FTP_CONFIG_INFO, “gopher” for GOPHERD_CONFIG_INFO, “global” for
INET_INFO_GLOBAL_CONFIG_INFO.
All variables access will be rendered as an ASCII string. The type as defined in the following tables is to
be interpreted in the following way :
· String : returns an ASCII string
· DWORD : returns the ASCII representation of a DWORD.
· BOOL : can only returns “0” or “1”
Note that a .htr script is bound to one and only one service (HTTP, FTP, Gopher ) at a time. Access to
variables undefined for the current service will generate an error.
5.2 Dir Service
Name Type Description
reqstatus DWORD Status request ( see the error code section below for a list of values )
urlparam String The characters following the ‘+’ character in the URL, after skipping
the service name and the script name
remoteaddr String IP address of the client for the current request
hostname String Local host name as a fully qualified domain name if available, else as a
ASCII representation of the IP address.
reqparam String Contains the request body ( usually the result of a HTML FORM ).
Iter DWORD Current index while in a beginiteration construct ( 0 based )
htmlapath String From the W3SVC\Parameters\HtmlaPath::REG_SZ registry entry. This
allow the .htr files to be location independent.
arg1 String Access the 1st sub-parameter in urlparam, where sub-parameters are
separated with a ‘?’
arg2 String Access the 2nd sub-parameter in urlparam.
arg3 String Access the 3rd sub-parameter in urlparam.
Directory browsing
rootdir String Root directory of the current sub-directory browsing, with no tail ‘\’
except for the drive root directory
basedir String Root directory of the current sub-directory browsing, with no tail ‘\’
dircount DWORD Number of iteration of the direntry field
direntry String Iterated field for all sub-directories of rootdir ( except ‘.’ & ‘..’ ), without
leading or trailing ‘\’
dircompcount DWORD Number of iteration of the dircompentry & dirfcompentry fields
dircompentry String Iterated field for all components of the rootdir path, without leading or
trailing ‘\’ except for the drive root directory.
dirfcompentry String Iterated fields giving the full path for all component of the rootdir path,
without leading or trailing ‘\’ except for the drive root directory.
drivecount DWORD Number of iteration of the drivexxxentry fields.
drivenameentry String Drive name ( e.g. “c:” )
drivelabelentry String Drive label
drivetypeentry DWORD Drive type : 2 is removable, 3 is hard disk, 4 is network drive
6 Error code
The “reqstatus” variable will contain one of the following status indication :
Microsoft Confidential 1