Skip to content

Commit 3869e3b

Browse files
committed
Documented the expected input for formats
1 parent a4fadaf commit 3869e3b

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

lib/avpair.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626

2727
/** Adds an attribute-value pair to the given list
2828
*
29-
* @note Always appends the new pair to the end of the list.
29+
* See rc_avpair_assign() for the format of the data.
30+
*
31+
* @note It always appends the new pair to the end of the list.
3032
*
3133
* @param rh a handle to parsed configuration.
3234
* @param list a VALUE_PAIR array of values; initially must be NULL.
@@ -66,6 +68,17 @@ VALUE_PAIR *rc_avpair_next (VALUE_PAIR *t)
6668
}
6769

6870
/** Assigns the given value to an attribute-value pair
71+
*
72+
* If the value is of type PW_TYPE_STRING it must either be
73+
* a null terminated string with len set to -1, or raw data
74+
* with length properly set. For PW_TYPE_DATE, PW_TYPE_INTEGER,
75+
* and PW_TYPE_IPADDR an uint32_t number should be set at pval.
76+
* For IPv4 addresses it should be in host byte order.
77+
*
78+
* For PW_TYPE_IPV6ADDR type a 16-byte long address is expected, and
79+
* for PW_TYPE_IPV6PREFIX the rfc3162 prefix format is expected. Simply
80+
* that is a zero byte, a byte with the value of prefix (e.g., 112), and
81+
* the remaining bytes are the IPv6 address.
6982
*
7083
* @param vp a pointer to a VALUE_PAIR structure.
7184
* @param pval the value (e.g., the actual username).
@@ -120,6 +133,8 @@ int rc_avpair_assign (VALUE_PAIR *vp, void const *pval, int len)
120133
}
121134

122135
/** Make a new attribute-value pair with given parameters
136+
*
137+
* See rc_avpair_assign() for the format of the data.
123138
*
124139
* @param rh a handle to parsed configuration.
125140
* @param attrid The attribute of the pair to add (e.g., PW_USER_NAME).

0 commit comments

Comments
 (0)