Add no_haveged option

This commit is contained in:
Nbiba Bedis 2021-09-27 19:40:38 +01:00
parent c69ac98154
commit 120edfef7e
5 changed files with 35 additions and 2 deletions

View File

@ -233,6 +233,19 @@
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="cb_no_haveged">
<property name="label" translatable="false">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">9</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="cb_psk">
<property name="label" translatable="yes">Use psk</property>

View File

@ -116,6 +116,9 @@ const char *build_wh_mkconfig_command(ConfigValues* cv){
if(cv->hidden!=NULL && (strcmp(cv->hidden,"1") == 0))
strcat(cmd_mkconfig," --hidden ");
if(cv->no_haveged!=NULL && (strcmp(cv->no_haveged,"1") == 0))
strcat(cmd_mkconfig," --no-haveged ");
if(cv->channel!=NULL && (strcmp(cv->channel,"default") != 0) && (cv->freq==NULL||(strcmp(cv->freq,"2.4") == 0)|| (strcmp(cv->freq,"5") == 0))){
strcat(cmd_mkconfig," -c ");

View File

@ -104,6 +104,9 @@ static void setConfigValues(const char * key, char *value){
if( !strcmp ( HIDDEN, key ))
configValues.hidden = value;
if( !strcmp ( NO_HAVEGED, key ))
configValues.no_haveged = value;
if( !strcmp ( NO_VIRT, key ))
configValues.no_virt = value;

View File

@ -45,6 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define NO_DNS "NO_DNS"
#define NO_DNSMASQ "NO_DNSMASQ"
#define HIDDEN "HIDDEN"
#define NO_HAVEGED "NO_HAVEGED"
#define MAC_FILTER "MAC_FILTER"
#define MAC_FILTER_ACCEP "MAC_FILTER_ACCEPT"
#define ISOLATE_CLIENTS "ISOLATE_CLIENTS"
@ -90,6 +91,7 @@ typedef struct{
char *accepted_macs;
char *ieee80211n;
char *ieee80211ac;
char *no_haveged;
} ConfigValues;

View File

@ -82,6 +82,7 @@ GtkRadioButton *rb_freq_2;
GtkRadioButton *rb_freq_5;
GtkCheckButton *cb_hidden;
GtkCheckButton *cb_no_haveged;
GtkCheckButton *cb_psk;
GtkCheckButton *cb_mac;
GtkCheckButton *cb_novirt;
@ -385,6 +386,7 @@ int initUi(int argc, char *argv[]){
combo_internet = (GtkComboBox *) gtk_builder_get_object(builder, "combo_internet");
cb_hidden = (GtkCheckButton *) gtk_builder_get_object(builder, "cb_hidden");
cb_no_haveged = (GtkCheckButton *) gtk_builder_get_object(builder, "cb_no_haveged");
cb_psk = (GtkCheckButton *) gtk_builder_get_object(builder, "cb_psk");
cb_mac = (GtkCheckButton *) gtk_builder_get_object(builder, "cb_mac");
cb_novirt = (GtkCheckButton *) gtk_builder_get_object(builder, "cb_novirt");
@ -480,6 +482,11 @@ void init_ui_from_config(){
gtk_toggle_button_set_active((GtkToggleButton*) cb_hidden,TRUE);
}
if(strcmp(values->no_haveged,"1")==0){
gtk_toggle_button_set_active((GtkToggleButton*) cb_no_haveged,TRUE);
}
if(strcmp(values->use_psk,"1")==0){
gtk_toggle_button_set_active((GtkToggleButton*) cb_psk,TRUE);
@ -826,6 +833,11 @@ static int init_config_val_input(ConfigValues* cv){
else
cv->hidden =NULL;
if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cb_no_haveged)))
cv->no_haveged = "1";
else
cv->no_haveged =NULL;
if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cb_novirt)))
cv->no_virt = "1";