📄 radius_structures.h
字号:
/* radius_structures.h *//* Definitions of basic RADIUS structures and function prototypes *//* Copyright 1984 - 2000 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history____________________Date Init Change description031202 md Enhancement - remove receive_packet_rate_per_second and maximum_packets_per_rx_interval data members from RADIUS_CLASS031102 md Enhancement - moving polling socket read to seperate tasks and replace taskLock/unLock with rwos_radius_data_mutex030402 md Add support for EAP111401 md Fixed SPR#70426 - pool packet identifiers per server092701 md Deleted radius_set_delay_retransmit_count and add two new functions prototype. radius_set_packet_id_reused_timer_before_reuse and radius_check_packet_id_reused_pending052301 tk Added user_count in the RADIUS_SERVER structure.020801 tk Added members to RADIUS_REQUEST_ENTRY and RADIUS_CLASS structures.121900 md Added packet pool id and receive_packet_rate_per_second121900 md Merged from visual source safe*/#ifndef __INCradius_structuresh#define __INCradius_structureshtypedef struct RADIUS_REQUEST_ENTRY{ RADIUS_PACKET *sptr_packet; RADIUS_PACKET_HEADER packet_header; UINT request_time; UINT request_timestamp; UINT request_retry_count; RADIUS_SERVER_HANDLE server_handle; /* target server handle */ RADIUS_SERVER_HANDLE backup_server_handle; RADIUS_REQUEST_HANDLE request_handle; RADIUS_REQUEST_CALLBACKS* p_callbacks; bool any_server; bool backup_server;} RADIUS_REQUEST_ENTRY;typedef struct RADIUS_SERVER_STATISTICS{ UINT authentication_round_trip_time; /* radiusAuthClientRoundTripTime */ UINT authentication_access_requests_tx; /* radiusAuthClientAccessRequests */ UINT authentication_access_requests_retransmit; /* radiusAuthClientAccessRetransmissions */ UINT authentication_access_accepts_rx; /* radiusAuthClientAccessAccepts */ UINT authentication_access_rejects_rx; /* radiusAuthClientAccessRejects */ UINT authentication_access_challenges_rx; /* radiusAuthClientAccessChallenges */ UINT authentication_malformed_access_responses_rx; /* radiusAuthClientMalformedAccessResponses */ UINT authentication_bad_authenticators_rx; /* radiusAuthClientBadAuthenticators */ UINT authentication_pending_access_requests; /* radiusAuthClientPendingRequests */ UINT authentication_timeouts; /* radiusAuthClientTimeouts */ UINT authentication_unknown_type_packets_rx; /* radiusAuthClientUnknownTypes */ UINT authentication_dropped_packets_rx; /* radiusAuthClientPacketsDropped */ UINT accounting_round_trip_time; /* radiusAccClientRoundTripTime */ UINT accounting_requests_tx; /* radiusAccClientRequests */ UINT accounting_requests_retransmit; /* radiusAccClientRetransmissions */ UINT accounting_responses_rx; /* radiusAccClientResponses */ UINT accounting_malformed_responses_rx; /* radiusAccClientMalformedResponses */ UINT accounting_bad_authenticators_rx; /* radiusAccClientBadAuthenticators */ UINT accounting_pending_access_requests; /* radiusAccClientPendingRequests */ UINT accounting_timeouts; /* radiusAccClientTimeouts */ UINT accounting_unknown_type_packets_rx; /* radiusAccClientUnknownTypes */ UINT accounting_dropped_packets_rx; /* radiusAccClientPacketsDropped */} RADIUS_SERVER_STATISTICS;typedef struct RADIUS_POOL_ID_CONFIG_INFO{ BOOLEAN packet_pool_id; UINT time_before_reused;} RADIUS_POOL_ID_CONFIG_INFO;typedef struct RADIUS_SERVER{ IP_ADDRESS ip_address; UINT port; BYTE* bp_secret; UINT secret_length; /* excluding NULL */ UINT max_retransmit_count; UINT retransmission_interval; enum RADIUS_SERVER_TYPE type; bool deleted; UINT pending_request_count; int user_count; RADIUS_SERVER_STATISTICS statistics; UINT packet_identifier_count; RADIUS_POOL_ID_CONFIG_INFO pool_id_config [MAXIMUM_NUMBER_OF_OUTSTANDING_REQUESTS];} RADIUS_SERVER;typedef struct RADIUS_ATTRIBUTE_CONTROLLER /*used to modify and iterate list*/{ RW_CONTAINER* p_list; RW_CONTAINER_ITERATOR iterator;} RADIUS_LIST_CONTROLLER;typedef struct RADIUS_SOCKET_OBJECT{ int task_id; int socket_descriptor; BYTE_ENUM (RADIUS_STATE) state;} RADIUS_SOCKET_OBJECT;typedef struct RADIUS_CONFIG_SERVER_INFO /* used for storing config info */{ IP_ADDRESS ip_address; UINT port; char secret[RADIUS_MAX_SECRET_LENGTH]; UINT max_retransmit_count; UINT retransmission_interval; enum RADIUS_SERVER_TYPE type;} RADIUS_CONFIG_SERVER_INFO;typedef struct RADIUS_CLASS{ BOOLEAN enabled; BOOLEAN timer_enabled; RWOS_DISPATCHER timer_dispatcher; ULONG client_ip_address; UINT authentication_client_port; UINT accounting_client_port; RADIUS_LIST_CONTROLLER server_controller; RADIUS_SOCKET_OBJECT authentication_socket_object; RADIUS_SOCKET_OBJECT accounting_socket_object; RADIUS_LIST_CONTROLLER request_controller; UINT maximum_rx_packet_size; BOOLEAN set_default_values; BOOLEAN printing_enabled; BOOLEAN alarm_printing_enabled; BOOLEAN initialization_printing_enabled; BOOLEAN socket_printing_enabled; BOOLEAN data_printing_enabled; BOOLEAN trace_printing_enabled; BOOLEAN disable_verify_response_authenticator; UINT number_of_servers_configured; RADIUS_CONFIG_SERVER_INFO server_info[6];#if defined (__RADIUS_BREAKPOINT__) BOOLEAN initialization_breakpoint; BOOLEAN shutdown_breakpoint; BOOLEAN configuration_breakpoint; BOOLEAN runtime_breakpoint;#endif} RADIUS_CLASS;/* radius_timer.c*/void radius_timer (void* p_user);/* radius_task.c */void RADIUSAuthSocketReadTask (void* p_socket_object);void RADIUSAcctSocketReadTask (void* p_socket_object);/* radius_initialize.c */void radius_printf (enum RADIUS_PRINTF_GROUPS printf_group,const char *cptr_format, ...);void radius_initialize_packet_pool_identifier_per_server (RADIUS_SERVER* p_server);enum TEST radius_get_next_available_packet_identifier_per_server (RADIUS_SERVER* p_server, UINT *uiptr_id);bool radius_check_packet_id_reused_pending_per_server (RADIUS_SERVER* p_server, UINT packet_id);void radius_free_packet_identifier_per_server (RADIUS_SERVER* p_server, UINT packet_id);void radius_set_packet_id_reused_timer_before_reuse_per_server (RADIUS_SERVER* p_server, UINT packet_id);enum TEST initialize_radius (ULONG clock_ticks_per_second);void terminate_radius (void);/* radius_tx.c */bool resend_radius_packet (RADIUS_REQUEST_ENTRY *sptr_request_entry);enum TEST radius_send_packet (RADIUS_SERVER_HANDLE server_handle, RADIUS_REQUEST_HANDLE radius_request_handle, RADIUS_REQUEST_CALLBACKS *p_callbacks, enum RADIUS_CODE code, RADIUS_ATTRIBUTE_LIST_HANDLE attribute_list_handle, bool* ep_error_callback_called, bool any_server);/*radius_interface.c*/bool radius_verify_attributes (enum RADIUS_CODE code, RADIUS_LIST_CONTROLLER* p_radius_attribute_list_controller);/* radius_rx.c */void receive_radius_packet (void* p_user);void print_radius_packet_header (char *function_name, RADIUS_PACKET_HEADER *sptr_packet_header);/* radius_authorize.c */enum TEST radius_encrypt_attributes_with_authenticator (RW_CONTAINER* p_attribute_list, BYTE *bptr_authenticator, RADIUS_SERVER* p_server);enum TEST radius_decrypt_attributes_with_authenticator (RW_CONTAINER* p_attribute_list, BYTE *bptr_authenticator, RADIUS_SERVER* p_server);bool verify_radius_response_authenticator (RADIUS_PACKET *sptr_rx_packet, BYTE *bptr_authenticator, RADIUS_SERVER* p_server);#ifdef __EAP__enum TEST radius_verifiy_message_authenticator (RADIUS_PACKET *sptr_rx_packet, BYTE *bptr_authenticator, RADIUS_LIST_CONTROLLER* p_radius_attribute_list_controller, RADIUS_SERVER* p_server);bool radius_check_eap_and_ma_attribute (RADIUS_LIST_CONTROLLER* p_radius_attribute_list_controller);#endif /* __EAP__ */bool radius_accounting_fill_in_request_authenticator (RADIUS_PACKET* p_packet, UINT length, RADIUS_SERVER* p_server, BYTE *bptr_authenticator);/* radius_configure.c */ULONG radius_get_configuration_table_address (void);void radius_parse_server_configuration_string (char *cptr_string);/* radius_attribute.c */void convert_bytes_to_ascii (BYTE *bptr_input_buffer, UINT length, char *cptr_output_buffer);void print_radius_attributes (RADIUS_LIST_CONTROLLER* p_radius_attribute_list_controller);/* radius_debug.c */#if defined (__RADIUS_BREAKPOINT__)void check_for_radius_initialization_breakpoint (void);void check_for_radius_shutdown_breakpoint (void);void check_for_radius_configuration_breakpoint (void);void check_for_radius_runtime_breakpoint (void);#endif /* __RADIUS_BREAKPOINT__ */#endif /*__INCradius_structuresh*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -