Yarilo v0.9.9
WPA2 Decrypter & Packet Analyzer
Loading...
Searching...
No Matches
yarilo::NetCardManager Class Reference

Manager for network card information gathering and state control. More...

#include <net_card_manager.h>

Classes

struct  iface_state
 Logical network interface (e.g. wlan0) data. More...
 
struct  phy_info
 Physical network interface (e.g. phy0) capability info. More...
 

Public Types

enum  ChannelModes {
  NO_HT , HT20 , HT40MINUS , HT40PLUS ,
  VHT80 , VHT80P80 , VHT160
}
 
enum  FcsState { FCS_ALL , FCS_VALID , FCS_INVALID }
 

Public Member Functions

 NetCardManager ()
 
bool connect ()
 
void disconnect ()
 
std::set< std::string > phy_interfaces () const
 
std::optional< phy_infophy_details (int phy_idx) const
 
std::optional< iface_statenet_iface_details (const std::string &ifname) const
 
bool set_phy_channel (int phy_idx, int chan) const
 
 ~NetCardManager ()
 

Static Public Member Functions

static std::set< std::string > net_interfaces ()
 
static int freq_to_chan (int freq)
 
static int chan_to_freq (int chan)
 

Detailed Description

Manager for network card information gathering and state control.

Member Enumeration Documentation

◆ ChannelModes

Enumerator
NO_HT 
HT20 
HT40MINUS 
HT40PLUS 
VHT80 
VHT80P80 
VHT160 

◆ FcsState

Enumerator
FCS_ALL 
FCS_VALID 
FCS_INVALID 

Constructor & Destructor Documentation

◆ NetCardManager()

yarilo::NetCardManager::NetCardManager ( )

Basic constructor for logger initialisation

◆ ~NetCardManager()

yarilo::NetCardManager::~NetCardManager ( )
inline

Member Function Documentation

◆ chan_to_freq()

int yarilo::NetCardManager::chan_to_freq ( int chan)
static

Get the frequency from a specific wifi channel

Parameters
[in]chanwifi channel
Returns
frequency

◆ connect()

bool yarilo::NetCardManager::connect ( )

Connect to the nl80211 netlink socket

Returns
True if the connection succeeded, false otherwise

◆ disconnect()

void yarilo::NetCardManager::disconnect ( )

Disconnect from the nl80211 netlink socket

◆ freq_to_chan()

int yarilo::NetCardManager::freq_to_chan ( int freq)
static

Get the channel from a specific frequency

Parameters
[in]freqfrequency
Returns
wifi channel number

◆ net_iface_details()

std::optional< iface_state > yarilo::NetCardManager::net_iface_details ( const std::string & ifname) const

Get the details for a particular logical interface. For details see iface_state

Parameters
[in]ifnameName of the logical interface (for example wlp1s0)
Returns
Optionally return details of an interface

◆ net_interfaces()

std::set< std::string > yarilo::NetCardManager::net_interfaces ( )
static

Get available logical interfaces (for example wlp1s0)

Returns
Set of available network interfaces

◆ phy_details()

std::optional< phy_info > yarilo::NetCardManager::phy_details ( int phy_idx) const

Get the details for a particular physical interface, like the available frequencies and monitor mode support. For details see phy_iface

Parameters
[in]phy_idxIndex of the physical interface (for example 0 for phy0)
Returns
Optionally return details of an interface

◆ phy_interfaces()

std::set< std::string > yarilo::NetCardManager::phy_interfaces ( ) const

Get available physical interfaces (for example phy0)

Returns
Set of available network interfaces

◆ set_phy_channel()

bool yarilo::NetCardManager::set_phy_channel ( int phy_idx,
int chan ) const

Set the physical focused channel of an interface, other programs can interfere with this setting, overriding it. It helps to have other programs like NetworkManager or wpa_supplicant disabled, or the phy excluded in their settings

Parameters
[in]phy_idxIndex of the physical interface (for example 0 for phy0)
[in]chantarget channel, supports only channels below 14 (2.4GHz band)
Returns
True if the operation succeeded, false otherwise

The documentation for this class was generated from the following files: