Symulacja NAT na przedmiot Symulacje Komputerowe
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
822 B

  1. /*
  2. * Packet.cpp
  3. *
  4. * Created on: 10-01-2017
  5. * Author: Piotr Dergun
  6. */
  7. #include "Packet.h"
  8. Packet::Packet(string msg) : Packet()
  9. {
  10. this->setMsg(msg);
  11. }
  12. Packet::~Packet()
  13. {
  14. // TODO Auto-generated destructor stub
  15. }
  16. //settery
  17. void Packet::setSrcIp(string srcIp)
  18. {
  19. this->srcIp = srcIp;
  20. }
  21. void Packet::setDstIp(string dstIp)
  22. {
  23. this->dstIp = dstIp;
  24. }
  25. void Packet::setSrcPort(int srcPort)
  26. {
  27. this->srcPort = srcPort;
  28. }
  29. void Packet::setDstPort(int dstPort)
  30. {
  31. this->dstPort = dstPort;
  32. }
  33. void Packet::setMsg(string msg)
  34. {
  35. this->msg = msg;
  36. }
  37. string Packet::getSrcIp()
  38. {
  39. return this->srcIp;
  40. }
  41. string Packet::getDstIp()
  42. {
  43. return this->dstIp;
  44. }
  45. int Packet::Packet::getSrcPort()
  46. {
  47. return this->srcPort;
  48. }
  49. int Packet::getDstPort()
  50. {
  51. return this->dstPort;
  52. }
  53. string Packet::getMsg()
  54. {
  55. return this->msg;
  56. }