SpoofSocket.hGo to the documentation of this file.00001 /* 00002 * Copyright (c) 2000-2003 Barak Weichselbaum <barak@komodia.com> 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions 00007 * are met: 00008 * 1. Redistributions of source code must retain the above copyright 00009 * notice, this list of conditions and the following disclaimer. 00010 * 2. Redistributions in binary form must reproduce the above copyright 00011 * notice, this list of conditions and the following disclaimer in the 00012 * documentation and/or other materials provided with the distribution. 00013 * 00014 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 00015 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00016 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00017 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 00018 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00019 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00020 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00021 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00022 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00023 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00024 * SUCH DAMAGE. 00025 * 00026 * Contact info: 00027 * ------------- 00028 * 00029 * Site: http://www.komodia.com 00030 * Main contact: barak@komodia.com 00031 * For custom projects, 00032 * consulting, or other 00033 * paid services: sales@komodia.com 00034 */ 00035 00036 #if !defined(AFX_SPOOFSOCKET_H__5BAEA068_961A_4652_8BBD_90B78F6FBB09__INCLUDED_) 00037 #define AFX_SPOOFSOCKET_H__5BAEA068_961A_4652_8BBD_90B78F6FBB09__INCLUDED_ 00038 00039 #if _MSC_VER > 1000 00040 #pragma once 00041 #endif // _MSC_VER > 1000 00042 00043 #include "SpoofBase.h" 00044 00045 KOMODIA_NAMESPACE_START 00046 ///////////////////////////////////////////////////////////////////////////// 00047 // CSpoofSocket command target 00048 ////////////////////////////////////////////////////////////////// 00049 // // 00050 // IP Header // 00051 // Implementation of RFC791 IP Header // 00052 // // 00053 ////////////////////////////////////////////////////////////////// 00054 00055 typedef struct _PseudoHeader 00056 { 00057 unsigned long ulSourceAddress; 00058 unsigned long ulDestinationAddress; 00059 unsigned char ucZeros; 00060 unsigned char ucPTCL; 00061 unsigned short usLength; 00062 } PseudoHeader; 00063 00064 typedef PseudoHeader FAR * LPPseudoHeader; 00065 00066 #define PseudoHeaderLength sizeof(PseudoHeader) 00067 00068 //IP Options flags (1bit) 00069 #define IPOption_COPY 128 00070 #define IPOption_DONT_COPY 0 00071 00072 //IP Options class (2 bits) 00073 #define IPOption_CONTROL 0 00074 #define IPOption_RESERVED 2 00075 #define IPOption_DEBUGGING 64 00076 #define IPOption_RESERVED2 6 00077 00078 //IP options type 00079 /*The Type of Service provides an indication of the abstract 00080 parameters of the quality of service desired. These parameters are 00081 to be used to guide the selection of the actual service parameters 00082 when transmitting a datagram through a particular network. Several 00083 networks offer service precedence, which somehow treats high 00084 precedence traffic as more important than other traffic (generally 00085 by accepting only traffic above a certain precedence at time of high 00086 load). The major choice is a three way tradeoff between low-delay, 00087 high-reliability, and high-throughput. 00088 00089 The use of the Delay, Throughput, and Reliability indications may 00090 increase the cost (in some sense) of the service. In many networks 00091 better performance for one of these parameters is coupled with worse 00092 performance on another. Except for very unusual cases at most two 00093 of these three indications should be set. 00094 00095 The type of service is used to specify the treatment of the datagram 00096 during its transmission through the internet system. Example 00097 mappings of the internet type of service to the actual service 00098 provided on networks such as AUTODIN II, ARPANET, SATNET, and PRNET 00099 is given in "Service Mappings" [8]. 00100 00101 The Network Control precedence designation is intended to be used 00102 within a network only. The actual use and control of that 00103 designation is up to each network. The Internetwork Control 00104 designation is intended for use by gateway control originators only. 00105 If the actual use of these precedence designations is of concern to 00106 a particular network, it is the responsibility of that network to 00107 control the access to, and use of, those precedence designations.*/ 00108 00109 #define IPOption_END_OPTION 0 //End of option list 00110 #define IPOption_NO_OPERATION 1 //Do nothing 00111 #define IPOption_SECURITY 2 //Security information 00112 #define IPOption_LOOSE_ROUTING 3 //Loose routing options 00113 #define IPOption_STRICT_ROUTING 9 //Strict source routing 00114 #define IPOption_RECORD_ROUTE 7 //Record route on datagram 00115 #define IPOption_STREAM 8 //Used to carry stream identifier 00116 #define IPOption_TIMESTAMP 4 //Internet timestamp 00117 00118 //IP options extensions - Security 00119 /*Specifies one of 16 levels of security (eight of which are 00120 reserved for future use). 00121 Compartments (C field): 16 bits 00122 00123 An all zero value is used when the information transmitted is 00124 not compartmented. Other values for the compartments field 00125 may be obtained from the Defense Intelligence Agency. 00126 00127 Handling Restrictions (H field): 16 bits 00128 00129 The values for the control and release markings are 00130 alphanumeric digraphs and are defined in the Defense 00131 Intelligence Agency Manual DIAM 65-19, "Standard Security 00132 Markings". 00133 00134 Transmission Control Code (TCC field): 24 bits 00135 00136 Provides a means to segregate traffic and define controlled 00137 communities of interest among subscribers. The TCC values are 00138 trigraphs, and are available from HQ DCA Code 530. 00139 00140 Must be copied on fragmentation. This option appears at most 00141 once in a datagram.*/ 00142 00143 #define IPOption_SECURITY_LENGTH 11 00144 00145 #define IPOption_SECURITY_UNCLASSIFIED 0 00146 #define IPOption_SECURITY_CONFIDENTIAL 0x1111000100110101b 00147 #define IPOption_SECURITY_EFTO 0x0111100010011010b 00148 #define IPOption_SECURITY_MMMM 0x1011110001001101b 00149 #define IPOption_SECURITY_PROG 0x0101111000100110b 00150 #define IPOption_SECURITY_RESTRICTED 0x1010111100010011b 00151 #define IPOption_SECURITY_SECRET 0x1101011110001000b 00152 #define IPOption_SECURITY_TOPSECRET 0x0110101111000101b 00153 #define IPOption_SECURITY_RESERVED1 0x0011010111100010b 00154 #define IPOption_SECURITY_RESERVED2 0x1001101011110001b 00155 #define IPOption_SECURITY_RESERVED3 0x0100110101111000b 00156 #define IPOption_SECURITY_RESERVED4 0x0010010010111101b 00157 #define IPOption_SECURITY_RESERVED5 0x0001001101011110b 00158 #define IPOption_SECURITY_RESERVED6 0x1000100110101111b 00159 #define IPOption_SECURITY_RESERVED7 0x1100010011010110b 00160 #define IPOption_SECURITY_RESERVED8 0x1110001001101011b 00161 00162 /*This option provides a way for the 16-bit SATNET stream 00163 identifier to be carried through networks that do not support 00164 the stream concept. 00165 00166 Must be copied on fragmentation. Appears at most once in a 00167 datagram.*/ 00168 00169 //IP options extensions - Stream ID 00170 #define IPOption_STREAM_LENGTH 4 00171 00172 /*The loose source and record route (LSRR) option provides a means 00173 for the source of an internet datagram to supply routing 00174 information to be used by the gateways in forwarding the 00175 datagram to the destination, and to record the route 00176 information. 00177 00178 The option begins with the option type code. The second octet 00179 is the option length which includes the option type code and the 00180 length octet, the pointer octet, and length-3 octets of route 00181 data. The third octet is the pointer into the route data 00182 indicating the octet which begins the next source address to be 00183 processed. The pointer is relative to this option, and the 00184 smallest legal value for the pointer is 4. 00185 00186 A route data is composed of a series of internet addresses. 00187 Each internet address is 32 bits or 4 octets. If the pointer is 00188 greater than the length, the source route is empty (and the 00189 recorded route full) and the routing is to be based on the 00190 destination address field. 00191 00192 If the address in destination address field has been reached and 00193 the pointer is not greater than the length, the next address in 00194 the source route replaces the address in the destination address 00195 field, and the recorded route address replaces the source 00196 address just used, and pointer is increased by four. 00197 00198 The recorded route address is the internet module's own internet 00199 address as known in the environment into which this datagram is 00200 being forwarded. 00201 00202 This procedure of replacing the source route with the recorded 00203 route (though it is in the reverse of the order it must be in to 00204 be used as a source route) means the option (and the IP header 00205 as a whole) remains a constant length as the datagram progresses 00206 through the internet. 00207 00208 This option is a loose source route because the gateway or host 00209 IP is allowed to use any route of any number of other 00210 intermediate gateways to reach the next address in the route. 00211 00212 Must be copied on fragmentation. Appears at most once in a 00213 datagram.*/ 00214 00215 /*The strict source and record route (SSRR) option provides a 00216 means for the source of an internet datagram to supply routing 00217 information to be used by the gateways in forwarding the 00218 datagram to the destination, and to record the route 00219 information. 00220 00221 The option begins with the option type code. The second octet 00222 is the option length which includes the option type code and the 00223 length octet, the pointer octet, and length-3 octets of route 00224 data. The third octet is the pointer into the route data 00225 indicating the octet which begins the next source address to be 00226 processed. The pointer is relative to this option, and the 00227 smallest legal value for the pointer is 4. 00228 00229 A route data is composed of a series of internet addresses. 00230 Each internet address is 32 bits or 4 octets. If the pointer is 00231 greater than the length, the source route is empty (and the 00232 00233 recorded route full) and the routing is to be based on the 00234 destination address field. 00235 00236 If the address in destination address field has been reached and 00237 the pointer is not greater than the length, the next address in 00238 the source route replaces the address in the destination address 00239 field, and the recorded route address replaces the source 00240 address just used, and pointer is increased by four. 00241 00242 The recorded route address is the internet module's own internet 00243 address as known in the environment into which this datagram is 00244 being forwarded. 00245 00246 This procedure of replacing the source route with the recorded 00247 route (though it is in the reverse of the order it must be in to 00248 be used as a source route) means the option (and the IP header 00249 as a whole) remains a constant length as the datagram progresses 00250 through the internet. 00251 00252 This option is a strict source route because the gateway or host 00253 IP must send the datagram directly to the next address in the 00254 source route through only the directly connected network 00255 indicated in the next address to reach the next gateway or host 00256 specified in the route. 00257 00258 Must be copied on fragmentation. Appears at most once in a 00259 datagram.*/ 00260 00261 //IP options extensions - Strict routing 00262 #define IPOption_STRICT_ROUTING_LENGTH 3 00263 #define IPOption_STRICT_ROUTING_POINTER 4 00264 00265 /*The Timestamp is a right-justified, 32-bit timestamp in 00266 milliseconds since midnight UT. If the time is not available in 00267 milliseconds or cannot be provided with respect to midnight UT 00268 then any time may be inserted as a timestamp provided the high 00269 order bit of the timestamp field is set to one to indicate the 00270 use of a non-standard value. 00271 00272 The originating host must compose this option with a large 00273 enough timestamp data area to hold all the timestamp information 00274 expected. The size of the option does not change due to adding 00275 00276 timestamps. The intitial contents of the timestamp data area 00277 must be zero or internet address/zero pairs. 00278 00279 If the timestamp data area is already full (the pointer exceeds 00280 the length) the datagram is forwarded without inserting the 00281 timestamp, but the overflow count is incremented by one. 00282 00283 If there is some room but not enough room for a full timestamp 00284 to be inserted, or the overflow count itself overflows, the 00285 original datagram is considered to be in error and is discarded. 00286 In either case an ICMP parameter problem message may be sent to 00287 the source host [3]. 00288 00289 The timestamp option is not copied upon fragmentation. It is 00290 carried in the first fragment. Appears at most once in a 00291 datagram.*/ 00292 00293 //IP options extensions - Time Stamp 00294 #define IPOption_TIMESTAMP_LENGTH 5 00295 00296 #define IPOption_TIMESTAMP_ONLY 0 00297 #define IPOption_TIMESTAMP_EACH 1 00298 #define IPOption_TIMESTAMP_PRE 2 00299 00300 #define IPOption_TIMESTAMP_SIZE 8 00301 00302 00303 typedef struct _IpHeader 00304 { 00305 unsigned char ucHeaderLength_Version; 00306 unsigned char ucTypeOfService; // Type of service 00307 unsigned short usTotalLength; // total length of the packet 00308 unsigned short usIdentification; // unique identifier 00309 unsigned short usFragmentationFlags; // flags 00310 unsigned char ucTTL; // Time To Live 00311 unsigned char ucProtocol; // protocol (TCP, UDP etc) 00312 unsigned short usChecksum; // IP Header checksum 00313 00314 unsigned long ulSourceAddress; // Source address 00315 unsigned long ulDestinationAddress; // Destination Address 00316 00317 } IpHeader; 00318 00319 typedef IpHeader FAR * LPIpHeader; 00320 00321 #define IpHeaderLength sizeof(IpHeader) 00322 00323 //Some IP constants 00324 //Version 00325 #define IpVersion 4 00326 00327 //Service types 00328 #define IpService_NETWORK_CONTROL 111 00329 #define IpService_INTERNETWORK_CONTROL 110 00330 #define IpService_CRITIC_ECP 101 00331 #define IpService_FLASH_OVERIDE 100 00332 #define IpService_FLASH 011 00333 #define IpService_IMMEDIATE 010 00334 #define IpService_PRIORITY 001 00335 #define IpService_ROUTINE 0 00336 00337 //Fragmetation flag 00338 #define IpFragFlag_MAY_FRAG 0x0000 00339 #define IpFragFlag_MORE_FRAG 0x2000 00340 #define IpFragFlag_LAST_FRAG 0x0000 00341 #define IpFragFlag_DONT_FRAG 0x4000 00342 00343 //Internet protocols 00344 #define IpProtocol_ICMP 1 00345 #define IpProtocol_TCP 6 00346 #define IpProtocol_UDP 17 00347 00348 #define IP_DEF_TTL 128 00349 00350 #define IPOption_WRAPSIZE 4 00351 #define IPOption_SIZE 40 00352 00353 #define IPOption_MAX_ROUTES 10 00354 00355 class CIPOptions : protected CSpoofBase 00356 { 00357 public: 00358 //Our option type 00359 typedef unsigned char OptionType; 00360 00361 //Option structure 00362 typedef struct _IPOption 00363 { 00364 OptionType aOptionType; 00365 unsigned char ucOptionLength; 00366 unsigned char ucOptionData; 00367 } IPOption; 00368 00369 //Routing structure 00370 typedef struct _Routing 00371 { 00372 int iRoutes; 00373 unsigned long ulRoutes[IPOption_MAX_ROUTES]; 00374 } Routing; 00375 public: 00376 //Ctor and Dtor 00377 CIPOptions(); 00378 CIPOptions(const CIPOptions& rIP); 00379 virtual ~CIPOptions(); 00380 protected: 00381 //Add option route 00382 void AddOption_Route(OptionType aRouteType, 00383 Routing aRoute); 00384 00385 //Add data to the buffer 00386 void AddToBuffer(const char* pBuffer, 00387 int iBufLength); 00388 00389 //Create an options prototype 00390 OptionType GetOption(unsigned char ucCopyFlag, 00391 unsigned char ucClassFlag, 00392 unsigned char ucTypeFlag); 00393 public: 00394 //Add options (according to the method name) 00395 void AddOption_Timestamp(OptionType tFlags, 00396 int iMaxStamps); 00397 void AddOption_LooseRoute(Routing tRoute); 00398 void AddOption_RecordRoute(int iMaxRoutes); 00399 void AddOption_StrictRoute(Routing tRoute); 00400 void AddOption_Stream(unsigned short usStreamID); 00401 virtual void AddOption_Security(unsigned short usType); 00402 virtual void AddOption_Nothing(); 00403 00404 //Delete all the options 00405 void Reset(); 00406 00407 //Set the autopad 00408 void SetAutoPad(BOOL bAutoPAD); 00409 00410 //Add list terminator 00411 virtual void AddOption_ENDLIST(); 00412 00413 //Get the length of the buffer 00414 int GetBufferLength() const; 00415 00416 //Get the buffer itself 00417 const char* GetBuffer() const; 00418 private: 00419 //No assigment operator 00420 CIPOptions& operator=(const CIPOptions& rOptions); 00421 00422 //Do we autopard 00423 BOOL m_bAutoPAD; 00424 00425 //Length of the buffer 00426 int m_iBufferLength; 00427 00428 //The buffer 00429 char* m_pBuffer; 00430 }; 00431 00432 //Value not specified within winsock2 00433 //Thanks on this one goes to Bjorn Stickler author of Natas 00434 #ifndef SIO_RCVALL 00435 #define SIO_RCVALL 0x98000001 00436 #endif 00437 00438 typedef unsigned long IP; 00439 00440 class CSpoofSocket : virtual public CSpoofBase 00441 { 00442 public: 00443 //Shutdown enum 00444 typedef enum _SocketShutdown 00445 { 00446 ssReceive, 00447 ssSend, 00448 ssBoth 00449 } SocketShutdown; 00450 00451 //Friend class the crafter 00452 friend class CIPCrafter; 00453 public: 00454 //Set receive timeout (for blocked only) 00455 BOOL SetReceiveTimeout(unsigned long ulMS); 00456 00457 //Get the socket handle 00458 SOCKET GetHandle()const; 00459 00460 //Set to be a broadcast 00461 BOOL SetBroadcast(BOOL bBroadcast); 00462 00463 //Is this socket created ? 00464 BOOL IsCreated()const; 00465 00466 //Check if socket if ready for writing 00467 BOOL CanWrite()const; 00468 00469 //Check if socket if ready for reading 00470 BOOL CanRead()const; 00471 00472 //Get the port if the remote connected system 00473 unsigned short GetPeerPort()const; 00474 00475 //Close one way of the socket (receive,send,both) 00476 BOOL Shutdown(SocketShutdown eHow); 00477 00478 //Get the address of the remote connected system 00479 long GetPeerAddress() const; 00480 00481 //Turn to be a sniffer socket (only for raw sockets) 00482 virtual BOOL Sniff(BOOL bSniff); 00483 00484 //Resolve a DNS entry (using winsock2 routines) 00485 static long ResolveDNS(const std::string& rAddress); 00486 00487 //Check if an address is valid 00488 static BOOL ValidAddress(const std::string& rAddress); 00489 00490 //Recieve data from remote socket, can be used with all 00491 //sub sockets (protocols) 00492 //Return value: 00493 //Positive - The number of bytes received. 00494 //Zero - Socket has been closed. 00495 //Negative - Error 00496 virtual int Receive(char* pBuffer, 00497 unsigned long ulBufferLength); 00498 00499 //Get the IP options 00500 CIPOptions* GetOptions()const; 00501 00502 //Do we allow options on this socket ? 00503 void SetOptions(BOOL bOptions); 00504 00505 //Set the packet Time to live 00506 void SetTTL(unsigned char ucTTL); 00507 00508 //Calculate the checksum for TCP and UDP 00509 unsigned short CalculatePseudoChecksum(const char* pBuffer, 00510 int iBufferLength, 00511 IP aDestinationAddress, 00512 int iPacketLength)const; 00513 00514 //Set source address for spoofing 00515 virtual void SetSourceAddress(IP aSourceAddress); 00516 virtual void SetSourceAddress(const std::string& rSourceAddress); 00517 00518 //Close the socket 00519 virtual BOOL Close(); 00520 00521 //Bind to a specific address 00522 virtual BOOL Bind(const std::string& rSourceAddress, 00523 unsigned short usPort); 00524 virtual BOOL Bind(IP aSourceAddress, 00525 unsigned short usPort); 00526 00527 //Send data to a socket , can be used with all 00528 //sub sockets (protocols) 00529 //Return value: 00530 //Positive - The number of bytes sent. 00531 //Negative - Error 00532 virtual int Send(IP aDestinationAddress, 00533 const char* pBuffer, 00534 unsigned long ulBufferLength, 00535 unsigned short usDestinationPort=0); 00536 virtual int Send(const std::string& rDestinationAddress, 00537 const char* pBuffer, 00538 unsigned long ulBufferLength, 00539 unsigned short usDestinationPort=0); 00540 00541 //Send raw data 00542 //Return value: 00543 //Positive - The number of bytes sent. 00544 //Negative - Error 00545 virtual int SendRawBuffer(IP aDestinationAddress, 00546 const char* pBuffer, 00547 unsigned long ulBufferLength, 00548 unsigned short usDestinationPort); 00549 00550 //Create a socket 00551 BOOL Create(int iProtocol); 00552 00553 //Create an IP header 00554 static LPIpHeader ConstructStaticIPHeader(unsigned char ucProtocol, 00555 unsigned short usFragmentationFlags, 00556 unsigned char ucTTL, 00557 unsigned short usIdentification, 00558 unsigned char ucHeaderLength); 00559 00560 //Calculate the data checksum 00561 static unsigned short CalculateChecksum(const unsigned short* pBuffer, 00562 int iSize); 00563 00564 //Operators, for compare 00565 bool operator==(const CSpoofSocket& rSocket)const; 00566 bool operator<(const CSpoofSocket& rSocket)const; 00567 00568 //Ctor and Dtor 00569 CSpoofSocket(BOOL bRawSocket); 00570 virtual ~CSpoofSocket(); 00571 protected: 00572 //Attach to a socket by constructor 00573 CSpoofSocket(SOCKET aSocket); 00574 00575 //Set the connected to 00576 void SetConnectedTo(const sockaddr_in& rAddress); 00577 00578 //Get the source address 00579 IP GetSourceAddress()const; 00580 00581 //Get the TTL 00582 unsigned char GetTTL()const; 00583 00584 //Get the protocol 00585 unsigned char GetProtocol()const; 00586 00587 //Do we have options 00588 BOOL HasOptions()const; 00589 00590 //Create an IP header 00591 virtual LPIpHeader ConstructIPHeader (unsigned char ucProtocol, 00592 unsigned short usFragmentationFlags, 00593 unsigned char ucTTL, 00594 unsigned short usIdentification, 00595 unsigned char ucHeaderLength)const; 00596 00597 //Check this socket is valid 00598 BOOL CheckSocketValid()const; 00599 00600 //Attach to a socket 00601 void AssignSocket(SOCKET aNewSocket, 00602 unsigned char ucProtocol=IPPROTO_TCP); 00603 00604 //Indication if we are a raw socket 00605 BOOL IsRaw()const; 00606 00607 //Set the protocol we are working on 00608 void SetProtocol(unsigned char iProtocol); 00609 00610 //Is our socket valid ? 00611 BOOL ValidSocket()const; 00612 00613 //initialize all the private memebers 00614 virtual void InitializeIP(); 00615 00616 //Set the address in the IP header 00617 virtual void SetIPHeaderAddress(LPIpHeader lpHead, 00618 IP aSourceAddress, 00619 IP aDestinationAddress)const; 00620 00621 //Last stop before sending the header 00622 virtual void FinalIPHeader(LPIpHeader lpHead)const; 00623 00624 //Recieve data from remote socket, saving the address 00625 virtual int ReceiveFrom(char* pBuffer, 00626 unsigned long ulBufferLength, 00627 IP& rIP, 00628 unsigned short& rSourcePort); 00629 private: 00630 //No copy Ctor 00631 CSpoofSocket(const CSpoofSocket& rSocket); 00632 00633 //No assigment operator 00634 CSpoofSocket& operator=(const CSpoofSocket& rSocket); 00635 00636 //Reseolve DNS 00637 static sockaddr_in InternalResolveDNS(const std::string& rAddress); 00638 00639 //Our options 00640 CIPOptions* m_pIPOptions; 00641 00642 //Do we have options 00643 BOOL m_bOptions; 00644 00645 //Are we raw ? 00646 BOOL m_bRaw; 00647 00648 //Time to live 00649 unsigned char m_ucTTL; 00650 00651 //The protocol 00652 unsigned char m_ucProtocol; 00653 00654 //Our source address 00655 IP m_ulSourceAddress; 00656 00657 //The actual socket handle 00658 SOCKET m_aSpoofSocket; 00659 00660 //Are we sniffing 00661 BOOL m_bSniffing; 00662 00663 //Are we an ovelapped socket 00664 BOOL m_bOverlapped; 00665 00666 //Remote address we are conencted to 00667 sockaddr_in m_aConnectedTo; 00668 }; 00669 00670 KOMODIA_NAMESPACE_END 00671 00672 #endif // !defined(AFX_SPOOFSOCKET_H__5BAEA068_961A_4652_8BBD_90B78F6FBB09__INCLUDED_) |