mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 17:42:41 +00:00
ucentral-event: add option82 handling
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -134,6 +134,7 @@ let handlers = {
|
||||
vlan: [ `${notify.data.vlan_id}` ]
|
||||
};
|
||||
ubus.call('network.interface.up_none', 'add_device', msg);
|
||||
ubus.call('dhcprelay', 'check_devices');
|
||||
},
|
||||
};
|
||||
|
||||
@@ -231,13 +232,23 @@ function dhcp_subscriber_remove_cb(remove) {
|
||||
}
|
||||
|
||||
function dhcp_relay_subscriber_notify_cb(notify) {
|
||||
printf('%.J\n', notify.data);
|
||||
return {
|
||||
address: relay.config.server,
|
||||
options: [
|
||||
[ 62, "hello, world" ]
|
||||
]
|
||||
};
|
||||
let ifname = split(notify.data.info.device, '-v');
|
||||
let hapd = hostapd[ifname[0]];
|
||||
let vlan = ifname[1];
|
||||
if (hapd) {
|
||||
vlan ??= hapd.config.vlan_id;
|
||||
let circuit_id = `${vlan}`;
|
||||
let remote_id = hapd.bssid;
|
||||
return {
|
||||
address: relay['vlan' + vlan]?.server,
|
||||
options: [
|
||||
[ 82,
|
||||
chr(1) + chr(length(circuit_id)) + circuit_id +
|
||||
chr(2) + chr(length(remote_id)) + remote_id
|
||||
]
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function dhcp_relay_subscriber_remove_cb(remove) {
|
||||
|
||||
Reference in New Issue
Block a user