klasa pseudopakietu + makefile + main

This commit is contained in:
2017-01-10 17:19:50 +01:00
parent db1ce5d94f
commit 0c15206723
5 changed files with 139 additions and 0 deletions

11
Main.cpp Normal file
View File

@@ -0,0 +1,11 @@
/*
* Main.cpp
*
* Created on: 07-01-2017
* Author: Piotr Dergun
*/
int main(int argc, char *argv[])
{
return 0;
}

View File

@@ -0,0 +1,16 @@
CXX = g++
CXXFLAGS = -Wall
LDFLAGS = -pthread
OBJ = Packet.o
all:
+@make simulation
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c -g $<
simulation: Main.o $(OBJ)
$(CXX) -g Main.cpp -o simulation $(OBJ) $(LDFLAGS)
clean:
rm -f *.o simulation

72
Packet.cpp Normal file
View File

@@ -0,0 +1,72 @@
/*
* Packet.cpp
*
* Created on: 10-01-2017
* Author: Piotr Dergun
*/
#include "Packet.h"
Packet::Packet()
{
// TODO Auto-generated constructor stub
}
Packet::~Packet()
{
// TODO Auto-generated destructor stub
}
//settery
void Packet::setSrcIP(string ip)
{
}
void Packet::setDstIP(string ip)
{
}
void Packet::setSrcPort(int port)
{
}
void Packet::setDstPort(int port)
{
}
void Packet::setMsg(string msg)
{
}
string Packet::getSrcIP()
{
}
string Packet::getDstIP()
{
}
int Packet::Packet::getSrcPort()
{
}
int Packet::getDstPort()
{
}
string Packet::getMsg()
{
}

40
Packet.h Normal file
View File

@@ -0,0 +1,40 @@
/*
* Packet.h
*
* Created on: 10-01-2017
* Author: Piotr Dergun
*/
#ifndef PACKET_H_
#define PACKET_H_
#include <iostream>
using namespace std;
class Packet
{
string srcIP;
string dstIP;
int srcPort;
int dstPort;
string msg;
public:
Packet();
virtual ~Packet();
//settery
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();
int getSrcPort();
int getDstPort();
string getMsg();
};
#endif /* PACKET_H_ */

View File