Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the vendorspecificatrribues problem #21

Open
wpp5632447 opened this issue Aug 9, 2024 · 2 comments
Open

the vendorspecificatrribues problem #21

wpp5632447 opened this issue Aug 9, 2024 · 2 comments

Comments

@wpp5632447
Copy link

Hello, can you solve the search and insertion of multiple private vendor attributes with the following data structure
[typeid,vendorid] //typeid = 26, or24x.26
[vendortype,length,value]
[vendortype,length,value]
[vendortype,length,value]
[vendortype,length,value]
[vendortype,length,value]
I spent a long time solving the parsing problem, but I couldn't solve the insertion problem of the above structure. If I try to solve it forcefully, it will turn the code into a pile of crap
thinks

@tsyd
Copy link
Member

tsyd commented Aug 22, 2024

Hello, the library doesn't currently have a good way to compact vendor-specific attributes into a single top-level attribute. For now, you could use RawAttribute like this when sending:

ByteBuffer byteBuffer = ByteBuffer.allocate(253);

byteBuffer.putInt(311); // Microsoft (26.311)
byteBuffer.put((byte) 7); // MPPE-Encryption-Policy (26.311.7)
byteBuffer.put((byte) (2 + 4)); // 2 + size of the value below (integer)
byteBuffer.putInt(1);
byteBuffer.put((byte) 21); // ARAP-PW-Change-Reason (26.311.21)
byteBuffer.put((byte) (2 + 4)); // 2 + size of the value below (integer)
byteBuffer.putInt(4);

byte[] rawAttributeData = new byte[byteBuffer.position()];
System.arraycopy(byteBuffer.array(), 0, rawAttributeData, 0, byteBuffer.position());

new RawAttribute(26, rawAttributeData);

A future version of the library will have a cleaner way of doing this using the built-in attribute dictionary support.

@wpp5632447
Copy link
Author

Thank you, great TSYD. Thank you for taking the time out of your busy schedule to answer my question, after a month of research (as I am not a real programmer). I downloaded the complete source code package and made modifications to the vendor attribute to parse and insert multiple VSAs.
Multi vas explanation: i.e. (26.311. [7, x, x, x, x, x,...]) a structure like this, as shown in the following figure
I modified the dictionary generation source code to parse multiple VSAs
Modified the VendorAttribute encode/decode method
I copied VSA to VSAS and made modifications.
If possible, I hope you can add this feature to serve the multi VSA that some manufacturers like to use now,
If you need my code, I will provide it for free. It's just that I wrote it poorly, but I can still implement this feature.
1724374930160

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants