Class CSpoofSocket::
SendRawBuffer()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: SendNext page: SetBroadcast    Show member index
Public Function Declared in:
SpoofSocket.h

'Declaration' icon -- Shortcut to top of page. Declaration

virtual int SendRawBuffer(
    IP aDestinationAddress,
    const char* pBuffer,
    unsigned long ulBufferLength,
    unsigned short usDestinationPort);

'Description' icon -- Shortcut to top of page. Description

Send raw data Return value: Positive - The number of bytes sent. Negative - Error

'Function Body' icon -- Shortcut to top of page. Function Body

try
{
    //Quit if not ok
    //Make things the fastest
    if (m_aSpoofSocket==INVALID_SOCKET ||
        !m_bRaw)
        return FALSE;

    //Define the target address
    sockaddr_in m_TargetAddress;

    m_TargetAddress.sin_family=AF_INET;
    m_TargetAddress.sin_addr.s_addr=aDestinationAddress;
    m_TargetAddress.sin_port=htons(usDestinationPort);
    memset(&m_TargetAddress.sin_zero,0,sizeof(m_TargetAddress.sin_zero));

    //And send the data
    //Send the data
    int iResult;
    iResult=sendto(GetHandle(),
                   pBuffer,
                   ulBufferLength,
                   0,
                   (sockaddr*)&m_TargetAddress,
                   sizeof(m_TargetAddress));

    if (iResult==GetErrorCode())
        //Set the error
        SetLastError("SendRawBuffer");

    //Done
    return iResult;
}
ERROR_HANDLER_RETURN("SendRawBuffer",GetErrorCode())

'See Also' icon -- Shortcut to top of page. See Also

Class Overview Class Overview  |  Public base class CSpoofBase  |  Hierarchy Chart Hierarchy Chart


Get Surveyor!This web site was generated using Surveyor V4.50.811.1.  Click here for more information. Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003.