![]() |
CSpoofSocket | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Class |
Declared in: SpoofSocket.h |
Copyright (c) 2000-2003 Barak Weichselbaum <barak@komodia.com> All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Contact info:
Site: http://www.komodia.com Main contact: barak@komodia.com For custom projects, consulting, or other paid services: sales@komodia.com
![]() |
virtual | CSpoofBase |
![]() |
sockaddr_in | m_aConnectedTo | Remote address we are conencted to |
![]() |
SOCKET | m_aSpoofSocket | The actual socket handle |
![]() |
BOOL | m_bOptions | Do we have options |
![]() |
BOOL | m_bOverlapped | Are we an ovelapped socket |
![]() |
BOOL | m_bRaw | Are we raw ? |
![]() |
BOOL | m_bSniffing | Are we sniffing |
![]() |
CIPOptions * | m_pIPOptions | Our options |
![]() |
unsigned char | m_ucProtocol | The protocol |
![]() |
unsigned char | m_ucTTL | Time to live |
![]() |
IP | m_ulSourceAddress | Our source address |
![]() |
CSpoofSocket( const CSpoofSocket& rSocket ) |
No copy Ctor | |
![]() |
CSpoofSocket( SOCKET aSocket ) |
Attach to a socket by constructor | |
![]() |
CSpoofSocket( BOOL bRawSocket ) |
Ctor and Dtor |
![]() |
virtual |
![]() |
void | AssignSocket( SOCKET aNewSocket, unsigned char ucProtocol=IPPROTO_TCP ) |
Attach to a socket |
![]() |
virtual BOOL | Bind( const std::string& rSourceAddress, unsigned short usPort ) |
Bind to a specific address |
![]() |
virtual BOOL | Bind( IP aSourceAddress, unsigned short usPort ) |
|
![]() |
static unsigned short | CalculateChecksum( const unsigned short* pBuffer, int iSize ) |
Calculate the data checksum |
![]() |
unsigned short | CalculatePseudoChecksum( const char* pBuffer, int iBufferLength, IP aDestinationAddress, int iPacketLength ) const |
Calculate the checksum for TCP and UDP |
![]() |
BOOL | CanRead() const |
Check if socket if ready for reading |
![]() |
BOOL | CanWrite() const |
Check if socket if ready for writing |
![]() |
BOOL | CheckSocketValid() const |
Check this socket is valid |
![]() |
virtual BOOL | Close() |
Close the socket |
![]() |
virtual LPIpHeader | ConstructIPHeader( unsigned char ucProtocol, unsigned short usFragmentationFlags, unsigned char ucTTL, unsigned short usIdentification, unsigned char ucHeaderLength ) const |
Create an IP header |
![]() |
static LPIpHeader | ConstructStaticIPHeader( unsigned char ucProtocol, unsigned short usFragmentationFlags, unsigned char ucTTL, unsigned short usIdentification, unsigned char ucHeaderLength ) |
Create an IP header |
![]() |
BOOL | Create( int iProtocol ) |
Create a socket |
![]() |
virtual void | FinalIPHeader( LPIpHeader lpHead ) const |
Last stop before sending the header |
![]() |
SOCKET | GetHandle() const |
Get the socket handle |
![]() |
CIPOptions * | GetOptions() const |
Get the IP options |
![]() |
long | GetPeerAddress() const |
Get the address of the remote connected system |
![]() |
unsigned short | GetPeerPort() const |
Get the port if the remote connected system |
![]() |
unsigned char | GetProtocol() const |
Get the protocol |
![]() |
IP | GetSourceAddress() const |
Get the source address |
![]() |
unsigned char | GetTTL() const |
Get the TTL |
![]() |
BOOL | HasOptions() const |
Do we have options |
![]() |
virtual void | initialize all the private memebers | |
![]() |
static sockaddr_in | InternalResolveDNS( const std::string& rAddress ) |
Reseolve DNS |
![]() |
BOOL | IsCreated() const |
Is this socket created ? |
![]() |
BOOL | IsRaw() const |
Indication if we are a raw socket |
![]() |
bool | operator <( const CSpoofSocket& rSocket ) const |
|
![]() |
CSpoofSocket & | operator =( const CSpoofSocket& rSocket ) |
No assigment operator |
![]() |
bool | operator ==( const CSpoofSocket& rSocket ) const |
Operators, for compare |
![]() |
virtual int | Receive( char* pBuffer, unsigned long ulBufferLength ) |
Recieve data from remote socket, can be used with all sub sockets (protocols) Return value: Positive - The number of bytes received. |
![]() |
virtual int | ReceiveFrom( char* pBuffer, unsigned long ulBufferLength, IP& rIP, unsigned short& rSourcePort ) |
Recieve data from remote socket, saving the address |
![]() |
static long | ResolveDNS( const std::string& rAddress ) |
Resolve a DNS entry (using winsock2 routines) |
![]() |
virtual int | Send( IP aDestinationAddress, const char* pBuffer, unsigned long ulBufferLength, unsigned short usDestinationPort=0 ) |
Send data to a socket , can be used with all sub sockets (protocols) Return value: Positive - The number of bytes received. |
![]() |
virtual int | Send( const std::string& rDestinationAddress, const char* pBuffer, unsigned long ulBufferLength, unsigned short usDestinationPort=0 ) |
|
![]() |
virtual int | SendRawBuffer( IP aDestinationAddress, const char* pBuffer, unsigned long ulBufferLength, unsigned short usDestinationPort ) |
Send raw data Return value: Positive - The number of bytes sent. |
![]() |
BOOL | SetBroadcast( BOOL bBroadcast ) |
Set to be a broadcast |
![]() |
void | SetConnectedTo( const sockaddr_in& rAddress ) |
Set the connected to |
![]() |
virtual void | SetIPHeaderAddress( LPIpHeader lpHead, IP aSourceAddress, IP aDestinationAddress ) const |
Set the address in the IP header |
![]() |
void | SetOptions( BOOL bOptions ) |
Do we allow options on this socket ? |
![]() |
void | SetProtocol( unsigned char ucProtocol ) |
Set the protocol we are working on |
![]() |
BOOL | SetReceiveTimeout( unsigned long ulMS ) |
Set receive timeout (for blocked only) |
![]() |
virtual void | SetSourceAddress( IP aSourceAddress ) |
Set source address for spoofing |
![]() |
virtual void | SetSourceAddress( const std::string& rSourceAddress ) |
|
![]() |
void | SetTTL( unsigned char ucTTL ) |
Set the packet Time to live |
![]() |
BOOL | Shutdown( SocketShutdown eHow ) |
Close one way of the socket (receive,send,both) |
![]() |
virtual BOOL | Sniff( BOOL bSniff ) |
Turn to be a sniffer socket (only for raw sockets) |
![]() |
static BOOL | ValidAddress( const std::string& rAddress ) |
Check if an address is valid |
![]() |
BOOL | ValidSocket() const |
Is our socket valid ? |
class CIPCrafter |
SpoofBase.h |
stdafx.h | for precompiled header directive |
SpoofSocket.h | |
ErrorHandlerMacros.h | |
Array_ptr.h | |
memory |
![]() |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |