CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

IPXADDR.H (4924B)


      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 
      9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 
     10 // in the hope that it will be useful, but with permitted additional restrictions 
     11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 
     12 // distributed with this program. You should have received a copy of the 
     13 // GNU General Public License along with permitted additional restrictions 
     14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
     15 
     16 /* $Header:   F:\projects\c&c\vcs\code\ipxaddr.h_v   2.19   16 Oct 1995 16:44:54   JOE_BOSTIC  $ */
     17 /***************************************************************************
     18  **   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        **
     19  ***************************************************************************
     20  *                                                                         *
     21  *                 Project Name : Command & Conquer                        *
     22  *                                                                         *
     23  *                    File Name : IPXADDR.H                                *
     24  *                                                                         *
     25  *                   Programmer : Bill Randolph                            *
     26  *                                                                         *
     27  *                   Start Date : December 19, 1994                        *
     28  *                                                                         *
     29  *                  Last Update : December 19, 1994   [BR]                 *
     30  *                                                                         *
     31  * This class is useful for any IPX-related code.  It's just a utility		*
     32  * to help manage those annoying IPX address fields.  This class lets you	*
     33  * compare addresses, copy addresses to & from the IPX header, etc.			*
     34  *                                                                         *
     35  * The class has no virtual functions, so you can treat this class just		*
     36  * like a data structure; it can be loaded & saved, and even transmitted	*
     37  * across the net.																			*
     38  *                                                                         *
     39  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     40 
     41 #ifndef IPXADDR_H
     42 #define IPXADDR_H
     43 
     44 #include "ipx.h"				// for NetNumType & NetNodeType
     45 
     46 
     47 /*
     48 ***************************** Class Declaration *****************************
     49 */
     50 class IPXAddressClass
     51 {
     52 	/*
     53 	---------------------------- Public Interface ----------------------------
     54 	*/
     55 	public:
     56 		/*.....................................................................
     57 		Constructors:
     58 		.....................................................................*/
     59 		IPXAddressClass(void);
     60 		IPXAddressClass(NetNumType net, NetNodeType node);
     61 		IPXAddressClass(IPXHeaderType *header);
     62 
     63 		/*.....................................................................
     64 		Set the address from explicit variables, or from the SOURCE values
     65 		in an IPX packet header.
     66 		.....................................................................*/
     67 		void Set_Address(NetNumType net, NetNodeType node);
     68 		void Set_Address(IPXHeaderType *header);
     69 		/*.....................................................................
     70 		Get the address values explicitly, or copy them into the DESTINATION
     71 		values in an IPX packet header.
     72 		.....................................................................*/
     73 		void Get_Address (NetNumType net, NetNodeType node);
     74 		void Get_Address(IPXHeaderType *header);
     75 
     76 		/*.....................................................................
     77 		Tells if this address is a broadcast address
     78 		.....................................................................*/
     79 		bool Is_Broadcast(void);
     80 
     81 		/*.....................................................................
     82 		Overloaded operators:
     83 		.....................................................................*/
     84 		int operator == (IPXAddressClass & addr);
     85 		int operator != (IPXAddressClass & addr);
     86 		int operator > (IPXAddressClass &addr);
     87 		int operator < (IPXAddressClass &addr);
     88 		int operator >= (IPXAddressClass &addr);
     89 		int operator <= (IPXAddressClass &addr);
     90 	/*
     91 	-------------------------- Protected Interface ---------------------------
     92 	*/
     93 	protected:
     94 	/*
     95 	--------------------------- Private Interface ----------------------------
     96 	*/
     97 	private:
     98 		NetNumType NetworkNumber;
     99 		NetNodeType NodeAddress;
    100 };
    101 
    102 #endif
    103 /**************************** end of ipxaddr.h *****************************/