From 26a7863de80ac8508b7ae9136568c38ec8f86fc1 Mon Sep 17 00:00:00 2001 From: PioDer Date: Tue, 10 Jan 2017 17:31:20 +0100 Subject: [PATCH] klasa NATItem + poprawka Packet --- NATItem.cpp | 20 ++++++++++++++++++++ NATItem.h | 25 +++++++++++++++++++++++++ Packet.cpp | 8 ++++---- Packet.h | 12 ++++++------ 4 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 NATItem.cpp create mode 100644 NATItem.h diff --git a/NATItem.cpp b/NATItem.cpp new file mode 100644 index 0000000..31f7791 --- /dev/null +++ b/NATItem.cpp @@ -0,0 +1,20 @@ +/* + * NATItem.cpp + * + * Created on: 10-01-2017 + * Author: Piotr Dergun + */ + +#include "NATItem.h" + +NATItem::NATItem() +{ + // TODO Auto-generated constructor stub + +} + +NATItem::~NATItem() +{ + // TODO Auto-generated destructor stub +} + diff --git a/NATItem.h b/NATItem.h new file mode 100644 index 0000000..ec5ece9 --- /dev/null +++ b/NATItem.h @@ -0,0 +1,25 @@ +/* + * NATItem.h + * + * Created on: 10-01-2017 + * Author: Piotr Dergun + */ + +#ifndef NATITEM_H_ +#define NATITEM_H_ + +#include +using namespace std; + +class NATItem +{ + int timeout; // czas (w sekundach) zajętości portu (0 - port wolny) + string ip; // IP wewn. do którego ma trafić odpowiedź / z którego przyszło żądanie + int port; // port komputera wewn. do którego ma trafić odpowiedź + +public: + NATItem(); + virtual ~NATItem(); +}; + +#endif /* NATITEM_H_ */ diff --git a/Packet.cpp b/Packet.cpp index 9f6a7ff..2efb34a 100644 --- a/Packet.cpp +++ b/Packet.cpp @@ -19,12 +19,12 @@ Packet::~Packet() } //settery -void Packet::setSrcIP(string ip) +void Packet::setSrcIp(string ip) { } -void Packet::setDstIP(string ip) +void Packet::setDstIp(string ip) { } @@ -44,12 +44,12 @@ void Packet::setMsg(string msg) } -string Packet::getSrcIP() +string Packet::getSrcIp() { } -string Packet::getDstIP() +string Packet::getDstIp() { } diff --git a/Packet.h b/Packet.h index 732d150..2d8ca9d 100644 --- a/Packet.h +++ b/Packet.h @@ -13,8 +13,8 @@ using namespace std; class Packet { - string srcIP; - string dstIP; + string srcIp; + string dstIp; int srcPort; int dstPort; string msg; @@ -23,15 +23,15 @@ public: virtual ~Packet(); //settery - void setSrcIP(string ip); - void setDstIP(string ip); + void setSrcIp(string ip); + void setDstIp(string ip); void setSrcPort(int port); void setDstPort(int port); void setMsg(string msg); //gettery - string getSrcIP(); - string getDstIP(); + string getSrcIp(); + string getDstIp(); int getSrcPort(); int getDstPort(); string getMsg();