You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation does not specify how vendor specific attributes are encoded/accessed. In Particular RFC2865 specifies a format for encoding multiple attributes by a single vendor in a single Attribute 26. I do not see how i would get those.
The text was updated successfully, but these errors were encountered:
Hi friend,
Looks like library simply misses this logic and to create VSA containing reply we should craft packet manually.
To create this type of reply:
We need something like this:
fn hardcode_bytes_vsa() -> Vec<u8> {
// let avp_type = 26 as u8;
// let avp_length = 23 as u8;
let mut avp_vendor_id = 4874_i32.to_be_bytes().to_vec();
let vsa_type = 65 as u8;
let vsa_length = 17 as u8;
let vsa_tag = 5 as u8;
let mut vsa_usa = "bar(1000,5441)".as_bytes().to_vec();
let mut vsa: Vec<u8> = Vec::new();
vsa.append(&mut avp_vendor_id);
vsa.push(vsa_type);
vsa.push(vsa_length);
vsa.push(vsa_tag);
vsa.append(&mut vsa_usa);
vsa
}
After that construct with the help of from_bytes function:
let vsa = AVP::from_bytes(VENDOR_SPECIFIC_TYPE, &hardcode_bytes_vsa());
_ = p.add(vsa);
Please note that you should omit type and length values. Type is specified as first parameter and length is calculated automatically.
The documentation does not specify how vendor specific attributes are encoded/accessed. In Particular RFC2865 specifies a format for encoding multiple attributes by a single vendor in a single Attribute 26. I do not see how i would get those.
The text was updated successfully, but these errors were encountered: