SYNOPSIS

int MGOinitialize (char *file)

DESCRIPTION

The MGOinitialize() function sets the rules used for establishing a connection to the Mango server. Rules appear one per line, in the form "rule=(value)", in the configuration file file. If file is NULL, or if MGOinitialize() is not called, the "default" set of rules will apply (see /usr/local/lib/mango/cconfig). The rules are as follows:

configfile is the location of another configuration file. This file is processed in-line. host is a blank-separated list of addresses of Mango servers. port is the Mango service's port number at the target address. socket is Mango's unix socket name for local connections. defoptions and options control the pre- and post-authenticated client options. They can be one or more of:

Prior to authentication, defoptions are in effect. It must match the server's value exactly. You can ding Mango with a 'q' datagram to determine what this value should be, or set the usedgram option to a value greater than 0 (the number of seconds to wait for a server response before giving up). After authentication, options are in effect (look here for a discussion on option naggling).

method controls the authentication method. It can be one of:

user is the name you wish to connect as. This can be either a user name, program name, or whatever. A "%s" directive inserts the client's user name, as determined by getlogin()/getuwuid(getuid()). If not specified, the default name is "anonymous".

Each rule can also be modified through its associated global variable MGOrule. Just remember that MGOinitialize() has to be called prior to changing any global variables. Subsequent calls to MGOinitialize() will change only the rules appearing in file.

EXAMPLE CONFIG FILE

# Mango client configuration file
#
defoptions=0
host=mango.u.washington.edu
method=2
options=2
port=645
socket=/dev/mgosock
usedgram=10
user=%s
#
krbfile=FILE:/usr/local/lib/mango/keytab
krbkey=pmango/%s
krbsrvkey=mango/%s
krbusecc=1
lscfile=/usr/local/lib/mango/ckeys
lsckey=pmango
lscsrvkey=mango
pwdfile=/usr/local/lib/mango/ckeys
pwdkey=pmango
pwdsalt=0xdeadbeef
pwdsrvkey=mango

RETURN VALUE

Returns 1 upon success or -1 if an error occurred (in which case MGOerrno and MGOerrmsg are set appropriately).

ERRORS

SEE ALSO

MGOconnect()