#include "tftp.h"

using namespace std;
using namespace tftp_tools;

int
main(int argc, char ** argv)
{
#ifdef __WIN32__
WSADATA wsaData;
WSAStartup(MAKEWORD(2,2), &wsaData);
#endif

   if(argc != 4) {
      cerr << "usage: tftp PUT | GET <host> <file>" << endl;
      exit(1);
   }
   tftp client(argv[2], 69);
   string file = argv[3];
   string host = argv[2];
   if(strcmp(argv[1], "GET") == 0) {
      client.get(file);
   }
   else if(strcmp(argv[1], "PUT") == 0) {
      client.put(file);
   }
#ifdef __WIN32__
WSACleanup();
#endif

   return 0;
}
