⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 remotesimdlg.h

📁 此文件包含两个独立程序,Sender和Receiver,用于测试网络对RAW类型的IP包的传输
💻 H
字号:
// RemoteSimDlg.h : header file
//

#if !defined(AFX_REMOTESIMDLG_H__BE2E60A7_198A_11D6_9903_5254AB337F89__INCLUDED_)
#define AFX_REMOTESIMDLG_H__BE2E60A7_198A_11D6_9903_5254AB337F89__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CRemoteSimDlg dialog
#define MPEG_SEND_BUFFER_SIZE 17000 /*16*1024+150*/

#pragma pack(push,1)
struct MPEGIPHEADER{
	unsigned char hdLen:4;
	unsigned char ver:4;
	unsigned char tos;
	unsigned short totalLen;
	unsigned short flag;
	unsigned short offset:13;
	unsigned short offsetflag:3;
	unsigned char ttl;
	unsigned char protocol;
	unsigned short crc;
	unsigned long srcAdr;
	unsigned long dstAdr;
};
struct RTPHEADER
{
	unsigned char cc:4;
	unsigned char p:1;
	unsigned char x:1;
	unsigned char v:2;
	unsigned char pt:7;
	unsigned char m:1;
	unsigned short sn;
	unsigned int timestamp;
	unsigned int ssrc;
};
struct RTPDATA{
	struct RTPHEADER rtpHeader;
	unsigned char data[MPEG_SEND_BUFFER_SIZE-sizeof(struct RTPHEADER)];
};
#pragma pack(pop)

typedef struct MPEGSENDMESSAGE
{
	union{
		struct RTPDATA rtpData;
		unsigned char data[MPEG_SEND_BUFFER_SIZE];
	}UNION;
	int dataLen;
}MPEGSENDMESSAGE,*PMPEGSENDMESSAGE;

class CRemoteSimDlg : public CDialog
{
// Construction
public:
	CRemoteSimDlg(CWnd* pParent = NULL);	// standard constructor
// Dialog Data
	//{{AFX_DATA(CRemoteSimDlg)
	enum { IDD = IDD_REMOTESIM_DIALOG };
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CRemoteSimDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;
	CString m_strIP;
	CString m_strIP1;
	int m_nProtocol;
	MPEGSENDMESSAGE m_Message;
	struct sockaddr_in m_to;
	SOCKET m_s;
	int m_nLength;
	int m_nTimer;

	// Generated message map functions
	//{{AFX_MSG(CRemoteSimDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedBConnect();
	afx_msg void OnTimer(UINT nIDEvent);
private:
	char m_strTemp[50];
public:
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_REMOTESIMDLG_H__BE2E60A7_198A_11D6_9903_5254AB337F89__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -