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.

66 lines
759 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. //settery
  13. void Packet::setSrcIp(string srcIp)
  14. {
  15. this->srcIp = srcIp;
  16. }
  17. void Packet::setDstIp(string dstIp)
  18. {
  19. this->dstIp = dstIp;
  20. }
  21. void Packet::setSrcPort(int srcPort)
  22. {
  23. this->srcPort = srcPort;
  24. }
  25. void Packet::setDstPort(int dstPort)
  26. {
  27. this->dstPort = dstPort;
  28. }
  29. void Packet::setMsg(string msg)
  30. {
  31. this->msg = msg;
  32. }
  33. string Packet::getSrcIp()
  34. {
  35. return this->srcIp;
  36. }
  37. string Packet::getDstIp()
  38. {
  39. return this->dstIp;
  40. }
  41. int Packet::Packet::getSrcPort()
  42. {
  43. return this->srcPort;
  44. }
  45. int Packet::getDstPort()
  46. {
  47. return this->dstPort;
  48. }
  49. string Packet::getMsg()
  50. {
  51. return this->msg;
  52. }