Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/Net/TFTP/TFTP_Parser.hpp

Go to the documentation of this file.
00001 /*
00002 
00003 NOTICE:  Block Number ARE ALWAYS FROM 1...WindowSize
00004 
00005 Block Number 0 means we STARTED !
00006 
00007 Someone must call this guy... Client/Server UDP... Done!
00008 
00009 */
00010 
00011 #ifndef __J2K__TFTP_Parser_HPP__
00012 #define __J2K__TFTP_Parser_HPP__
00013 
00014 #include <j2k/Fred/Standard.hpp>
00015 #include <j2k/Fred/String/Str-fn.hpp>
00016 
00017 #include <j2k/Net/TFTP/TFTP_header.hpp>
00018 #include <j2k/Net/TFTP/TFTP_Option.hpp>
00019 #include <j2k/Net/TFTP/TFTP_OptionSaved.hpp>
00020 #include <j2k/Net/TFTP/TFTP_DataAck.hpp>
00021 
00022 class TFTP_Parser;
00023 typedef void ( TFTP_Parser::*TFTP_ParserCallback )( char*, int ); 
00024 
00025 class TFTP_Parser
00026 {
00027 public:
00028 
00029          TFTP_Parser();
00030 virtual ~TFTP_Parser();
00031 
00032 /***************************************************************************
00033  s = packet->pkt
00034  ***************************************************************************
00035  ***************************************************************************/
00036 
00037       void  parseOptions( char* str, size_t  length, size_t  offset );
00038       char* scanParam(    char* str, size_t* len    );
00039       void  getParams(    char* str, size_t  offset );
00040 
00041 // Return 0, if the param has no associated value
00042 // Return 1, if the next param is taken as a value
00043 int select( int i );
00044 
00045 // Static functions and array of function table
00046 #include <j2k/Net/TFTP/TFTP_ParserStatic.hpp>
00047 
00048 // if not set, set default in TFTP_Option.
00049 private:
00050   BOOL    OACK_arg;
00051 
00052   int   blocksizeDefault;
00053   int  windowsizeDefault;
00054   int     timeoutDefault;
00055 
00056   size_t  expectedBlockSize;
00057 
00058   TFTP_ParserCallback* opTable;
00059 
00060   char*   array[12];
00061   size_t  array_sz;
00062 };
00063 
00064 #endif
00065 
00066 

Generated on Sun Oct 14 18:46:34 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001