summaryrefslogtreecommitdiffstats
path: root/knetworkconf/knetworkconf/kaddressvalidator.h
diff options
context:
space:
mode:
Diffstat (limited to 'knetworkconf/knetworkconf/kaddressvalidator.h')
-rw-r--r--knetworkconf/knetworkconf/kaddressvalidator.h48
1 files changed, 24 insertions, 24 deletions
diff --git a/knetworkconf/knetworkconf/kaddressvalidator.h b/knetworkconf/knetworkconf/kaddressvalidator.h
index 9e1df59..5a05d84 100644
--- a/knetworkconf/knetworkconf/kaddressvalidator.h
+++ b/knetworkconf/knetworkconf/kaddressvalidator.h
@@ -19,7 +19,7 @@
#define KADDRESSVALIDATOR_H
/*
- Class for validating IP address and netmasks, and to calculate network and broadcast values.
+ Class for validating IP address and nettqmasks, and to calculate network and broadcast values.
The functions to do the last two things where taken from the code of ipcalc.c, made by
Erik Troan <ewt@redhat.com> and Preston Brown <pbrown@redhat.com> from Red Hat Inc.
*/
@@ -30,12 +30,12 @@
\def IPBITS
\brief the number of bits in an IP address.
*/
-#define IPBITS (sizeof(Q_UINT32) * 8)
+#define IPBITS (sizeof(TQ_UINT32) * 8)
/*!
\def IPBYTES
\brief the number of bytes in an IP address.
*/
-#define IPBYTES (sizeof(Q_UINT32))
+#define IPBYTES (sizeof(TQ_UINT32))
#include <sys/types.h>
#include <sys/socket.h>
@@ -43,7 +43,7 @@
#include <netinet/in.h>
#include <tqstring.h>
-/**Class that has simple methods for validating IP addresses, netmasks, calculating
+/**Class that has simple methods for validating IP addresses, nettqmasks, calculating
broadcast and network addresses.
*@author Juan Luis Baptiste
@@ -55,19 +55,19 @@ public:
~KAddressValidator();
/** Validates if the address written by the user is a valid one. Return true if it is and false if not. */
static bool isValidIPAddress(TQString addr);
- /** Validates if the Netmask written by the user is a valid one. Return true if it is and false if not. */
- static bool isNetmaskValid(TQString addr);
+ /** Validates if the Nettqmask written by the user is a valid one. Return true if it is and false if not. */
+ static bool isNettqmaskValid(TQString addr);
/** Validates if the Network written by the user is a valid one. Return true if it is and false if not. */
static bool isNetworkValid(const TQString &addr);
/** Validates if the Broadcast written by the user is a valid one. Return true if it is and false if not. */
static bool isBroadcastValid(TQString addr);
- /** Is a wrapper function to calc_network that receives the IP address and netsmask as TQString and
+ /** Is a wrapper function to calc_network that receives the IP address and netstqmask as TQString and
returns the network value also as a TQString, or NULL if it couldn't be calculated. */
- static TQString calculateNetwork(TQString addr,TQString netmask);
-/** Is a wrapper function to calc_broadcast that receives the IP address and netsmask as TQString and
+ static TQString calculateNetwork(TQString addr,TQString nettqmask);
+/** Is a wrapper function to calc_broadcast that receives the IP address and netstqmask as TQString and
returns the broadcast value also as a TQString, or NULL if it couldn't be calculated. */
- static TQString calculateBroadcast(TQString addr, TQString netmask);
+ static TQString calculateBroadcast(TQString addr, TQString nettqmask);
private: // Private methods
/** \fn unsigned long int calc_broadcast(unsigned long int addr, int prefix)
@@ -88,29 +88,29 @@ private: // Private methods
\return the base address of the network that addr is associated with, in
network byte order. */
static unsigned long int calc_network(unsigned long int addr, int prefix);
- /** \fn unsigned long int prefix2mask(int bits)
- \brief creates a netmask from a specified number of bits
+ /** \fn unsigned long int prefix2tqmask(int bits)
+ \brief creates a nettqmask from a specified number of bits
- This function converts a prefix length to a netmask. As CIDR (classless
+ This function converts a prefix length to a nettqmask. As CIDR (classless
internet domain internet domain routing) has taken off, more an more IP
addresses are being specified in the format address/prefix
- (i.e. 192.168.2.3/24, with a corresponding netmask 255.255.255.0). If you
- need to see what netmask corresponds to the prefix part of the address, this
- is the function. See also \ref mask2prefix.
+ (i.e. 192.168.2.3/24, with a corresponding nettqmask 255.255.255.0). If you
+ need to see what nettqmask corresponds to the prefix part of the address, this
+ is the function. See also \ref tqmask2prefix.
- \param prefix is the number of bits to create a mask for.
- \return a network mask, in network byte order.
+ \param prefix is the number of bits to create a tqmask for.
+ \return a network tqmask, in network byte order.
*/
- static unsigned long int prefix2mask(int prefix);
- /** \fn int mask2prefix(unsigned long int mask)
- \brief calculates the number of bits masked off by a netmask.
+ static unsigned long int prefix2tqmask(int prefix);
+ /** \fn int tqmask2prefix(unsigned long int tqmask)
+ \brief calculates the number of bits tqmasked off by a nettqmask.
This function calculates the significant bits in an IP address as specified by
- a netmask. See also \ref prefix2mask.
+ a nettqmask. See also \ref prefix2tqmask.
- \param mask is the netmask, specified as an unsigned long integer in network byte order.
+ \param tqmask is the nettqmask, specified as an unsigned long integer in network byte order.
\return the number of significant bits. */
- static int mask2prefix(unsigned long int mask);
+ static int tqmask2prefix(unsigned long int tqmask);
};
#endif