From dd8c28a58e58e84a22da44da03812eca879f70fa Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sat, 11 Sep 2010 10:11:57 +0100 Subject: [PATCH] auth: Add documentation for ktc_ListTokensEx Document ktc_ListTokensEx, and add a stub implementation of the function for Windows. Change-Id: Ie168081f1a991fcf13358a5a1eeb8d0b96f5800a Reviewed-on: http://gerrit.openafs.org/2825 Tested-by: BuildBot Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/auth/ktc.c | 21 +++++++++++++++++++++ src/auth/ktc_nt.c | 23 ++++++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/auth/ktc.c b/src/auth/ktc.c index 3e0e0a79f9..3478a009ed 100644 --- a/src/auth/ktc.c +++ b/src/auth/ktc.c @@ -736,6 +736,27 @@ ktc_ForgetToken(struct ktc_principal *aserver) } #endif /* NO_AFS_CLIENT */ +/*! + * An iterator which can list all cells with tokens in the cache + * + * This function may be used to list the names of all cells for which + * tokens exist in the current cache. The first time that it is called, + * prevIndex should be set to 0. On all subsequent calls, prevIndex + * should be set to the value returned in newIndex by the last call + * to the function. Note that there is no guarantee that the index value + * is monotonically increasing. + * + * @param prevIndex + * The index returned by the last call, or 0 if this is the first + * call in an iteration + * @param newIndex + * A pointer to an int which, upon return, will hold the next value + * to be used. + * @param cellName + * A pointer to a char * which, upon return, will hold a cellname. + * This must be freed by the caller using free() + */ + int ktc_ListTokensEx(int prevIndex, int *newIndex, char **cellName) { struct ViceIoctl iob; diff --git a/src/auth/ktc_nt.c b/src/auth/ktc_nt.c index 65aaac2853..0342f973a5 100644 --- a/src/auth/ktc_nt.c +++ b/src/auth/ktc_nt.c @@ -960,9 +960,30 @@ ForgetOneLocalToken(struct ktc_principal *aserver) return KTC_NOENT; } +/*! + * An iterator which can list all cells with tokens in the cache + * + * This function may be used to list the names of all cells for which + * tokens exist in the current cache. The first time that it is called, + * prevIndex should be set to 0. On all subsequent calls, prevIndex + * should be set to the value returned in newIndex by the last call + * to the function. Note that there is no guarantee that the index value + * is monotonically increasing. + * + * @param prevIndex + * The index returned by the last call, or 0 if this is the first + * call in an iteration + * @param newIndex + * A pointer to an int which, upon return, will hold the next value + * to be used. + * @param cellName + * A pointer to a char * which, upon return, will hold a cellname. + * This must be freed by the caller using free() + */ + int ktc_ListTokensEx(int prevIndex, int *newIndex, char **cellName) { - /* Not yet implemented */ + *cellName == NULL; return KTC_PIOCTLFAIL; }