⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xsupconfig.h

📁 linux 下通过802.1认证的安装包
💻 H
字号:
/**
 *
 * Licensed under a dual GPL/BSD license.  (See LICENSE file for more info.)
 *
 * \author chris@open1x.org
 *
 **/

#ifndef _XSUPCONFIG_H_
#define _XSUPCONFIG_H_

#ifndef WINDOWS
#include <stdint.h>
#endif

#include "xsupconfig_structs.h"

#ifndef TRUE
#define TRUE          1
#endif

#ifndef FALSE
#define FALSE         0
#endif

#define SET_FLAG(var,flag)    (var |= flag)
#define UNSET_FLAG(var,flag)  (var &= ~flag)
#define TEST_FLAG(var,flag)   (var & flag)

#define DEST_AUTO      0
#define DEST_BSSID     1
#define DEST_MULTICAST 2
#define DEST_SOURCE    3

// The default network priority that is assigned to all networks that
// don't explicitly list a priority.
#define DEFAULT_PRIORITY  0xff

// The timer that we use to determine when we need to retransmit.  This 
// should probably be tied in to a lower layer timer, but for now, we
// will use a #define.
#define IDLE_WHILE_TIMER  30

// If a WEP key sits around for more than the timeout below, we should barf
// out a warning letting the user know that their data isn't as secure as
// it could be.
#define STALE_KEY_WARN_TIMEOUT 600   // 10 minutes.

// The amount of time we should wait before we assume an authentication will
// not be able to succeed.
#define AUTHENTICATION_TIMEOUT  30   // 30 seconds.

// The length of time to wait before we assume an assocation failed. (Defined
// by 802.11i section 8.1.3 as dot11RSNAConfigSA-Timeout.)  Default is 60, but
// we may want to provide the ability to change this in the future.
#define ASSOCIATION_TIMEOUT           60    // in seconds.

// The length of time to wait before we attempt another passive scan.
#define PASSIVE_TIMEOUT               300   // in seconds.

// The length of time to wait before we attempt another active scan.
#define RESCAN_TIMEOUT                15    // in seconds.

// The length of time to stay in HELD state.
#define HELD_STATE_TIMEOUT            60    // in seconds.

// The maximum number of starts to send before we assume that we are on a device that doesn't
// understand 802.1X, and switch to authenticated state.
#define MAX_STARTS                    3

// The default size (in MB) to roll the log file at.
#define LOG_SIZE_TO_ROLL              10    // MB
#define OLD_LOGS_TO_KEEP              3     // How many old log files should we keep around.

/*** EAP Type IDs (Only for EAP types that are implemented!!) ***/

// Bogus invalid EAP method # that indicates that we are talking about
// static WEP.
#define EAP_TYPE_MD5        4
#define EAP_TYPE_OTP        5
#define EAP_TYPE_GTC        6
#define EAP_TYPE_TLS        13
#define EAP_TYPE_LEAP       17
#define EAP_TYPE_SIM        18
#define EAP_TYPE_TTLS       21
#define EAP_TYPE_AKA        23
#define EAP_TYPE_PEAP       25
#define EAP_TYPE_MSCHAPV2   26
#define EAP_TYPE_TNC        38   /* tentative assignment per TNC_IFT_v1_0_r3 */
                                 /* (Section 7.1.3, page 27) */
#define EAP_TYPE_FAST       43

// Phase 2 Types for TTLS
#define TTLS_PHASE2_PAP       1
#define TTLS_PHASE2_CHAP      2
#define TTLS_PHASE2_MSCHAP    3
#define TTLS_PHASE2_MSCHAPv2  4

int config_setup(char *);
void config_destroy();
struct config_connection *config_find_config(char *);
struct config_connection *config_get_connections();
struct config_profiles *config_get_profiles();
struct config_managed_networks *config_get_managed_networks();
void config_set_managed_networks(struct config_managed_networks *);
void config_set_forced_profile(char *);
int config_delete_connection(char *);
int config_delete_profile(char *);
int config_delete_trusted_server(char *);
int config_delete_interface(char *);
void config_create_new_config();
void config_terminate();
struct config_globals *config_get_globals();
void reset_config_globals(struct config_globals *);
int add_change_config_connections(struct config_connection *);
int add_change_config_profiles(struct config_profiles *);
int add_change_config_trusted_server(struct config_trusted_server *);
struct xsup_interfaces *config_get_config_ints();
struct xsup_interfaces *config_find_int(char *);
uint8_t config_get_network_priority(char *);
struct config_connection *config_find_connection_from_ssid(char *);
uint8_t config_get_friendly_warnings();
uint8_t config_get_idleWhile();
struct config_connection *config_find_connection(char *);
struct config_profiles *config_find_profile(char *);
char *config_get_pwd_from_profile(struct config_eap_method *);
int config_parse();
struct config_trusted_servers *config_get_trusted_servers();
int config_set_pwd_on_conn(char *, char *);
int config_set_new_globals(struct config_globals *);
char *config_get_inner_user_from_profile(struct config_eap_method *);

void delete_config_ip_data(struct config_connection *);
void delete_config_association(struct config_connection *);

// * private functions for config code
void delete_config_eap_tls(struct config_eap_tls **);
void dump_config_eap_tls(struct config_eap_tls *);

void delete_config_eap_fast(struct config_eap_fast **);
void dump_config_eap_fast(struct config_eap_fast *);

void delete_config_eap_tnc(struct config_eap_tnc **);
void dump_config_eap_tnc(struct config_eap_tnc *);

void delete_config_pwd_only(struct config_pwd_only **);
void dump_config_pwd_only(struct config_pwd_only *, char *, int);

void delete_config_ttls_phase2(struct config_eap_ttls *);
void delete_config_ttls_eap(struct config_eap_method **);
void dump_config_ttls_phase2(struct config_eap_ttls *);

void delete_config_eap_ttls(struct config_eap_ttls **);
void dump_config_eap_ttls(struct config_eap_ttls *);

void delete_config_eap_mschapv2(struct config_eap_mschapv2 **);
void dump_config_eap_mschapv2(struct config_eap_mschapv2 *, int);

void delete_config_eap_peap(struct config_eap_peap **);
void dump_config_eap_peap(struct config_eap_peap *);

void delete_config_eap_sim(struct config_eap_sim **);
void dump_config_eap_sim(struct config_eap_sim *, int);

void delete_config_eap_aka(struct config_eap_aka **);
void dump_config_eap_aka(struct config_eap_aka *, int);

void delete_config_eap_method(struct config_eap_method **);
void dump_config_eap_method(struct config_eap_method *, int);

void initialize_config_connections(struct config_connection **);
void delete_config_single_connection(struct config_connection **);
void delete_config_connections(struct config_connection **);
void dump_config_connections(struct config_connection *);

void initialize_config_globals(struct config_globals **);
void delete_config_globals(struct config_globals **);
void dump_config_globals(struct config_globals *);

void delete_config_profiles(struct config_profiles **);

void delete_config_data();
void dump_config_data();

int config_change_pwd(struct config_eap_method *, char *);
void delete_config_trusted_server(struct config_trusted_server **);
void delete_config_interface(struct xsup_interfaces **);


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -