wifi_cfg.h 786 B

12345678910111213141516171819202122
  1. /* Staged WiFi connect request, written by the network menu and read by
  2. * `wifi connectfile <path>`.
  3. *
  4. * The normal `wifi connect <ssid> <pass>` command arguments are limited by
  5. * SYS_SPAWN's VFS_PATH_MAX buffer (64 bytes), which is too small for a long
  6. * SSID plus a 63-character WPA2 passphrase. The menu therefore writes this
  7. * fixed-size record to a /share file and spawns a helper with a short path. */
  8. #ifndef WIFI_CFG_H
  9. #define WIFI_CFG_H
  10. #define WIFI_CFG_MAGIC 0x4E425746u /* "NBWF" */
  11. struct wifi_cfg {
  12. unsigned int magic;
  13. unsigned char ssid_len; /* 1..32 */
  14. unsigned char pass_len; /* 0..64 (64 = raw hex PSK) */
  15. unsigned char bssid[6];
  16. unsigned char ssid[32];
  17. char pass[65]; /* NUL terminated, pass_len used */
  18. };
  19. #endif