| iMatix home page
| << | < | > | >>
SMT Logo SMT
Version 2.81

 

smtauth_init

#include "smtdefn.h"
int
smtauth_init (void)

Synopsis

Initialises the SMT authorisation agent. Returns 0 if initialised okay, -1 if there was an error. Supports these public methods:
OPEN Create a protected url symbol table.
REOPEN Reload authorisation data
CHECK URL Check if a url is protected.
CHECK NAME Check user name and password for a url; returns user name.
CLOSE Free symbol table and end thread.
Sends errors to the SMTOPER agent.

Source Code - (smtauth.c)

{
    AGENT  *agent;                      /*  Handle for our agent             */
    THREAD *thread;                     /*  Handle to console thread         */
#   include "smtauth.i"                 /*  Include dialog interpreter       */

    /*                      Method name   Event value        Priority        */
    /*  Shutdown event comes from Kernel                                     */
    method declare (agent, "SHUTDOWN",    shutdown_event,    SMT_PRIORITY_MAX);

    /*  Public methods supported by this agent                               */
    method declare (agent, "OPEN",        open_event,        0);
    method declare (agent, "REOPEN",      reopen_event,      0);
    method declare (agent, "CHECK_URL",   check_url_event,   0);
    method declare (agent, "CHECK_NAME",  check_name_event,  0);
    method declare (agent, "CLOSE",       close_event,       0);

    /*  Ensure that operator console is running, else start it up            */
    smtoper init ();
    if ((thread = thread lookup (SMT_OPERATOR, "")) != NULL)
        console = thread-> queue-> qid;
    else
        return (-1);

    /*  Signal okay to caller that we initialised okay                       */
    return (0);
}

| << | < | > | >> iMatix Copyright © 1996-99 iMatix Corporation