Skip to content

Commit

Permalink
Merge pull request #221 from lakinduakash/dev
Browse files Browse the repository at this point in the history
Able to customize gateway
Add tests
  • Loading branch information
lakinduakash authored Dec 26, 2021
2 parents 1e1b739 + 3b163bc commit 0b4960d
Show file tree
Hide file tree
Showing 15 changed files with 379 additions and 178 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libqrencode-dev libpng-dev build-essential gcc g++ pkg-config make
make test
make
sudo make install
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ install:
@echo "Installing..."
cd src && $(MAKE) install

test:
mkdir -p build
@echo "Testing..."
cd test && $(MAKE)

install-cli-only:
@echo "Installing command line interface only..."
cd src/scripts && $(MAKE) install-cli-only
Expand All @@ -19,7 +24,8 @@ uninstall:
clean-old:
cd src && $(MAKE) clean-old

.PHONY: clean
.PHONY: clean test

clean:
cd src && $(MAKE) clean
cd test && $(MAKE) clean
2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
linux-wifi-hotspot (4.3.3) UNRELEASED; urgency=high
linux-wifi-hotspot (4.4.0) UNRELEASED; urgency=low

* Minor secrurty fixes

Expand Down
2 changes: 1 addition & 1 deletion src/scripts/create_ap.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CHANNEL=default
GATEWAY=10.0.0.1
GATEWAY=192.168.12.1
WPA_VERSION=2
ETC_HOSTS=0
DHCP_DNS=gateway
Expand Down
2 changes: 1 addition & 1 deletion src/ui/glade/about.glade
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<property name="type_hint">dialog</property>
<property name="gravity">center</property>
<property name="program_name">Linux Wifi Hotspot</property>
<property name="version">4.3.3</property>
<property name="version">4.4.0</property>
<property name="copyright" translatable="yes">(c) lakinduakash 2021</property>
<property name="comments" translatable="yes">For more info visit
https://github.com/lakinduakash/linux-wifi-hotspot</property>
Expand Down
124 changes: 77 additions & 47 deletions src/ui/glade/wifih.ui
Original file line number Diff line number Diff line change
Expand Up @@ -221,29 +221,70 @@
<property name="row_spacing">10</property>
<property name="column_homogeneous">True</property>
<child>
<object class="GtkCheckButton" id="cb_hidden">
<property name="label" translatable="yes">Hidden</property>
<object class="GtkRadioButton" id="rb_freq_2">
<property name="label" translatable="yes">2.4Ghz</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<property name="group">rb_freq_auto</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="rb_freq_auto">
<property name="label" translatable="yes">Auto</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<property name="group">rb_freq_5</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Frequency band</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="cb_no_haveged">
<property name="label">No Haveged</property>
<object class="GtkRadioButton" id="rb_freq_5">
<property name="label" translatable="yes">5Ghz</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<property name="group">rb_freq_auto</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="cb_hidden">
<property name="label" translatable="yes">Hidden</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">9</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -322,57 +363,27 @@
</packing>
</child>
<child>
<object class="GtkRadioButton" id="rb_freq_2">
<property name="label" translatable="yes">2.4Ghz</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<property name="group">rb_freq_auto</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="rb_freq_auto">
<property name="label" translatable="yes">Auto</property>
<object class="GtkCheckButton" id="cb_gateway">
<property name="label" translatable="yes">Gateway</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<property name="group">rb_freq_5</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Frequency band</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="rb_freq_5">
<property name="label" translatable="yes">5Ghz</property>
<object class="GtkEntry" id="entry_gateway">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<property name="group">rb_freq_auto</property>
<property name="halign">start</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">0</property>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
Expand All @@ -385,7 +396,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
Expand All @@ -398,7 +409,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
<property name="top_attach">7</property>
<property name="height">2</property>
</packing>
</child>
Expand All @@ -412,7 +423,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">8</property>
<property name="top_attach">9</property>
</packing>
</child>
<child>
Expand All @@ -425,9 +436,28 @@
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">8</property>
<property name="top_attach">9</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="cb_no_haveged">
<property name="label">No Haveged</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">10</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
Expand Down
9 changes: 7 additions & 2 deletions src/ui/h_prop.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ const char *build_wh_start_command(char *iface_src, char *iface_dest, char *ssid

const char *build_wh_mkconfig_command(ConfigValues* cv){

const char* a=get_config_file(CONFIG_FILE_NAME);
const char* config_ffile_name=get_config_file(CONFIG_FILE_NAME);

snprintf(cmd_mkconfig, BUFSIZE, "%s %s %s %s '%s' '%s' %s %s",SUDO, CREATE_AP, cv->iface_wifi, cv->iface_inet, cv->ssid, cv->pass,MKCONFIG,a);
snprintf(cmd_mkconfig, BUFSIZE, "%s %s %s %s '%s' '%s' %s %s",SUDO, CREATE_AP, cv->iface_wifi, cv->iface_inet, cv->ssid, cv->pass,MKCONFIG,config_ffile_name);

if(cv->freq!=NULL){
strcat(cmd_mkconfig," --freq-band ");
Expand Down Expand Up @@ -141,6 +141,11 @@ const char *build_wh_mkconfig_command(ConfigValues* cv){
strcat(cmd_mkconfig, cv->mac);
}

if(cv->gateway!=NULL) {
strcat(cmd_mkconfig, " --gateway ");
strcat(cmd_mkconfig, cv->gateway);
}

if(cv->mac_filter!=NULL && (strcmp(cv->mac_filter,"1") == 0)){
strcat(cmd_mkconfig, " --mac-filter ");
strcat(cmd_mkconfig, cv->mac_filter);
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 ( GATEWAY, key ))
configValues.gateway = value;

}

Expand Down
1 change: 1 addition & 0 deletions src/ui/read_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ typedef struct{
char *ieee80211n;
char *ieee80211ac;
char *no_haveged;
char *gateway;
} ConfigValues;


Expand Down
Loading

0 comments on commit 0b4960d

Please sign in to comment.