From: John Kohl Date: Fri, 7 Sep 1990 16:18:20 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: krb5-1.0-alpha2~311 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=aa1f0783cbbd4b84800c2946561f489788bc82f8;p=krb5.git *** empty log message *** git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1100 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/asn.1/adr2kadr.c b/src/lib/krb5/asn.1/adr2kadr.c new file mode 100644 index 000000000..9e0d32933 --- /dev/null +++ b/src/lib/krb5/asn.1/adr2kadr.c @@ -0,0 +1,63 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1989,1990 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * Glue between Kerberos version and ISODE 6.0 version of structures. + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_adr2kadr_c[] = +"$Id$"; +#endif /* lint || saber */ + +#include +#include + +/*#include */ +#include +#include "KRB5-types.h" +#include "asn1glue.h" +#include "asn1defs.h" + +#include + +/* ISODE defines max(a,b) */ + + + +krb5_address * +KRB5_HostAddress2krb5_addr(val, error) +const struct type_KRB5_HostAddress *val; +register int *error; +{ + register krb5_address *retval; + + retval = (krb5_address *) xmalloc(sizeof(*retval)); + if (!retval) { + nomem: + *error = ENOMEM; + return 0; + } + xbzero(retval, sizeof(*retval)); + + if (qb_pullup(val->address) != OK) { + xfree(retval); + goto nomem; + } + retval->contents = (unsigned char *)xmalloc(val->address->qb_forw->qb_len); + if (!retval->contents) { + xfree(retval); + goto nomem; + } + retval->addrtype = val->addr__type; + retval->length = val->address->qb_forw->qb_len; + xbcopy(val->address->qb_forw->qb_data, + retval->contents, retval->length); + return(retval); +} + diff --git a/src/lib/krb5/asn.1/kadr2adr.c b/src/lib/krb5/asn.1/kadr2adr.c new file mode 100644 index 000000000..4394923f3 --- /dev/null +++ b/src/lib/krb5/asn.1/kadr2adr.c @@ -0,0 +1,52 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1989,1990 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * Glue between Kerberos version and ISODE 6.0 version of structures. + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_kadr2adr_c[] = +"$Id$"; +#endif /* lint || saber */ + +#include +#include + +/*#include */ +#include +#include "KRB5-types.h" +#include "asn1glue.h" +#include "asn1defs.h" + +#include + +/* ISODE defines max(a,b) */ + +struct type_KRB5_HostAddress * +krb5_addr2KRB5_HostAddress(val, error) +register krb5_address const *val; +register int *error; +{ + register struct type_KRB5_HostAddress *retval; + + retval = (struct type_KRB5_HostAddress *) xmalloc(sizeof(*retval)); + if (!retval) { + nomem: + *error = ENOMEM; + return(0); + } + xbzero(retval, sizeof(*retval)); + retval->addr__type = val->addrtype; + retval->address = str2qb((char *)val->contents, val->length, 1); + if (!retval->address) { + xfree(retval); + goto nomem; + } + return(retval); +}