*** empty log message ***
authorJohn Kohl <jtkohl@mit.edu>
Fri, 7 Sep 1990 16:18:20 +0000 (16:18 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Fri, 7 Sep 1990 16:18:20 +0000 (16:18 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1100 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/asn.1/adr2kadr.c [new file with mode: 0644]
src/lib/krb5/asn.1/kadr2adr.c [new file with mode: 0644]

diff --git a/src/lib/krb5/asn.1/adr2kadr.c b/src/lib/krb5/asn.1/adr2kadr.c
new file mode 100644 (file)
index 0000000..9e0d329
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1989,1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/copyright.h>.
+ *
+ * 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 <krb5/copyright.h>
+#include <krb5/krb5.h>
+
+/*#include <time.h> */
+#include <isode/psap.h>
+#include "KRB5-types.h"
+#include "asn1glue.h"
+#include "asn1defs.h"
+
+#include <krb5/ext-proto.h>
+
+/* 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 (file)
index 0000000..4394923
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1989,1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/copyright.h>.
+ *
+ * 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 <krb5/copyright.h>
+#include <krb5/krb5.h>
+
+/*#include <time.h> */
+#include <isode/psap.h>
+#include "KRB5-types.h"
+#include "asn1glue.h"
+#include "asn1defs.h"
+
+#include <krb5/ext-proto.h>
+
+/* 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);
+}