* octets" that contain the octets of the bit string. (For IP
* addresses, the encoding of the length will be just the length.)
*/
+ if (vp->vp_ip.prefix == 32) {
+ FR_DBUFF_IN_RETURN(&our_dbuff, (uint8_t) 0x00);
+ FR_DBUFF_IN_MEMCPY_RETURN(&our_dbuff, (uint8_t const *) &vp->vp_ipv4addr, sizeof(vp->vp_ipv4addr));
+ return fr_dbuff_set(dbuff, &our_dbuff);
+ }
+
FR_DBUFF_IN_RETURN(&our_dbuff, (uint8_t) (8 - (vp->vp_ip.prefix & 0x07)));
len = (vp->vp_ip.prefix + 0x07) >> 3;
* addresses, the encoding of the length will be just the length.)
*/
+ if (vp->vp_ip.prefix == 128) {
+ FR_DBUFF_IN_RETURN(&our_dbuff, (uint8_t) 0x00);
+ FR_DBUFF_IN_MEMCPY_RETURN(&our_dbuff, (uint8_t const *) &vp->vp_ipv6addr, sizeof(vp->vp_ipv6addr));
+ return fr_dbuff_set(dbuff, &our_dbuff);
+ }
+
FR_DBUFF_IN_RETURN(&our_dbuff, (uint8_t) (8 - (vp->vp_ip.prefix & 0x07)));
len = (vp->vp_ip.prefix + 0x07) >> 3;
encode-pair Test-IPv4-Prefix = 10.5.0.0/23
match 03 04 01 0a 05 00
+encode-pair Test-IPv4-Prefix = 10.5.0.4/32
+match 03 05 00 0a 05 00 04
+
#
# Just the length byte
#
decode-pair 03 04 01 0a 05 00
match Test-IPv4-Prefix = 10.5.0.0/23
+decode-pair 03 05 00 0a 05 00 04
+match Test-IPv4-Prefix = 10.5.0.4/32
+
decode-pair 03 01 00
match Test-IPv4-Prefix = 0.0.0.0/0
count
-match 545
+match 549