46 lines
1.2 KiB
C
46 lines
1.2 KiB
C
#ifndef MONITOR_H
|
|
#define MONITOR_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
/**
|
|
* @brief Set WiFi interface to monitor mode
|
|
* @param interface Interface name (e.g., "wlan0")
|
|
* @param channel Channel number (1-165)
|
|
* @return 0 on success, -1 on error
|
|
*/
|
|
int set_monitor_mode(const char *interface, int channel);
|
|
|
|
/**
|
|
* @brief Restore WiFi interface to managed mode
|
|
* @param interface Interface name
|
|
* @return 0 on success, -1 on error
|
|
*/
|
|
int restore_managed_mode(const char *interface);
|
|
|
|
/**
|
|
* @brief Set channel for monitor interface
|
|
* @param interface Interface name
|
|
* @param channel Channel number (1-165)
|
|
* @return 0 on success, -1 on error
|
|
*/
|
|
int set_channel(const char *interface, int channel);
|
|
|
|
/**
|
|
* @brief Get current channel from interface
|
|
* @param interface Interface name
|
|
* @param freq_out Optional pointer to receive frequency in MHz
|
|
* @return Channel number on success, -1 on error
|
|
*/
|
|
int get_current_channel(const char *interface, uint32_t *freq_out);
|
|
|
|
/**
|
|
* @brief Convert WiFi channel number to frequency in MHz
|
|
* @param channel Channel number (1-165)
|
|
* @return Frequency in MHz, or 0 if invalid
|
|
*/
|
|
uint32_t channel_to_freq(int channel);
|
|
|
|
#endif /* MONITOR_H */
|