Files
wlan-ap/feeds/wlan-ap/opensync/patches/33-add-apc-radsecproxy-schema.patch
Arif Alam dd86dfceb0 opensync: add radsec, radius proxy and apc functionality
- add ovsdb schema for radsec and radius proxy config
- add radsec and radius proxy functionality
- add APC functionality for radsec and radius proxy
  Send APC mode information through ubus
  from APC application to WM.
  Use the APC mode to direct the configuration
  of radius proxy.
  We get this information from APC:
  mode:
	DR (Designated Router)
	BDR (Back up Designated Router)
	OR (Other Router)
	NC (Not connected/Not configured)
  bdr_addr: IP of the BDR
  dr_addr: IP of the DR
  enabled: If Enabled/Disabled

Signed-off-by: Arif Alam <arif.alam@netexperience.com>
Signed-off-by: Chaitanya Godavarthi <chaitanya.kiran@netexperience.com>
2021-04-22 00:44:40 -04:00

143 lines
3.6 KiB
Diff

Index: opensync-2.0.5.0/interfaces/opensync.ovsschema
===================================================================
--- opensync-2.0.5.0.orig/interfaces/opensync.ovsschema
+++ opensync-2.0.5.0/interfaces/opensync.ovsschema
@@ -9368,6 +9368,68 @@
}
},
"isRoot": true
+ },
+ "APC_Config": {
+ "columns": {
+ "enabled": {
+ "type": {
+ "key": {
+ "type": "boolean"
+ },
+ "min": 0,
+ "max": 1
+ }
+ }
+ },
+ "isRoot": true,
+ "maxRows": 1
+ },
+ "APC_State": {
+ "columns": {
+ "dr_addr": {
+ "type": {
+ "key": {
+ "type": "string"
+ }
+ }
+ },
+ "bdr_addr": {
+ "type": {
+ "key": {
+ "type": "string"
+ }
+ }
+ },
+ "enabled": {
+ "type": {
+ "key": {
+ "type": "boolean"
+ },
+ "min": 0,
+ "max": 1
+ }
+ },
+ "mode": {
+ "type": {
+ "key": {
+ "type": "string",
+ "enum": [
+ "set",
+ [
+ "DR",
+ "BDR",
+ "OR",
+ "NC"
+ ]
+ ]
+ },
+ "min": 0,
+ "max": 1
+ }
+ }
+ },
+ "isRoot": true,
+ "maxRows": 1
}
}
}
Index: opensync-2.0.5.0/platform/openwrt/src/lib/target/src/radio_ubus.c
===================================================================
--- opensync-2.0.5.0.orig/platform/openwrt/src/lib/target/src/radio_ubus.c
+++ opensync-2.0.5.0/platform/openwrt/src/lib/target/src/radio_ubus.c
@@ -10,6 +10,7 @@
extern struct ev_loop *wifihal_evloop;
static struct ubus_context *ubus;
extern struct ev_loop *wifihal_evloop;
+extern void apc_state_set(struct blob_attr *msg);
int hapd_rrm_enable(char *name, int neighbor, int beacon)
{
@@ -179,6 +180,7 @@ radio_ubus_add_vif_cb(struct ubus_contex
return UBUS_STATUS_OK;
}
+
static const struct ubus_method radio_ubus_methods[] = {
UBUS_METHOD("dbg_add_vif", radio_ubus_add_vif_cb, add_vif_policy),
UBUS_METHOD("dummy", radio_ubus_dummy_cb, dummy_policy),
@@ -201,8 +203,36 @@ static void radio_ubus_connect(struct ub
ubus_add_object(ubus, &radio_ubus_object);
}
+static int radio_ubus_notify(struct ubus_context *ctx, struct ubus_object *obj,
+ struct ubus_request_data *req, const char *method,
+ struct blob_attr *msg)
+{
+ char *str;
+
+ str = blobmsg_format_json(msg, true);
+ LOGD("ubus: Received ubus notify '%s': %s\n", method, str);
+ free(str);
+
+ if (!strncmp(method, "apc", 3)) {
+ LOGD("APC notification Received");
+ apc_state_set(msg);
+ }
+
+ return 0;
+}
+
+
+
static struct ubus_instance ubus_instance = {
.connect = radio_ubus_connect,
+ .notify = radio_ubus_notify,
+ .list = {
+ {
+ .path = "apc",
+ },
+ },
+ .len = 1,
+
};
int radio_ubus_init(void)
Index: opensync-2.0.5.0/src/lib/schema/inc/schema_consts.h
===================================================================
--- opensync-2.0.5.0.orig/src/lib/schema/inc/schema_consts.h
+++ opensync-2.0.5.0/src/lib/schema/inc/schema_consts.h
@@ -154,6 +154,7 @@ typedef enum {
#define SCHEMA_CONSTS_DISABLE_B_RATES "disable_b_rates"
#define SCHEMA_CONSTS_IEEE80211k "ieee80211k"
#define SCHEMA_CONSTS_DYNAMIC_VLAN "dynamic_vlan"
+#define SCHEMA_CONSTS_RADPROXY "radproxy"
/* radio Custom options */
#define SCHEMA_CONSTS_LOCAL_PWR_CONSTRAINT "local_pwr_constraint"