File: RadiusVendorSpecificAttribute.h

package info (click to toggle)
openvpn-auth-radius 2.1-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,824 kB
  • sloc: cpp: 9,043; perl: 323; makefile: 46
file content (84 lines) | stat: -rwxr-xr-x 2,261 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
 *  RadiusClass -- An C++-Library for radius authentication 
 *					and accounting.
 * 
 *  Copyright (C) 2005 EWE TEL GmbH/Ralf Luebben <ralfluebben@gmx.de>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
#ifndef _RADIUSVENDORSPECIFICATTRIB_H_
#define _RADIUSVENDORSPECIFICATTRIB_H_
#include <string>
#include "radius.h"
#include <iostream>
using namespace std;

/**This class represents a radius vendor specific attribute as defined in RFC 2865. */

class RadiusVendorSpecificAttribute
{
private:
	Octet		id[4];		/**< The attribute length, of the value*/
	Octet		type;		/**< The vendor specific attibute type.*/
	Octet		length;		/**< The attribute length, of the value*/
	Octet		*value;		/**< A pointer to the value*/
	
	
public:
					
					RadiusVendorSpecificAttribute();
					~RadiusVendorSpecificAttribute(void);
					
					RadiusVendorSpecificAttribute & operator=(const RadiusVendorSpecificAttribute &);
					
					RadiusVendorSpecificAttribute(const RadiusVendorSpecificAttribute &);
		
	int				getLength(void);
	Octet *			getLength_Octet(void);
	void			setLength(Octet);
		
	int				getId(void);
	Octet *			getId_Octet(void);
	void			setId(int);	
		
	int				getType(void);
	Octet *			getType_Octet(void);
	void			setType(Octet);
	
	Octet *			getValue(void);
	int			    setValue(const char *);
	int			    setValue(int);
	
		
	int 			decodeRecvAttribute(Octet *);
	
	void			getShapedAttribute(Octet *);	
	
	int				intFromBuf(void);
	 
	string			ipFromBuf(void); 
		
	string			stringFromBuf(void);
	
	void			dumpRadiusAttrib(void);
	
	
};




#endif //_RADIUSVENDORSPECIFICATTRIB_H_