#include <stdio.h>

#include "wind_validate.h"

int main(int argc, char *argv[]) {
    char *ticket, *service;
    char netid[30];		/* anonymous identifiers can be a bit long */
    char error[256];  /* error message */
				
/* Columbia's WIND system does not need to pass the service
   when calling validate. Only the ticket needs to be sent. */

    if (argc < 2) {
	ticket = "foo";
	service = "";
    } else {
	ticket = argv[1];
	service = "";
    }

    if (WIND_validate(ticket, service, netid, sizeof(netid), error))
	printf("valid ticket for '%s'\n", netid);
    else
      {
        printf("invalid ticket for ticket:'%s'", ticket);
	
	if (error!=NULL)
	  {
	    printf(" error: %s", error);
	  }
	printf ("\n");
      }
}
