IPXADDR.H 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. /* $Header: /CounterStrike/IPXADDR.H 1 3/03/97 10:24a Joe_bostic $ */
  15. /***************************************************************************
  16. ** 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 **
  17. ***************************************************************************
  18. * *
  19. * Project Name : Command & Conquer *
  20. * *
  21. * File Name : IPXADDR.H *
  22. * *
  23. * Programmer : Bill Randolph *
  24. * *
  25. * Start Date : December 19, 1994 *
  26. * *
  27. * Last Update : December 19, 1994 [BR] *
  28. * *
  29. * This class is useful for any IPX-related code. It's just a utility *
  30. * to help manage those annoying IPX address fields. This class lets you *
  31. * compare addresses, copy addresses to & from the IPX header, etc. *
  32. * *
  33. * The class has no virtual functions, so you can treat this class just *
  34. * like a data structure; it can be loaded & saved, and even transmitted *
  35. * across the net. *
  36. * *
  37. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  38. #ifndef IPXADDR_H
  39. #define IPXADDR_H
  40. #include "ipx.h" // for NetNumType & NetNodeType
  41. /*
  42. ***************************** Class Declaration *****************************
  43. */
  44. class IPXAddressClass
  45. {
  46. /*
  47. ---------------------------- Public Interface ----------------------------
  48. */
  49. public:
  50. /*.....................................................................
  51. Constructors:
  52. .....................................................................*/
  53. IPXAddressClass(void);
  54. IPXAddressClass(NetNumType net, NetNodeType node);
  55. IPXAddressClass(IPXHeaderType *header);
  56. /*.....................................................................
  57. Set the address from explicit variables, or from the SOURCE values
  58. in an IPX packet header.
  59. .....................................................................*/
  60. void Set_Address(NetNumType net, NetNodeType node);
  61. void Set_Address(IPXHeaderType *header);
  62. /*.....................................................................
  63. Get the address values explicitly, or copy them into the DESTINATION
  64. values in an IPX packet header.
  65. .....................................................................*/
  66. void Get_Address (NetNumType net, NetNodeType node);
  67. void Get_Address(IPXHeaderType *header);
  68. /*.....................................................................
  69. Tells if this address is a broadcast address
  70. .....................................................................*/
  71. int Is_Broadcast(void);
  72. /*.....................................................................
  73. Overloaded operators:
  74. .....................................................................*/
  75. int operator == (IPXAddressClass & addr);
  76. int operator != (IPXAddressClass & addr);
  77. int operator > (IPXAddressClass &addr);
  78. int operator < (IPXAddressClass &addr);
  79. int operator >= (IPXAddressClass &addr);
  80. int operator <= (IPXAddressClass &addr);
  81. /*
  82. -------------------------- Protected Interface ---------------------------
  83. */
  84. protected:
  85. /*
  86. --------------------------- Private Interface ----------------------------
  87. */
  88. private:
  89. NetNumType NetworkNumber;
  90. NetNodeType NodeAddress;
  91. };
  92. #endif
  93. /**************************** end of ipxaddr.h *****************************/