/* 
   authentication client test for podfuk-smb

   Copyright (C) Tim Potter 2000
   
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#include <stdio.h>
#include <stdlib.h>
#include "podfuk-smb-auth-cli.h"

int main(void)
{
	struct auth_token *tokens;
	int result, num_tokens;

	result = list_tokens(0, &tokens, &num_tokens);

	printf("result was %s\n", result ? "success" : "failure");

	if (result) {
		int i;

		printf("%d token%s returned\n", num_tokens, 
		       (num_tokens == 1) ? "" : "s");

		for (i = 0; i < num_tokens; i++) {
			printf("%d: %d/%s/%s/%s/%s\n", i, 
			       tokens[i].uid, tokens[i].sharename,
			       tokens[i].workgroup, tokens[i].username,
			       tokens[i].password);
		}
		
		free(tokens);
	}

	return 0;
}
