NAME

map_autodrm_netsta, map_seed_chanloc, map_autodrm_chanaux, map_seed_netsta, autodrm_net, seed_net, autodrm_aux, seed_loc, finit_db - map between SEED or autoDRM station/channel keys and CSS 3.0 keys

SYNOPSIS

int finit_db ( Dbptr db )

int map_autodrm_netsta ( char *anet, char *fsta, char *sta );
int map_seed_netsta ( char *snet, char *fsta, char *sta );

int map_autodrm_chanaux ( char *sta, char *fchan, char *aux, char *chan );
int map_seed_chanloc ( char *sta, char *fchan, char *loc, char *chan );

int autodrm_net ( char *sta, char *anet, char *fsta );
int seed_net ( char *sta, char *snet, char *fsta );

int autodrm_aux ( char *sta, char *chan, char *fchan, char *aux );
int seed_loc ( char *sta, char *chan, char *fchan, char *loc );

DESCRIPTION

Increasingly, there are situations where station and channel codes do not uniquely identify a data stream. SEED uses net and loc codes to disambiguate these situations; autodrm uses net and aux codes.

One method of dealing with this would be to modify the css3.0 schema to add net (and loc/aux) to every table where sta (and chan) are currently keys. However, this is a fairly high cost solution involving modifying all programs which reference these keys, and adding extra fields to the keys for a table would have a cost in execution speed also.

For many sites, this is only an occasional issue, warranting a less expensive solution: folding the network code into the station key, and the loc/aux code into the channel key, only when required. It's important that this happen in a well-defined manner, however. These routines address that issue.

These routines use one of the following tables: anetsta, snetsta, achanloc, or schanloc. Typically, a program initializes the database in which these tables should be found by calling finit_db; otherwise, a local foreignkeys database is used.

map_autodrm_netsta maps a net and station code from autodrm into a sta code for the local css3.0 database.

map_autodrm_chanaux maps a channel and aux code from autodrm into a chan code for a local css3.0 database; it also requires a local sta code.

autodrm_net and autodrm_aux perform the reverse mapping.

Similarly, map_seed_netsta maps a net and station code from seed into a sta code for the local css3.0 database.

map_seed_chanloc maps a channel and loc code from seed into a chan code for a local css3.0 database; it also requires a local sta code.

seed_net and seed_loc perform the reverse mapping.

FILES

The default central database is specified in the trdefaults.pf(5) file.

RETURN VALUES

These routines return zero when one match is found, -1 if no matches are found, and -2 if multiple matches are found. If seed_net or seed_loc returns a net, sta, chan or loc code which is too long for SEED, the return value is -5; this indicates a problem in either trdefaults.pf, or the snetsta or schanloc tables. Of course, no matches are found if the mapping database is not present.

When no match is found, the value returned is the input sta or chan name for the routines mapping foreign keys to local keys.

The routines mapping local keys to foreign keys return default values (taken from trdefaults.pf(5)) when no match is found.

When multiple matches are found, the values from one of the matching records is returned.

LIBRARY

$(TRLIBS)

DIAGNOSTICS

These routines leave no messages on the error log.

SEE ALSO

trdefaults(5)
trmapnames(1)

BUGS AND CAVEATS

It's important to declare the output strings with plenty of space, as the routines do not attempt to limit the size of the output. In the case where no mapping exists, they return the sta followed by underscore and net code, or loc/aux code followed by underscore and chan.

There's no easy way to fill the various tables; they must be filled by hand.

The underlying tables do not allow for time dependencies in the mappings.

AUTHOR

Daniel Quinlan

Table of Contents
Antelope Release 4.11 SunOS 5.10 2010-01-13
Boulder Real Time Technologies, Inc For more information, contact support@brtt.com