cleanup unused parameter warnings
[mech_eap.git] / util.h
diff --git a/util.h b/util.h
index e7ba9f9..ddf95a9 100644 (file)
--- a/util.h
+++ b/util.h
@@ -75,6 +75,12 @@ extern "C" {
 #define MIN(_a,_b)  ((_a)<(_b)?(_a):(_b))
 #endif
 
+#if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#define GSSEAP_UNUSED __attribute__ ((__unused__)) 
+#else
+#define GSSEAP_UNUSED
+#endif
+
 /* util_buffer.c */
 OM_uint32
 makeStringBuffer(OM_uint32 *minor,
@@ -154,7 +160,8 @@ enum gss_eap_token_type {
     TOK_TYPE_EXPORT_NAME             = 0x0401,  /* RFC 2743 exported name */
     TOK_TYPE_EXPORT_NAME_COMPOSITE   = 0x0402,  /* exported composite name */
     TOK_TYPE_DELETE_CONTEXT          = 0x0405,  /* RFC 2743 delete context */
-    TOK_TYPE_ESTABLISH_CONTEXT       = 0x0601,  /* establish context */
+    TOK_TYPE_INITIATOR_CONTEXT       = 0x0601,  /* initiator-sent context token */
+    TOK_TYPE_ACCEPTOR_CONTEXT        = 0x0602,  /* acceptor-sent context token */
 };
 
 /* inner token types and flags */
@@ -539,7 +546,9 @@ enum gss_eap_state {
     GSSEAP_STATE_AUTHENTICATE   = 0x02,     /* exchange EAP messages */
     GSSEAP_STATE_INITIATOR_EXTS = 0x04,     /* initiator extensions */
     GSSEAP_STATE_ACCEPTOR_EXTS  = 0x08,     /* acceptor extensions */
+#ifdef GSSEAP_ENABLE_REAUTH
     GSSEAP_STATE_REAUTHENTICATE = 0x10,     /* GSS reauthentication messages */
+#endif
     GSSEAP_STATE_ESTABLISHED    = 0x20,     /* context established */
     GSSEAP_STATE_ALL            = 0x3F
 };
@@ -552,7 +561,7 @@ enum gss_eap_state {
 void gssEapSmTransition(gss_ctx_id_t ctx, enum gss_eap_state state);
 #define GSSEAP_SM_TRANSITION(ctx, state)    gssEapSmTransition((ctx), (state))
 #else
-#define GSSEAP_SM_TRANSITION(ctx, state)    do { (ctx)->state = (state); } while (0)
+#define GSSEAP_SM_TRANSITION(ctx, newstate)    do { (ctx)->state = (newstate); } while (0)
 #endif
 
 #define GSSEAP_SM_TRANSITION_NEXT(ctx)      GSSEAP_SM_TRANSITION((ctx), GSSEAP_STATE_NEXT(GSSEAP_SM_STATE((ctx))))
@@ -577,13 +586,11 @@ struct gss_eap_sm {
 };
 
 /* state machine flags, set by handler */
-#define SM_FLAG_FORCE_SEND_TOKEN            0x00000001  /* send token even if empty */
-#define SM_FLAG_STOP_EVAL                   0x00000002  /* no more handlers for this state */
-#define SM_FLAG_RESTART                     0x00000004  /* restart state machine */
-#define SM_FLAG_OUTPUT_TOKEN_CRITICAL       0x00000008  /* output token is critical */
+#define SM_FLAG_FORCE_SEND_TOKEN            0x00000001  /* send token even if no inner tokens */
+#define SM_FLAG_OUTPUT_TOKEN_CRITICAL       0x00000002  /* output token is critical */
 
 /* state machine flags, set by state machine */
-#define SM_FLAG_INPUT_TOKEN_CRITICAL        0x40000000  /* input token was critical */
+#define SM_FLAG_INPUT_TOKEN_CRITICAL        0x10000000  /* input token was critical */
 
 #define SM_ITOK_FLAG_REQUIRED               0x00000001  /* received tokens must be present */