Manual merge of aec08bce7f
[freeradius.git] / src / include / libradius.h
index 07b0193..1d12fd7 100644 (file)
@@ -62,6 +62,7 @@ RCSIDH(libradius_h, "$Id$")
 #define AUTH_VECTOR_LEN                16
 #define CHAP_VALUE_LENGTH       16
 #define MAX_STRING_LEN         254     /* RFC2138: string 0-253 octets */
+#define FR_MAX_VENDOR          (1 << 24) /* RFC limitations */
 
 #ifdef _LIBRADIUS
 #  define AUTH_HDR_LEN         20
@@ -106,6 +107,7 @@ typedef struct attr_flags {
 
        int8_t                  tag;          /* tag for tunneled attributes */
        uint8_t                 encrypt;      /* encryption method */
+       uint8_t                 length;
 } ATTR_FLAGS;
 
 /*
@@ -156,7 +158,7 @@ typedef union value_pair_data {
 
 typedef struct value_pair {
        const char              *name;
-       int                     attribute;
+       unsigned int            attribute;
        int                     vendor;
        int                     type;
        size_t                  length; /* of data */
@@ -325,10 +327,11 @@ VALUE_PAIR        *rad_attr2vp(const RADIUS_PACKET *packet, const RADIUS_PACKET *origin
                             int length, const uint8_t *data);
 int            rad_vp2attr(const RADIUS_PACKET *packet,
                            const RADIUS_PACKET *original, const char *secret,
-                           const VALUE_PAIR *vp, uint8_t *ptr);
+                           const VALUE_PAIR *vp, uint8_t *ptr, size_t room);
 
 /* valuepair.c */
 VALUE_PAIR     *pairalloc(DICT_ATTR *da);
+VALUE_PAIR     *paircreate_raw(int attr, int vendor, int type, VALUE_PAIR *);
 VALUE_PAIR     *paircreate(int attr, int vendor, int type);
 void           pairfree(VALUE_PAIR **);
 void            pairbasicfree(VALUE_PAIR *pair);