Comments (1)
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.
from radius-rs.
Related Issues (12)
- More meaningful errors
- Dependency Dashboard
- Support extended-type
- Consider changing license HOT 1
- Extensible Authentication Protocol support HOT 4
- Pedantic request to doc/comment attributes file
- Wrong attribute lengths HOT 2
- Why no "Packet::get_attributes"?
- performance tuning for attributes HOT 1
- Please add support for rfc6613 and rfc6614
- No way to set packet identifier HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from radius-rs.