klasa pseudopakietu + makefile + main
This commit is contained in:
11
Main.cpp
Normal file
11
Main.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* Main.cpp
|
||||
*
|
||||
* Created on: 07-01-2017
|
||||
* Author: Piotr Dergun
|
||||
*/
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
16
Makefile
16
Makefile
@@ -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
72
Packet.cpp
Normal 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
40
Packet.h
Normal 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_ */
|
||||
Reference in New Issue
Block a user