|
IBR-DTNSuite 0.6
|
00001 /* 00002 * StreamContactHeader.h 00003 * 00004 * Created on: 30.06.2009 00005 * Author: morgenro 00006 */ 00007 00008 00009 00010 #ifndef STREAMCONTACTHEADER_H_ 00011 #define STREAMCONTACTHEADER_H_ 00012 00013 00014 #include "ibrdtn/data/EID.h" 00015 #include "ibrdtn/data/Exceptions.h" 00016 #include <sys/types.h> 00017 00018 00019 using namespace dtn::data; 00020 00021 namespace dtn 00022 { 00023 namespace streams 00024 { 00025 static const unsigned char TCPCL_VERSION = 3; 00026 00027 class StreamContactHeader 00028 { 00029 public: 00030 enum HEADER_BITS 00031 { 00032 REQUEST_ACKNOWLEDGMENTS = 1 << 0, 00033 REQUEST_FRAGMENTATION = 1 << 1, 00034 REQUEST_NEGATIVE_ACKNOWLEDGMENTS = 1 << 2 00035 }; 00036 00037 StreamContactHeader(); 00038 StreamContactHeader(EID localeid); 00039 virtual ~StreamContactHeader(); 00040 00041 StreamContactHeader& operator=(const StreamContactHeader &other); 00042 00043 const EID getEID() const; 00044 00045 EID _localeid; 00046 char _flags; 00047 u_int16_t _keepalive; 00048 00049 friend std::ostream &operator<<(std::ostream &stream, const StreamContactHeader &h); 00050 friend std::istream &operator>>(std::istream &stream, StreamContactHeader &h); 00051 }; 00052 } 00053 } 00054 00055 #endif /* STREAMCONTACTHEADER_H_ */