gatenet.hotspot package¶
Submodules¶
gatenet.hotspot.backend module¶
- class gatenet.hotspot.backend.BackendResult(ok, message='')[source]¶
Bases:
object-
message:
str= ''¶
-
ok:
bool¶
-
message:
gatenet.hotspot.dhcp module¶
DHCP server management for hotspot functionality.
- class gatenet.hotspot.dhcp.DHCPServer(ip_range, gateway, dns_servers=None)[source]¶
Bases:
objectManage DHCP server for hotspot clients.
Example
>>> from gatenet.hotspot import DHCPServer >>> dhcp = DHCPServer("192.168.4.0/24", "192.168.4.1") >>> dhcp.start() >>> dhcp.stop()
gatenet.hotspot.hotspot module¶
Main hotspot management class for creating and controlling Wi-Fi access points.
- class gatenet.hotspot.hotspot.Hotspot(config, backend=None)[source]¶
Bases:
objectCreate and manage Wi-Fi hotspots on Linux/macOS systems.
Example
>>> from gatenet.hotspot import Hotspot, HotspotConfig >>> config = HotspotConfig(ssid="MyHotspot", password="mypassword123") >>> hotspot = Hotspot(config) >>> hotspot.start() >>> hotspot.get_connected_devices() >>> hotspot.stop()
- get_connected_devices()[source]¶
Get list of devices connected to the hotspot.
- Returns:
List of connected devices with MAC, IP, and hostname
- Return type:
List[Dict]
Example
>>> devices = hotspot.get_connected_devices() >>> print(f"Connected devices: {len(devices)}")
- class gatenet.hotspot.hotspot.HotspotConfig(ssid, password=None, interface='wlan0', ip_range='192.168.4.0/24', gateway='192.168.4.1', channel=6, hidden=False)[source]¶
Bases:
objectConfiguration for hotspot creation.
-
channel:
int= 6¶
-
gateway:
str= '192.168.4.1'¶
-
interface:
str= 'wlan0'¶
-
ip_range:
str= '192.168.4.0/24'¶
-
password:
Optional[str] = None¶
-
ssid:
str¶
-
channel:
gatenet.hotspot.security module¶
Security configuration for hotspot access points.
- class gatenet.hotspot.security.SecurityConfig(password=None, security_type=SecurityType.WPA2)[source]¶
Bases:
objectManage security settings for Wi-Fi hotspots.
Example
>>> from gatenet.hotspot import SecurityConfig, SecurityType >>> config = SecurityConfig("mypassword123", SecurityType.WPA2) >>> config.validate_password() >>> strong_password = SecurityConfig.generate_password()
- static generate_password(length=12, include_symbols=True)[source]¶
Generate a strong random password.
- Parameters:
length (int) – Password length (minimum 8)
include_symbols (bool) – Include special characters
- Returns:
Strong random password
- Return type:
str
Example
>>> password = SecurityConfig.generate_password(16) >>> len(password) == 16 # True
- get_hostapd_config()[source]¶
Generate hostapd configuration for the security settings.
- Returns:
Configuration lines for hostapd
- Return type:
str
- get_security_level()[source]¶
Get a human-readable security level description.
- Returns:
Security level description
- Return type:
str
- validate_password()[source]¶
Validate the password strength.
- Returns:
True if password meets security requirements
- Return type:
bool
Example
>>> config = SecurityConfig("weakpass") >>> config.validate_password() # False >>> config = SecurityConfig("StrongPass123!") >>> config.validate_password() # True
Module contents¶
Gatenet hotspot module for creating and managing Wi-Fi access points.
This module provides functionality to create software access points, manage DHCP services, and control connected devices.
- class gatenet.hotspot.BackendResult(ok, message='')[source]¶
Bases:
object-
message:
str= ''¶
-
ok:
bool¶
-
message:
- class gatenet.hotspot.DHCPServer(ip_range, gateway, dns_servers=None)[source]¶
Bases:
objectManage DHCP server for hotspot clients.
Example
>>> from gatenet.hotspot import DHCPServer >>> dhcp = DHCPServer("192.168.4.0/24", "192.168.4.1") >>> dhcp.start() >>> dhcp.stop()
- class gatenet.hotspot.Hotspot(config, backend=None)[source]¶
Bases:
objectCreate and manage Wi-Fi hotspots on Linux/macOS systems.
Example
>>> from gatenet.hotspot import Hotspot, HotspotConfig >>> config = HotspotConfig(ssid="MyHotspot", password="mypassword123") >>> hotspot = Hotspot(config) >>> hotspot.start() >>> hotspot.get_connected_devices() >>> hotspot.stop()
- get_connected_devices()[source]¶
Get list of devices connected to the hotspot.
- Returns:
List of connected devices with MAC, IP, and hostname
- Return type:
List[Dict]
Example
>>> devices = hotspot.get_connected_devices() >>> print(f"Connected devices: {len(devices)}")
- class gatenet.hotspot.HotspotBackend[source]¶
Bases:
ABC
- class gatenet.hotspot.HotspotConfig(ssid, password=None, interface='wlan0', ip_range='192.168.4.0/24', gateway='192.168.4.1', channel=6, hidden=False)[source]¶
Bases:
objectConfiguration for hotspot creation.
-
channel:
int= 6¶
-
gateway:
str= '192.168.4.1'¶
-
interface:
str= 'wlan0'¶
-
ip_range:
str= '192.168.4.0/24'¶
-
password:
Optional[str] = None¶
-
ssid:
str¶
-
channel:
- class gatenet.hotspot.SecurityConfig(password=None, security_type=SecurityType.WPA2)[source]¶
Bases:
objectManage security settings for Wi-Fi hotspots.
Example
>>> from gatenet.hotspot import SecurityConfig, SecurityType >>> config = SecurityConfig("mypassword123", SecurityType.WPA2) >>> config.validate_password() >>> strong_password = SecurityConfig.generate_password()
- static generate_password(length=12, include_symbols=True)[source]¶
Generate a strong random password.
- Parameters:
length (int) – Password length (minimum 8)
include_symbols (bool) – Include special characters
- Returns:
Strong random password
- Return type:
str
Example
>>> password = SecurityConfig.generate_password(16) >>> len(password) == 16 # True
- get_hostapd_config()[source]¶
Generate hostapd configuration for the security settings.
- Returns:
Configuration lines for hostapd
- Return type:
str
- get_security_level()[source]¶
Get a human-readable security level description.
- Returns:
Security level description
- Return type:
str
- validate_password()[source]¶
Validate the password strength.
- Returns:
True if password meets security requirements
- Return type:
bool
Example
>>> config = SecurityConfig("weakpass") >>> config.validate_password() # False >>> config = SecurityConfig("StrongPass123!") >>> config.validate_password() # True