Click here to Skip to main content
15,881,709 members
Articles / Desktop Programming / MFC

EnetstatX

Rate me:
Please Sign up or sign in to vote.
4.42/5 (26 votes)
9 Jun 20041 min read 117.1K   4K   41  
Enhance netstat and packet filtering.
// ConnContainer1.h: interface for the CConnContainer class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_CONNCONTAINER1_H__9B173F89_208C_4C48_853B_9B20BF1D1F1D__INCLUDED_)
#define AFX_CONNCONTAINER1_H__9B173F89_208C_4C48_853B_9B20BF1D1F1D__INCLUDED_

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

#pragma warning(disable:4786) // get rid of stl warnings

#include "TCPTable.h"
#include <map>
#include <list>
#include <vector>
#include <algorithm>
using std::map;
using std::list;
using std::vector;

#include "afxmt.h"

/************************************************************************/
/* Note: 
Outgoing connection: (connection state is set to "ESTABLISHED")
+ new local port (don't care about remote context, but store it) #ACT

		Incomming connection: (connection state is set to "ESTABLISHED")
		+ on existing local port
			- new remote IP (don't care about remote port, but store it) #ACT
			+ same remote IP
				- different remote port(store it)			 #ACT
*/
/************************************************************************/
typedef vector <MIB_TCPROW_EX> vectTcpTable;

class CConnContainer  
{
	public:
		CConnContainer();
		virtual ~CConnContainer();

	public:
		static bool IsNewConnection();

	private:
		static vectTcpTable m_vTcpTable;
		static CCriticalSection __CriticalSection__;
};

#endif // !defined(AFX_CONNCONTAINER1_H__9B173F89_208C_4C48_853B_9B20BF1D1F1D__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Romania Romania
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions