Skip to content

Commit

Permalink
Merge pull request #362 from Catty2014/master
Browse files Browse the repository at this point in the history
Add 802.11ax(wifi6) ability
  • Loading branch information
lakinduakash authored Dec 30, 2023
2 parents 2dc1649 + 38e4828 commit d73242a
Show file tree
Hide file tree
Showing 9 changed files with 261 additions and 189 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* Customise wifi Channel, Change MAC address, etc.
* Hide SSID
* customize gateway IP address
* Enable IEEE 80211n, IEEE 80211ac modes
* Enable IEEE 80211n, IEEE 80211ac and IEEE 80211ax modes

![screenshot](docs/sc4.png)

Expand Down
6 changes: 6 additions & 0 deletions src/scripts/bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ _create_ap() {
--ieee80211n)
# No Options
;;
--ieee80211ac)
# No Options
;;
--ieee80211ax)
# No Options
;;
--ht_capab)
# Refer http://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf
opts='
Expand Down
16 changes: 13 additions & 3 deletions src/scripts/create_ap
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# dnsmasq
# iptables

VERSION=0.4.7
VERSION=0.4.8
PROGNAME="$(basename $0)"

# make sure that all command outputs are in english
Expand Down Expand Up @@ -50,6 +50,7 @@ usage() {
echo " --isolate-clients Disable communication between clients"
echo " --ieee80211n Enable IEEE 802.11n (HT)"
echo " --ieee80211ac Enable IEEE 802.11ac (VHT)"
echo " --ieee80211ax Enable IEEE 802.11ax (VHT)"
echo " --ht_capab <HT> HT capabilities (default: [HT40+])"
echo " --vht_capab <VHT> VHT capabilities"
echo " --country <code> Set two-letter country code for regularity (example: US)"
Expand Down Expand Up @@ -649,6 +650,7 @@ ISOLATE_CLIENTS=0
SHARE_METHOD=nat
IEEE80211N=0
IEEE80211AC=0
IEEE80211AX=0
HT_CAPAB='[HT40+]'
VHT_CAPAB=
DRIVER=nl80211
Expand All @@ -666,7 +668,7 @@ HOSTAPD_DEBUG_ARGS=
REDIRECT_TO_LOCALHOST=0

CONFIG_OPTS=(CHANNEL GATEWAY WPA_VERSION ETC_HOSTS DHCP_DNS NO_DNS NO_DNSMASQ HIDDEN MAC_FILTER MAC_FILTER_ACCEPT ISOLATE_CLIENTS
SHARE_METHOD IEEE80211N IEEE80211AC HT_CAPAB VHT_CAPAB DRIVER NO_VIRT COUNTRY FREQ_BAND
SHARE_METHOD IEEE80211N IEEE80211AC IEEE80211AX HT_CAPAB VHT_CAPAB DRIVER NO_VIRT COUNTRY FREQ_BAND
NEW_MACADDR DAEMONIZE DAEMON_PIDFILE DAEMON_LOGFILE NO_HAVEGED WIFI_IFACE INTERNET_IFACE
SSID PASSPHRASE USE_PSK ADDN_HOSTS)

Expand Down Expand Up @@ -1070,7 +1072,7 @@ for ((i=0; i<$#; i++)); do
fi
done

GETOPT_ARGS=$(getopt -o hc:w:g:de:nm: -l "help","hidden","hostapd-debug:","hostapd-timestamps","redirect-to-localhost","mac-filter","mac-filter-accept:","isolate-clients","ieee80211n","ieee80211ac","ht_capab:","vht_capab:","driver:","no-virt","fix-unmanaged","country:","freq-band:","mac:","dhcp-dns:","daemon","pidfile:","logfile:","stop:","list","list-running","list-clients:","version","psk","no-haveged","no-dns","no-dnsmasq","mkconfig:","config:" -n "$PROGNAME" -- "$@")
GETOPT_ARGS=$(getopt -o hc:w:g:de:nm: -l "help","hidden","hostapd-debug:","hostapd-timestamps","redirect-to-localhost","mac-filter","mac-filter-accept:","isolate-clients","ieee80211n","ieee80211ac","ieee80211ax","ht_capab:","vht_capab:","driver:","no-virt","fix-unmanaged","country:","freq-band:","mac:","dhcp-dns:","daemon","pidfile:","logfile:","stop:","list","list-running","list-clients:","version","psk","no-haveged","no-dns","no-dnsmasq","mkconfig:","config:" -n "$PROGNAME" -- "$@")
[[ $? -ne 0 ]] && exit 1
eval set -- "$GETOPT_ARGS"

Expand Down Expand Up @@ -1143,6 +1145,10 @@ while :; do
shift
IEEE80211AC=1
;;
--ieee80211ax)
shift
IEEE80211AX=1
;;
--ht_capab)
shift
HT_CAPAB="$1"
Expand Down Expand Up @@ -1711,6 +1717,10 @@ if [[ $IEEE80211AC -eq 1 ]]; then
echo "ieee80211ac=1" >> $CONFDIR/hostapd.conf
fi

if [[ $IEEE80211AX -eq 1 ]]; then
echo "ieee80211ax=1" >> $CONFDIR/hostapd.conf
fi

if [[ -n "$VHT_CAPAB" ]]; then
echo "vht_capab=${VHT_CAPAB}" >> $CONFDIR/hostapd.conf
fi
Expand Down
1 change: 1 addition & 0 deletions src/scripts/create_ap.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ISOLATE_CLIENTS=0
SHARE_METHOD=nat
IEEE80211N=0
IEEE80211AC=0
IEEE80211AX=0
HT_CAPAB=[HT40+]
VHT_CAPAB=
DRIVER=nl80211
Expand Down
404 changes: 219 additions & 185 deletions src/ui/glade/wifih.ui

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/ui/h_prop.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ const char *build_wh_mkconfig_command(ConfigValues* cv){
strcat(cmd_mkconfig," --ieee80211ac ");
}

if(cv->ieee80211ax!=NULL && (strcmp(cv->ieee80211ax,"1") == 0)){
strcat(cmd_mkconfig," --ieee80211ax ");
}

if(cv->mac!=NULL) {
strcat(cmd_mkconfig, " --mac ");
strcat(cmd_mkconfig, cv->mac);
Expand Down
3 changes: 3 additions & 0 deletions src/ui/read_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ static void setConfigValues(const char * key, char *value){

if( !strcmp ( IEEE80211AC, key ))
configValues.ieee80211ac = value;

if( !strcmp ( IEEE80211AX, key ))
configValues.ieee80211ax = value;

if( !strcmp ( GATEWAY, key ))
configValues.gateway = value;
Expand Down
2 changes: 2 additions & 0 deletions src/ui/read_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define SHARE_METHOD "SHARE_METHOD"
#define IEEE80211N "IEEE80211N"
#define IEEE80211AC "IEEE80211AC"
#define IEEE80211AX "IEEE80211AX"
#define HT_CAPAB "HT_CAPAB"
#define VHT_CAPAB "VHT_CAPAB"
#define DRIVER "DRIVER"
Expand Down Expand Up @@ -91,6 +92,7 @@ typedef struct{
char *accepted_macs;
char *ieee80211n;
char *ieee80211ac;
char *ieee80211ax;
char *no_haveged;
char *gateway;
} ConfigValues;
Expand Down
12 changes: 12 additions & 0 deletions src/ui/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ GtkCheckButton *cb_open;
GtkCheckButton *cb_mac_filter;
GtkCheckButton *cb_ieee80211n;
GtkCheckButton *cb_ieee80211ac;
GtkCheckButton *cb_ieee80211ax;

GtkProgressBar *progress_bar;

Expand Down Expand Up @@ -440,6 +441,7 @@ int initUi(int argc, char *argv[]){
cb_mac_filter = (GtkCheckButton *) gtk_builder_get_object(builder, "cb_mac_filter");
cb_ieee80211n = (GtkCheckButton *) gtk_builder_get_object(builder, "cb_ieee80211n");
cb_ieee80211ac= (GtkCheckButton *) gtk_builder_get_object(builder, "cb_ieee80211ac");
cb_ieee80211ax= (GtkCheckButton *) gtk_builder_get_object(builder, "cb_ieee80211ax");

rb_freq_auto = (GtkRadioButton *) gtk_builder_get_object(builder, "rb_freq_auto");
rb_freq_2 = (GtkRadioButton *) gtk_builder_get_object(builder, "rb_freq_2");
Expand Down Expand Up @@ -557,6 +559,11 @@ void init_ui_from_config(){
gtk_toggle_button_set_active((GtkToggleButton*) cb_ieee80211ac,TRUE);
}

if(strcmp(values->ieee80211ax,"1")==0){

gtk_toggle_button_set_active((GtkToggleButton*) cb_ieee80211ax,TRUE);
}

if(strcmp(values->channel,"")!=0 && strcmp(values->channel,"default")!=0){
gtk_toggle_button_set_active((GtkToggleButton*) cb_channel,TRUE);
gtk_entry_set_text(entry_channel,values->channel);
Expand Down Expand Up @@ -943,6 +950,11 @@ static int init_config_val_input(ConfigValues* cv){
else
cv->ieee80211ac =NULL;

if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cb_ieee80211ax)))
cv->ieee80211ax = "1";
else
cv->ieee80211ax =NULL;

if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cb_mac_filter))){

cv->mac_filter = "1";
Expand Down

0 comments on commit d73242a

Please sign in to comment.