/*++ Copyright (c) 2000 Microsoft Corporation. All rights reserved. --*/ #ifndef __FILTERDATASTRUCTURES_H_ #define __FILTERDATASTRUCTURES_H_ #include #include using namespace std ; // Keep all the sockets related to an IP in a list // so when a bind request is coming we can locate the primaty // connectin. typedef list< CAdapt > > SOCKLIST; // For Each IP we keep the session that was opened for it, // and a count (how many connections where made for this IP) // and a list of all its sockets. struct SessionItem { CComPtr spSession; int Count; SOCKLIST socklist; SessionItem() : Count(0) {} SessionItem(SessionItem const &s) : spSession(s.spSession), Count(s.Count), socklist(s.socklist) {} SessionItem& operator=(SessionItem const &s) { if (&s != this) { spSession = s.spSession; Count = s.Count; socklist = s.socklist; } return *this; } } ; struct UserIP { u_long IPAddr; LPSTR user; }; struct IPUserless:std::binary_function { bool operator() (const UserIP& _X, const UserIP& _Y) const { if (_X.IPAddr < _Y.IPAddr) return TRUE; if (_X.IPAddr > _Y.IPAddr) return FALSE; else return (strcmp(_X.user,_Y.user) > 0 ); } }; typedef std::map::iterator IT; #endif //__FILTERDATASTRUCTURES_H