retailnext / node-radius

Node.js RADIUS library for packet encoding and decoding.
Other
200 stars 60 forks source link

encode: invalid attributes - must give buffer for unknown attribute 'WISPr-Bandwitdth-Max-Down' #59

Open nkarabulut381 opened 2 years ago

nkarabulut381 commented 2 years ago

I want to add WISPr dictionary but I get encoding error.

I added file dictionary.wispr in dictionary folder

https://opensource.apple.com/source/freeradius/freeradius-11/freeradius/share/dictionary.wispr.auto.html

muirdm commented 2 years ago

Looks like you have a typo in WISPr-Bandwitdth-Max-Down (should be WISPr-Bandwidth-Max-Down).

nkarabulut381 commented 2 years ago

The typo here doesn't matter. Including the dictionary, but the attributes is not working.

muirdm commented 2 years ago

Can you show the code you are using to try to load the dictionary and use the attribute?

nkarabulut381 commented 2 years ago

I am copying Dictionary.wispr which is the link to the radius/dictionary folder. I'm not doing anything else. because it needs to pull directly from that folder.

How do you think it should be?

nkarabulut381 commented 2 years ago

var dictionary_locations = [path.normalize(__dirname + "/../dictionaries")];

muirdm commented 2 years ago

You need to show your code if you want help. The dictionary works fine for me:

var radius = require('radius');

radius.add_dictionary('wispr.dict');

var packet = radius.encode({
  code: "Access-Request",
  secret: "obsidian order",
  attributes: [
    ['Vendor-Specific', 'WISPr', [['WISPr-Bandwidth-Max-Down', 1234]]],
  ]
});
nkarabulut381 commented 2 years ago

It worked this way. I just get the "Unknown Vendor" warning.

thanks