RX_SECIDX_K5 = 5, /** kerberos 5 tickets as tokens. */
} rx_securityIndex;
+/*
+ * We use an enum for the symbol definitions but have no need for a typedef
+ * because the enum is at least as wide as 'int' and these have to fit into
+ * a field of type 'char'. Direct assigment will do the right thing if the
+ * enum value fits into that type.
+ */
+enum {
+ RX_SECTYPE_UNK = 0,
+ RX_SECTYPE_NULL = 1,
+ RX_SECTYPE_VAB = 2,
+ RX_SECTYPE_KAD = 3,
+};
struct rx_securityObjectStats {
- char type; /* 0:unk 1:null,2:vab 3:kad */
+ char type; /* An RX_SECTYPE_* value */
char level;
char sparec[10]; /* force correct alignment */
afs_int32 flags; /* 1=>unalloc, 2=>auth, 4=>expired */
} else {
if (tconn.securityIndex != RX_SECIDX_KAD)
continue;
- if (withSecStats && (tconn.secStats.type == 3)
+ if (withSecStats && (tconn.secStats.type == RX_SECTYPE_KAD)
&& (tconn.secStats.level != onlyAuth))
continue;
}
if (withSecStats) {
switch ((int)tconn.secStats.type) {
- case 0:
+ case RX_SECTYPE_UNK:
if (tconn.securityIndex == RX_SECIDX_KAD)
printf
(" no GetStats procedure for security object\n");
break;
- case 1:
+ case RX_SECTYPE_NULL:
printf(" rxnull level=%d, flags=%d\n",
tconn.secStats.level, tconn.secStats.flags);
break;
- case 2:
+ case RX_SECTYPE_VAB:
printf(" rxvab level=%d, flags=%d\n",
tconn.secStats.level, tconn.secStats.flags);
break;
- case 3:{
+ case RX_SECTYPE_KAD:{
char *level;
char flags = tconn.secStats.flags;
if (tconn.secStats.level == 0)