BUILDMAP(3X)

NAME
buildmap, transin, transout - translate labels between computers

SYNOPSIS

#include <cbit.h>

struct mapping *buildmap(int fd, char *file, char *me, char *pw, server);

transin(struct mapping *map, struct label *foreign, struct label *domestic);

transout(struct mapping *map, struct label *domestic, struct label *foreign);

DESCRIPTION
Buildmap and its partner (which may be another instance of buildmap) at the far end of the stream fd work out a mapping for translating labels. The label space at the near end is defined by file , which contains ASCII representations of cbit(3) structures. The identity (for authorization purposes) of the near end is me, using a secret password pw. Each end challenges the other, using its own password to compose a response, whose validity is checked by verify ; see notary(3); The ends need not know each other's passwords. Server is to simplify the protocol: one end should have server set to zero, the other end to one.

Transout and transin translate labels according to the formula determined by buildmap. Labels in transit are represented in the binary form of the source machine and are translated on receipt, so transout's job is simpler. Both routines return 0 if translation is impossible or illegal, otherwise they perform the translation and return 1.

SEE ALSO
cbit(3), notary(3)

DIAGNOSTICS
These routines all return 0 on error.