OpenAFS
OpenAFS distributed network file system
/cygdrive/c/src/openafs/openafs.git/repo/src/WINNT/netidmgr_plugin/afsnewcreds.h
00001 /*
00002  * Copyright (c) 2005,2006 Secure Endpoints Inc.
00003  *
00004  * Permission is hereby granted, free of charge, to any person
00005  * obtaining a copy of this software and associated documentation
00006  * files (the "Software"), to deal in the Software without
00007  * restriction, including without limitation the rights to use, copy,
00008  * modify, merge, publish, distribute, sublicense, and/or sell copies
00009  * of the Software, and to permit persons to whom the Software is
00010  * furnished to do so, subject to the following conditions:
00011  *
00012  * The above copyright notice and this permission notice shall be
00013  * included in all copies or substantial portions of the Software.
00014  *
00015  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00016  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00017  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00018  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
00019  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
00020  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00021  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00022  * SOFTWARE.
00023  */
00024 
00025 /* $Id$ */
00026 
00027 #ifndef __AFS_NEWCREDS_H
00028 #define __AFS_NEWCREDS_H
00029 
00030 typedef struct tag_afs_cred_row {
00031     wchar_t * cell;
00032     wchar_t * realm;
00033     afs_tk_method method;
00034     khm_int32 flags;
00035 } afs_cred_row;
00036 
00037 /* we checked whether this cell exists */
00038 #define DLGROW_FLAG_CHECKED  0x00000001
00039 
00040 /* cell was checked and was found to be valid */
00041 #define DLGROW_FLAG_VALID    0x00000002
00042 
00043 /* cell was deleted  */
00044 #define DLGROW_FLAG_DELETED  0x00000004
00045 
00046 /* tokens obtained for cell */
00047 #define DLGROW_FLAG_DONE     0x00000008
00048 
00049 /* tokens for this cell already exist */
00050 #define DLGROW_FLAG_EXISTS   0x00000010
00051 
00052 /* tokens for this cell exist and is listed under a different
00053    identity */
00054 #define DLGROW_FLAG_NOTOWNED 0x00000020
00055 
00056 /* tokens for this cell exist and are expired */
00057 #define DLGROW_FLAG_EXPIRED  0x00000040
00058 
00059 /* this cell was added because it was listed in the identity
00060    configuration */
00061 #define DLGROW_FLAG_CONFIG   0x00000080
00062 
00063 /* the subitem indexes for each data field */
00064 enum afs_ncwnd_subitems {
00065     NCAFS_IDX_CELL=0,
00066     NCAFS_IDX_REALM,
00067     NCAFS_IDX_METHOD
00068 };
00069 
00070 #define DLG_TOOLTIP_TIMER_ID 1
00071 #define DLG_TOOLTIP_TIMEOUT  5000
00072 
00073 typedef struct tag_afs_cred_list {
00074     afs_cred_row * rows;
00075     int n_rows;
00076     int nc_rows;
00077 } afs_cred_list;
00078 
00079 typedef struct tag_afs_dlg_data {
00080     khui_new_creds * nc;
00081 
00082     afs_cred_list creds;
00083 
00084     khm_int32 afs_enabled;
00085 
00086     BOOL tooltip_visible;
00087     BOOL dirty;
00088     HWND tooltip;
00089 
00090     /* list view state image indices */
00091     int idx_new_token;
00092     int idx_existing_token;
00093     int idx_bad_token;
00094 
00095     CRITICAL_SECTION cs;
00096 
00097     /* used with configuration dialogs */
00098     khm_boolean config_dlg;
00099     khui_config_init_data cfg;
00100     khm_handle ident;
00101 } afs_dlg_data;
00102 
00103 #define AFS_DLG_ROW_ALLOC 4
00104 
00105 INT_PTR CALLBACK
00106 afs_dlg_proc(HWND hwnd,
00107              UINT uMsg,
00108              WPARAM wParam,
00109              LPARAM lParam);
00110 
00111 void
00112 afs_dlg_update_rows(HWND hwnd, afs_dlg_data * d);
00113 
00114 void
00115 afs_cred_flush_rows(afs_cred_list * l);
00116 
00117 void
00118 afs_cred_free_rows(afs_cred_list * l);
00119 
00120 void
00121 afs_cred_assert_rows(afs_cred_list * l, int n);
00122 
00123 void
00124 afs_cred_delete_row(afs_cred_list * l, int i);
00125 
00126 afs_cred_row *
00127 afs_cred_get_new_row(afs_cred_list * l);
00128 
00129 khm_int32 KHMAPI
00130 afs_cred_add_cred_proc(khm_handle cred, void * rock);
00131 
00132 void
00133 afs_cred_get_context_creds(afs_cred_list *l,
00134                            khui_action_context * ctx);
00135 
00136 void
00137 afs_cred_get_identity_creds(afs_cred_list * l,
00138                             khm_handle ident,
00139                             khm_boolean * enabled);
00140 
00141 void
00142 afs_cred_write_ident_data(afs_dlg_data * d);
00143 
00144 khm_int32
00145 afs_msg_newcred(khm_int32 msg_subtype,
00146                 khm_ui_4 uparam,
00147                 void * vparam);
00148 
00149 #endif
 All Data Structures Files Functions Variables