Date: | 16-Mar-2001 |
Document number: | 2501,846/FS |
Change number: | ECO 4428 |
Master format: | HTML |
Issue: | 3 |
Last release: | 2 |
Associated project: | 310 "STB-400" |
Authors: | A.Hodgkinson |
Status: | Confidential (secret) © Pace Micro Technology plc |
# Video Control protocol module selection. VideoControl_ProtocolModules jupiter.eng.acorn.co.uk 53580 .eng.acorn.co.uk/testvideos/ 53540 .eng.acorn.co.uk/testvideos/2/ 535C0 # JavaScript video control extension security. NCFresco_JavaScript_VideoSecurity webpool.isp.com - users.isp.com -
CheckURL_Check |
(SWI &54140) |
R0 | = |
Flags:
|
||||||||||||
R1 | = | Pointer to a NUL-terminated area name string if R0:0 clear, else an area ID | ||||||||||||
R2 | = | Pointer to a NUL-terminated URL string if R0:1 clear, else pointer to a URL descriptor block |
R0 | = |
Flags:
|
|||||||||
R1 | = | Pointer to the parameter string associated with the matched fragment, NUL terminated, if R0:0 on exit is set, else preserved |
CheckURL_ReadAreaID |
(SWI &54141) |
R0 | = |
Flags:
|
|||||||||
R1 | = | Pointer to a NUL-terminated area name string if R0:0 clear, else an area ID |
R0 | = | Flags All bits currently reserved (must be zero) |
R1 | = | An area ID if R0:0 on entry was clear, else pointer to a NUL-terminated area name string |
CheckURL_ReadFile |
(SWI &54142) |
R0 | = | Flags: All bits currently reserved (must be zero) |
R1 | = | Pointer to NUL-terminated filename string |
VideoControl_ProtocolModules / 53580 .eng.acorn.co.uk/testvideos/ 53540and a client attempts to load this file:
VideoControl_ProtocolModules / 53A00 /multicast 53540the result is the same as loading the following in one go:
VideoControl_ProtocolModules / 53580 .eng.acorn.co.uk/testvideos/ 53540 / 53A00 /multicast 53540So with bottom-up matching, the / entry for 53580 would never get matched. Adding new areas or adding new fragments to existing areas does not alter the validity of area IDs.
CheckURL_AddArea |
(SWI &54143) |
R0 | = |
Flags:
|
||||||||||||
R1 | = | A NUL-terminated area name string if R0:0 clear, else an area ID | ||||||||||||
R2 | = | Pointer to a NUL-terminated set of CR or LF separated fragments and parameter pairs if R0:1 clear, else pointer to a NUL-terminated filename string; zero if no fragments are to be added to the area at this time |
R1 | = | Area ID of the (possibly new) area in use. |
CheckURL_DeleteArea |
(SWI &54144) |
R0 | = |
Flags:
|
||||||||||||
R1 | = | If R0:0 set, ignored. If R0:0 and R0:1 clear, pointer to a NUL-terminated area name string. If R0:0 clear and R0:1 set, an area ID |
Error no. | Meaning |
---|---|
&818600 |
Area not known A client has passed an unknown area name string or ID to SWI CheckURL_Check, CheckURL_ReadAreaID, or CheckURL_DeleteArea. |
&818601 |
Cannot open configuration file An attempt to open a configuration file has failed. This is only raised in response to any SWI that calls for a file to be read. |
&818602 |
Invalid configuration file Raised whenever any file read by Check URL is of an apparently invalid format. This includes finding an area name field if a file is read in SWI CheckURL_AddArea. |
&818603 |
Invalid fragments The URL fragments and parameters string given to SWI CheckURL_AddArea is of an apparently invalid format (for example, a fragment may be missing a parameter). |
&818604 |
Check URL could not claim enough memory Memory was exhausted during some allocation operation being performed by Check URL. |
#include <stdlib.h> #include <stdbool.h> #include <swis.h> /* This is exported via. Check URL's !MkExport */ #include <CheckURL.h> /* Area name to use */ #define AreaName "VideoControl_ProtocolModules" /* For any URL, this can hold a more complete description than */ /* strings, and makes comparing two URLs in a valid manner easier. */ typedef struct url_description { char * full; /* Complete, canonicalised URL */ char * protocol; /* Such as 'http' or 'mailto' */ char * host; /* E.g. 'www.acorn.com' */ char * port; /* For example '8080' */ char * user; /* E.g. 'ahodgkin' */ char * password; /* E.g. 'NotMine' */ char * account; /* As in ftp://user:pass:account@host/ */ char * path; /* Speaks for itself */ char * query; /* CGI info - after a '?' in a URL */ char * fragment; /* Anchor info - after a '#' in a URL */ } url_description; /**************************************************************/ /* url_match() */ /* */ /* Match a given URL_Description in the area recorded in */ /* 'ConfigArea' through the Check URL module. Caches the area */ /* ID for speed and will attempt to re-cache if this ID */ /* appears to become invalid later via. a recursive call. */ /* */ /* Parameters: Pointer to the url_description to match; */ /* */ /* Pointer to a char * to take a pointer to the */ /* match parameter (will be NULL on exit if the */ /* match fails); */ /* */ /* true to support the stale ID recovery attempt */ /* else false. */ /**************************************************************/ static _kernel_oserror * url_match(url_description * d, const char ** param, bool allow_fail) { static unsigned int area_id = 0; _kernel_oserror * e; unsigned int match; if (param == NULL) return NULL; *param = NULL; /* Ensure we have an area ID */ if (area_id == 0) { allow_fail = false; /* Make sure we don't try and reread it in a moment */ e = _swix(CheckURL_ReadAreaID, _INR(0,1) | _OUT(1), 0, AreaName, /* See near top of file */ &area_id); if (e != NULL) return e; } /* Try the match */ e = _swix(CheckURL_Check, _INR(0,2) | _OUTR(0,1), CU_Check_OnEntry_GivenAreaID | CU_Check_OnEntry_GivenURLDescriptor, area_id, d, &match, param); if (e == NULL) { /* If no match, clear "param" (R1 is preserved on exit for no match) */ if ((match & CU_Check_OnExit_MatchFound) == 0) *param = NULL; } else if (e->errnum == cu_ERROR_AREA_NOT_KNOWN && allow_fail) { /* Since allow_fail is true, we area allowed to fail on an area ID */ /* lookup. This is because we know IDs can become stale. In this */ /* case, try again, but only once. */ area_id = 0; e = url_match(d, param, false); } return e; }
Issue A | 06-Mar-2000 | First draft completed and checked (ADH) |
Issue B | 09-Mar-2000 | Released following review (ADH) |
Issue 1 | 21-Mar-2000 | Corrected a description of R1 that didn't match the description of flags in R0 and corrected description of the way in which fragments are added to existing areas (ADH) |
Issue 1A | 22-May-2000 | Extended CheckURL_AddArea to return an area ID in R1. ROM builds have to defer loading of the central configuration file. Gave example code for cacheing an area ID. Few typing errors fixed (ADH) |
Issue 1B | 05-Jul-2000 | Corrected example code which wasn't checking on-exit flags of the call to CheckURL_Check (ADH) |
Issue 2 | 04-Aug-2000 | Released following review (AMR 5390, ADH) |
Issue 3 | 16-Mar-2001 | Updated automatic section numbering to handle subsectionNumberingSections. Used full subsection numbers for SWIs. Updated references section using links into the drawing office search engine and added validation footer. Overall, all changes were internal. ECO allocated for release (ECO 4428, ADH) |