/******************************************************************************* ** ** Cabletron Systems Incorporated ** Post Office Box 5005 ** Rochester, NH 03866-5005 ** (c) Copyright Cabletron Systems Inc. 1999 ** ** Workfile: %M% ** Logfile: %P% ** Original Author: Todd Crowley ** SCCS Delta ID: %I% ** Last Delta Date/Time: %G% %U% ** *******************************************************************************/ #ifndef LFAPSTRUCT_H_ #define LFAPSTRUCT_H_ #include "Lfap.h" #include "LfapVR.h" #include "LfapAR.h" #include "LfapARA.h" #include "LfapVRA.h" #include "LfapFAR.h" #include "LfapFUN.h" #ifdef __cplusplus extern "C" { #endif /* typedef for the callback entrypoint for the Synchronize method and timer callbacks */ typedef int (*LFAP_CB_ENTRYPOINT)(void*); /* FOR DEBUG PURPOSES Only! */ /* define CS_DEBUG if you want print statements compiled into the code */ #define CS_DEBUG 1 /* depending on what lfap_debug is set to, will have various types of printouts, as long as the printouts were compiled in (lfap_debug is declared in LfapFlowMgr.c */ /* extern int lfap_debug; */ /* levels of debugging printouts */ #define LFAP_DBG_ERRORS 1 #define LFAP_DBG_TIMERS 2 #define LFAP_DBG_WARNINGS 4 #define LFAP_DBG_MESSAGES 8 #define LFAP_DBG_FUNCTIONS 16 #define LFAP_DBG_CONNECTING 32 #define LFAP_DBG_KEEPALIVE 64 /* invalid values */ #define LFAP_QUALIFIER_INVALID 0 #define LFAP_AS_NUM_INVALID 0xFFFFFFFF /* maximum length of an address (this is the maximum length of the longest address, an ATM address */ #define LFAP_MAX_ADDR_LEN 20 /* maximum length of the RMON protocol string passed in the LFAPFlowInfo structure */ #define LFAP_MAX_PROTOCOL_LEN 20 /* default values for the configuration tunables */ #define LFAP_DEFAULT 0 /* value will be defaulted */ #define LFAP_DEFAULT_POLL_INTERVAL 86400000 /* 24 hours, in milliseconds */ #define LFAP_DEFAULT_BATCH_SIZE 32 /* max records in one FUN */ #define LFAP_DEFAULT_BATCH_INTERVAL 1000 /* 1 second, in millisecs */ #define LFAP_DEFAULT_SRVR_RETRY_INTRVL 60000 /* 1 minute, in milliseconds */ #define LFAP_DEFAULT_LOST_CONN_INTERVAL 30000 /* 30 seconds, in millisecs */ #define LFAP_DEFAULT_MAX_SEND_QUEUE 10000 /* 10,000 messages */ /* statistics values */ #define LFAP_DELTA_STATS 0 #define LFAP_TOTAL_STATS 1 /* statistics types */ #define LFAP_NO_STATS_AVAILABLE 0 /* no statistics available */ #define LFAP_BYTES_STATS 1 /* only byte count data */ #define LFAP_PACKETS_STATS 2 /* only packet count data */ #define LFAP_BOTH_STATS 3 /* both packet and byte counts */ /* return values after sending a message */ #define LFAP_SEND_FAILURE 0 /* the send was a success */ #define LFAP_SEND_SUCCESS 1 /* the send was a failure */ /* maximum number of messages in the send vector */ #define LFAP_MAX_MSGS_IN_SEND_VECTOR 16 /* Must be numerically sequential */ typedef enum { LFAP_INITIAL_STATE = 1, LFAP_NO_TCP_CONNECTION, LFAP_ATTEMPTING_TCP_CONNECT, LFAP_TCP_CONNECTION, LFAP_PROTOCOL_NEGOTIATION, LFAP_SECURITY_CHECK, LFAP_DATA_EXPORT_NEGOTIATION, LFAP_SESSION_ESTABLISHED } LFAPConnState_t; #ifdef pac_remove /* TCP connection values */ #define LFAP_NOT_TRYING_TO_CONNECT 0 /* TCP not trying to connect */ #define LFAP_ALREADY_TRYING_TO_CONNECT -2 /* TCP already trying to connect */ #define LFAP_TCP_CONNECTION_ESTABLISHED 1 /* TCP connection successful */ #define LFAP_TCP_CONNECTION_FAILED -1 /* TCP connection failure */ #define LFAP_TCP_DISCONNECT_SUCCESS 1 /* TCP disconnect successful */ #define LFAP_TCP_DISCONNECT_FAILED -1 /* TCP disconnect failure */ #define LFAP_TCP_CONNECTED_NO_ACK 2 /* TCP connected, but no ack rcvd */ #define LFAP_CONNECTION_ESTABLISHED 0 /* TCP connection exists to FAS */ #define LFAP_CONNECTION_LOST 1 /* no TCP connection exists to FAS */ #endif /* possible error conditions for the LFAPError structure */ #define LFAP_NO_ERROR_OCCURRED 0 /* no errors have occurred */ #define LFAP_NO_SERVERS_IN_LIST 1 /* servers list is empty */ #define LFAP_NO_SERVERS_AVAILABLE 2 /* could not connect to any server */ #define LFAP_INCOMPATIBLE_VERSION 3 /* diff LFAP version than server */ #define LFAP_RCVD_PARTIAL_MESSAGE 4 /* rcvd message is truncated */ #define LFAP_INVALID_FLOW_PREFIX_RCVD 5 /* server not functioning properly */ #define LFAP_LOST_CONN_INTERVAL_EXPIRED 6 /* conn interval expired: disconn */ /* indicates if more work needs to be done */ #define LFAP_WORK_COMPLETED 0 /* no more work to do at this time */ #define LFAP_WORK_INCOMPLETE 1 /* more work needs to be done */ /* timer states */ #define LFAP_TIMER_INACTIVE 0 /* currently not set */ #define LFAP_TIMER_WAITING 1 /* timer is set, and waiting */ #define LFAP_TIMER_EXPIRED 2 /* timer has just expired */ #define LFAP_TIMER_PROCESSING 3 /* currently processing the timer */ /* reporting on flows */ #define LFAP_NOT_REPORTING_FLOWS 0 /* currently not reporting */ #define LFAP_REPORT_INDICATED_FLOWS 1 /* reporting on indicated flows */ /* if connecting and at the end of server list, retry at beginning or not */ #define LFAP_RETRY_IF_LIST_END 0 /* retry if at the end of the list */ #define LFAP_WAIT_IF_LIST_END 1 /* wait if at the end of the list */ /* The LFAPFlowStats structure is passed to the LFAPGetStatistics function on the CCE. It is also passed to the LFAPFlowDeleted function. The CCE has to fill in the structure for the flow. All of the members (other than the 'type') of the structure are 2 element arrays, with the name of the array explaining their intended content. For each array of the LFAPFlowStats structure, the first element (e.g. byte_rcvd[0]) is the high value, and the second element (e.g. byte_rcvd[1]) is the low value. 'type' must be set to the appropriate constant defined above (either LFAP_NO_STATS_AVAILABLE, LFAP_BYTES_STATS, LFAP_PACKETS_STATS, or LFAP_BOTH_STATS). */ typedef struct lfap_flow_statistics { lfapui16_t type; lfapui64_t byte_rcvd; lfapui64_t byte_sent; lfapui64_t packet_rcvd; lfapui64_t packet_sent; } LFAPFlowStats; /* The LFAPFlowInfo structure is passed from the CCE to the LFAP API when LFAPAdmitFlow is called. The CCE has to fill in the structure with information concerning the flow. The source address (src_addr) along with its related information (family: src_fam and length: src_len) and the destination address (dest_addr) along with its related information are required to be filled in by the CCE. The src_port, src_port_type, protocol, type_of_service, client_data (and len), src_cce_addr (and related information), src_as, dest_as, ingress_port, egress_port, cxn_priority, and checkpoint are optional when LFAPAdmitFlow is called. Notice that the character buffers (src_addr, dest_addr, and src_cce_addr) are actually arrays that need to be filled in appropriately. Each member of one of the address arrays is a field of the address (i.e. an IP address would use 4 members of the character array, a MAC address would use 6, and an ATM address would use all LFAP_MAX_ADDR_LEN members). For example, if the address is of type IP, then each char will be a value between 1 and 255. The family type of the addresses are specified in RFC 1700. */ typedef struct lfap_flow_information { char src_addr[LFAP_MAX_ADDR_LEN]; lfapui16_t src_fam; lfapui16_t src_len; char dest_addr[LFAP_MAX_ADDR_LEN]; lfapui16_t dest_fam; lfapui16_t dest_len; lfapui16_t src_port; lfapui16_t src_port_type; char protocol[LFAP_MAX_PROTOCOL_LEN]; void* client_data; lfapui16_t client_data_len; char src_cce_addr[LFAP_MAX_ADDR_LEN]; lfapui16_t src_cce_fam; lfapui16_t src_cce_len; lfapui32_t src_as; lfapui32_t dest_as; lfapui16_t ingress_port; lfapui16_t egress_port; lfapui16_t src_vlan_id; lfapui16_t dst_vlan_id; lfapui16_t cxn_priority; lfapui16_t checkpoint; lfapui32_t CoS_Arr[LFAP_COS_MAX_TYPES+1][LFAP_COS_RT+1]; lfapui32_t inMplsLabel[LFAP_MAX_LABELS]; lfapui32_t outMplsLabel[LFAP_MAX_LABELS]; char next_hop_addr[LFAP_MAX_ADDR_LEN]; lfapui16_t next_hop_fam; lfapui16_t next_hop_len; lfapui16_t ldpFECLen[LFAP_MAX_FECs]; lfapui8_t *ldpFEC[LFAP_MAX_FECs]; } LFAPFlowInfo; /* The LFAPError structure is used to indicate to the CCE what was the most recent error that occurred in the LFAP API, and what time the error occurred. The CCE can call the LFAP API LFAPGetLastError function to retrieve the most recent error. The time is set when an error occurs by calling the CCE LFAPGetUptime function. */ typedef struct lfap_error { lfapui16_t error; lfapui32_t time; } LFAPError; /* The LFAPApiStats structure is used to store the various statistics that relate to the LFAP API. The CCE can call the LFAP API LFAPGetApiStats function to retrieve the most recent set of statistics. */ typedef struct lfap_api_statistics { lfapui32_t conn_time; /* time last connected */ lfapui32_t up_time; /* time connected to server */ lfapui16_t num_servers; /* number of known servers */ lfapui32_t this_server; /* this server's IP address */ lfapui16_t this_server_in_list; /* is server in current list? */ lfapui32_t retry_conn_success; /* successful connections */ lfapui32_t retry_conn_failure; /* unsuccessful connections */ lfapui32_t total_bytes_sent; /* total bytes sent */ lfapui32_t total_bytes_rcvd; /* total bytes received */ lfapui32_t msgs_sent_success; /* # msgs sent successfully */ lfapui32_t msgs_sent_failure; /* # msgs not sent */ lfapui32_t msgs_rcvd_corrupt; /* # corrupt msgs received */ lfapui32_t msgs_rcvd_error; /* # error msgs received */ lfapui32_t msgs_rcvd_success; /* # good msgs received */ lfapui32_t msgs_send_buf; /* # msgs in send buffer */ lfapui32_t msgs_rcvd_buf; /* # msgs in rcvd buffer */ lfapui32_t msg_vr_sent; /* # VR messages sent */ lfapui32_t msg_vra_rcvd; /* # VRA messages received */ lfapui32_t msg_far_sent; /* # FAR messages sent */ lfapui32_t msg_fun_sent; /* # FUN messages sent */ lfapui32_t msg_ar_sent; /* # AR messages sent */ lfapui32_t msg_ar_rcvd; /* # AR messages received */ lfapui32_t msg_cr_sent; /* # CR messages sent */ lfapui32_t msg_cr_rcvd; /* # CR messages received */ lfapui32_t msg_ka_sent; /* # CR messages sent */ lfapui32_t msg_ka_rcvd; /* # CR messages received */ lfapui32_t msg_dr_sent; /* # CR messages sent */ lfapui32_t msg_dr_rcvd; /* # CR messages received */ lfapui32_t msg_crn_sent; /* # CR messages sent */ lfapui32_t msg_crn_rcvd; /* # CR messages received */ lfapui32_t msg_can_sent; /* # CR messages sent */ lfapui32_t msg_can_rcvd; /* # CR messages received */ lfapui32_t msg_fer_sent; /* # CR messages sent */ lfapui32_t msg_fer_rcvd; /* # CR messages received */ lfapui32_t msg_ara_sent; /* # ARA messages sent */ lfapui32_t msg_ara_rcvd; /* # ARA messages received */ lfapui32_t msg_unk_rcvd; /* # Unknown messages rcvd */ lfapui32_t dropped_send_msgs; /* # send messages dropped */ lfapui32_t dropped_send_msgs_conn; /* # send messages dropped w/conn */ lfapui32_t dropped_vr_msgs; /* # VR messages dropped */ lfapui32_t dropped_vra_msgs; /* # VRA messages dropped */ lfapui32_t dropped_ar_msgs; /* # AR messages dropped */ lfapui32_t dropped_ara_msgs; /* # ARA messages dropped */ lfapui32_t dropped_cr_msgs; /* # CR messages dropped */ lfapui32_t dropped_ka_msgs; /* # CR messages dropped */ lfapui32_t dropped_dr_msgs; /* # CR messages dropped */ lfapui32_t dropped_can_msgs; /* # CR messages dropped */ lfapui32_t dropped_crn_msgs; /* # CR messages dropped */ lfapui32_t dropped_fer_msgs; /* # CR messages dropped */ lfapui32_t dropped_far_msgs; /* # FAR messages dropped */ lfapui32_t dropped_fun_i_msgs; /* # FUN-I messages dropped */ lfapui32_t dropped_fun_msgs; /* # FUN messages dropped */ lfapui32_t dropped_rcvd_msgs; /* # rcvd messages dropped */ lfapui64_t lost_bytes_sent; /* # bytes sent lost */ lfapui64_t lost_bytes_rcvd; /* # bytes rcvd lost */ lfapui64_t lost_packets_sent; /* # packets sent lost */ lfapui64_t lost_packets_rcvd; /* # packets rcvd lost */ lfapui32_t flow_setups; /* # actual flow setups */ lfapui32_t flow_teardowns; /* # actual flow teardowns */ lfapui32_t active_flows; /* # currently active flows */ lfapui32_t peak_msgs_send_buf; /* peak # msgs in send buffer */ lfapui32_t peak_active_flows; /* peak # active flows */ } LFAPApiStats; #define SIZEOF_LFAP_API_STATS sizeof(LFAPApiStats) /* The LFAPMsgHolder structure is used to hold a message buffer and its length. The CCE's LFAPSendVector function takes an array of these structures to send the data. */ typedef struct lfap_msg_holder_struct { void* buf; int len; } LFAPMsgHolder; #define SIZEOF_LFAP_MSG_HOLDER sizeof(LFAPMsgHolder) #define LFAPSendMsg LFAPMsgHolder #define LFAPRcvdMsg LFAPMsgHolder #ifdef __cplusplus } #endif #endif /* LFAPSTRUCT_H_ */