Annotation of 43BSDReno/contrib/isode-beta/acsap/acsapdse.c, revision 1.1.1.1

1.1       root        1: /* acsapdse.c - application entity info -- directory service interface */
                      2: 
                      3: #ifndef        lint
                      4: static char *rcsid = "$Header: /f/osi/acsap/RCS/acsapdse.c,v 7.2 90/07/09 14:30:29 mrose Exp $";
                      5: #endif
                      6: 
                      7: /* 
                      8:  * $Header: /f/osi/acsap/RCS/acsapdse.c,v 7.2 90/07/09 14:30:29 mrose Exp $
                      9:  *
                     10:  *
                     11:  * $Log:       acsapdse.c,v $
                     12:  * Revision 7.2  90/07/09  14:30:29  mrose
                     13:  * sync
                     14:  * 
                     15:  * Revision 7.1  90/07/01  21:01:53  mrose
                     16:  * pepsy
                     17:  * 
                     18:  * Revision 7.0  89/11/23  21:21:47  mrose
                     19:  * Release 6.0
                     20:  * 
                     21:  */
                     22: 
                     23: /*
                     24:  *                               NOTICE
                     25:  *
                     26:  *    Acquisition, use, and distribution of this module and related
                     27:  *    materials are subject to the restrictions of a license agreement.
                     28:  *    Consult the Preface in the User's Manual for the full terms of
                     29:  *    this agreement.
                     30:  *
                     31:  */
                     32: 
                     33: 
                     34: /* LINTLIBRARY */
                     35: 
                     36: #include <stdio.h>
                     37: #include "DSE-types.h"
                     38: #include "psap.h"
                     39: #include "isoaddrs.h"
                     40: #include "tailor.h"
                     41: 
                     42: /*    DATA */
                     43: 
                     44: static AEInfo aeis;
                     45: static struct PSAPaddr pas;
                     46: 
                     47: extern PE    name2value_dase ();
                     48: 
                     49: PE     (*acsap_lookup) () = name2value_dase;
                     50: 
                     51: /*  */
                     52: 
                     53: AEI    str2aei_dse (designator, qualifier, context, ontty)
                     54: char   *designator,
                     55:        *qualifier,
                     56:        *context;
                     57: int    ontty;
                     58: {
                     59:     char   *alias,
                     60:            name[BUFSIZ];
                     61:     PE     pe;
                     62:     register AEI aei = &aeis;
                     63:     register struct PSAPaddr *pa = &pas;
                     64:     static int first_time = 1;
                     65: 
                     66:     if (first_time)
                     67:        first_time = 0;
                     68:     else {
                     69:        AEIFREE (aei);
                     70:     }
                     71:     bzero ((char *) aei, sizeof *aei);
                     72: 
                     73:     if ((alias = alias2name (designator)) == NULL)
                     74:        alias = designator;
                     75:     (void) strcpy (name, alias);
                     76: 
                     77:     if (acsap_lookup == NULL) {
                     78:        PY_advise (NULLCP, "str2aei_dse: acsap_lookup function not set");
                     79:        SLOG (addr_log, LLOG_EXCEPTIONS, NULLCP, ("%s", PY_pepy));
                     80:        return NULLAEI;
                     81:     }
                     82: 
                     83:     bzero ((char *) pa, sizeof *pa);
                     84:     if (pe = (*acsap_lookup) (name, qualifier, context, ontty,
                     85:                              &aei -> aei_ap_title)) {
                     86:        if (parse_DSE_PSAPaddr (pe, 1, NULLIP, NULLVP, (char *) pa) == NOTOK) {
                     87:            SLOG (addr_log, LLOG_EXCEPTIONS, NULLCP,
                     88:                  ("parse of presentationAddress failed: %s", PY_pepy));
                     89:        }
                     90:        else
                     91:            PLOG (addr_log, print_DSE_PSAPaddr, pe, "address", 1);
                     92: 
                     93:        pe_free (pe);
                     94:     }
                     95:     else
                     96:        SLOG (addr_log, LLOG_EXCEPTIONS, NULLCP,
                     97:              ("directory returns no value"));
                     98: 
                     99:     return (aei -> aei_ap_title ? aei : NULLAEI);
                    100: }
                    101: 
                    102: /*  */
                    103: 
                    104: struct PSAPaddr *aei2addr_dse (aei)
                    105: AEI    aei;
                    106: {
                    107:     register struct PSAPaddr *pa;
                    108: 
                    109:     if (aei != &aeis) {
                    110:        SLOG (addr_log, LLOG_EXCEPTIONS, NULLCP,
                    111:              ("aei2addr_dse cache miss on %s", sprintaei (aei)));
                    112: 
                    113:        return NULLPA;
                    114:     }
                    115: 
                    116:     return ((pa = &pas) -> pa_addr.sa_addr.ta_naddr > 0 ? pa : NULLPA);
                    117: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.