00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00025
00026
00027 #ifndef PacketSequenceChecker_H
00028 #define PacketSequenceChecker_H
00029
00030 #ifdef MAGMA_IRIX
00031 #define H3D Magma
00032 #endif
00033
00034 #include "H3DNetworkingUtils/Config.h"
00035 #include <iostream>
00036
00037 namespace H3DNetworkingUtils {
00038
00042
00043 class H3D_NETWORKING_UTILS_DLL_SPEC PacketSequenceChecker {
00044 public:
00045 typedef unsigned short u_int16;
00046 typedef short int16;
00047 typedef unsigned int u_int32;
00048
00050 PacketSequenceChecker();
00051
00054 virtual bool inSequence(u_int16 seq);
00055
00056 protected:
00057
00058 private:
00059 static const int MIN_SEQUENTIAL;
00060 static const int MAX_ALLOWABLE_DIFF;
00061 static const int WRAP_CHECK;
00062
00063
00064 u_int16 prev_seq_num;
00065 u_int16 bad_seq;
00066 u_int16 probation;
00067 };
00068
00069 }
00070
00071 #endif