pkgsrc/net/gnugk/patches/patch-ac

146 lines
4.4 KiB
Text

$NetBSD: patch-ac,v 1.1 2005/03/16 12:55:02 rillig Exp $
--- radproto.h.orig Mon Jul 26 14:19:42 2004
+++ radproto.h Wed Mar 16 10:19:08 2005
@@ -225,7 +225,7 @@ public:
*/
RadiusAttr(
const RadiusAttr& attr /// atrribute to copy from
- ) { memcpy(m_data, attr.m_data, attr.m_length); }
+ ) { memcpy(m_data, attr.m_data, attr.s.m_length); }
/** Create TLV RADIUS attribute of a given type,
initializing #value# field with 'stringValue.GetLength()' bytes
@@ -329,7 +329,7 @@ public:
/** @return
Type of this attribute (see #enum AttrTypes#).
*/
- unsigned char GetType() const { return m_type; }
+ unsigned char GetType() const { return s.m_type; }
/** @return
Vendor-specific type for this attribute, assuming this
@@ -337,19 +337,19 @@ public:
(has vendorId, vendorType and vendorLength fields).
*/
unsigned char GetVsaType() const
- { return (m_length < VsaRfc2865FixedHeaderLength) ? 0 : m_vendorType; }
+ { return (s.m_length < VsaRfc2865FixedHeaderLength) ? 0 : s.s.m_vendorType; }
/** @return
Total length (bytes) of this attribute.
*/
- PINDEX GetLength() const { return m_length; }
+ PINDEX GetLength() const { return s.m_length; }
/** @return
Length of the Value field for this attribute.
*/
PINDEX GetValueLength() const
{
- const PINDEX len = m_length;
+ const PINDEX len = s.m_length;
const PINDEX headerLen = IsVsa() ? VsaFixedHeaderLength : FixedHeaderLength;
return (len <= headerLen) ? 0 : (len - headerLen);
@@ -386,7 +386,7 @@ public:
/** @return
True if this is a vendor-specific attribute (VSA).
*/
- bool IsVsa() const { return (m_type == VendorSpecific); }
+ bool IsVsa() const { return (s.m_type == VendorSpecific); }
/** @return
32 bit vendor identifier for VSA. This call is valid only
@@ -510,7 +510,7 @@ public:
*/
RadiusAttr& operator=(
const RadiusAttr& attr /// the attribute that contents will be assigned from
- ) { memcpy(m_data, attr.m_data, attr.m_length); return *this; }
+ ) { memcpy(m_data, attr.m_data, attr.s.m_length); return *this; }
/** Check whether this attribute contains valid data.
@@ -519,7 +519,7 @@ public:
*/
bool IsValid() const
{
- return ((PINDEX)m_length) >= ((m_type == VendorSpecific)
+ return ((PINDEX)s.m_length) >= ((s.m_type == VendorSpecific)
? VsaFixedHeaderLength : FixedHeaderLength
);
}
@@ -579,9 +579,9 @@ protected:
unsigned char m_vendorType;
unsigned char m_vendorLength;
unsigned char m_vendorValue[MaxLength - VsaRfc2865FixedHeaderLength];
- };
+ } s;
};
- };
+ } s;
};
};
@@ -655,35 +655,35 @@ public:
/** @return
Code for this RADIUS packet (see #enum Codes#)
*/
- unsigned char GetCode() const { return m_code; }
+ unsigned char GetCode() const { return s.m_code; }
/** Set new type (Code filed) for this PDU.
*/
void SetCode(
unsigned char newCode /// new PDU type
- ) { m_code = newCode; }
+ ) { s.m_code = newCode; }
/** @return
Identifier (Id field) of this RADIUS packet
*/
- unsigned char GetId() const { return m_id; }
+ unsigned char GetId() const { return s.m_id; }
/** Set new identifier for this RADIUS packet.
*/
void SetId(
unsigned char newId /// new packet identifier
- ) { m_id = newId; }
+ ) { s.m_id = newId; }
/** @return
Length of this RADIUS packet (bytes)
*/
PINDEX GetLength() const
- { return (((PINDEX)(m_length[0]) & 0xff) << 8) | ((PINDEX)(m_length[1]) & 0xff); }
+ { return (((PINDEX)(s.m_length[0]) & 0xff) << 8) | ((PINDEX)(s.m_length[1]) & 0xff); }
/** @return
A pointer to a memory block that holds 16 bytes authenticator.
*/
- const unsigned char* GetAuthenticator() const { return m_authenticator; }
+ const unsigned char* GetAuthenticator() const { return s.m_authenticator; }
/** Fill the array with 16 bytes #authenticator# vector
associated with this RADIUS packet.
@@ -911,8 +911,8 @@ private:
PINDEX newLen /// new packet length in bytes
)
{
- m_length[0] = (unsigned char)((newLen >> 8) & 0xff);
- m_length[1] = (unsigned char)(newLen & 0xff);
+ s.m_length[0] = (unsigned char)((newLen >> 8) & 0xff);
+ s.m_length[1] = (unsigned char)(newLen & 0xff);
}
protected:
@@ -929,7 +929,7 @@ protected:
/// RADIUS authenticator vector
unsigned char m_authenticator[AuthenticatorLength];
unsigned char m_attributes[MaxPduLength - FixedHeaderLength];
- };
+ } s;
};
};