WSPUDP.H 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // Copyright 2020 Electronic Arts Inc.
  3. //
  4. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free
  5. // software: you can redistribute it and/or modify it under the terms of
  6. // the GNU General Public License as published by the Free Software Foundation,
  7. // either version 3 of the License, or (at your option) any later version.
  8. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed
  9. // in the hope that it will be useful, but with permitted additional restrictions
  10. // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
  11. // distributed with this program. You should have received a copy of the
  12. // GNU General Public License along with permitted additional restrictions
  13. // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
  14. /***********************************************************************************************
  15. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  16. ***********************************************************************************************
  17. * *
  18. * Project Name : Command & Conquer *
  19. * *
  20. * $Archive:: /Sun/WSPUDP.h $*
  21. * *
  22. * $Author:: Joe_b $*
  23. * *
  24. * $Modtime:: 8/05/97 6:45p $*
  25. * *
  26. * $Revision:: 3 $*
  27. * *
  28. *---------------------------------------------------------------------------------------------*
  29. * Functions: *
  30. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  31. #ifndef WSPUDP_H
  32. #define WSPUDP_H
  33. #include "WSProto.h"
  34. #include <nspapi.h>
  35. /*
  36. ** Class to allow access to UDP specific portions of the Winsock interface.
  37. **
  38. */
  39. class UDPInterfaceClass : public WinsockInterfaceClass {
  40. public:
  41. UDPInterfaceClass (void);
  42. virtual ~UDPInterfaceClass(void);
  43. virtual long Message_Handler(HWND window, UINT message, UINT wParam, LONG lParam);
  44. virtual bool Open_Socket ( SOCKET socketnum );
  45. virtual void Set_Broadcast_Address ( void *address );
  46. virtual void Broadcast (void *buffer, int buffer_len);
  47. virtual ProtocolEnum Get_Protocol (void) {
  48. return (PROTOCOL_UDP);
  49. };
  50. virtual int Protocol_Event_Message (void) {
  51. return (WM_UDPASYNCEVENT);
  52. };
  53. private:
  54. /*
  55. ** Address to use when broadcasting a packet.
  56. */
  57. DynamicVectorClass <unsigned char *> BroadcastAddresses;
  58. /*
  59. ** List of local addresses.
  60. */
  61. DynamicVectorClass <unsigned char *> LocalAddresses;
  62. };
  63. #endif