summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorJohn Carr <jfc@mit.edu>1992-08-21 02:42:39 +0000
committerJohn Carr <jfc@mit.edu>1992-08-21 02:42:39 +0000
commit4226d2a62cc402812baa55266514f53fa332c335 (patch)
tree36eb247487291633e4cb1418634206a40bdc9ec8 /src/include
parentdebb7eb36558fd89bf53447b2af7cdc9e2faae92 (diff)
downloadkrb5-4226d2a62cc402812baa55266514f53fa332c335.tar.gz
krb5-4226d2a62cc402812baa55266514f53fa332c335.tar.xz
krb5-4226d2a62cc402812baa55266514f53fa332c335.zip
For mips compiler, allow definition of "NO_NESTED_PROTOTYPES" to
suppress prototype function declarations within structure declarations. Change krb5_principal to be a pointer to structure; add accessor macros. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2337 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include')
-rw-r--r--src/include/krb5/base-defs.h45
1 files changed, 41 insertions, 4 deletions
diff --git a/src/include/krb5/base-defs.h b/src/include/krb5/base-defs.h
index a1f8f3e55..17365df9b 100644
--- a/src/include/krb5/base-defs.h
+++ b/src/include/krb5/base-defs.h
@@ -97,11 +97,48 @@ typedef char const * krb5_const_pointer;
#define OLDDECLARG(type, val) type val;
#endif /* STDC or PROTOTYPES */
-typedef krb5_data ** krb5_principal; /* array of strings */
- /* CONVENTION: realm is first elem. */
+#ifdef NO_NESTED_PROTOTYPES
+#define NPROTOTYPE(x) ()
+#else
+#define NPROTOTYPE(x) PROTOTYPE(x)
+#endif
+
+typedef struct krb5_principal_data {
+ krb5_data realm;
+ krb5_data *data;
+ krb5_int32 length;
+ krb5_int32 type;
+} krb5_principal_data;
+
+typedef krb5_principal_data *krb5_principal; /* array of strings */
+
+/*
+ * Per V5 spec on definition of principal types
+ */
+
+/* Name type not known */
+#define KRB5_NT_UNKNOWN 0
+/* Just the name of the principal as in DCE, or for users */
+#define KRB5_NT_PRINCIPAL 1
+/* Service and other unique instance (krbtgt) */
+#define KRB5_NT_SRV_INST 2
+/* Service with host name as instance (telnet, rcommands) */
+#define KRB5_NT_SRV_HST 3
+/* Service with host as remaining components */
+#define KRB5_NT_SRV_XHST 4
+/* Unique ID */
+#define KRB5_NT_UID 5
+
/* constant version thereof: */
-typedef krb5_data * const * krb5_const_principal;
+typedef const krb5_principal_data *krb5_const_principal;
-#define krb5_princ_realm(princ) ((princ)[0])
+#define krb5_princ_realm(princ) (&(princ)->realm)
+#define krb5_princ_set_realm(princ,value) ((princ)->realm = *(value))
+#define krb5_princ_set_realm_length(princ,value) (princ)->realm.length = (value)
+#define krb5_princ_set_realm_data(princ,value) (princ)->realm.data = (value)
+#define krb5_princ_size(princ) (princ)->length
+#define krb5_princ_type(princ) (princ)->type
+#define krb5_princ_name(princ) (princ)->data
+#define krb5_princ_component(princ,i) ((princ)->data + i)
#endif /* KRB5_BASE_DEFS__ */