📄 config_grammar.y
字号:
tmp_sim); else delete_config_eap_sim(&tmp_sim); tmp_sim = NULL; } | eap_aka_statement { set_current_network(); if (!config_eap_method_contains_method(tmp_network->methods, EAP_TYPE_AKA)) add_config_eap_method(&(tmp_network->methods), EAP_TYPE_AKA, tmp_aka); else delete_config_eap_aka(&tmp_aka); tmp_aka = NULL; } | wpa_psk_statement { set_current_network(); if (!config_eap_method_contains_method(tmp_network->methods, WPA_PSK)) add_config_eap_method(&(tmp_network->methods), WPA_PSK, tmp_wpa_psk); else delete_config_wpa_psk(&tmp_wpa_psk); tmp_wpa_psk = NULL; } ;eap_type_list : eap_type_list ',' eap_type | eap_type ;eap_type : TK_EAP_TLS { parameter_debug("Allow Type: TLS\n"); set_current_network(); SET_FLAG(tmp_network->flags, CONFIG_NET_ALLOW_TLS); } | TK_EAP_MD5 { parameter_debug("Allow Type: MD5\n"); set_current_network(); SET_FLAG(tmp_network->flags, CONFIG_NET_ALLOW_MD5); } | TK_EAP_TTLS { parameter_debug("Allow Type: TTLS\n"); set_current_network(); SET_FLAG(tmp_network->flags, CONFIG_NET_ALLOW_TTLS); } | TK_EAP_LEAP { parameter_debug("Allow Type: LEAP\n"); set_current_network(); SET_FLAG(tmp_network->flags, CONFIG_NET_ALLOW_LEAP); } | TK_EAP_MSCHAPV2 { parameter_debug("Allow Type: MSCHAPV2\n"); set_current_network(); SET_FLAG(tmp_network->flags, CONFIG_NET_ALLOW_MSCV2); } | TK_EAP_PEAP { parameter_debug("Allow Type: PEAP\n"); set_current_network(); SET_FLAG(tmp_network->flags, CONFIG_NET_ALLOW_PEAP); } | TK_EAP_SIM { parameter_debug("Allow Type: SIM\n"); set_current_network(); SET_FLAG(tmp_network->flags, CONFIG_NET_ALLOW_SIM); } | TK_EAP_AKA { parameter_debug("Allow Type: AKA\n"); set_current_network(); SET_FLAG(tmp_network->flags, CONFIG_NET_ALLOW_AKA); } | TK_EAP_GTC { parameter_debug("Allow Type: GTC\n"); set_current_network(); SET_FLAG(tmp_network->flags, CONFIG_NET_ALLOW_GTC); } | TK_EAP_OTP { parameter_debug("Allow Type: OTP\n"); set_current_network(); SET_FLAG(tmp_network->flags, CONFIG_NET_ALLOW_OTP); } ;static_wep_statement: TK_STATIC_WEP '{' static_wep_params '}' | TK_STATIC_WEP '{' '}' { set_current_static_wep(); } ;static_wep_params : static_wep_params static_wep_param | static_wep_param ;static_wep_param : TK_STATIC_KEY1 '=' TK_QUOTED_STR { set_current_static_wep(); parameter_debug("Static Key 1 : %s\n", $3); if (!tmp_static_wep->key[1]) tmp_static_wep->key[1] = (uint8_t *) $3; } | TK_STATIC_KEY2 '=' TK_QUOTED_STR { set_current_static_wep(); parameter_debug("Static Key 2 : %s\n", $3); if (!tmp_static_wep->key[2]) tmp_static_wep->key[2] = (uint8_t *) $3; } | TK_STATIC_KEY3 '=' TK_QUOTED_STR { set_current_static_wep(); parameter_debug("Static Key 3 : %s\n", $3); if (!tmp_static_wep->key[3]) tmp_static_wep->key[3] = (uint8_t *) $3; } | TK_STATIC_KEY4 '=' TK_QUOTED_STR { set_current_static_wep(); parameter_debug("Static Key 4 : %s\n", $3); if (!tmp_static_wep->key[4]) tmp_static_wep->key[4] = (uint8_t *) $3; } | TK_WEP_TX_KEY '=' TK_NUMBER { set_current_static_wep(); parameter_debug("TX Key : %d\n", $3); if (($3>4) || ($3<1)) { printf("Static WEP key index is out of range! It must be a number in the range 1..4! Defaulting to 1.\n"); tmp_static_wep->tx_key = 1; } else { tmp_static_wep->tx_key = $3; } } ;initial_wep_statement: TK_INITIAL_WEP '{' initial_wep_params '}' | TK_INITIAL_WEP '{' '}' { set_current_initial_wep(); } ;initial_wep_params : initial_wep_params initial_wep_param | initial_wep_param ;initial_wep_param : TK_STATIC_KEY1 '=' TK_QUOTED_STR { set_current_initial_wep(); parameter_debug("Initial Key 1 : %s\n", $3); if (!tmp_initial_wep->key[1]) tmp_initial_wep->key[1] = (uint8_t *) $3; } | TK_STATIC_KEY2 '=' TK_QUOTED_STR { set_current_initial_wep(); parameter_debug("Initial Key 2 : %s\n", $3); if (!tmp_initial_wep->key[2]) tmp_initial_wep->key[2] = (uint8_t *) $3; } | TK_STATIC_KEY3 '=' TK_QUOTED_STR { set_current_initial_wep(); parameter_debug("Initial Key 3 : %s\n", $3); if (!tmp_initial_wep->key[3]) tmp_initial_wep->key[3] = (uint8_t *) $3; } | TK_STATIC_KEY4 '=' TK_QUOTED_STR { set_current_initial_wep(); parameter_debug("Initial Key 4 : %s\n", $3); if (!tmp_initial_wep->key[4]) tmp_initial_wep->key[4] = (uint8_t *) $3; } | TK_WEP_TX_KEY '=' TK_NUMBER { set_current_initial_wep(); parameter_debug("Initial TX Key : %d\n", $3); if (($3>4) || ($3<1)) { printf("Initial WEP key index is out of range! It must be a number in the range 1..4! Defaulting to 1.\n"); tmp_initial_wep->tx_key = 1; } else { tmp_initial_wep->tx_key = $3; } } ;eap_tls_statement : TK_EAP_TLS '{' eap_tls_params '}' | TK_EAP_TLS '{' '}' { set_current_tls(); /* define an empty tls struct*/ } ;eap_tls_params : eap_tls_params eap_tls_param | eap_tls_param ;smartcard_section : TK_SMARTCARD '{' smartcard_params '}' { set_current_tls(); parameter_debug("Using Engine: \"%s\"\n", tmp_tls->sc.engine_id); } /* don't allow empty smartcard sections */ ;smartcard_params : smartcard_param smartcard_params | smartcard_param ;smartcard_param : TK_ENGINE_ID '=' TK_UNQUOTED_STR { set_current_tls(); tmp_tls->sc.engine_id = strdup($3); parameter_debug("engine: \"%s\"\n", tmp_tls->sc.engine_id); } | TK_OPENSC_SO_PATH '=' TK_UNQUOTED_STR { set_current_tls(); tmp_tls->sc.opensc_so_path = $3; parameter_debug("opensc_so_path: \"%s\"\n", tmp_tls->sc.opensc_so_path); } | TK_OPENSC_SO_PATH '=' TK_QUOTED_STR { set_current_tls(); tmp_tls->sc.opensc_so_path = $3; parameter_debug("opensc_so_path: \"%s\"\n", tmp_tls->sc.opensc_so_path); } | TK_KEYID '=' TK_UNQUOTED_STR { set_current_tls(); tmp_tls->sc.key_id = $3; parameter_debug("cert_id: \"%s\"\n", tmp_tls->sc.key_id); } | TK_KEYID '=' TK_NUMBER { set_current_tls(); tmp_tls->sc.key_id = (char *)malloc(5); sprintf(tmp_tls->sc.key_id, "%d", $3); parameter_debug("cert_id: \"%s\"\n", tmp_tls->sc.key_id); } ;eap_tls_param : TK_USER_CERT '=' TK_UNQUOTED_STR { parameter_debug("tls user cert: \"%s\"\n", $3); set_current_tls(); if (!tmp_tls->user_cert) tmp_tls->user_cert = $3; else free($3); } | TK_USER_CERT '=' TK_QUOTED_STR { parameter_debug("tls user cert: \"%s\"\n", $3); set_current_tls(); if (!tmp_tls->user_cert) tmp_tls->user_cert = $3; else free($3); } | TK_USER_KEY '=' TK_UNQUOTED_STR { parameter_debug("tls user key: \"%s\"\n", $3); set_current_tls(); if (!tmp_tls->user_key) tmp_tls->user_key = $3; else free($3); } | TK_USER_KEY '=' TK_QUOTED_STR { parameter_debug("tls user key: \"%s\"\n", $3); set_current_tls(); if (!tmp_tls->user_key) tmp_tls->user_key = $3; else free($3); } | TK_USER_KEY_PASS '=' TK_PASS { parameter_debug("tls user pass: \"%s\"\n", $3); set_current_tls(); if (!tmp_tls->user_key_pass) tmp_tls->user_key_pass = $3; else free($3); } | TK_USER_KEY_PASS '=' TK_QUOTED_STR { parameter_debug("tls user pass: \"%s\"\n", $3); set_current_tls(); if (!tmp_tls->user_key_pass) tmp_tls->user_key_pass = $3; else free($3); } | TK_USER_KEY_PASS '=' TK_UNQUOTED_STR { parameter_debug("tls user pass: \"%s\"\n", $3); set_current_tls(); if (!tmp_tls->user_key_pass) tmp_tls->user_key_pass = $3; else free($3); } | TK_SESSION_RESUME '=' TK_YES { parameter_debug("Session Resumption = YES\n"); set_current_tls(); if (tmp_tls->session_resume == RES_UNSET) tmp_tls->session_resume = RES_YES; } | TK_SESSION_RESUME '=' TK_NO { parameter_debug("Session Resumption = NO\n"); set_current_tls(); if (tmp_tls->session_resume == RES_UNSET) tmp_tls->session_resume = RES_NO; } | TK_SESSION_RESUME '=' TK_UNQUOTED_STR { set_current_tls(); tmp_tls->session_resume = RES_NO; printf("Invalid value for session resumption = \"%s\"! Defaulting to NO! (Line : %d)\n", $3, config_linenum); } | TK_ROOT_CERT '=' TK_UNQUOTED_STR { parameter_debug("tls root_cert: \"%s\"\n", $3); set_current_tls(); if (!tmp_tls->root_cert) tmp_tls->root_cert = $3; else free($3); } | TK_ROOT_CERT '=' TK_QUOTED_STR { parameter_debug("tls root_cert: \"%s\"\n", $3); set_current_tls(); if (!tmp_tls->root_cert) tmp_tls->root_cert = $3; else free($3); } | TK_ROOT_DIR '=' TK_UNQUOTED_STR { parameter_debug("tls root_dir: \"%s\"\n", $3); set_current_tls(); if (!tmp_tls->root_dir) tmp_tls->root_dir = $3; else free($3); } | TK_ROOT_DIR '=' TK_QUOTED_STR { parameter_debug("tls root_dir: \"%s\"\n", $3); set_current_tls(); if (!tmp_tls->root_dir) tmp_tls->root_dir = $3; else free($3); } | TK_CRL_DIR '=' TK_UNQUOTED_STR { parameter_debug("tls crl_dir: \"%s\"\n", $3); set_current_tls(); if (!tmp_tls->crl_dir) tmp_tls->crl_dir = $3; else free($3); } | TK_CRL_DIR '=' TK_QUOTED_STR { parameter_debug("tls crl_dir: \"%s\"\n", $3); set_current_tls(); if (!tmp_tls->crl_dir) tmp_tls->crl_dir = $3; else free($3); } | TK_CHUNK_SIZE '=' TK_NUMBER { parameter_debug("tls chunk: %d\n", $3); set_current_tls(); if (tmp_tls->chunk_size == 0) tmp_tls->chunk_size = $3; } | TK_RANDOM_FILE '=' TK_UNQUOTED_STR { parameter_debug("tls rand: \"%s\"\n", $3); set_current_tls(); if (!tmp_tls->random_file) tmp_tls->random_file = $3; else free($3); } | TK_RANDOM_FILE '=' TK_QUOTED_STR { parameter_debug("tls rand: \"%s\"\n", $3);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -