#ifndef __MYSTREAM_N2_H__
#define __MYSTREAM_N2_H__
#include <string.h>
#include "ns3/application.h"
#include "ns3/event-id.h"
#include "ns3/ptr.h"
#include "ns3/ipv4-address.h"
#include "ns3/data-list.h"
#include "ns3/pointer.h"
#include "ns3/timer.h"
#include "ns3/log.h"
#include "stream-application.h"
namespace ns3{
class Address;
class Socket;
class Packet;
class Timer;
class MyStream_n2 : public Application
{
public:
static TypeId GetTypeId (void);
MyStream_n2 ();
virtual ~MyStream_n2 ();
//void MyStream_n2_Notify (void);
void StreamNotify(void);
protected:
virtual void DoDispose (void);
private:
void StartApplication (void);
void StopApplication (void);
void Packet_recv (Ptr<Socket>);
void Send_Downstream_n4(Ptr<Packet>);
void Send_Downstream_n5(Ptr<Packet>);
void HandleAccept(Ptr<Socket>, const Address& from);
//void Filter(Ptr<Packet>);
//void Send_Upstream(void);
void n3_is_broken(void);
//uint32_t m_idsize;//8byte taple id
//uint32_t m_data;//50byte
//uint32_t m_sent; //current number of times to send packets
uint8_t *max_data_id;
//uint8_t *m_RecvBuf;
Address m_down_n4;
Address m_down_n5;
//Address m_up_n0;
Address m_up_n1;
Address m_local;
Ptr<Socket> m_n0_socket;
//Ptr<Socket> m_n1_socket;
Ptr<Socket> m_n4_socket;
Ptr<Socket> m_n5_socket;
//Ptr<Socket> m_n0_socket_accepted;
//Ptr<Socket> m_n1_socket_accepted;
Ptr<Socket> back_to_n1_socket;
Ptr<Packet> m_recvpacket;
EventId m_sendEvent; //identifer event
TypeId m_tid;
Time m_interval;
Timer m_timer;
Timer m_timer2;
Timer m_timer3;
// private:
};
}
#endif //__MYSTREAM_N2_H__
//#ifndef __MYSTREAM_N2_H__
//#define __MYSTREAM_N2_H__
//
//#include <string.h>
//#include "ns3/application.h"
//#include "ns3/event-id.h"
//#include "ns3/ptr.h"
//#include "ns3/ipv4-address.h"
//#include "ns3/data-list.h"
//#include "ns3/pointer.h"
//#include "ns3/timer.h"
//#include "ns3/log.h"
////#include "ns3/filter.h"
//
//
//namespace ns3{
//
// class Address;
// class Socket;
// class Packet;
// class Timer;
//
// class MyStream_n2 : public Application
// {
// public:
// static TypeId GetTypeId (void);
//
// MyStream_n2 ();
// virtual ~MyStream_n2 ();
// //void MyStream_n2_Notify (void);
//
// protected:
// virtual void DoDispose (void);
//
// private:
// void StartApplication (void);
// void StopApplication (void);
//
// void Packet_recv (Ptr<Socket>);
// void Send_Downstream_n4(Ptr<Packet>);
// void Send_Downstream_n5(Ptr<Packet>);
// void HandleAccept(Ptr<Socket>, const Address& from);
// void Filter(Ptr<Packet>);
// //void Send_Upstream (void);
//
// Address m_down_n4;
// Address m_down_n5;
// Address m_up_n0;
// Address m_up_n1;
// Address m_local;
// Ptr<Socket> m_n0_socket;
// Ptr<Socket> m_n1_socket;
// Ptr<Socket> m_n4_socket;
// Ptr<Socket> m_n5_socket;
// Ptr<Socket> m_n0_socket_accepted;
// Ptr<Socket> m_n1_socket_accepted;
// Ptr<Packet> m_recvpacket;
// EventId m_sendEvent; //identifer event
//
// TypeId m_tid;
// Time m_interval;
// Timer m_timer;
// Timer m_timer2;
// Timer m_timer3;
//
//// private:
//
// };
//}
//
//#endif //__MYSTREAM_N2_H__
//#ifndef __MYSTREAM_N2_H__
//#define __MYSTREAM_N2_H__
//
//#include <string.h>
//#include "ns3/application.h"
//#include "ns3/event-id.h"
//#include "ns3/ptr.h"
//#include "ns3/ipv4-address.h"
//#include "ns3/data-list.h"
//#include "ns3/pointer.h"
//#include "ns3/timer.h"
//#include "ns3/log.h"
////#include "ns3/filter.h"
//
//
//namespace ns3{
//
// class Address;
// class Socket;
// class Packet;
// class Timer;
//
// class MyStream_n2 : public Application
// {
// public:
// static TypeId GetTypeId (void);
//
// MyStream_n2 ();
// virtual ~MyStream_n2 ();
// //void MyStream_n2_Notify (void);
//
// protected:
// virtual void DoDispose (void);
//
// private:
// void StartApplication (void);
// void StopApplication (void);
//
// void Packet_recv (Ptr<Socket>);
// void Send_Downstream_n4(Ptr<Packet>);
// void Send_Downstream_n5(Ptr<Packet>);
// void HandleAccept(Ptr<Socket>, const Address& from);
// void Filter(Ptr<Packet>);
// //void Send_Upstream (void);
//
// Address m_down_n4;
// Address m_down_n5;
// Address m_up_n0;
// Address m_up_n1;
// Address m_local;
// Ptr<Socket> m_n0_socket;
// Ptr<Socket> m_n1_socket;
// Ptr<Socket> m_n4_socket;
// Ptr<Socket> m_n5_socket;
// Ptr<Socket> m_n0_socket_accepted;
// Ptr<Socket> m_n1_socket_accepted;
// Ptr<Packet> m_recvpacket;
// EventId m_sendEvent; //identifer event
//
// TypeId m_tid;
// Time m_interval;
// Timer m_timer;
// Timer m_timer2;
// Timer m_timer3;
//
//// private:
//
// };
//}
//
//#endif //__MYSTREAM_N2_H__
//#ifndef __MYSTREAM_N2_H__
//#define __MYSTREAM_N2_H__
//
//#include <string.h>
//#include "ns3/application.h"
//#include "ns3/event-id.h"
//#include "ns3/ptr.h"
//#include "ns3/ipv4-address.h"
//#include "ns3/data-list.h"
//#include "ns3/pointer.h"
//#include "ns3/timer.h"
//#include "ns3/log.h"
////#include "ns3/filter.h"
//
//namespace ns3{
//
// class Address;
// class Socket;
// class Packet;
// class Timer;
//
// class MyStream_n2 : public Application
// {
// public:
// static TypeId GetTypeId (void);
//
// MyStream_n2 ();
// virtual ~MyStream_n2 ();
// //void MyStream_n2_Notify (void);
//
// protected:
// virtual void DoDispose (void);
//
// private:
// void StartApplication (void);
// void StopApplication (void);
//
// void Packet_recv (Ptr<Socket>);
// void Send_Downstream_n4(Ptr<Packet>);
// void Send_Downstream_n5(Ptr<Packet>);
// void HandleAccept(Ptr<Socket>, const Address& from);
// void Filter(Ptr<Packet>);
// //void Send_Upstream (void);
//
// Address m_down_n4;
// Address m_down_n5;
// Address m_up_n0;
// Address m_up_n1;
// Address m_local;
// Ptr<Socket> m_n0_socket;
// Ptr<Socket> m_n1_socket;
// Ptr<Socket> m_n4_socket;
// Ptr<Socket> m_n5_socket;
// Ptr<Socket> m_n0_socket_accepted;
// Ptr<Socket> m_n1_socket_accepted;
// Ptr<Packet> m_recvpacket;
// EventId m_sendEvent; //identifer event
//
// TypeId m_tid;
// Time m_interval;
// Timer m_timer;
// Timer m_timer2;
// Timer m_timer3;
// uint8_t max_data_id[8];
//
//// private:
//
// };
//}
//
//#endif //__MYSTREAM_N2_H__
- 1
- 2
- 3
- 4
前往页