📄 xsupgui_request.h
字号:
typedef struct {
char *ipaddr;
char *gateway;
char *netmask;
char *dns1;
char *dns2;
char *dns3;
} ipinfo_type;
typedef struct {
char *ssidname;
uint8_t abil; ///< A bitmap made up of ABILITY_* #define values.
} ssid_info_enum;
typedef struct {
char *errmsgs;
} error_messages;
typedef struct _cert_info {
char *C; ///< The Country Field in the Certificate
char *S; ///< The State Field in the Certificate
char *L; ///< The Location Field in the Certificate
char *O; ///< The Organization Field in the Certificate
char *OU; ///< The Organizational Unit Field in the Certificate
char *CN; ///< The Common Name Field in the Certificate
} cert_info;
#ifdef WINDOWS
#pragma pack(1)
#endif
#ifdef WINDOWS
typedef struct {
uint8_t flag_byte;
uint32_t length;
} ipc_header;
#else
struct _ipc_header {
uint8_t flag_byte;
uint32_t length;
} __attribute__((__packed__));
typedef struct _ipc_header ipc_header;
#endif
#ifdef WINDOWS
#pragma pack()
#endif
#define IPC_MSG_COMPLETE 0x00 ///< With this packet, the IPC message is complete.
#define IPC_MSG_TOTAL_SIZE BIT(0) ///< The four bytes in the header indicate the total size of the message.
#define IPC_MSG_MORE_FRAGS BIT(1) ///< There are additional fragments coming.
#define IPC_MSG_FRAG_SIZE BIT(2) ///< The four bytes in the header indicate the total size of this fragment.
/**
* Values for the 802.1X state machine states.
**/
// This matches the order of states listed in IEEE 802.1X-2001, pg. 59,
// section 8.5.10. (NOTE: These should match the values of the same name in
// statemachine.h!)
#define LOGOFF 1
#define DISCONNECTED 2
#define CONNECTING 3
#define ACQUIRED 4
#define AUTHENTICATING 5
#define HELD 6
#define AUTHENTICATED 7
// 802.1X-REV-d11 (2004) specifies a few additional states. Also, in EAPoL
// v2, the ACQUIRED state no longer exists.
#define RESTART 8
#define S_FORCE_AUTH 9
#define S_FORCE_UNAUTH 10
/**
* Values for the 802.1X backend state machine. These MUST sync up with the
* values in backend_sm.h!
**/
#define BACKEND_UNKNOWN 0
#define BACKEND_REQUEST 1
#define BACKEND_RESPONSE 2
#define BACKEND_SUCCESS 3
#define BACKEND_FAIL 4
#define BACKEND_TIMEOUT 5
#define BACKEND_IDLE 6
#define BACKEND_INITIALIZE 7
#define BACKEND_RECEIVE 8
/**
* Values for the physical state machine. (Only wireless for now.)
**/
#define WIRELESS_UNKNOWN_STATE 0
#define WIRELESS_UNASSOCIATED 1
#define WIRELESS_ASSOCIATED 2
#define WIRELESS_ACTIVE_SCAN 3 // There may be a passive scan later.
#define WIRELESS_ASSOCIATING 4 // Attempting to associate
#define WIRELESS_ASSOCIATION_TIMEOUT_S 5
// State 6 has been removed.
#define WIRELESS_PORT_DOWN 7 // The interface is down state.
#define WIRELESS_NO_ENC_ASSOCIATION 8
#define WIRELESS_INT_RESTART 9 // Restart everything.
#define WIRELESS_INT_STOPPED 10 // Stop answering requests.
#define WIRELESS_INT_HELD 11 // Hold the authentication, waiting for an event.
/**
* Cipher types that can be used. These defines need to
* stay in sync with the values in wpa_common.h.
**/
#define CIPHER_NONE 0x00
#define CIPHER_WEP40 0x01
#define CIPHER_TKIP 0x02
#define CIPHER_WRAP 0x03
#define CIPHER_CCMP 0x04
#define CIPHER_WEP104 0x05
/**
* Values for the EAP state machine. These MUST sync up with the values in
* eap_sm.h of the same name!
**/
#define EAP_UNKNOWN 0
#define EAP_DISABLED 1
#define EAP_INITIALIZE 2
#define EAP_IDLE 3
#define EAP_RECEIVED 4
#define EAP_GET_METHOD 5
#define EAP_METHOD 6
#define EAP_SEND_RESPONSE 7
#define EAP_DISCARD 8
#define EAP_IDENTITY 9
#define EAP_NOTIFICATION 10
#define EAP_RETRANSMIT 11
#define EAP_SUCCESS 12
#define EAP_FAILURE 13
/**
* Different values for the type of association that was used to connect to a
* wireless network.
**/
#define ASSOC_TYPE_UNKNOWN 0
#define ASSOC_TYPE_OPEN 1
#define ASSOC_TYPE_SHARED 2
#define ASSOC_TYPE_LEAP 3
#define ASSOC_TYPE_WPA1 4
#define ASSOC_TYPE_WPA2 5
// Abilities that will be stored in the SSID cache, for a "quick look" at
// what the SSID supports.
#define ABILITY_ENC 0x02
#define ABILITY_WPA_IE 0x04
#define ABILITY_RSN_IE 0x08
// Different encryption/authentication modes that are supported. (Since
// any interface should be able to do 802.1X, we don't flag that here.)
// These are the capability values returned from xsupgui_request_get_interface_capabilities().
#define DOES_WPA 0x00000001
#define DOES_WPA2 0x00000002
#define DOES_WEP40 0x00000004
#define DOES_WEP104 0x00000008
#define DOES_TKIP 0x00000010
#define DOES_CCMP 0x00000020
/**
* Calls that operate on things that are outside the configuration file. (Live data,
* calls to start and stop various things in the supplicant, etc.)
*/
int xsupgui_request_enum_eap_methods(eap_enum **eaptypes);
int xsupgui_request_get_1x_state(char *device, int *);
int xsupgui_request_get_eap_state(char *device, int *);
int xsupgui_request_get_backend_state(char *device, int *);
int xsupgui_request_get_physical_state(char *device, int *);
int xsupgui_request_get_pairwise_key_type(char *device, int *);
int xsupgui_request_get_group_key_type(char *device, int *);
int xsupgui_request_get_eap_type_in_use(char *device, int *);
int xsupgui_request_get_ip_info(char *device, ipinfo_type **info);
int xsupgui_request_set_connection(char *device, char *conn_name);
int xsupgui_request_get_connection_upw(char *conn_name, char **username, char **password, int *authtype);
int xsupgui_request_set_connection_upw(char *conn_name, char *username, char *password);
int xsupgui_request_set_disassociate(char *device, unsigned char reason);
int xsupgui_request_get_signal_strength_percent(char *device, int *strength);
int xsupgui_request_get_seconds_authenticated(char *device, long int *seconds);
int xsupgui_request_get_association_type(char *device, int *assoctype);
int xsupgui_request_ping();
int xsupgui_request_terminate();
int xsupgui_request_stop(char *device);
int xsupgui_request_logoff(char *device);
int xsupgui_request_get_devname(char *dev_desc, char **device);
int xsupgui_request_get_devdesc(char *device, char **dev_desc);
int xsupgui_request_enum_live_ints(int_enum **retints);
int xsupgui_request_enum_ssids(char *device, ssid_info_enum **ssids);
int xsupgui_request_wireless_scan(char *, uint8_t);
int xsupgui_request_version_string(char **);
int xsupgui_request_enum_root_ca_certs(cert_enum **);
int xsupgui_request_ca_certificate_info(char *, char *, cert_info **);
int xsupgui_request_answer_tnc_ui_request(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
int xsupgui_request_get_os_specific_int_data(char *, char **, char **, int *);
int xsupgui_request_get_ssid(char *device, char **ssid);
int xsupgui_request_get_conn_name_from_int(char *intname, char **connname);
int xsupgui_request_get_error_msgs(error_messages **);
int xsupgui_request_enum_possible_connections(poss_conn_enum **connections);
int xsupgui_request_unbind_connection(char *device);
int xsupgui_request_create_trouble_ticket_file(char *filename, char *scratchdir, int overwrite);
int xsupgui_request_get_interface_capabilities(char *device, int *capabilities);
int xsupgui_request_get_link_state_from_int(char *intname, int *state);
int xsupgui_request_add_root_ca_certificate(char *filename);
int xsupgui_request_get_tnc_conn_id(char *device, unsigned int *tnc_conn_id);
/**
* Calls that operate on the configuration file structures. (Things that will become
* part of the configuration file once a write request is executed.)
*/
int xsupgui_request_enum_ints_config(int_config_enum **retints);
int xsupgui_request_enum_profiles(profile_enum **profs);
int xsupgui_request_enum_connections(conn_enum **);
int xsupgui_request_reload_config();
int xsupgui_request_get_globals_config(config_globals **globals);
int xsupgui_request_get_profile_config(char *prof_name, config_profiles **prof_config);
int xsupgui_request_get_connection_config(char *conn_name, config_connection **conn_config);
int xsupgui_request_get_interface_config(char *intname, config_interfaces **int_config);
int xsupgui_request_get_trusted_server_config(char *servname, config_trusted_server **ts_config);
int xsupgui_request_get_managed_network_config(char *ouname, config_managed_networks **mnconfig);
int xsupgui_request_set_trusted_server_config(config_trusted_server *);
int xsupgui_request_set_connection_config(config_connection *conn_config);
int xsupgui_request_set_profile_config(config_profiles *prof_config);
int xsupgui_request_set_interface_config(config_interfaces *int_config);
int xsupgui_request_set_globals_config(config_globals *globals);
int xsupgui_request_set_managed_network_config(config_managed_networks *mnconfig);
int xsupgui_request_delete_profile_config(char *prof_name, int force);
int xsupgui_request_delete_connection_config(char *conn_name);
int xsupgui_request_delete_interface_config(char *intname);
int xsupgui_request_delete_trusted_server_config(char *servname, int force);
int xsupgui_request_delete_managed_network_config(char *ouname);
int xsupgui_request_enum_trusted_servers(trusted_servers_enum **);
int xsupgui_request_enum_managed_networks(managed_nets_enum **);
int xsupgui_request_write_config(char *);
int xsupgui_request_rename_connection(char *, char *);
int xsupgui_request_rename_trusted_server(char *, char *);
int xsupgui_request_rename_profile(char *, char *);
/**
* Calls to free the values returned from "live" data calls
*/
int xsupgui_request_free_eap_enum(eap_enum **);
int xsupgui_request_free_ip_info(ipinfo_type **);
int xsupgui_request_free_int_enum(int_enum **);
int xsupgui_request_free_ssid_enum(ssid_info_enum **);
void xsupgui_request_free_cert_enum(cert_enum **);
void xsupgui_request_free_cert_info(cert_info **);
void xsupgui_request_free_error_msgs(error_messages **);
int xsupgui_request_free_poss_conn_enum(poss_conn_enum **);
/**
* Calls to free the values returned from the configuration file calls.
*/
int xsupgui_request_free_int_config_enum(int_config_enum **);
int xsupgui_request_free_namedesc_enum(namedesc_enum **);
int xsupgui_request_free_profile_enum(profile_enum **);
int xsupgui_request_free_conn_enum(conn_enum **);
int xsupgui_request_free_managed_networks_enum(managed_nets_enum **);
int xsupgui_request_free_trusted_servers_enum(trusted_servers_enum **);
int xsupgui_request_free_config_globals(config_globals **);
int xsupgui_request_free_profile_config(config_profiles **);
int xsupgui_request_free_connection_config(config_connection **);
int xsupgui_request_free_interface_config(config_interfaces **);
int xsupgui_request_free_trusted_server_config(config_trusted_server **);
int xsupgui_request_free_managed_network_config(config_managed_networks **);
/**
* Calls to free generic data types.
*/
int xsupgui_request_free_str(char **);
/**
* Utility calls for functions in the library. (A UI normally won't use these.)
*/
int xsupgui_request_is_ack(xmlDocPtr);
int xsupgui_request_set_as_event(char **, int *);
xmlNodePtr xsupgui_request_find_node(xmlNodePtr, char *);
#endif // _XSUPGUI_REQUEST_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -