refactor #1 + adding documentation (#36)
Build and publish release / metadata (push) Successful in 44s
Build and publish release / create-release (push) Successful in 49s
Build and publish release / publish-release (push) Canceled after 0s
Build and publish release / build (push) Canceled after 7m44s

Reviewed-on: #36
Co-authored-by: Koda YeenBean <n122330@gmail.com>
This commit was merged in pull request #36.
This commit is contained in:
2026-07-19 21:26:28 +01:00
committed by Koda
parent db81260d7f
commit 3fcd99af1f
31 changed files with 4068 additions and 2598 deletions
+60
View File
@@ -0,0 +1,60 @@
#ifndef OPENUF_WLAN_INTERNAL_H
#define OPENUF_WLAN_INTERNAL_H
#include <stddef.h>
#include <stdio.h>
#include <json-c/json.h>
#include <uci.h>
enum wifi_standard {
WIFI_STANDARD_UNKNOWN = 0,
WIFI_STANDARD_4 = 4,
WIFI_STANDARD_5 = 5,
WIFI_STANDARD_6 = 6,
WIFI_STANDARD_7 = 7,
};
const char *wlan_security_to_uci(const char *unifi_security);
const char *wlan_security_to_unifi(const char *uci_security);
int wlan_valid_object_id(const char *object_id);
int wlan_ensure_vap_ids(struct json_object *vaps);
void wlan_mobility_domain_for_ssid(const char *ssid, char output[5]);
int wlan_radio_uses_ath9k(const char *device_name);
int wlan_json_boolean_any(struct json_object *object,
const char *const *keys,
size_t key_count);
int wlan_feature_enabled(const char *text);
void wlan_safe_section_name(const char *ssid, char *output, size_t output_size);
int wlan_uci_set(struct uci_context *context,
const char *path,
const char *value);
int wlan_uci_set_required(struct uci_context *context,
struct uci_package *package,
const char *section_name,
const char *option_name,
const char *value);
int wlan_uci_add_list(struct uci_context *context,
const char *path,
const char *value);
int wlan_uci_ensure_section(struct uci_context *context,
struct uci_package *package,
const char *section_name,
const char *section_type);
int wlan_ensure_vlan_network(int vlan_id);
int wlan_configure_band_steering(int enabled);
#define WLAN_UCI_SET(context, package, section, option, value) do { \
char openuf_uci_path[256]; \
snprintf(openuf_uci_path, sizeof(openuf_uci_path), "%s.%s.%s", \
package, section, option); \
wlan_uci_set(context, openuf_uci_path, value); \
} while (0)
#define WLAN_UCI_SET_INT(context, package, section, option, integer_value) do { \
char openuf_uci_value[32]; \
snprintf(openuf_uci_value, sizeof(openuf_uci_value), "%d", integer_value); \
WLAN_UCI_SET(context, package, section, option, openuf_uci_value); \
} while (0)
#endif /* OPENUF_WLAN_INTERNAL_H */