Browse Source

klasa pseudopakietu + makefile + main

master
Piotr Dergun 7 years ago
parent
commit
0c15206723
5 changed files with 139 additions and 0 deletions
  1. +11
    -0
      Main.cpp
  2. +16
    -0
      Makefile
  3. +72
    -0
      Packet.cpp
  4. +40
    -0
      Packet.h
  5. +0
    -0
      main.cpp

+ 11
- 0
Main.cpp View File

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

+ 16
- 0
Makefile 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
- 0
Packet.cpp 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
- 0
Packet.h 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_ */

+ 0
- 0
main.cpp View File


Loading…
Cancel
Save