IPXADDR.H 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. ** Command & Conquer(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /* $Header: F:\projects\c&c\vcs\code\ipxaddr.h_v 2.19 16 Oct 1995 16:44:54 JOE_BOSTIC $ */
  19. /***************************************************************************
  20. ** 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 **
  21. ***************************************************************************
  22. * *
  23. * Project Name : Command & Conquer *
  24. * *
  25. * File Name : IPXADDR.H *
  26. * *
  27. * Programmer : Bill Randolph *
  28. * *
  29. * Start Date : December 19, 1994 *
  30. * *
  31. * Last Update : December 19, 1994 [BR] *
  32. * *
  33. * This class is useful for any IPX-related code. It's just a utility *
  34. * to help manage those annoying IPX address fields. This class lets you *
  35. * compare addresses, copy addresses to & from the IPX header, etc. *
  36. * *
  37. * The class has no virtual functions, so you can treat this class just *
  38. * like a data structure; it can be loaded & saved, and even transmitted *
  39. * across the net. *
  40. * *
  41. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  42. #ifndef IPXADDR_H
  43. #define IPXADDR_H
  44. #include "ipx.h" // for NetNumType & NetNodeType
  45. /*
  46. ***************************** Class Declaration *****************************
  47. */
  48. class IPXAddressClass
  49. {
  50. /*
  51. ---------------------------- Public Interface ----------------------------
  52. */
  53. public:
  54. /*.....................................................................
  55. Constructors:
  56. .....................................................................*/
  57. IPXAddressClass(void);
  58. IPXAddressClass(NetNumType net, NetNodeType node);
  59. IPXAddressClass(IPXHeaderType *header);
  60. /*.....................................................................
  61. Set the address from explicit variables, or from the SOURCE values
  62. in an IPX packet header.
  63. .....................................................................*/
  64. void Set_Address(NetNumType net, NetNodeType node);
  65. void Set_Address(IPXHeaderType *header);
  66. /*.....................................................................
  67. Get the address values explicitly, or copy them into the DESTINATION
  68. values in an IPX packet header.
  69. .....................................................................*/
  70. void Get_Address (NetNumType net, NetNodeType node);
  71. void Get_Address(IPXHeaderType *header);
  72. /*.....................................................................
  73. Tells if this address is a broadcast address
  74. .....................................................................*/
  75. bool Is_Broadcast(void);
  76. /*.....................................................................
  77. Overloaded operators:
  78. .....................................................................*/
  79. int operator == (IPXAddressClass & addr);
  80. int operator != (IPXAddressClass & addr);
  81. int operator > (IPXAddressClass &addr);
  82. int operator < (IPXAddressClass &addr);
  83. int operator >= (IPXAddressClass &addr);
  84. int operator <= (IPXAddressClass &addr);
  85. /*
  86. -------------------------- Protected Interface ---------------------------
  87. */
  88. protected:
  89. /*
  90. --------------------------- Private Interface ----------------------------
  91. */
  92. private:
  93. NetNumType NetworkNumber;
  94. NetNodeType NodeAddress;
  95. };
  96. #endif
  97. /**************************** end of ipxaddr.h *****************************/