connection_Setup.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * connection_Setup.h
  3. *
  4. * Created on: Nov 27, 2017
  5. * Author: anay
  6. */
  7. #ifndef CONNECTION_CONNECTION_SETUP_H_
  8. #define CONNECTION_CONNECTION_SETUP_H_
  9. #include <stdlib.h>
  10. #include <stdint.h>
  11. #include <string.h>
  12. #include <omnetpp.h>
  13. #include "Connection/connection.h"
  14. #include "Connection/sockets.h"
  15. class connection_Setup: public send_UDP {
  16. private:
  17. UDPSocket socket;
  18. uint64_t CID;
  19. Long_Header *pkt;
  20. uint32_t PN = 1;
  21. uint32_t version;
  22. uint32_t lastAckPn;
  23. public:
  24. void initialize(int stage);
  25. void handleMessage(cMessage *msg);
  26. void sendVersionNegotiation();
  27. void receiveVersionNegotiation(Long_Header *pkt);
  28. void sendClientInitial(uint32_t version, const char* string);
  29. void receiveClientInitial(Long_Header *pkt);
  30. void sendClientCleartext(uint32_t version, const char* string);
  31. void receiveClientCleartext(Long_Header *pkt);
  32. void sendServerStatelessRetry(uint32_t version, const char* string);
  33. void receiveServerStatelessRetry(Long_Header *pkt);
  34. void sendServerCleartext(uint32_t version, const char* string);
  35. void receiveServerCleartext(Long_Header *pkt);
  36. void sendRTTProtected(uint32_t version, const char* string);
  37. void receiveRTTProtected(Long_Header *pkt);
  38. };
  39. #endif /* CONNECTION_CONNECTION_SETUP_H_ */