📄 config_grammar.y
字号:
set_current_tls(); if (!tmp_tls->random_file) tmp_tls->random_file = $3; else free($3); } | smartcard_section ;eap_md5_statement : TK_EAP_MD5 '{' eap_md5_params'}' | TK_EAP_MD5 '{' '}' { set_current_md5(); /* define an empty md5 struct*/ } ;eap_md5_params : eap_md5_params eap_md5_param | eap_md5_param ;eap_md5_param : TK_USERNAME '=' TK_USERNAME_VAL { parameter_debug("md5 username: \"%s\"\n", $3); set_current_md5(); if (!tmp_md5->username) tmp_md5->username = $3; else free($3); } | TK_USERNAME '=' TK_UNQUOTED_STR { parameter_debug("md5 username: \"%s\"\n", $3); set_current_md5(); if (!tmp_md5->username) tmp_md5->username = $3; else free($3); } | TK_USERNAME '=' TK_QUOTED_STR { parameter_debug("md5 username: \"%s\"\n", $3); set_current_md5(); if (!tmp_md5->username) tmp_md5->username = $3; else free($3); } | TK_PASSWORD '=' TK_PASS { parameter_debug("md5 password: \"%s\"\n", $3); set_current_md5(); if (!tmp_md5->password) tmp_md5->password = $3; else free($3); } | TK_PASSWORD '=' TK_UNQUOTED_STR { parameter_debug("md5 password: \"%s\"\n", $3); set_current_md5(); if (!tmp_md5->password) tmp_md5->password = $3; else free($3); } | TK_PASSWORD '=' TK_QUOTED_STR { parameter_debug("md5 password: \"%s\"\n", $3); set_current_md5(); if (!tmp_md5->password) tmp_md5->password = $3; else free($3); } ;eap_ttls_statement : TK_EAP_TTLS '{' eap_ttls_params '}' | TK_EAP_TTLS '{' '}' { set_current_ttls(); /* define an empty ttls struct*/ } ;eap_ttls_params : eap_ttls_params eap_ttls_param | eap_ttls_param ;eap_ttls_param : TK_USER_CERT '=' TK_UNQUOTED_STR { parameter_debug("ttls user cert: \"%s\"\n", $3); set_current_ttls(); if (!tmp_ttls->user_cert) tmp_ttls->user_cert = $3; else free($3); } | TK_USER_CERT '=' TK_QUOTED_STR { parameter_debug("ttls user cert: \"%s\"\n", $3); set_current_ttls(); if (!tmp_ttls->user_cert) tmp_ttls->user_cert = $3; else free($3); } | TK_USER_KEY '=' TK_UNQUOTED_STR { parameter_debug("ttls user key: \"%s\"\n", $3); set_current_ttls(); if (!tmp_ttls->user_key) tmp_ttls->user_key = $3; else free($3); } | TK_USER_KEY '=' TK_QUOTED_STR { parameter_debug("ttls user key: \"%s\"\n", $3); set_current_ttls(); if (!tmp_ttls->user_key) tmp_ttls->user_key = $3; else free($3); } | TK_USER_KEY_PASS '=' TK_PASS { parameter_debug("ttls user pass: \"%s\"\n", $3); set_current_ttls(); if (!tmp_ttls->user_key_pass) tmp_ttls->user_key_pass = $3; else free($3); } | TK_USER_KEY_PASS '=' TK_UNQUOTED_STR { parameter_debug("ttls user pass: \"%s\"\n", $3); set_current_ttls(); if (!tmp_ttls->user_key_pass) tmp_ttls->user_key_pass = $3; else free($3); } | TK_USER_KEY_PASS '=' TK_QUOTED_STR { parameter_debug("ttls user pass: \"%s\"\n", $3); set_current_ttls(); if (!tmp_ttls->user_key_pass) tmp_ttls->user_key_pass = $3; else free($3); } | TK_ROOT_CERT '=' TK_UNQUOTED_STR { parameter_debug("ttls root_cert: \"%s\"\n", $3); set_current_ttls(); if (!tmp_ttls->root_cert) tmp_ttls->root_cert = $3; else free($3); } | TK_ROOT_CERT '=' TK_QUOTED_STR { parameter_debug("ttls root_cert: \"%s\"\n", $3); set_current_ttls(); if (!tmp_ttls->root_cert) tmp_ttls->root_cert = $3; else free($3); } | TK_ROOT_DIR '=' TK_UNQUOTED_STR { parameter_debug("ttls root_dir: \"%s\"\n", $3); set_current_ttls(); if (!tmp_ttls->root_dir) tmp_ttls->root_dir = $3; else free($3); } | TK_ROOT_DIR '=' TK_QUOTED_STR { parameter_debug("ttls root_dir: \"%s\"\n", $3); set_current_ttls(); if (!tmp_ttls->root_dir) tmp_ttls->root_dir = $3; else free($3); } | TK_CRL_DIR '=' TK_UNQUOTED_STR { parameter_debug("ttls crl_dir: \"%s\"\n", $3); set_current_ttls(); if (!tmp_ttls->crl_dir) tmp_ttls->crl_dir = $3; else free($3); } | TK_CRL_DIR '=' TK_QUOTED_STR { parameter_debug("ttls crl_dir: \"%s\"\n", $3); set_current_ttls(); if (!tmp_ttls->crl_dir) tmp_ttls->crl_dir = $3; else free($3); } | TK_CHUNK_SIZE '=' TK_NUMBER { parameter_debug("ttls chunk: %d\n", $3); set_current_ttls(); if (tmp_ttls->chunk_size == 0) tmp_ttls->chunk_size = $3; } | TK_RANDOM_FILE '=' TK_UNQUOTED_STR { parameter_debug("ttls rand: \"%s\"\n", $3); set_current_ttls(); if (!tmp_ttls->random_file) tmp_ttls->random_file = $3; else free($3); } | TK_RANDOM_FILE '=' TK_QUOTED_STR { parameter_debug("ttls rand: \"%s\"\n", $3); set_current_ttls(); if (!tmp_ttls->random_file) tmp_ttls->random_file = $3; else free($3); } | TK_SESSION_RESUME '=' TK_YES { parameter_debug("Session Resumption = YES\n"); set_current_ttls(); if (tmp_ttls->session_resume == RES_UNSET) tmp_ttls->session_resume = RES_YES; } | TK_SESSION_RESUME '=' TK_NO { parameter_debug("Session Resumption = NO\n"); set_current_ttls(); if (tmp_ttls->session_resume == RES_UNSET) tmp_ttls->session_resume = RES_NO; } | TK_SESSION_RESUME '=' TK_UNQUOTED_STR { set_current_ttls(); tmp_ttls->session_resume = RES_NO; printf("Invalid value for session resume = \"%s\"! Defaulting to NO! (Line : %d)\n", $3, config_linenum); } | TK_CNCHECK '=' TK_UNQUOTED_STR { parameter_debug("ttls CN check : \"%s\"\n", $3); set_current_ttls(); if (!tmp_ttls->cncheck) tmp_ttls->cncheck = $3; else free($3); } | TK_CNEXACT '=' TK_YES { parameter_debug("match CN exactly : \"yes\"\n"); set_current_ttls(); tmp_ttls->cnexact = 1; } | TK_CNEXACT '=' TK_NO { parameter_debug("match CN exactly : \"no\"\n"); set_current_ttls(); tmp_ttls->cnexact = 0; } | TK_PHASE2_TYPE '=' TK_PAP { parameter_debug("ttls phase2_type 'pap'\n"); if (tmp_ttls && tmp_ttls->phase2_type != TTLS_PHASE2_UNDEFINED) { cleanup_parse(); return XECONFIGPARSEFAIL; } set_current_ttls(); tmp_ttls->phase2_type = TTLS_PHASE2_PAP; } | TK_PHASE2_TYPE '=' TK_CHAP { parameter_debug("ttls phase2_type 'chap'\n"); if (tmp_ttls && tmp_ttls->phase2_type != TTLS_PHASE2_UNDEFINED) { cleanup_parse(); return XECONFIGPARSEFAIL; } set_current_ttls(); tmp_ttls->phase2_type = TTLS_PHASE2_CHAP; } | TK_PHASE2_TYPE '=' TK_MSCHAP { parameter_debug("ttls phase2_type 'mschap'\n"); if (tmp_ttls && tmp_ttls->phase2_type != TTLS_PHASE2_UNDEFINED) { cleanup_parse(); return XECONFIGPARSEFAIL; } set_current_ttls(); tmp_ttls->phase2_type = TTLS_PHASE2_MSCHAP; } | TK_PHASE2_TYPE '=' TK_MSCHAPV2 { parameter_debug("ttls phase2_type 'mschapv2'\n"); if (tmp_ttls && tmp_ttls->phase2_type != TTLS_PHASE2_UNDEFINED) { cleanup_parse(); return XECONFIGPARSEFAIL; } set_current_ttls(); tmp_ttls->phase2_type = TTLS_PHASE2_MSCHAPV2; } | TK_PHASE2_TYPE '=' TK_EAP_MD5 { parameter_debug("ttls phase2_type 'eap_md5'\n"); if (tmp_ttls && tmp_ttls->phase2_type != TTLS_PHASE2_UNDEFINED) { cleanup_parse(); return XECONFIGPARSEFAIL; } set_current_ttls(); tmp_ttls->phase2_type = TTLS_PHASE2_EAP_MD5; } | eap_ttls_phase2_statement ;eap_ttls_phase2_statement : phase2_pap_statement | phase2_chap_statement | phase2_mschap_statement | phase2_mschapv2_statement | eap_ttls_phase2_eap_statement ;phase2_pap_statement : TK_PAP '{' phase2_pap_params'}' { set_current_ttls(); if (!config_ttls_phase2_contains_phase2(tmp_ttls->phase2, TTLS_PHASE2_PAP)) add_config_ttls_phase2(&(tmp_ttls->phase2), TTLS_PHASE2_PAP, tmp_p2pap); else delete_config_pap(&tmp_p2pap); tmp_p2pap = NULL; } ;phase2_pap_params : phase2_pap_params phase2_pap_param | phase2_pap_param ;phase2_pap_param : TK_USERNAME '=' TK_USERNAME_VAL { parameter_debug("pap username: \"%s\"\n", $3); set_current_p2pap(); if (!tmp_p2pap->username) tmp_p2pap->username = $3; else free($3); } | TK_USERNAME '=' TK_UNQUOTED_STR { parameter_debug("pap username: \"%s\"\n", $3); set_current_p2pap(); if (!tmp_p2pap->username) tmp_p2pap->username = $3; else free($3); } | TK_USERNAME '=' TK_QUOTED_STR { parameter_debug("pap username: \"%s\"\n", $3); set_current_p2pap(); if (!tmp_p2pap->username) tmp_p2pap->username = $3; else free($3); } | TK_PASSWORD '=' TK_PASS { parameter_debug("pap password: \"%s\"\n", $3); set_current_p2pap(); if (!tmp_p2pap->password) tmp_p2pap->password = $3; else free($3); } | TK_PASSWORD '=' TK_UNQUOTED_STR { parameter_debug("pap password: \"%s\"\n", $3); set_current_p2pap(); if (!tmp_p2pap->password) tmp_p2pap->password = $3; else free($3); } | TK_PASSWORD '=' TK_QUOTED_STR { parameter_debug("pap password: \"%s\"\n", $3); set_current_p2pap(); if (!tmp_p2pap->password) tmp_p2pap->password = $3; else free($3); } ;phase2_chap_statement : TK_CHAP '{' phase2_chap_params'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -